diff --git a/ReactWindows/Playground/App.xaml.cs b/ReactWindows/Playground/App.xaml.cs index 748d5945d33..c1511bbc9ac 100644 --- a/ReactWindows/Playground/App.xaml.cs +++ b/ReactWindows/Playground/App.xaml.cs @@ -50,7 +50,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { - //this.DebugSettings.EnableFrameRateCounter = true; + this.DebugSettings.EnableFrameRateCounter = true; } #endif diff --git a/ReactWindows/Playground/Resources/main.dev.jsbundle b/ReactWindows/Playground/Resources/main.dev.jsbundle deleted file mode 100644 index 7e702396230..00000000000 --- a/ReactWindows/Playground/Resources/main.dev.jsbundle +++ /dev/null @@ -1,57378 +0,0 @@ -__DEV__= -true; - - -__BUNDLE_START_TIME__=Date.now(); -( -function(global){ -var modules=Object.create(null); -var inGuard=false; - -function define(id,factory){ -modules[id]={ -factory:factory, -module:{exports:{}}, -isInitialized:false, -hasError:false};} - - - -function require(id){ -var mod=modules[id]; -if(mod&&mod.isInitialized){ -return mod.module.exports;} - - -return requireImpl(id);} - - -function requireImpl(id){ -if(global.ErrorUtils&&!inGuard){ -inGuard=true; -var returnValue; -try{ -returnValue=requireImpl.apply(this,arguments);} -catch(e) { -global.ErrorUtils.reportFatalError(e);} - -inGuard=false; -return returnValue;} - - -var mod=modules[id]; -if(!mod){ -var msg='Requiring unknown module "'+id+'"'; -if(__DEV__){ -msg+='. If you are sure the module is there, try restarting the packager.';} - -throw new Error(msg);} - - -if(mod.hasError){ -throw new Error( -'Requiring module "'+id+'" which threw an exception');} - - - -try{ - - -mod.isInitialized=true; - -__DEV__&&BridgeProfiling().profile('JS_require_'+id); - - - -mod.factory.call(global,global,require,mod.module,mod.module.exports); - -__DEV__&&BridgeProfiling().profileEnd();} -catch(e) { -mod.hasError=true; -mod.isInitialized=false; -throw e;} - - -return mod.module.exports;} - - -var BridgeProfiling=__DEV__&&function(){ -var _BridgeProfiling; -try{ -_BridgeProfiling=require('BridgeProfiling');} -catch(e) {} - -return _BridgeProfiling&&_BridgeProfiling.profile? -_BridgeProfiling:{profile:function(){},profileEnd:function(){}};}; - - -global.__d=define; -global.require=require;})( -this); -Object. - - - - - - - - - - - - - - - - - -assign=function(target,sources){ -if(__DEV__){ -if(target==null){ -throw new TypeError('Object.assign target cannot be null or undefined');} - -if(typeof target!=='object'&&typeof target!=='function'){ -throw new TypeError( -'In this environment the target of assign MUST be an object.'+ -'This error is a performance optimization and not spec compliant.');}} - - - - -for(var nextIndex=1;nextIndex=0||keys.indexOf('description')>=0)){ -return formatError(value);} - - - -if(keys.length===0){ -if(isFunction(value)){ -var name=value.name?': '+value.name:''; -return ctx.stylize('[Function'+name+']','special');} - -if(isRegExp(value)){ -return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');} - -if(isDate(value)){ -return ctx.stylize(Date.prototype.toString.call(value),'date');} - -if(isError(value)){ -return formatError(value);}} - - - -var base='',array=false,braces=['{','}']; - - -if(isArray(value)){ -array=true; -braces=['[',']'];} - - - -if(isFunction(value)){ -var n=value.name?': '+value.name:''; -base=' [Function'+n+']';} - - - -if(isRegExp(value)){ -base=' '+RegExp.prototype.toString.call(value);} - - - -if(isDate(value)){ -base=' '+Date.prototype.toUTCString.call(value);} - - - -if(isError(value)){ -base=' '+formatError(value);} - - -if(keys.length===0&&(!array||value.length==0)){ -return braces[0]+base+braces[1];} - - -if(recurseTimes<0){ -if(isRegExp(value)){ -return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}else -{ -return ctx.stylize('[Object]','special');}} - - - -ctx.seen.push(value); - -var output; -if(array){ -output=formatArray(ctx,value,recurseTimes,visibleKeys,keys);}else -{ -output=keys.map(function(key){ -return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array);});} - - - -ctx.seen.pop(); - -return reduceToSingleString(output,base,braces);} - - - -function formatPrimitive(ctx,value){ -if(isUndefined(value)) -return ctx.stylize('undefined','undefined'); -if(isString(value)){ -var simple='\''+JSON.stringify(value).replace(/^"|"$/g,''). -replace(/'/g,"\\'"). -replace(/\\"/g,'"')+'\''; -return ctx.stylize(simple,'string');} - -if(isNumber(value)) -return ctx.stylize(''+value,'number'); -if(isBoolean(value)) -return ctx.stylize(''+value,'boolean'); - -if(isNull(value)) -return ctx.stylize('null','null');} - - - -function formatError(value){ -return '['+Error.prototype.toString.call(value)+']';} - - - -function formatArray(ctx,value,recurseTimes,visibleKeys,keys){ -var output=[]; -for(var i=0,l=value.length;i-1){ -if(array){ -str=str.split('\n').map(function(line){ -return ' '+line;}). -join('\n').substr(2);}else -{ -str='\n'+str.split('\n').map(function(line){ -return ' '+line;}). -join('\n');}}}else - - -{ -str=ctx.stylize('[Circular]','special');}} - - -if(isUndefined(name)){ -if(array&&key.match(/^\d+$/)){ -return str;} - -name=JSON.stringify(''+key); -if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){ -name=name.substr(1,name.length-2); -name=ctx.stylize(name,'name');}else -{ -name=name.replace(/'/g,"\\'"). -replace(/\\"/g,'"'). -replace(/(^"|"$)/g,"'"); -name=ctx.stylize(name,'string');}} - - - -return name+': '+str;} - - - -function reduceToSingleString(output,base,braces){ -var numLinesEst=0; -var length=output.reduce(function(prev,cur){ -numLinesEst++; -if(cur.indexOf('\n')>=0)numLinesEst++; -return prev+cur.replace(/\u001b\[\d\d?m/g,'').length+1;}, -0); - -if(length>60){ -return braces[0]+( -base===''?'':base+'\n ')+ -' '+ -output.join(',\n ')+ -' '+ -braces[1];} - - -return braces[0]+base+' '+output.join(', ')+' '+braces[1];} - - - - - -function isArray(ar){ -return Array.isArray(ar);} - - -function isBoolean(arg){ -return typeof arg==='boolean';} - - -function isNull(arg){ -return arg===null;} - - -function isNullOrUndefined(arg){ -return arg==null;} - - -function isNumber(arg){ -return typeof arg==='number';} - - -function isString(arg){ -return typeof arg==='string';} - - -function isSymbol(arg){ -return typeof arg==='symbol';} - - -function isUndefined(arg){ -return arg===void 0;} - - -function isRegExp(re){ -return isObject(re)&&objectToString(re)==='[object RegExp]';} - - -function isObject(arg){ -return typeof arg==='object'&&arg!==null;} - - -function isDate(d){ -return isObject(d)&&objectToString(d)==='[object Date]';} - - -function isError(e){ -return isObject(e)&&( -objectToString(e)==='[object Error]'||e instanceof Error);} - - -function isFunction(arg){ -return typeof arg==='function';} - - -function isPrimitive(arg){ -return arg===null|| -typeof arg==='boolean'|| -typeof arg==='number'|| -typeof arg==='string'|| -typeof arg==='symbol'|| -typeof arg==='undefined';} - - -function objectToString(o){ -return Object.prototype.toString.call(o);} - - -function hasOwnProperty(obj,prop){ -return Object.prototype.hasOwnProperty.call(obj,prop);} - - -return inspect;})(); - - - -var OBJECT_COLUMN_NAME='(index)'; -var LOG_LEVELS={ -trace:0, -info:1, -warn:2, -error:3}; - - -function setupConsole(global){ -var originalConsole=global.console; - -if(!global.nativeLoggingHook){ -return;} - - -function getNativeLogFunction(level){ -return function(){ -var str; -if(arguments.length===1&&typeof arguments[0]==='string'){ -str=arguments[0];}else -{ -str=Array.prototype.map.call(arguments,function(arg){ -return inspect(arg,{depth:10});}). -join(', ');} - - -var logLevel=level; -if(str.slice(0,9)==='Warning: '&&logLevel>=LOG_LEVELS.error){ - - - -logLevel=LOG_LEVELS.warn;} - -global.nativeLoggingHook(str,logLevel);};} - - - -var repeat=function(element,n){ -return Array.apply(null,Array(n)).map(function(){return element;});}; - - -function consoleTablePolyfill(rows){ - -if(!Array.isArray(rows)){ -var data=rows; -rows=[]; -for(var key in data){ -if(data.hasOwnProperty(key)){ -var row=data[key]; -row[OBJECT_COLUMN_NAME]=key; -rows.push(row);}}} - - - -if(rows.length===0){ -global.nativeLoggingHook('',LOG_LEVELS.info); -return;} - - -var columns=Object.keys(rows[0]).sort(); -var stringRows=[]; -var columnWidths=[]; - - - -columns.forEach(function(k,i){ -columnWidths[i]=k.length; -for(var j=0;j'; -function guarded(){ -return ( -ErrorUtils.applyWithGuard( -fun, -context||this, -arguments, -null, -name));} - - - - -return guarded;}}; - - -global.ErrorUtils=ErrorUtils; - - - - - -function setupErrorGuard(){ -var onError=function(e){ -global.console.error( -'Error: '+ -'\n stack: '+e.stack+ -'\n line: '+e.line+ -'\n message: '+e.message, -e);}; - - -global.ErrorUtils.setGlobalHandler(onError);} - - -setupErrorGuard();})( -this); -if( - - - - - - - - - - - -!String.prototype.startsWith){ -String.prototype.startsWith=function(search){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -var pos=arguments.length>1? -Number(arguments[1])||0:0; -var start=Math.min(Math.max(pos,0),string.length); -return string.indexOf(String(search),pos)===start;};} - - - -if(!String.prototype.endsWith){ -String.prototype.endsWith=function(search){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -var stringLength=string.length; -var searchString=String(search); -var pos=arguments.length>1? -Number(arguments[1])||0:stringLength; -var end=Math.min(Math.max(pos,0),stringLength); -var start=end-searchString.length; -if(start<0){ -return false;} - -return string.lastIndexOf(searchString,start)===start;};} - - - -if(!String.prototype.contains){ -String.prototype.contains=function(search){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -var pos=arguments.length>1? -Number(arguments[1])||0:0; -return string.indexOf(String(search),pos)!==-1;};} - - - -if(!String.prototype.repeat){ -String.prototype.repeat=function(count){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -count=Number(count)||0; -if(count<0||count===Infinity){ -throw RangeError();} - -if(count===1){ -return string;} - -var result=''; -while(count){ -if(count&1){ -result+=string;} - -if(count>>=1){ -string+=string;}} - - -return result;};} -( - - - - - - - - - -function(undefined){ - -function findIndex(predicate,context){ -if(this==null){ -throw new TypeError( -'Array.prototype.findIndex called on null or undefined');} - - -if(typeof predicate!=='function'){ -throw new TypeError('predicate must be a function');} - -var list=Object(this); -var length=list.length>>>0; -for(var i=0;i=0)continue; -if(!Object.prototype.hasOwnProperty.call(obj,i))continue; -target[i]=obj[i];} - - -return target;}; - - -babelHelpers.possibleConstructorReturn=function(self,call){ -if(!self){ -throw new ReferenceError("this hasn't been initialised - super() hasn't been called");} - - -return call&&(typeof call==="object"||typeof call==="function")?call:self;}; - - -babelHelpers.slicedToArray=(function(){ -function sliceIterator(arr,i){ -var _arr=[]; -var _n=true; -var _d=false; -var _e=undefined; - -try{ -for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){ -_arr.push(_s.value); - -if(i&&_arr.length===i)break;}} - -catch(err) { -_d=true; -_e=err;}finally -{ -try{ -if(!_n&&_i["return"])_i["return"]();}finally -{ -if(_d)throw _e;}} - - - -return _arr;} - - -return function(arr,i){ -if(Array.isArray(arr)){ -return arr;}else -if(Symbol.iterator in Object(arr)){ -return sliceIterator(arr,i);}else -{ -throw new TypeError("Invalid attempt to destructure non-iterable instance");}};})(); - - - - -babelHelpers.taggedTemplateLiteral=function(strings,raw){ -return Object.freeze(Object.defineProperties(strings,{ -raw:{ -value:Object.freeze(raw)}}));}; - - - - -babelHelpers.toConsumableArray=function(arr){ -if(Array.isArray(arr)){ -for(var i=0,arr2=Array(arr.length);i1<<5&&( -this._debugInfo[this._callbackID>>5]=null); - -this._debugInfo[this._callbackID>>1]=[module,method]; -onFail&¶ms.push(this._callbackID); -this._callbacks[this._callbackID++]=onFail; -onSucc&¶ms.push(this._callbackID); -this._callbacks[this._callbackID++]=onSucc;} - -this._queue[MODULE_IDS].push(module); -this._queue[METHOD_IDS].push(method); -this._queue[PARAMS].push(params); - -var now=new Date().getTime(); -if(global.nativeFlushQueueImmediate&& -now-this._lastFlush>=MIN_TIME_BETWEEN_FLUSHES_MS){ -global.nativeFlushQueueImmediate(this._queue); -this._queue=[[],[],[]]; -this._lastFlush=now;} - -if(__DEV__&&SPY_MODE&&isFinite(module)){ -console.log('JS->N : '+this._remoteModuleTable[module]+'.'+ -this._remoteMethodTable[module][method]+'('+JSON.stringify(params)+')');}}},{key:'__callFunction',value:function __callFunction( - - - -module,method,args){ -this._lastFlush=new Date().getTime(); -if(isFinite(module)){ -method=this._methodTable[module][method]; -module=this._moduleTable[module];} - -BridgeProfiling.profile(function(){return module+'.'+method+'('+stringifySafe(args)+')';}); -if(__DEV__&&SPY_MODE){ -console.log('N->JS : '+module+'.'+method+'('+JSON.stringify(args)+')');} - -var moduleMethods=this._callableModules[module]; -if(!moduleMethods){ - - - -console.warn('Module is not registered:',module); -moduleMethods=require(module);} - - - - - - - - -moduleMethods[method].apply(moduleMethods,args); -BridgeProfiling.profileEnd();}},{key:'__invokeCallback',value:function __invokeCallback( - - -cbID,args){ -BridgeProfiling.profile( -function(){return 'MessageQueue.invokeCallback('+cbID+', '+stringifySafe(args)+')';}); -this._lastFlush=new Date().getTime(); -var callback=this._callbacks[cbID]; -if(!callback||__DEV__){ -var debug=this._debugInfo[cbID>>1]; -var _module=debug&&this._remoteModuleTable[debug[0]]; -var method=debug&&this._remoteMethodTable[debug[0]][debug[1]]; -invariant( -callback,'Callback with id '+ -cbID+': '+_module+'.'+method+'() not found'); - -if(callback&&SPY_MODE){ -console.log('N->JS : ('+JSON.stringify(args)+')');}} - - -this._callbacks[cbID&~1]=null; -this._callbacks[cbID|1]=null; -callback.apply(null,args); -BridgeProfiling.profileEnd();}},{key:'_genModulesConfig',value:function _genModulesConfig( - - - - - - - - - - - -modules){ -if(Array.isArray(modules)){ -return modules;}else -{ -var moduleArray=[]; -var moduleNames=Object.keys(modules); -for(var i=0,l=moduleNames.length;i0?args[args.length-1]:null; -var secondLastArg=args.length>1?args[args.length-2]:null; -var hasSuccCB=typeof lastArg==='function'; -var hasErrorCB=typeof secondLastArg==='function'; -hasErrorCB&&invariant( -hasSuccCB, -'Cannot have a non-function arg after a function arg.'); - -var numCBs=hasSuccCB+hasErrorCB; -var onSucc=hasSuccCB?lastArg:null; -var onFail=hasErrorCB?secondLastArg:null; -args=args.slice(0,args.length-numCBs); -return self.__nativeCall(module,method,args,onFail,onSucc);};} - - -fn.type=type; -return fn;}},{key:'registerCallableModule',value:function registerCallableModule( - - -name,methods){ -this._callableModules[name]=methods;}}]);return MessageQueue;})(); - - - - -function moduleHasConstants(moduleArray){ -return !Array.isArray(moduleArray[1]);} - - -function arrayContains(array,value){ -return array.indexOf(value)!==-1;} - - -function createErrorFromErrorData(errorData){var - -message= - -errorData.message;var extraErrorInfo=babelHelpers.objectWithoutProperties(errorData,['message']); -var error=new Error(message); -error.framesToPop=1; -return babelHelpers.extends(error,extraErrorInfo);} - - -module.exports=MessageQueue; -}); -__d('BridgeProfiling',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - -var GLOBAL=GLOBAL||this; -var TRACE_TAG_REACT_APPS=1<<17; -var TRACE_TAG_JSC_CALLS=1<<27; - -var _enabled=false; -var _asyncCookie=0; -var _ReactPerf=null; -function ReactPerf(){ -if(!_ReactPerf){ -_ReactPerf=require('ReactPerf');} - -return _ReactPerf;} - - -var BridgeProfiling={ -setEnabled:function(enabled){ -if(_enabled!==enabled){ -if(enabled){ -global.nativeTraceBeginLegacy&&global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS);}else -{ -global.nativeTraceEndLegacy&&global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS);}} - - -_enabled=enabled; - -ReactPerf().enableMeasure=enabled;}, - - - - - -profile:function(profileName){ -if(_enabled){ -profileName=typeof profileName==='function'? -profileName():profileName; -global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS,profileName);}}, - - - -profileEnd:function(){ -if(_enabled){ -global.nativeTraceEndSection(TRACE_TAG_REACT_APPS);}}, - - - - - - - - -profileAsync:function(profileName){ -var cookie=_asyncCookie; -if(_enabled){ -_asyncCookie++; -profileName=typeof profileName==='function'? -profileName():profileName; -global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS,profileName,cookie,0);} - -return cookie;}, - - -profileAsyncEnd:function(profileName,cookie){ -if(_enabled){ -profileName=typeof profileName==='function'? -profileName():profileName; -global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS,profileName,cookie,0);}}, - - - -reactPerfMeasure:function(objName,fnName,func){ -return function(component){ -if(!_enabled){ -return func.apply(this,arguments);} - - -var name=objName==='ReactCompositeComponent'&&this.getName()||''; -BridgeProfiling.profile(objName+'.'+fnName+'('+name+')'); -var ret=func.apply(this,arguments); -BridgeProfiling.profileEnd(); -return ret;};}, - - - -swizzleReactPerf:function(){ -ReactPerf().injection.injectMeasure(BridgeProfiling.reactPerfMeasure);}, - - - - - - -attachToRelayProfiler:function(relayProfiler){ -relayProfiler.attachProfileHandler('*',function(name){ -var cookie=BridgeProfiling.profileAsync(name); -return function(){ -BridgeProfiling.profileAsyncEnd(name,cookie);};});}, - - - - - - -swizzleJSON:function(){ -BridgeProfiling.measureMethods(JSON,'JSON',[ -'parse', -'stringify']);}, - - - - - - - - - - - -measureMethods:function(object,objectName,methodNames){ -if(!__DEV__){ -return;} - - -methodNames.forEach(function(methodName){ -object[methodName]=BridgeProfiling.measure( -objectName, -methodName, -object[methodName]);});}, - - - - - - - - - - - - - -measure:function(objName,fnName,func){ -if(!__DEV__){ -return func;} - - -var profileName=objName+'.'+fnName; -return function(){ -if(!_enabled){ -return func.apply(this,arguments);} - - -BridgeProfiling.profile(profileName); -var ret=func.apply(this,arguments); -BridgeProfiling.profileEnd(); -return ret;};}}; - - - - -BridgeProfiling.setEnabled(global.__RCTProfileIsProfiling||false); - -module.exports=BridgeProfiling; -}); -__d('ReactPerf',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - -var ReactPerf={ - - - - -enableMeasure:false, - - - - - -storedMeasure:_noMeasure, - - - - - - -measureMethods:function(object,objectName,methodNames){ -if(__DEV__){ -for(var key in methodNames){ -if(!methodNames.hasOwnProperty(key)){ -continue;} - -object[key]=ReactPerf.measure( -objectName, -methodNames[key], -object[key]);}}}, - - - - - - - - - - - - - -measure:function(objName,fnName,func){ -if(__DEV__){ -var measuredFunc=null; -var wrapper=function(){ -if(ReactPerf.enableMeasure){ -if(!measuredFunc){ -measuredFunc=ReactPerf.storedMeasure(objName,fnName,func);} - -return measuredFunc.apply(this,arguments);} - -return func.apply(this,arguments);}; - -wrapper.displayName=objName+'_'+fnName; -return wrapper;} - -return func;}, - - -injection:{ - - - -injectMeasure:function(measure){ -ReactPerf.storedMeasure=measure;}}}; - - - - - - - - - - - - -function _noMeasure(objName,fnName,func){ -return func;} - - -module.exports=ReactPerf; -}); -__d('ErrorUtils',function(global, require, module, exports) { var - - - - - - - - - - - -GLOBAL=this; - - - - - - - - - - - - - -module.exports=GLOBAL.ErrorUtils; -}); -__d('JSTimersExecution',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -var invariant=require('invariant'); -var keyMirror=require('keyMirror'); -var performanceNow=require('performanceNow'); -var warning=require('warning'); -var BridgeProfiling=require('BridgeProfiling'); - - - - - - -var JSTimersExecution={ -GUID:1, -Type:keyMirror({ -setTimeout:null, -setInterval:null, -requestAnimationFrame:null, -setImmediate:null}), - - - -callbacks:[], -types:[], -timerIDs:[], -immediates:[], - - - - - - -callTimer:function(timerID){ -warning(timerID<=JSTimersExecution.GUID,'Tried to call timer with ID '+timerID+' but no such timer exists'); -var timerIndex=JSTimersExecution.timerIDs.indexOf(timerID); - - - - - -if(timerIndex===-1){ -return;} - -var type=JSTimersExecution.types[timerIndex]; -var callback=JSTimersExecution.callbacks[timerIndex]; - - -if(type===JSTimersExecution.Type.setTimeout|| -type===JSTimersExecution.Type.setImmediate|| -type===JSTimersExecution.Type.requestAnimationFrame){ -JSTimersExecution._clearIndex(timerIndex);} - - -try{ -if(type===JSTimersExecution.Type.setTimeout|| -type===JSTimersExecution.Type.setInterval|| -type===JSTimersExecution.Type.setImmediate){ -callback();}else -if(type===JSTimersExecution.Type.requestAnimationFrame){ -var currentTime=performanceNow(); -callback(currentTime);}else -{ -console.error('Tried to call a callback with invalid type: '+type); -return;}} - -catch(e) { - -JSTimersExecution.errors=JSTimersExecution.errors||[]; -JSTimersExecution.errors.push(e);}}, - - - - - - - -callTimers:function(timerIDs){ -invariant(timerIDs.length!==0,'Probably shouldn\'t call "callTimers" with no timerIDs'); - -JSTimersExecution.errors=null; -timerIDs.forEach(JSTimersExecution.callTimer); - -var errors=JSTimersExecution.errors; -if(errors){ -var errorCount=errors.length; -if(errorCount>1){ - - -for(var ii=1;ii0){ -var passImmediates=JSTimersExecution.immediates.slice(); -JSTimersExecution.immediates=[]; - - - -for(var i=0;i0;}, - - - - - - -callImmediates:function(){ -JSTimersExecution.errors=null; -while(JSTimersExecution.callImmediatesPass()){} -if(JSTimersExecution.errors){ -JSTimersExecution.errors.forEach(function(error){return ( -require('JSTimers').setTimeout(function(){throw error;},0));});}}, - - - - -_clearIndex:function(i){ -JSTimersExecution.timerIDs[i]=null; -JSTimersExecution.callbacks[i]=null; -JSTimersExecution.types[i]=null;}}; - - - -module.exports=JSTimersExecution; -}); -__d('keyMirror',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var invariant=require('invariant'); - - - - - - - - - - - - - - - - - - - -var keyMirror=function(obj){ -var ret={}; -var key; -invariant( -obj instanceof Object&&!Array.isArray(obj), -'keyMirror(...): Argument must be an object.'); - -for(key in obj){ -if(!obj.hasOwnProperty(key)){ -continue;} - -ret[key]=key;} - -return ret;}; - - -module.exports=keyMirror; -}); -__d('performanceNow',function(global, require, module, exports) { var - - - - - - - - - - - -performance=require('performance'); -var curPerformance=performance; - - - - - - -if(!curPerformance||!curPerformance.now){ -curPerformance=Date;} - - -var performanceNow=curPerformance.now.bind(curPerformance); - -module.exports=performanceNow; -}); -__d('performance',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ExecutionEnvironment=require('ExecutionEnvironment'); - -var performance; - -if(ExecutionEnvironment.canUseDOM){ -performance= -window.performance|| -window.msPerformance|| -window.webkitPerformance;} - - -module.exports=performance||{}; -}); -__d('ExecutionEnvironment',function(global, require, module, exports) { "use strict"; - - - - - - - - - - - - - - - - - - - - - - - -var canUseDOM=false; - - - - - - - -var ExecutionEnvironment={ - -canUseDOM:canUseDOM, - -canUseWorkers:typeof Worker!=='undefined', - -canUseEventListeners: -canUseDOM&&!!(window.addEventListener||window.attachEvent), - -canUseViewport:canUseDOM&&!!window.screen, - -isInWorker:!canUseDOM}; - - - -module.exports=ExecutionEnvironment; -}); -__d('warning',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var emptyFunction=require('emptyFunction'); - - - - - - - - -var warning=emptyFunction; - -if(__DEV__){ -warning=function(condition,format){for(var _len=arguments.length,args=Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){args[_key-2]=arguments[_key];} -if(format===undefined){ -throw new Error( -'`warning(condition, format, ...args)` requires a warning '+ -'message argument');} - - - -if(format.indexOf('Failed Composite propType: ')===0){ -return;} - - -if(!condition){ -var argIndex=0; -var message='Warning: '+format.replace(/%s/g,function(){return args[argIndex++];}); -if(typeof console!=='undefined'){ -console.error(message);} - -try{ - - - -throw new Error(message);} -catch(x) {}}};} - - - - -module.exports=warning; -}); -__d('emptyFunction',function(global, require, module, exports) { function - - - - - - - - - - -makeEmptyFunction(arg){ -return function(){ -return arg;};} - - - - - - - - -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; -}); -__d('JSTimers',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var RCTTiming=require('NativeModules').Timing; -var JSTimersExecution=require('JSTimersExecution'); - - - - - - -var JSTimers={ -Types:JSTimersExecution.Types, - - - - - -_getFreeIndex:function(){ -var freeIndex=JSTimersExecution.timerIDs.indexOf(null); -if(freeIndex===-1){ -freeIndex=JSTimersExecution.timerIDs.length;} - -return freeIndex;}, - - - - - - -setTimeout:function(func,duration){for(var _len=arguments.length,args=Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){args[_key-2]=arguments[_key];} -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=function(){ -return func.apply(undefined,args);}; - -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.setTimeout; -RCTTiming.createTimer(newID,duration||0,Date.now(),false); -return newID;}, - - - - - - -setInterval:function(func,duration){for(var _len2=arguments.length,args=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){args[_key2-2]=arguments[_key2];} -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=function(){ -return func.apply(undefined,args);}; - -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.setInterval; -RCTTiming.createTimer(newID,duration||0,Date.now(),true); -return newID;}, - - - - - - -setImmediate:function(func){for(var _len3=arguments.length,args=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];} -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=function(){ -return func.apply(undefined,args);}; - -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.setImmediate; -JSTimersExecution.immediates.push(newID); -return newID;}, - - - - - -requestAnimationFrame:function(func){ -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=func; -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.requestAnimationFrame; -RCTTiming.createTimer(newID,1,Date.now(),false); -return newID;}, - - -clearTimeout:function(timerID){ -JSTimers._clearTimerID(timerID);}, - - -clearInterval:function(timerID){ -JSTimers._clearTimerID(timerID);}, - - -clearImmediate:function(timerID){ -JSTimers._clearTimerID(timerID); -JSTimersExecution.immediates.splice( -JSTimersExecution.immediates.indexOf(timerID), -1);}, - - - -cancelAnimationFrame:function(timerID){ -JSTimers._clearTimerID(timerID);}, - - -_clearTimerID:function(timerID){ - - -if(timerID==null){ -return;} - - -var index=JSTimersExecution.timerIDs.indexOf(timerID); - -if(index!==-1){ -JSTimersExecution._clearIndex(index); -if(JSTimersExecution.types[index]!==JSTimersExecution.Type.setImmediate){ -RCTTiming.deleteTimer(timerID);}}}}; - - - - - -module.exports=JSTimers; -}); -__d('stringifySafe',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - -function stringifySafe(arg){ -var ret; -var type=typeof arg; -if(arg===undefined){ -ret='undefined';}else -if(arg===null){ -ret='null';}else -if(type==='string'){ -ret='"'+arg+'"';}else -if(type==='function'){ -try{ -ret=arg.toString();} -catch(e) { -ret='[function unknown]';}}else - -{ - - -try{ -ret=JSON.stringify(arg);} -catch(e) { -if(typeof arg.toString==='function'){ -try{ -ret=arg.toString();} -catch(E) {}}}} - - - -return ret||'["'+type+'" failed to stringify]';} - - -module.exports=stringifySafe; -}); -__d('findNodeHandle',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ReactCurrentOwner=require('ReactCurrentOwner'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function findNodeHandle(componentOrHandle){ -if(__DEV__){ -var owner=ReactCurrentOwner.current; -if(owner!==null){ -warning( -owner._warnedAboutRefsInRender, -'%s is accessing findNodeHandle inside its render(). '+ -'render() should be a pure function of props and state. It should '+ -'never access something that requires stale data from the previous '+ -'render, such as refs. Move this logic to componentDidMount and '+ -'componentDidUpdate instead.', -owner.getName()||'A component'); - -owner._warnedAboutRefsInRender=true;}} - - -if(componentOrHandle==null){ -return null;} - -if(typeof componentOrHandle==='number'){ - -return componentOrHandle;} - - -var component=componentOrHandle; - - - -var internalInstance=ReactInstanceMap.get(component); -if(internalInstance){ -return ReactNativeTagHandles.rootNodeIDToTag[internalInstance._rootNodeID];}else -{ -var rootNodeID=component._rootNodeID; -if(rootNodeID){ -return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];}else -{ -invariant( - - -typeof component==='object'&& -'_rootNodeID' in component|| - - -component.render!=null&& -typeof component.render==='function', - -'findNodeHandle(...): Argument is not a component '+ -'(type: %s, keys: %s)', -typeof component, -Object.keys(component)); - -invariant( -false, -'findNodeHandle(...): Unable to find node handle for unmounted '+ -'component.');}}} - - - - - -module.exports=findNodeHandle; -}); -__d('ReactCurrentOwner',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - -var ReactCurrentOwner={ - - - - - -current:null}; - - - -module.exports=ReactCurrentOwner; -}); -__d('ReactInstanceMap',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - -var ReactInstanceMap={ - - - - - - -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; -}); -__d('ReactNativeTagHandles',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - - - - - - -var INITIAL_TAG_COUNT=1; -var NATIVE_TOP_ROOT_ID_SEPARATOR='{TOP_LEVEL}'; -var ReactNativeTagHandles={ -tagsStartAt:INITIAL_TAG_COUNT, -tagCount:INITIAL_TAG_COUNT, - -allocateTag:function(){ - -while(this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount)){ -ReactNativeTagHandles.tagCount++;} - -var tag=ReactNativeTagHandles.tagCount; -ReactNativeTagHandles.tagCount++; -return tag;}, - - - - - - - - - - - -associateRootNodeIDWithMountedNodeHandle:function( -rootNodeID, -tag) -{ -warning(rootNodeID&&tag,'Root node or tag is null when associating'); -if(rootNodeID&&tag){ -ReactNativeTagHandles.tagToRootNodeID[tag]=rootNodeID; -ReactNativeTagHandles.rootNodeIDToTag[rootNodeID]=tag;}}, - - - -allocateRootNodeIDForTag:function(tag){ -invariant( -this.reactTagIsNativeTopRootID(tag), -'Expect a native root tag, instead got ',tag); - -return '.r['+tag+']'+NATIVE_TOP_ROOT_ID_SEPARATOR;}, - - -reactTagIsNativeTopRootID:function(reactTag){ - -return reactTag%10===1;}, - - -getNativeTopRootIDFromNodeID:function(nodeID){ -if(!nodeID){ -return null;} - -var index=nodeID.indexOf(NATIVE_TOP_ROOT_ID_SEPARATOR); -if(index===-1){ -return null;} - -return nodeID.substr(0,index+NATIVE_TOP_ROOT_ID_SEPARATOR.length);}, - - - - - - - - - - - - - - -mostRecentMountedNodeHandleForRootNodeID:function( -rootNodeID) -{ -return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];}, - - -tagToRootNodeID:[], - -rootNodeIDToTag:{}}; - - -module.exports=ReactNativeTagHandles; -}); -__d('ReactPropTypes',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactElement=require('ReactElement'); -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); - -var emptyFunction=require('emptyFunction'); -var getIteratorFn=require('getIteratorFn'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ANONYMOUS='<>'; - -var ReactPropTypes={ -array:createPrimitiveTypeChecker('array'), -bool:createPrimitiveTypeChecker('boolean'), -func:createPrimitiveTypeChecker('function'), -number:createPrimitiveTypeChecker('number'), -object:createPrimitiveTypeChecker('object'), -string:createPrimitiveTypeChecker('string'), - -any:createAnyTypeChecker(), -arrayOf:createArrayOfTypeChecker, -element:createElementTypeChecker(), -instanceOf:createInstanceTypeChecker, -node:createNodeChecker(), -objectOf:createObjectOfTypeChecker, -oneOf:createEnumTypeChecker, -oneOfType:createUnionTypeChecker, -shape:createShapeTypeChecker}; - - -function createChainableTypeChecker(validate){ -function checkType( -isRequired, -props, -propName, -componentName, -location, -propFullName) -{ -componentName=componentName||ANONYMOUS; -propFullName=propFullName||propName; -if(props[propName]==null){ -var locationName=ReactPropTypeLocationNames[location]; -if(isRequired){ -return new Error( -'Required '+locationName+' `'+propFullName+'` was not specified in '+('`'+ -componentName+'`.'));} - - -return null;}else -{ -return validate(props,propName,componentName,location,propFullName);}} - - - -var chainedCheckType=checkType.bind(null,false); -chainedCheckType.isRequired=checkType.bind(null,true); - -return chainedCheckType;} - - -function createPrimitiveTypeChecker(expectedType){ -function validate(props,propName,componentName,location,propFullName){ -var propValue=props[propName]; -var propType=getPropType(propValue); -if(propType!==expectedType){ -var locationName=ReactPropTypeLocationNames[location]; - - - -var preciseType=getPreciseType(propValue); - -return new Error( -'Invalid '+locationName+' `'+propFullName+'` of type '+('`'+ -preciseType+'` supplied to `'+componentName+'`, expected ')+('`'+ -expectedType+'`.'));} - - -return null;} - -return createChainableTypeChecker(validate);} - - -function createAnyTypeChecker(){ -return createChainableTypeChecker(emptyFunction.thatReturns(null));} - - -function createArrayOfTypeChecker(typeChecker){ -function validate(props,propName,componentName,location,propFullName){ -var propValue=props[propName]; -if(!Array.isArray(propValue)){ -var locationName=ReactPropTypeLocationNames[location]; -var propType=getPropType(propValue); -return new Error( -'Invalid '+locationName+' `'+propFullName+'` of type '+('`'+ -propType+'` supplied to `'+componentName+'`, expected an array.'));} - - -for(var i=0;i>';} - -return propValue.constructor.name;} - - -module.exports=ReactPropTypes; -}); -__d('ReactElement',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactCurrentOwner=require('ReactCurrentOwner'); - -var assign=require('Object.assign'); -var canDefineProperty=require('canDefineProperty'); - - - -var REACT_ELEMENT_TYPE= -typeof Symbol==='function'&&Symbol.for&&Symbol.for('react.element')|| -0xeac7; - -var RESERVED_PROPS={ -key:true, -ref:true, -__self:true, -__source:true}; - - - - - - - - - - - - - - - - - - - - -var ReactElement=function(type,key,ref,self,source,owner,props){ -var element={ - -$$typeof:REACT_ELEMENT_TYPE, - - -type:type, -key:key, -ref:ref, -props:props, - - -_owner:owner}; - - -if(__DEV__){ - - - - -element._store={}; - - - - - -if(canDefineProperty){ -Object.defineProperty(element._store,'validated',{ -configurable:false, -enumerable:false, -writable:true, -value:false}); - - -Object.defineProperty(element,'_self',{ -configurable:false, -enumerable:false, -writable:false, -value:self}); - - - -Object.defineProperty(element,'_source',{ -configurable:false, -enumerable:false, -writable:false, -value:source});}else - -{ -element._store.validated=false; -element._self=self; -element._source=source;} - -Object.freeze(element.props); -Object.freeze(element);} - - -return element;}; - - -ReactElement.createElement=function(type,config,children){ -var propName; - - -var props={}; - -var key=null; -var ref=null; -var self=null; -var source=null; - -if(config!=null){ -ref=config.ref===undefined?null:config.ref; -key=config.key===undefined?null:''+config.key; -self=config.__self===undefined?null:config.__self; -source=config.__source===undefined?null:config.__source; - -for(propName in config){ -if(config.hasOwnProperty(propName)&& -!RESERVED_PROPS.hasOwnProperty(propName)){ -props[propName]=config[propName];}}} - - - - - - -var childrenLength=arguments.length-2; -if(childrenLength===1){ -props.children=children;}else -if(childrenLength>1){ -var childArray=Array(childrenLength); -for(var i=0;i1){ -var childArray=Array(childrenLength); -for(var i=0;i=0;--i){ -var entry=this.tryEntries[i]; -var record=entry.completion; - -if(entry.tryLoc==="root"){ - - - -return handle("end");} - - -if(entry.tryLoc<=this.prev){ -var hasCatch=hasOwn.call(entry,"catchLoc"); -var hasFinally=hasOwn.call(entry,"finallyLoc"); - -if(hasCatch&&hasFinally){ -if(this.prev=0;--i){ -var entry=this.tryEntries[i]; -if(entry.tryLoc<=this.prev&& -hasOwn.call(entry,"finallyLoc")&& -this.prev=0;--i){ -var entry=this.tryEntries[i]; -if(entry.finallyLoc===finallyLoc){ -this.complete(entry.completion,entry.afterLoc); -resetTryEntry(entry); -return ContinueSentinel;}}}, - - - - -"catch":function(tryLoc){ -for(var i=this.tryEntries.length-1;i>=0;--i){ -var entry=this.tryEntries[i]; -if(entry.tryLoc===tryLoc){ -var record=entry.completion; -if(record.type==="throw"){ -var thrown=record.arg; -resetTryEntry(entry);} - -return thrown;}} - - - - - -throw new Error("illegal catch attempt");}, - - -delegateYield:function(iterable,resultName,nextLoc){ -this.delegate={ -iterator:values(iterable), -resultName:resultName, -nextLoc:nextLoc}; - - -return ContinueSentinel;}};})( - - - - - - -typeof global==="object"?global: -typeof window==="object"?window: -typeof self==="object"?self:this); -}); -__d('ExceptionsManager',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTExceptionsManager=require('NativeModules').ExceptionsManager; - -var loadSourceMap=require('loadSourceMap'); -var parseErrorStack=require('parseErrorStack'); -var stringifySafe=require('stringifySafe'); - -var sourceMapPromise; - -var exceptionID=0; - - - - -function reportException(e,isFatal){ -var currentExceptionID=++exceptionID; -if(RCTExceptionsManager){ -var stack=parseErrorStack(e); -if(isFatal){ -RCTExceptionsManager.reportFatalException(e.message,stack,currentExceptionID);}else -{ -RCTExceptionsManager.reportSoftException(e.message,stack,currentExceptionID);} - -if(__DEV__){ -(sourceMapPromise=sourceMapPromise||loadSourceMap()). -then(function(map){ -var prettyStack=parseErrorStack(e,map); -RCTExceptionsManager.updateExceptionMessage(e.message,prettyStack,currentExceptionID);}). - -catch(function(error){ - - -console.warn('Unable to load source map: '+error.message);});}}} - - - - - - - - -function handleException(e,isFatal){ - - - - -if(!e.message){ -e=new Error(e);} - - -(console._errorOriginal||console.error)(e.message); -reportException(e,isFatal);} - - - - - - -function installConsoleErrorReporter(){ - -if(console._errorOriginal){ -return;} - -console._errorOriginal=console.error.bind(console); -console.error=function reactConsoleError(){ -console._errorOriginal.apply(null,arguments); -if(!console.reportErrorsAsExceptions){ -return;} - - -if(arguments[0]&&arguments[0].stack){ -reportException(arguments[0],false);}else -{ -var str=Array.prototype.map.call(arguments,stringifySafe).join(', '); -if(str.slice(0,10)==='"Warning: '){ - - - -return;} - -var error=new Error('console.error: '+str); -error.framesToPop=1; -reportException(error,false);}}; - - -if(console.reportErrorsAsExceptions===undefined){ -console.reportErrorsAsExceptions=true;}} - - - -module.exports={handleException:handleException,installConsoleErrorReporter:installConsoleErrorReporter}; -}); -__d('loadSourceMap',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var Promise=require('Promise'); -var NativeModules=require('NativeModules'); -var SourceMapConsumer=require('SourceMap').SourceMapConsumer; -var SourceMapURL=require('react-native/Libraries/JavaScriptAppEngine/Initialization/source-map-url.js'); - -var RCTSourceCode=NativeModules.SourceCode; -var RCTNetworking=NativeModules.Networking; - -function loadSourceMap(){ -return fetchSourceMap(). -then(function(map){return new SourceMapConsumer(map);});} - - -function fetchSourceMap(){ -if(global.RAW_SOURCE_MAP){ -return Promise.resolve(global.RAW_SOURCE_MAP);} - - -if(!RCTSourceCode){ -return Promise.reject(new Error('RCTSourceCode module is not available'));} - - -if(!RCTNetworking){ - -return Promise.reject(new Error('RCTNetworking module is not available'));} - - -return new Promise(RCTSourceCode.getScriptText). -then(extractSourceMapURL). -then(function(url){ -if(url===null){ -return Promise.reject(new Error('No source map URL found. May be running from bundled file.'));} - -return Promise.resolve(url);}). - -then(fetch). -then(function(response){return response.text();});} - - -function extractSourceMapURL(_ref){var url=_ref.url;var text=_ref.text;var fullSourceMappingURL=_ref.fullSourceMappingURL; -if(fullSourceMappingURL){ -return fullSourceMappingURL;} - -var mapURL=SourceMapURL.getFrom(text); -if(!mapURL){ -return null;} - -var baseURL=url.match(/(.+:\/\/.*?)\//)[1]; -return baseURL+mapURL;} - - -module.exports=loadSourceMap; -}); -__d('Promise',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - -global.setImmediate=require('setImmediate'); -var Promise=require('promise/setimmediate/es6-extensions.js'); -require('promise/setimmediate/done.js'); - - - - -Promise.prototype.finally=function(onSettled){ -return this.then(onSettled,onSettled);}; - - - -module.exports=Promise; -}); -__d('setImmediate',function(global, require, module, exports) { module. - - - - - - - - - - - - - - - - -exports=global.setImmediate|| -require('ImmediateImplementation').setImmediate; -}); -__d('ImmediateImplementation',function(global, require, module, exports) { /** - * @generated SignedSource<<57d0446bbd1186485d372efe6b323dca>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic - * Denicola - * - * 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. - * - * @preserve-header - * @providesModule ImmediateImplementation - */ - -(function(global,undefined){ -"use strict"; - -var nextHandle=1; -var tasksByHandle={}; -var queueHead={}; -var queueTail=queueHead; -var currentlyRunningATask=false; -var doc=global.document; -var setImmediate; - -function addFromSetImmediateArguments(args){ -var handler=args[0]; -args=Array.prototype.slice.call(args,1); -tasksByHandle[nextHandle]=function(){ -handler.apply(undefined,args);}; - -queueTail=queueTail.next={handle:nextHandle++}; -return queueTail.handle;} - - -function flushQueue(){ -var next,task; -while(!currentlyRunningATask&&(next=queueHead.next)){ -queueHead=next; -if(task=tasksByHandle[next.handle]){ -currentlyRunningATask=true; -try{ -task(); -currentlyRunningATask=false;}finally -{ -clearImmediate(next.handle); -if(currentlyRunningATask){ -currentlyRunningATask=false; - - - - - - -if(queueHead.next){ -setImmediate(flushQueue);}}}}}} - - - - - - - -function clearImmediate(handle){ -delete tasksByHandle[handle];} - - -function canUsePostMessage(){ - - -if(global.postMessage&&!global.importScripts){ -var postMessageIsAsynchronous=true; - -var onMessage=function(){ -postMessageIsAsynchronous=false; -if(global.removeEventListener){ -global.removeEventListener("message",onMessage,false);}else -{ -global.detachEvent("onmessage",onMessage);}}; - - - -if(global.addEventListener){ -global.addEventListener("message",onMessage,false);}else -if(global.attachEvent){ -global.attachEvent("onmessage",onMessage);}else -{ -return false;} - - -global.postMessage("","*"); -return postMessageIsAsynchronous;}} - - - -function installPostMessageImplementation(){ - - -var messagePrefix="setImmediate$"+Math.random()+"$"; -var onGlobalMessage=function(event){ -if(event.source===global&& -typeof event.data==="string"&& -event.data.indexOf(messagePrefix)===0){ -flushQueue();}}; - - - -if(global.addEventListener){ -global.addEventListener("message",onGlobalMessage,false);}else -{ -global.attachEvent("onmessage",onGlobalMessage);} - - -setImmediate=function(){ -var handle=addFromSetImmediateArguments(arguments); -global.postMessage(messagePrefix+handle,"*"); -return handle;};} - - - -function installMessageChannelImplementation(){ -var channel=new MessageChannel(); -channel.port1.onmessage=flushQueue; -setImmediate=function(){ -var handle=addFromSetImmediateArguments(arguments); -channel.port2.postMessage(handle); -return handle;};} - - - -function installReadyStateChangeImplementation(){ -var html=doc.documentElement; -setImmediate=function(){ -var handle=addFromSetImmediateArguments(arguments); - - -var script=doc.createElement("script"); -script.onreadystatechange=function(){ -script.onreadystatechange=null; -html.removeChild(script); -script=null; -flushQueue();}; - -html.appendChild(script); -return handle;};} - - - -function installSetTimeoutImplementation(){ -setImmediate=function(){ -setTimeout(flushQueue,0); -return addFromSetImmediateArguments(arguments);};} - - - -if(canUsePostMessage()){ - -installPostMessageImplementation();}else - -if(global.MessageChannel){ - -installMessageChannelImplementation();}else - -if(doc&&"onreadystatechange" in doc.createElement("script")){ - -installReadyStateChangeImplementation();}else - -{ - -installSetTimeoutImplementation();} - - -exports.setImmediate=setImmediate; -exports.clearImmediate=clearImmediate;})( -Function("return this")()); -}); -__d('promise/setimmediate/es6-extensions.js',function(global, require, module, exports) { 'use strict'; - - - -var Promise=require('promise/setimmediate/core.js'); - -module.exports=Promise; - - - -var TRUE=valuePromise(true); -var FALSE=valuePromise(false); -var NULL=valuePromise(null); -var UNDEFINED=valuePromise(undefined); -var ZERO=valuePromise(0); -var EMPTYSTRING=valuePromise(''); - -function valuePromise(value){ -var p=new Promise(Promise._61); -p._81=1; -p._65=value; -return p;} - -Promise.resolve=function(value){ -if(value instanceof Promise)return value; - -if(value===null)return NULL; -if(value===undefined)return UNDEFINED; -if(value===true)return TRUE; -if(value===false)return FALSE; -if(value===0)return ZERO; -if(value==='')return EMPTYSTRING; - -if(typeof value==='object'||typeof value==='function'){ -try{ -var then=value.then; -if(typeof then==='function'){ -return new Promise(then.bind(value));}} - -catch(ex) { -return new Promise(function(resolve,reject){ -reject(ex);});}} - - - -return valuePromise(value);}; - - -Promise.all=function(arr){ -var args=Array.prototype.slice.call(arr); - -return new Promise(function(resolve,reject){ -if(args.length===0)return resolve([]); -var remaining=args.length; -function res(i,val){ -if(val&&(typeof val==='object'||typeof val==='function')){ -if(val instanceof Promise&&val.then===Promise.prototype.then){ -while(val._81===3){ -val=val._65;} - -if(val._81===1)return res(i,val._65); -if(val._81===2)reject(val._65); -val.then(function(val){ -res(i,val);}, -reject); -return;}else -{ -var then=val.then; -if(typeof then==='function'){ -var p=new Promise(then.bind(val)); -p.then(function(val){ -res(i,val);}, -reject); -return;}}} - - - -args[i]=val; -if(--remaining===0){ -resolve(args);}} - - -for(var i=0;i0&&aGenerated.column>=0&& -!aOriginal&&!aSource&&!aName){ - -return;}else - -if(aGenerated&&'line' in aGenerated&&'column' in aGenerated&& -aOriginal&&'line' in aOriginal&&'column' in aOriginal&& -aGenerated.line>0&&aGenerated.column>=0&& -aOriginal.line>0&&aOriginal.column>=0&& -aSource){ - -return;}else - -{ -throw new Error('Invalid mapping: '+JSON.stringify({ -generated:aGenerated, -source:aSource, -orginal:aOriginal, -name:aName}));}}; - - - - - - - - -SourceMapGenerator.prototype._serializeMappings= -function SourceMapGenerator_serializeMappings(){ -var previousGeneratedColumn=0; -var previousGeneratedLine=1; -var previousOriginalColumn=0; -var previousOriginalLine=0; -var previousName=0; -var previousSource=0; -var result=''; -var mapping; - - - - - - -this._mappings.sort(util.compareByGeneratedPositions); - -for(var i=0,len=this._mappings.length;i0){ -if(!util.compareByGeneratedPositions(mapping,this._mappings[i-1])){ -continue;} - -result+=',';}} - - - -result+=base64VLQ.encode(mapping.generatedColumn- -previousGeneratedColumn); -previousGeneratedColumn=mapping.generatedColumn; - -if(mapping.source){ -result+=base64VLQ.encode(this._sources.indexOf(mapping.source)- -previousSource); -previousSource=this._sources.indexOf(mapping.source); - - -result+=base64VLQ.encode(mapping.originalLine-1- -previousOriginalLine); -previousOriginalLine=mapping.originalLine-1; - -result+=base64VLQ.encode(mapping.originalColumn- -previousOriginalColumn); -previousOriginalColumn=mapping.originalColumn; - -if(mapping.name){ -result+=base64VLQ.encode(this._names.indexOf(mapping.name)- -previousName); -previousName=this._names.indexOf(mapping.name);}}} - - - - -return result;}; - - -SourceMapGenerator.prototype._generateSourcesContent= -function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){ -return aSources.map(function(source){ -if(!this._sourcesContents){ -return null;} - -if(aSourceRoot){ -source=util.relative(aSourceRoot,source);} - -var key=util.toSetString(source); -return Object.prototype.hasOwnProperty.call(this._sourcesContents, -key)? -this._sourcesContents[key]: -null;}, -this);}; - - - - - -SourceMapGenerator.prototype.toJSON= -function SourceMapGenerator_toJSON(){ -var map={ -version:this._version, -file:this._file, -sources:this._sources.toArray(), -names:this._names.toArray(), -mappings:this._serializeMappings()}; - -if(this._sourceRoot){ -map.sourceRoot=this._sourceRoot;} - -if(this._sourcesContents){ -map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot);} - - -return map;}; - - - - - -SourceMapGenerator.prototype.toString= -function SourceMapGenerator_toString(){ -return JSON.stringify(this);}; - - -exports.SourceMapGenerator=SourceMapGenerator;}); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -define('source-map/base64-vlq',['require','exports','module','source-map/base64'],function(require,exports,module){ - -var base64=require('./base64'); - - - - - - - - - - - - - -var VLQ_BASE_SHIFT=5; - - -var VLQ_BASE=1<>1; -return isNegative? --shifted: -shifted;} - - - - - -exports.encode=function base64VLQ_encode(aValue){ -var encoded=""; -var digit; - -var vlq=toVLQSigned(aValue); - -do { -digit=vlq&VLQ_BASE_MASK; -vlq>>>=VLQ_BASE_SHIFT; -if(vlq>0){ - - -digit|=VLQ_CONTINUATION_BIT;} - -encoded+=base64.encode(digit);}while( -vlq>0); - -return encoded;}; - - - - - - -exports.decode=function base64VLQ_decode(aStr){ -var i=0; -var strLen=aStr.length; -var result=0; -var shift=0; -var continuation,digit; - -do { -if(i>=strLen){ -throw new Error("Expected more digits in base 64 VLQ value.");} - -digit=base64.decode(aStr.charAt(i++)); -continuation=!!(digit&VLQ_CONTINUATION_BIT); -digit&=VLQ_BASE_MASK; -result=result+(digit<s2)-(s1=0&&aIdx0){ -if(str.charAt(0)===';'){ -generatedLine++; -str=str.slice(1); -previousGeneratedColumn=0;}else - -if(str.charAt(0)===','){ -str=str.slice(1);}else - -{ -mapping={}; -mapping.generatedLine=generatedLine; - - -temp=base64VLQ.decode(str); -mapping.generatedColumn=previousGeneratedColumn+temp.value; -previousGeneratedColumn=mapping.generatedColumn; -str=temp.rest; - -if(str.length>0&&!mappingSeparator.test(str.charAt(0))){ - -temp=base64VLQ.decode(str); -mapping.source=this._sources.at(previousSource+temp.value); -previousSource+=temp.value; -str=temp.rest; -if(str.length===0||mappingSeparator.test(str.charAt(0))){ -throw new Error('Found a source, but no line and column');} - - - -temp=base64VLQ.decode(str); -mapping.originalLine=previousOriginalLine+temp.value; -previousOriginalLine=mapping.originalLine; - -mapping.originalLine+=1; -str=temp.rest; -if(str.length===0||mappingSeparator.test(str.charAt(0))){ -throw new Error('Found a source and line, but no column');} - - - -temp=base64VLQ.decode(str); -mapping.originalColumn=previousOriginalColumn+temp.value; -previousOriginalColumn=mapping.originalColumn; -str=temp.rest; - -if(str.length>0&&!mappingSeparator.test(str.charAt(0))){ - -temp=base64VLQ.decode(str); -mapping.name=this._names.at(previousName+temp.value); -previousName+=temp.value; -str=temp.rest;}} - - - -this.__generatedMappings.push(mapping); -if(typeof mapping.originalLine==='number'){ -this.__originalMappings.push(mapping);}}} - - - - -this.__originalMappings.sort(util.compareByOriginalPositions);}; - - - - - - -SourceMapConsumer.prototype._findMapping= -function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName, -aColumnName,aComparator){ - - - - - -if(aNeedle[aLineName]<=0){ -throw new TypeError('Line must be greater than or equal to 1, got '+ -aNeedle[aLineName]);} - -if(aNeedle[aColumnName]<0){ -throw new TypeError('Column must be greater than or equal to 0, got '+ -aNeedle[aColumnName]);} - - -return binarySearch.search(aNeedle,aMappings,aComparator);}; - - - - - - - - - - - - - - - - - -SourceMapConsumer.prototype.originalPositionFor= -function SourceMapConsumer_originalPositionFor(aArgs){ -var needle={ -generatedLine:util.getArg(aArgs,'line'), -generatedColumn:util.getArg(aArgs,'column')}; - - -var mapping=this._findMapping(needle, -this._generatedMappings, -"generatedLine", -"generatedColumn", -util.compareByGeneratedPositions); - -if(mapping){ -var source=util.getArg(mapping,'source',null); -if(source&&this.sourceRoot){ -source=util.join(this.sourceRoot,source);} - -return { -source:source, -line:util.getArg(mapping,'originalLine',null), -column:util.getArg(mapping,'originalColumn',null), -name:util.getArg(mapping,'name',null)};} - - - -return { -source:null, -line:null, -column:null, -name:null};}; - - - - - - - - -SourceMapConsumer.prototype.sourceContentFor= -function SourceMapConsumer_sourceContentFor(aSource){ -if(!this.sourcesContent){ -return null;} - - -if(this.sourceRoot){ -aSource=util.relative(this.sourceRoot,aSource);} - - -if(this._sources.has(aSource)){ -return this.sourcesContent[this._sources.indexOf(aSource)];} - - -var url; -if(this.sourceRoot&&( -url=util.urlParse(this.sourceRoot))){ - - - - -var fileUriAbsPath=aSource.replace(/^file:\/\//,""); -if(url.scheme=="file"&& -this._sources.has(fileUriAbsPath)){ -return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];} - - -if((!url.path||url.path=="/")&& -this._sources.has("/"+aSource)){ -return this.sourcesContent[this._sources.indexOf("/"+aSource)];}} - - - -throw new Error('"'+aSource+'" is not in the SourceMap.');}; - - - - - - - - - - - - - - - - -SourceMapConsumer.prototype.generatedPositionFor= -function SourceMapConsumer_generatedPositionFor(aArgs){ -var needle={ -source:util.getArg(aArgs,'source'), -originalLine:util.getArg(aArgs,'line'), -originalColumn:util.getArg(aArgs,'column')}; - - -if(this.sourceRoot){ -needle.source=util.relative(this.sourceRoot,needle.source);} - - -var mapping=this._findMapping(needle, -this._originalMappings, -"originalLine", -"originalColumn", -util.compareByOriginalPositions); - -if(mapping){ -return { -line:util.getArg(mapping,'generatedLine',null), -column:util.getArg(mapping,'generatedColumn',null)};} - - - -return { -line:null, -column:null};}; - - - -SourceMapConsumer.GENERATED_ORDER=1; -SourceMapConsumer.ORIGINAL_ORDER=2; - - - - - - - - - - - - - - - - - -SourceMapConsumer.prototype.eachMapping= -function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){ -var context=aContext||null; -var order=aOrder||SourceMapConsumer.GENERATED_ORDER; - -var mappings; -switch(order){ -case SourceMapConsumer.GENERATED_ORDER: -mappings=this._generatedMappings; -break; -case SourceMapConsumer.ORIGINAL_ORDER: -mappings=this._originalMappings; -break; -default: -throw new Error("Unknown order of iteration.");} - - -var sourceRoot=this.sourceRoot; -mappings.map(function(mapping){ -var source=mapping.source; -if(source&&sourceRoot){ -source=util.join(sourceRoot,source);} - -return { -source:source, -generatedLine:mapping.generatedLine, -generatedColumn:mapping.generatedColumn, -originalLine:mapping.originalLine, -originalColumn:mapping.originalColumn, -name:mapping.name};}). - -forEach(aCallback,context);}; - - -exports.SourceMapConsumer=SourceMapConsumer;}); - - - - - - - - -define('source-map/binary-search',['require','exports','module'],function(require,exports,module){ - - - - - - - - - - -function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){ - - - - - - - - - - -var mid=Math.floor((aHigh-aLow)/2)+aLow; -var cmp=aCompare(aNeedle,aHaystack[mid],true); -if(cmp===0){ - -return aHaystack[mid];}else - -if(cmp>0){ - -if(aHigh-mid>1){ - -return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare);} - - - -return aHaystack[mid];}else - -{ - -if(mid-aLow>1){ - -return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare);} - - - -return aLow<0? -null: -aHaystack[aLow];}} - - - - - - - - - - - - - - - - -exports.search=function search(aNeedle,aHaystack,aCompare){ -return aHaystack.length>0? -recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare): -null;};}); - - - - - - - - - -define('source-map/source-node',['require','exports','module','source-map/source-map-generator','source-map/util'],function(require,exports,module){ - -var SourceMapGenerator=require('./source-map-generator').SourceMapGenerator; -var util=require('./util'); - - - - - - - - - - - - - -function SourceNode(aLine,aColumn,aSource,aChunks,aName){ -this.children=[]; -this.sourceContents={}; -this.line=aLine===undefined?null:aLine; -this.column=aColumn===undefined?null:aColumn; -this.source=aSource===undefined?null:aSource; -this.name=aName===undefined?null:aName; -if(aChunks!=null)this.add(aChunks);} - - - - - - - - -SourceNode.fromStringWithSourceMap= -function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer){ - - -var node=new SourceNode(); - - - -var remainingLines=aGeneratedCode.split('\n'); - - -var lastGeneratedLine=1,lastGeneratedColumn=0; - - - - -var lastMapping=null; - -aSourceMapConsumer.eachMapping(function(mapping){ -if(lastMapping===null){ - - - -while(lastGeneratedLine=0;i--){ -this.prepend(aChunk[i]);}}else - - -if(aChunk instanceof SourceNode||typeof aChunk==="string"){ -this.children.unshift(aChunk);}else - -{ -throw new TypeError( -"Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk);} - - -return this;}; - - - - - - - - - -SourceNode.prototype.walk=function SourceNode_walk(aFn){ -var chunk; -for(var i=0,len=this.children.length;i0){ -newChildren=[]; -for(i=0;i-1?upcased:method;} - - -function Request(input,options){ -options=options||{}; -var body=options.body; -if(Request.prototype.isPrototypeOf(input)){ -if(input.bodyUsed){ -throw new TypeError('Already read');} - -this.url=input.url; -this.credentials=input.credentials; -if(!options.headers){ -this.headers=new Headers(input.headers);} - -this.method=input.method; -this.mode=input.mode; -if(!body){ -body=input._bodyInit; -input.bodyUsed=true;}}else - -{ -this.url=input;} - - -this.credentials=options.credentials||this.credentials||'omit'; -if(options.headers||!this.headers){ -this.headers=new Headers(options.headers);} - -this.method=normalizeMethod(options.method||this.method||'GET'); -this.mode=options.mode||this.mode||null; -this.referrer=null; - -if((this.method==='GET'||this.method==='HEAD')&&body){ -throw new TypeError('Body not allowed for GET or HEAD requests');} - -this._initBody(body);} - - -Request.prototype.clone=function(){ -return new Request(this);}; - - -function decode(body){ -var form=new FormData(); -body.trim().split('&').forEach(function(bytes){ -if(bytes){ -var split=bytes.split('='); -var name=split.shift().replace(/\+/g,' '); -var value=split.join('=').replace(/\+/g,' '); -form.append(decodeURIComponent(name),decodeURIComponent(value));}}); - - -return form;} - - -function headers(xhr){ -var head=new Headers(); -var pairs=xhr.getAllResponseHeaders().trim().split('\n'); -pairs.forEach(function(header){ -var split=header.trim().split(':'); -var key=split.shift().trim(); -var value=split.join(':').trim(); -head.append(key,value);}); - -return head;} - - -Body.call(Request.prototype); - -function Response(bodyInit,options){ -if(!options){ -options={};} - - -this._initBody(bodyInit); -this.type='default'; -this.url=null; -this.status=options.status; -this.ok=this.status>=200&&this.status<300; -this.statusText=options.statusText; -this.headers=options.headers instanceof Headers?options.headers:new Headers(options.headers); -this.url=options.url||'';} - - -Response.prototype.clone=function(){ -return new Response(this._bodyInit,{ -status:this.status, -statusText:this.statusText, -headers:new Headers(this.headers), -url:this.url});}; - - - -Body.call(Response.prototype); - -self.Headers=Headers; -self.Request=Request; -self.Response=Response; - -self.fetch=function(input,init){ -var request; -if(Request.prototype.isPrototypeOf(input)&&!init){ -request=input;}else -{ -request=new Request(input,init);} - - -return new Promise(function(resolve,reject){ -var xhr=new XMLHttpRequest(); - -function responseURL(){ -if('responseURL' in xhr){ -return xhr.responseURL;} - - - -if(/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())){ -return xhr.getResponseHeader('X-Request-URL');} - - -return;} - - -xhr.onload=function(){ -var status=xhr.status===1223?204:xhr.status; -if(status<100||status>599){ -reject(new TypeError('Network request failed')); -return;} - -var options={ -status:status, -statusText:xhr.statusText, -headers:headers(xhr), -url:responseURL()}; - -var body='response' in xhr?xhr.response:xhr.responseText; -resolve(new Response(body,options));}; - - -xhr.onerror=function(){ -reject(new TypeError('Network request failed'));}; - - -xhr.open(request.method,request.url,true); - -if(request.credentials==='include'){ -xhr.withCredentials=true;} - - -if('responseType' in xhr&&support.blob){ -xhr.responseType='blob';} - - -request.headers.forEach(function(value,name){ -xhr.setRequestHeader(name,value);}); - - -xhr.send(typeof request._bodyInit==='undefined'?null:request._bodyInit);});}; - - -self.fetch.polyfill=true;})(); - - - - -module.exports=self; -}); -__d('Geolocation',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTDeviceEventEmitter=require('RCTDeviceEventEmitter'); -var RCTLocationObserver=require('NativeModules').LocationObserver; - -var invariant=require('invariant'); -var logError=require('logError'); -var warning=require('warning'); - -var subscriptions=[]; - -var updatesEnabled=false; - - - - - - - - - - - - - - - - - - - - - - - - - - -var Geolocation={ - - - - - -getCurrentPosition:function( -geo_success, -geo_error, -geo_options) -{ -invariant( -typeof geo_success==='function', -'Must provide a valid geo_success callback.'); - -RCTLocationObserver.getCurrentPosition( -geo_options||{}, -geo_success, -geo_error||logError);}, - - - - - - - -watchPosition:function(success,error,options){ -if(!updatesEnabled){ -RCTLocationObserver.startObserving(options||{}); -updatesEnabled=true;} - -var watchID=subscriptions.length; -subscriptions.push([ -RCTDeviceEventEmitter.addListener( -'geolocationDidChange', -success), - -error?RCTDeviceEventEmitter.addListener( -'geolocationError', -error): -null]); - -return watchID;}, - - -clearWatch:function(watchID){ -var sub=subscriptions[watchID]; -if(!sub){ - - -return;} - - -sub[0].remove(); - -var sub1=sub[1];sub1&&sub1.remove(); -subscriptions[watchID]=undefined; -var noWatchers=true; -for(var ii=0;ii0){ -var types=Array(arguments.length); -for(var i=0;i1){ -var index=id.indexOf(SEPARATOR,1); -return index>-1?id.substr(0,index):id;} - -return null;}, - - - - - - - - - - - - - - - - -traverseEnterLeave:function(leaveID,enterID,cb,upArg,downArg){ -var ancestorID=getFirstCommonAncestorID(leaveID,enterID); -if(ancestorID!==leaveID){ -traverseParentPath(leaveID,ancestorID,cb,upArg,false,true);} - -if(ancestorID!==enterID){ -traverseParentPath(ancestorID,enterID,cb,downArg,true,false);}}, - - - - - - - - - - - - - -traverseTwoPhase:function(targetID,cb,arg){ -if(targetID){ -traverseParentPath('',targetID,cb,arg,true,false); -traverseParentPath(targetID,'',cb,arg,false,true);}}, - - - - - - -traverseTwoPhaseSkipTarget:function(targetID,cb,arg){ -if(targetID){ -traverseParentPath('',targetID,cb,arg,true,true); -traverseParentPath(targetID,'',cb,arg,true,true);}}, - - - - - - - - - - - - - - - -traverseAncestors:function(targetID,cb,arg){ -traverseParentPath('',targetID,cb,arg,true,false);}, - - -getFirstCommonAncestorID:getFirstCommonAncestorID, - - - - - -_getNextDescendantID:getNextDescendantID, - -isAncestorIDOf:isAncestorIDOf, - -SEPARATOR:SEPARATOR}; - - - -module.exports=ReactInstanceHandles; -}); -__d('ReactRootIndex',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ReactRootIndexInjection={ - - - -injectCreateReactRootIndex:function(_createReactRootIndex){ -ReactRootIndex.createReactRootIndex=_createReactRootIndex;}}; - - - -var ReactRootIndex={ -createReactRootIndex:null, -injection:ReactRootIndexInjection}; - - -module.exports=ReactRootIndex; -}); -__d('ReactNativeMount',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactElement=require('ReactElement'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var ReactPerf=require('ReactPerf'); -var ReactReconciler=require('ReactReconciler'); -var ReactUpdateQueue=require('ReactUpdateQueue'); -var ReactUpdates=require('ReactUpdates'); -var UIManager=require('UIManager'); - -var emptyObject=require('emptyObject'); -var instantiateReactComponent=require('instantiateReactComponent'); -var shouldUpdateReactComponent=require('shouldUpdateReactComponent'); - -function instanceNumberToChildRootID(rootNodeID,instanceNumber){ -return rootNodeID+'['+instanceNumber+']';} - - - - - - - -var TopLevelWrapper=function(){}; -TopLevelWrapper.prototype.isReactComponent={}; -if(__DEV__){ -TopLevelWrapper.displayName='TopLevelWrapper';} - -TopLevelWrapper.prototype.render=function(){ - -return this.props;}; - - - - - - - - - - -function mountComponentIntoNode( -componentInstance, -rootID, -container, -transaction){ -var markup=ReactReconciler.mountComponent( -componentInstance,rootID,transaction,emptyObject); - -componentInstance._renderedComponent._topLevelWrapper=componentInstance; -ReactNativeMount._mountImageIntoNode(markup,container);} - - - - - - - - - -function batchedMountComponentIntoNode( -componentInstance, -rootID, -container){ -var transaction=ReactUpdates.ReactReconcileTransaction.getPooled(); -transaction.perform( -mountComponentIntoNode, -null, -componentInstance, -rootID, -container, -transaction); - -ReactUpdates.ReactReconcileTransaction.release(transaction);} - - - - - - -var ReactNativeMount={ -instanceCount:0, - -_instancesByContainerID:{}, - - -findNodeHandle:require('findNodeHandle'), -nativeTagToRootNodeID:function(nativeTag){ -return ReactNativeTagHandles.tagToRootNodeID[nativeTag];}, - - - - - - -renderComponent:function( -nextElement, -containerTag, -callback) -{ -var nextWrappedElement=new ReactElement( -TopLevelWrapper, -null, -null, -null, -null, -null, -nextElement); - - -var topRootNodeID=ReactNativeTagHandles.tagToRootNodeID[containerTag]; -if(topRootNodeID){ -var prevComponent=ReactNativeMount._instancesByContainerID[topRootNodeID]; -if(prevComponent){ -var prevWrappedElement=prevComponent._currentElement; -var prevElement=prevWrappedElement.props; -if(shouldUpdateReactComponent(prevElement,nextElement)){ -ReactUpdateQueue.enqueueElementInternal(prevComponent,nextWrappedElement); -if(callback){ -ReactUpdateQueue.enqueueCallbackInternal(prevComponent,callback);} - -return prevComponent;}else -{ -ReactNativeMount.unmountComponentAtNode(containerTag);}}} - - - - -if(!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)){ -console.error('You cannot render into anything but a top root'); -return;} - - -var topRootNodeID=ReactNativeTagHandles.allocateRootNodeIDForTag(containerTag); -ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle( -topRootNodeID, -containerTag); - - -var instance=instantiateReactComponent(nextWrappedElement); -ReactNativeMount._instancesByContainerID[topRootNodeID]=instance; - -var childRootNodeID=instanceNumberToChildRootID( -topRootNodeID, -ReactNativeMount.instanceCount++); - - - - - - -ReactUpdates.batchedUpdates( -batchedMountComponentIntoNode, -instance, -childRootNodeID, -topRootNodeID); - -var component=instance.getPublicInstance(); -if(callback){ -callback.call(component);} - -return component;}, - - - - - - -_mountImageIntoNode:ReactPerf.measure( - -'ReactComponentBrowserEnvironment', -'mountImageIntoNode', -function(mountImage,containerID){ - - -ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle( -mountImage.rootNodeID, -mountImage.tag); - -var addChildTags=[mountImage.tag]; -var addAtIndices=[0]; -UIManager.manageChildren( -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID), -null, -null, -addChildTags, -addAtIndices, -null);}), - - - - - - - - - - - - -unmountComponentAtNodeAndRemoveContainer:function( -containerTag) -{ -ReactNativeMount.unmountComponentAtNode(containerTag); - -UIManager.removeRootView(containerTag);}, - - - - - - - -unmountComponentAtNode:function(containerTag){ -if(!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)){ -console.error('You cannot render into anything but a top root'); -return false;} - - -var containerID=ReactNativeTagHandles.tagToRootNodeID[containerTag]; -var instance=ReactNativeMount._instancesByContainerID[containerID]; -if(!instance){ -return false;} - -ReactNativeMount.unmountComponentFromNode(instance,containerID); -delete ReactNativeMount._instancesByContainerID[containerID]; -return true;}, - - - - - - - - - - - -unmountComponentFromNode:function( -instance, -containerID) -{ - -ReactReconciler.unmountComponent(instance); -var containerTag= -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID); -UIManager.removeSubviewsFromContainerWithID(containerTag);}, - - -getNode:function(rootNodeID){ -return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];}, - - -getID:function(nativeTag){ -return ReactNativeTagHandles.tagToRootNodeID[nativeTag];}}; - - - -ReactNativeMount.renderComponent=ReactPerf.measure( -'ReactMount', -'_renderNewRootComponent', -ReactNativeMount.renderComponent); - - -module.exports=ReactNativeMount; -}); -__d('ReactReconciler',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactRef=require('ReactRef'); - - - - - -function attachRefs(){ -ReactRef.attachRefs(this,this._currentElement);} - - -var ReactReconciler={ - - - - - - - - - - - -mountComponent:function(internalInstance,rootID,transaction,context){ -var markup=internalInstance.mountComponent(rootID,transaction,context); -if(internalInstance._currentElement&& -internalInstance._currentElement.ref!=null){ -transaction.getReactMountReady().enqueue(attachRefs,internalInstance);} - -return markup;}, - - - - - - - - -unmountComponent:function(internalInstance){ -ReactRef.detachRefs(internalInstance,internalInstance._currentElement); -internalInstance.unmountComponent();}, - - - - - - - - - - - -receiveComponent:function( -internalInstance,nextElement,transaction,context) -{ -var prevElement=internalInstance._currentElement; - -if(nextElement===prevElement&& -context===internalInstance._context) -{ - - - - - - - - - - -return;} - - -var refsChanged=ReactRef.shouldUpdateRefs( -prevElement, -nextElement); - - -if(refsChanged){ -ReactRef.detachRefs(internalInstance,prevElement);} - - -internalInstance.receiveComponent(nextElement,transaction,context); - -if(refsChanged&& -internalInstance._currentElement&& -internalInstance._currentElement.ref!=null){ -transaction.getReactMountReady().enqueue(attachRefs,internalInstance);}}, - - - - - - - - - - -performUpdateIfNecessary:function( -internalInstance, -transaction) -{ -internalInstance.performUpdateIfNecessary(transaction);}}; - - - - -module.exports=ReactReconciler; -}); -__d('ReactRef',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactOwner=require('ReactOwner'); - -var ReactRef={}; - -function attachRef(ref,component,owner){ -if(typeof ref==='function'){ -ref(component.getPublicInstance());}else -{ - -ReactOwner.addComponentAsRefTo(component,ref,owner);}} - - - -function detachRef(ref,component,owner){ -if(typeof ref==='function'){ -ref(null);}else -{ - -ReactOwner.removeComponentAsRefFrom(component,ref,owner);}} - - - -ReactRef.attachRefs=function(instance,element){ -if(element===null||element===false){ -return;} - -var ref=element.ref; -if(ref!=null){ -attachRef(ref,instance,element._owner);}}; - - - -ReactRef.shouldUpdateRefs=function(prevElement,nextElement){ - - - - - - - - - - - - -var prevEmpty=prevElement===null||prevElement===false; -var nextEmpty=nextElement===null||nextElement===false; - -return ( - -prevEmpty||nextEmpty|| -nextElement._owner!==prevElement._owner|| -nextElement.ref!==prevElement.ref);}; - - - -ReactRef.detachRefs=function(instance,element){ -if(element===null||element===false){ -return;} - -var ref=element.ref; -if(ref!=null){ -detachRef(ref,instance,element._owner);}}; - - - -module.exports=ReactRef; -}); -__d('ReactOwner',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ReactOwner={ - - - - - - -isValidOwner:function(object){ -return !!( -object&& -typeof object.attachRef==='function'&& -typeof object.detachRef==='function');}, - - - - - - - - - - - - -addComponentAsRefTo:function(component,ref,owner){ -invariant( -ReactOwner.isValidOwner(owner), -'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might '+ -'be adding a ref to a component that was not created inside a component\'s '+ -'`render` method, or you have multiple copies of React loaded '+ -'(details: https://fb.me/react-refs-must-have-owner).'); - -owner.attachRef(ref,component);}, - - - - - - - - - - - -removeComponentAsRefFrom:function(component,ref,owner){ -invariant( -ReactOwner.isValidOwner(owner), -'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might '+ -'be removing a ref to a component that was not created inside a component\'s '+ -'`render` method, or you have multiple copies of React loaded '+ -'(details: https://fb.me/react-refs-must-have-owner).'); - - - -if(owner.getPublicInstance().refs[ref]===component.getPublicInstance()){ -owner.detachRef(ref);}}}; - - - - - -module.exports=ReactOwner; -}); -__d('ReactUpdateQueue',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactCurrentOwner=require('ReactCurrentOwner'); -var ReactElement=require('ReactElement'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactUpdates=require('ReactUpdates'); - -var assign=require('Object.assign'); -var invariant=require('invariant'); -var warning=require('warning'); - -function enqueueUpdate(internalInstance){ -ReactUpdates.enqueueUpdate(internalInstance);} - - -function getInternalInstanceReadyForUpdate(publicInstance,callerName){ -var internalInstance=ReactInstanceMap.get(publicInstance); -if(!internalInstance){ -if(__DEV__){ - - - -warning( -!callerName, -'%s(...): Can only update a mounted or mounting component. '+ -'This usually means you called %s() on an unmounted component. '+ -'This is a no-op. Please check the code for the %s component.', -callerName, -callerName, -publicInstance.constructor.displayName);} - - -return null;} - - -if(__DEV__){ -warning( -ReactCurrentOwner.current==null, -'%s(...): Cannot update during an existing state transition '+ -'(such as within `render`). Render methods should be a pure function '+ -'of props and state.', -callerName);} - - - -return internalInstance;} - - - - - - -var ReactUpdateQueue={ - - - - - - - - -isMounted:function(publicInstance){ -if(__DEV__){ -var owner=ReactCurrentOwner.current; -if(owner!==null){ -warning( -owner._warnedAboutRefsInRender, -'%s is accessing isMounted inside its render() function. '+ -'render() should be a pure function of props and state. It should '+ -'never access something that requires stale data from the previous '+ -'render, such as refs. Move this logic to componentDidMount and '+ -'componentDidUpdate instead.', -owner.getName()||'A component'); - -owner._warnedAboutRefsInRender=true;}} - - -var internalInstance=ReactInstanceMap.get(publicInstance); -if(internalInstance){ - - - -return !!internalInstance._renderedComponent;}else -{ -return false;}}, - - - - - - - - - - - -enqueueCallback:function(publicInstance,callback){ -invariant( -typeof callback==='function', -'enqueueCallback(...): You called `setProps`, `replaceProps`, '+ -'`setState`, `replaceState`, or `forceUpdate` with a callback that '+ -'isn\'t callable.'); - -var internalInstance=getInternalInstanceReadyForUpdate(publicInstance); - - - - - - -if(!internalInstance){ -return null;} - - -if(internalInstance._pendingCallbacks){ -internalInstance._pendingCallbacks.push(callback);}else -{ -internalInstance._pendingCallbacks=[callback];} - - - - - -enqueueUpdate(internalInstance);}, - - -enqueueCallbackInternal:function(internalInstance,callback){ -invariant( -typeof callback==='function', -'enqueueCallback(...): You called `setProps`, `replaceProps`, '+ -'`setState`, `replaceState`, or `forceUpdate` with a callback that '+ -'isn\'t callable.'); - -if(internalInstance._pendingCallbacks){ -internalInstance._pendingCallbacks.push(callback);}else -{ -internalInstance._pendingCallbacks=[callback];} - -enqueueUpdate(internalInstance);}, - - - - - - - - - - - - - - - -enqueueForceUpdate:function(publicInstance){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'forceUpdate'); - - -if(!internalInstance){ -return;} - - -internalInstance._pendingForceUpdate=true; - -enqueueUpdate(internalInstance);}, - - - - - - - - - - - - - -enqueueReplaceState:function(publicInstance,completeState){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'replaceState'); - - -if(!internalInstance){ -return;} - - -internalInstance._pendingStateQueue=[completeState]; -internalInstance._pendingReplaceState=true; - -enqueueUpdate(internalInstance);}, - - - - - - - - - - - - -enqueueSetState:function(publicInstance,partialState){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'setState'); - - -if(!internalInstance){ -return;} - - -var queue= -internalInstance._pendingStateQueue||( -internalInstance._pendingStateQueue=[]); -queue.push(partialState); - -enqueueUpdate(internalInstance);}, - - - - - - - - - -enqueueSetProps:function(publicInstance,partialProps){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'setProps'); - -if(!internalInstance){ -return;} - -ReactUpdateQueue.enqueueSetPropsInternal(internalInstance,partialProps);}, - - -enqueueSetPropsInternal:function(internalInstance,partialProps){ -var topLevelWrapper=internalInstance._topLevelWrapper; -invariant( -topLevelWrapper, -'setProps(...): You called `setProps` on a '+ -'component with a parent. This is an anti-pattern since props will '+ -'get reactively updated when rendered. Instead, change the owner\'s '+ -'`render` method to pass the correct value as props to the component '+ -'where it is created.'); - - - - -var wrapElement=topLevelWrapper._pendingElement|| -topLevelWrapper._currentElement; -var element=wrapElement.props; -var props=assign({},element.props,partialProps); -topLevelWrapper._pendingElement=ReactElement.cloneAndReplaceProps( -wrapElement, -ReactElement.cloneAndReplaceProps(element,props)); - - -enqueueUpdate(topLevelWrapper);}, - - - - - - - - - -enqueueReplaceProps:function(publicInstance,props){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'replaceProps'); - -if(!internalInstance){ -return;} - -ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance,props);}, - - -enqueueReplacePropsInternal:function(internalInstance,props){ -var topLevelWrapper=internalInstance._topLevelWrapper; -invariant( -topLevelWrapper, -'replaceProps(...): You called `replaceProps` on a '+ -'component with a parent. This is an anti-pattern since props will '+ -'get reactively updated when rendered. Instead, change the owner\'s '+ -'`render` method to pass the correct value as props to the component '+ -'where it is created.'); - - - - -var wrapElement=topLevelWrapper._pendingElement|| -topLevelWrapper._currentElement; -var element=wrapElement.props; -topLevelWrapper._pendingElement=ReactElement.cloneAndReplaceProps( -wrapElement, -ReactElement.cloneAndReplaceProps(element,props)); - - -enqueueUpdate(topLevelWrapper);}, - - -enqueueElementInternal:function(internalInstance,newElement){ -internalInstance._pendingElement=newElement; -enqueueUpdate(internalInstance);}}; - - - - -module.exports=ReactUpdateQueue; -}); -__d('ReactUpdates',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var CallbackQueue=require('CallbackQueue'); -var PooledClass=require('PooledClass'); -var ReactPerf=require('ReactPerf'); -var ReactReconciler=require('ReactReconciler'); -var Transaction=require('Transaction'); - -var assign=require('Object.assign'); -var invariant=require('invariant'); - -var dirtyComponents=[]; -var asapCallbackQueue=CallbackQueue.getPooled(); -var asapEnqueued=false; - -var batchingStrategy=null; - -function ensureInjected(){ -invariant( -ReactUpdates.ReactReconcileTransaction&&batchingStrategy, -'ReactUpdates: must inject a reconcile transaction class and batching '+ -'strategy');} - - - -var NESTED_UPDATES={ -initialize:function(){ -this.dirtyComponentsLength=dirtyComponents.length;}, - -close:function(){ -if(this.dirtyComponentsLength!==dirtyComponents.length){ - - - - - -dirtyComponents.splice(0,this.dirtyComponentsLength); -flushBatchedUpdates();}else -{ -dirtyComponents.length=0;}}}; - - - - -var UPDATE_QUEUEING={ -initialize:function(){ -this.callbackQueue.reset();}, - -close:function(){ -this.callbackQueue.notifyAll();}}; - - - -var TRANSACTION_WRAPPERS=[NESTED_UPDATES,UPDATE_QUEUEING]; - -function ReactUpdatesFlushTransaction(){ -this.reinitializeTransaction(); -this.dirtyComponentsLength=null; -this.callbackQueue=CallbackQueue.getPooled(); -this.reconcileTransaction= -ReactUpdates.ReactReconcileTransaction.getPooled(false);} - - -assign( -ReactUpdatesFlushTransaction.prototype, -Transaction.Mixin, -{ -getTransactionWrappers:function(){ -return TRANSACTION_WRAPPERS;}, - - -destructor:function(){ -this.dirtyComponentsLength=null; -CallbackQueue.release(this.callbackQueue); -this.callbackQueue=null; -ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); -this.reconcileTransaction=null;}, - - -perform:function(method,scope,a){ - - -return Transaction.Mixin.perform.call( -this, -this.reconcileTransaction.perform, -this.reconcileTransaction, -method, -scope, -a);}}); - - - - - -PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); - -function batchedUpdates(callback,a,b,c,d,e){ -ensureInjected(); -batchingStrategy.batchedUpdates(callback,a,b,c,d,e);} - - - - - - - - - -function mountOrderComparator(c1,c2){ -return c1._mountOrder-c2._mountOrder;} - - -function runBatchedUpdates(transaction){ -var len=transaction.dirtyComponentsLength; -invariant( -len===dirtyComponents.length, -'Expected flush transaction\'s stored dirty-components length (%s) to '+ -'match dirty-components array length (%s).', -len, -dirtyComponents.length); - - - - - -dirtyComponents.sort(mountOrderComparator); - -for(var i=0;i component.'); - -this._rootNodeID=rootID; -var tag=ReactNativeTagHandles.allocateTag(); -var nativeTopRootID=ReactNativeTagHandles.getNativeTopRootIDFromNodeID(rootID); -UIManager.createView( -tag, -'RCTRawText', -nativeTopRootID?ReactNativeTagHandles.rootNodeIDToTag[nativeTopRootID]:null, -{text:this._stringText}); - -return { -rootNodeID:rootID, -tag:tag};}, - - - -receiveComponent:function(nextText,transaction,context){ -if(nextText!==this._currentElement){ -this._currentElement=nextText; -var nextStringText=''+nextText; -if(nextStringText!==this._stringText){ -this._stringText=nextStringText; -UIManager.updateView( -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID( -this._rootNodeID), - -'RCTRawText', -{text:this._stringText});}}}, - - - - - -unmountComponent:function(){ -this._currentElement=null; -this._stringText=null; -this._rootNodeID=null;}}); - - - - -module.exports=ReactNativeTextComponent; -}); -__d('RCTDebugComponentOwnership',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - -var BatchedBridge=require('BatchedBridge'); -var DebugComponentOwnershipModule=require('NativeModules').DebugComponentOwnershipModule; -var InspectorUtils=require('InspectorUtils'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); - -function componentToString(component){ -return component.getName?component.getName():'Unknown';} - - -function getRootTagForTag(tag){ -var rootNodeID=ReactNativeTagHandles.tagToRootNodeID[tag]; -if(!rootNodeID){ -return null;} - -var rootID=ReactNativeTagHandles.getNativeTopRootIDFromNodeID(rootNodeID); -if(!rootID){ -return null;} - -return ReactNativeTagHandles.rootNodeIDToTag[rootID];} - - -var RCTDebugComponentOwnership={ - - - - - - - - -getOwnerHierarchy:function(requestID,tag){ -var rootTag=getRootTagForTag(tag); -var instance=InspectorUtils.findInstanceByNativeTag(rootTag,tag); -var ownerHierarchy=instance? -InspectorUtils.getOwnerHierarchy(instance).map(componentToString): -null; -DebugComponentOwnershipModule.receiveOwnershipHierarchy(requestID,tag,ownerHierarchy);}}; - - - -BatchedBridge.registerCallableModule( -'RCTDebugComponentOwnership', -RCTDebugComponentOwnership); - - -module.exports=RCTDebugComponentOwnership; -}); -__d('InspectorUtils',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -var ReactInstanceHandles=require('ReactInstanceHandles'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactNativeMount=require('ReactNativeMount'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); - -function traverseOwnerTreeUp(hierarchy,instance){ -if(instance){ -hierarchy.unshift(instance); -traverseOwnerTreeUp(hierarchy,instance._currentElement._owner);}} - - - -function findInstance(component,targetID){ -if(targetID===findRootNodeID(component)){ -return component;} - -if(component._renderedComponent){ -return findInstance(component._renderedComponent,targetID);}else -{ -for(var key in component._renderedChildren){ -var child=component._renderedChildren[key]; -if(ReactInstanceHandles.isAncestorIDOf(findRootNodeID(child),targetID)){ -var instance=findInstance(child,targetID); -if(instance){ -return instance;}}}}} - - - - - - -function findRootNodeID(component){ -var internalInstance=ReactInstanceMap.get(component); -return internalInstance?internalInstance._rootNodeID:component._rootNodeID;} - - -function findInstanceByNativeTag(rootTag,nativeTag){ -var containerID=ReactNativeTagHandles.tagToRootNodeID[rootTag]; -var rootInstance=ReactNativeMount._instancesByContainerID[containerID]; -var targetID=ReactNativeTagHandles.tagToRootNodeID[nativeTag]; -if(!targetID){ -return undefined;} - -return findInstance(rootInstance,targetID);} - - -function getOwnerHierarchy(instance){ -var hierarchy=[]; -traverseOwnerTreeUp(hierarchy,instance); -return hierarchy;} - - -module.exports={findInstanceByNativeTag:findInstanceByNativeTag,getOwnerHierarchy:getOwnerHierarchy}; -}); -__d('PerformanceLogger',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -var BatchedBridge=require('BatchedBridge'); - -var performanceNow=require('performanceNow'); - -var timespans={}; -var extras={}; - - - - - -var PerformanceLogger={ -addTimespan:function(key,lengthInMs,description){ -if(timespans[key]){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to add a timespan that already exists ', -key);} - - -return;} - - -timespans[key]={ -description:description, -totalTime:lengthInMs};}, - - - -startTimespan:function(key,description){ -if(timespans[key]){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to start a timespan that already exists ', -key);} - - -return;} - - -timespans[key]={ -description:description, -startTime:performanceNow()};}, - - - -stopTimespan:function(key){ -if(!timespans[key]||!timespans[key].startTime){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to end a timespan that has not started ', -key);} - - -return;} - -if(timespans[key].endTime){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to end a timespan that has already ended ', -key);} - - -return;} - - -timespans[key].endTime=performanceNow(); -timespans[key].totalTime= -timespans[key].endTime-timespans[key].startTime;}, - - -clear:function(){ -timespans={}; -extras={};}, - - -clearExceptTimespans:function(keys){ -timespans=Object.keys(timespans).reduce(function(previous,key){ -if(keys.indexOf(key)!==-1){ -previous[key]=timespans[key];} - -return previous;}, -{}); -extras={};}, - - -getTimespans:function(){ -return timespans;}, - - -hasTimespan:function(key){ -return !!timespans[key];}, - - -logTimespans:function(){ -for(var key in timespans){ -if(timespans[key].totalTime){ -console.log(key+': '+timespans[key].totalTime+'ms');}}}, - - - - -addTimespans:function(newTimespans,labels){ -for(var i=0,l=newTimespans.length;i-1, -'EventPluginRegistry: Cannot inject event plugins that do not exist in '+ -'the plugin ordering, `%s`.', -pluginName); - -if(EventPluginRegistry.plugins[pluginIndex]){ -continue;} - -invariant( -PluginModule.extractEvents, -'EventPluginRegistry: Event plugins must implement an `extractEvents` '+ -'method, but `%s` does not.', -pluginName); - -EventPluginRegistry.plugins[pluginIndex]=PluginModule; -var publishedEvents=PluginModule.eventTypes; -for(var eventName in publishedEvents){ -invariant( -publishEventForPlugin( -publishedEvents[eventName], -PluginModule, -eventName), - -'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', -eventName, -pluginName);}}} - - - - - - - - - - - - - -function publishEventForPlugin(dispatchConfig,PluginModule,eventName){ -invariant( -!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), -'EventPluginHub: More than one plugin attempted to publish the same '+ -'event name, `%s`.', -eventName); - -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;} - - - - - - - - - - -function publishRegistrationName(registrationName,PluginModule,eventName){ -invariant( -!EventPluginRegistry.registrationNameModules[registrationName], -'EventPluginHub: More than one plugin attempted to publish the same '+ -'registration name, `%s`.', -registrationName); - -EventPluginRegistry.registrationNameModules[registrationName]=PluginModule; -EventPluginRegistry.registrationNameDependencies[registrationName]= -PluginModule.eventTypes[eventName].dependencies;} - - - - - - - -var EventPluginRegistry={ - - - - -plugins:[], - - - - -eventNameDispatchConfigs:{}, - - - - -registrationNameModules:{}, - - - - -registrationNameDependencies:{}, - - - - - - - - - - -injectEventPluginOrder:function(InjectedEventPluginOrder){ -invariant( -!EventPluginOrder, -'EventPluginRegistry: Cannot inject event plugin ordering more than '+ -'once. You are likely trying to load more than one copy of React.'); - - -EventPluginOrder=Array.prototype.slice.call(InjectedEventPluginOrder); -recomputePluginOrdering();}, - - - - - - - - - - - - -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){ -invariant( -!namesToPlugins[pluginName], -'EventPluginRegistry: Cannot inject two different event plugins '+ -'using the same name, `%s`.', -pluginName); - -namesToPlugins[pluginName]=PluginModule; -isOrderingDirty=true;}} - - -if(isOrderingDirty){ -recomputePluginOrdering();}}, - - - - - - - - - - -getPluginModuleForEvent:function(event){ -var dispatchConfig=event.dispatchConfig; -if(dispatchConfig.registrationName){ -return EventPluginRegistry.registrationNameModules[ -dispatchConfig.registrationName]|| -null;} - -for(var phase in dispatchConfig.phasedRegistrationNames){ -if(!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)){ -continue;} - -var PluginModule=EventPluginRegistry.registrationNameModules[ -dispatchConfig.phasedRegistrationNames[phase]]; - -if(PluginModule){ -return PluginModule;}} - - -return null;}, - - - - - - -_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];}}}}; - - - - - - -module.exports=EventPluginRegistry; -}); -__d('EventPluginUtils',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventConstants=require('EventConstants'); -var ReactErrorUtils=require('ReactErrorUtils'); - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - -var injection={ -Mount:null, -injectMount:function(InjectedMount){ -injection.Mount=InjectedMount; -if(__DEV__){ -warning( -InjectedMount&&InjectedMount.getNode&&InjectedMount.getID, -'EventPluginUtils.injection.injectMount(...): Injected Mount '+ -'module is missing getNode or getID.');}}}; - - - - - -var topLevelTypes=EventConstants.topLevelTypes; - -function isEndish(topLevelType){ -return topLevelType===topLevelTypes.topMouseUp|| -topLevelType===topLevelTypes.topTouchEnd|| -topLevelType===topLevelTypes.topTouchCancel;} - - -function isMoveish(topLevelType){ -return topLevelType===topLevelTypes.topMouseMove|| -topLevelType===topLevelTypes.topTouchMove;} - -function isStartish(topLevelType){ -return topLevelType===topLevelTypes.topMouseDown|| -topLevelType===topLevelTypes.topTouchStart;} - - - -var validateEventDispatches; -if(__DEV__){ -validateEventDispatches=function(event){ -var dispatchListeners=event._dispatchListeners; -var dispatchIDs=event._dispatchIDs; - -var listenersIsArr=Array.isArray(dispatchListeners); -var idsIsArr=Array.isArray(dispatchIDs); -var IDsLen=idsIsArr?dispatchIDs.length:dispatchIDs?1:0; -var listenersLen=listenersIsArr? -dispatchListeners.length: -dispatchListeners?1:0; - -warning( -idsIsArr===listenersIsArr&&IDsLen===listenersLen, -'EventPluginUtils: Invalid `event`.');};} - - - - - - - - - - - -function executeDispatch(event,simulated,listener,domID){ -var type=event.type||'unknown-event'; -event.currentTarget=injection.Mount.getNode(domID); -if(simulated){ -ReactErrorUtils.invokeGuardedCallbackWithCatch( -type, -listener, -event, -domID);}else - -{ -ReactErrorUtils.invokeGuardedCallback(type,listener,event,domID);} - -event.currentTarget=null;} - - - - - -function executeDispatchesInOrder(event,simulated){ -var dispatchListeners=event._dispatchListeners; -var dispatchIDs=event._dispatchIDs; -if(__DEV__){ -validateEventDispatches(event);} - -if(Array.isArray(dispatchListeners)){ -for(var i=0;i=len){ -this._iteratedObject=undefined; -return createIterResultObject(undefined,true);} - - -this._nextIndex=index+1; - -if(kind===KIND_KEY){ -return createIterResultObject(index,false);}else -if(kind===KIND_VALUE){ -return createIterResultObject(array[index],false);}else -if(kind===KIND_KEY_VAL){ -return createIterResultObject([index,array[index]],false);}}},{key: - - - - -'@@iterator',value:function iterator(){ -return this;}}]);return ArrayIterator;})();var - - - -StringIterator=(function(){ - -function StringIterator(string){babelHelpers.classCallCheck(this,StringIterator); -if(typeof string!=='string'){ -throw new TypeError('Object is not a string');} - -this._iteratedString=string; -this._nextIndex=0;}babelHelpers.createClass(StringIterator,[{key:'next',value:function next() - - - -{ -if(!this instanceof StringIterator){ -throw new TypeError('Object is not a StringIterator');} - - -if(this._iteratedString==null){ -return createIterResultObject(undefined,true);} - - -var index=this._nextIndex; -var s=this._iteratedString; -var len=s.length; - -if(index>=len){ -this._iteratedString=undefined; -return createIterResultObject(undefined,true);} - - -var ret; -var first=s.charCodeAt(index); - -if(first<0xD800||first>0xDBFF||index+1===len){ -ret=s[index];}else -{ -var second=s.charCodeAt(index+1); -if(second<0xDC00||second>0xDFFF){ -ret=s[index];}else -{ -ret=s[index]+s[index+1];}} - - - -this._nextIndex=index+ret.length; - -return createIterResultObject(ret,false);}},{key: - - - -'@@iterator',value:function iterator(){ -return this;}}]);return StringIterator;})(); - - - - -function createIterResultObject(value,done){ -return {value:value,done:done};} - - -return function(object,kind){ -if(typeof object==='string'){ -return new StringIterator(object);}else -if(Array.isArray(object)){ -return new ArrayIterator(object,kind||KIND_VALUE);}else -{ -return object[ITERATOR_SYMBOL]();}};})();}else - - - -{ -return function(object){ -return object[ITERATOR_SYMBOL]();};}})(); - - - - - - - - -babelHelpers.extends(toIterator,{ -KIND_KEY:KIND_KEY, -KIND_VALUE:KIND_VALUE, -KIND_KEY_VAL:KIND_KEY_VAL, -ITERATOR_SYMBOL:ITERATOR_SYMBOL}); - - -module.exports=toIterator; -}); -__d('_shouldPolyfillES6Collection',function(global, require, module, exports) { function - - - - - - - - - - - - - - - - - - - - - - - - -shouldPolyfillES6Collection(collectionName){ -var Collection=global[collectionName]; -if(Collection==null){ -return true;} - - - - - - -if(typeof global.Symbol!=='function'){ -return true;} - - -var proto=Collection.prototype; - - - - -return Collection==null|| -typeof Collection!=='function'|| -typeof proto.clear!=='function'|| -new Collection().size!==0|| -typeof proto.keys!=='function'|| -typeof proto.forEach!=='function';} - - -module.exports=shouldPolyfillES6Collection; -}); -__d('ReactNativeGlobalResponderHandler',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var UIManager=require('UIManager'); - -var ReactNativeGlobalResponderHandler={ -onChange:function(from,to,blockNativeResponder){ -if(to!==null){ -UIManager.setJSResponder( -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(to), -blockNativeResponder);}else - -{ -UIManager.clearJSResponder();}}}; - - - - -module.exports=ReactNativeGlobalResponderHandler; -}); -__d('ResponderEventPlugin',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventConstants=require('EventConstants'); -var EventPluginUtils=require('EventPluginUtils'); -var EventPropagators=require('EventPropagators'); -var ReactInstanceHandles=require('ReactInstanceHandles'); -var ResponderSyntheticEvent=require('ResponderSyntheticEvent'); -var ResponderTouchHistoryStore=require('ResponderTouchHistoryStore'); - -var accumulate=require('accumulate'); -var invariant=require('invariant'); -var keyOf=require('keyOf'); - -var isStartish=EventPluginUtils.isStartish; -var isMoveish=EventPluginUtils.isMoveish; -var isEndish=EventPluginUtils.isEndish; -var executeDirectDispatch=EventPluginUtils.executeDirectDispatch; -var hasDispatches=EventPluginUtils.hasDispatches; -var executeDispatchesInOrderStopAtTrue= -EventPluginUtils.executeDispatchesInOrderStopAtTrue; - - - - - -var responderID=null; - - - - - -var trackedTouchCount=0; - - - - -var previousActiveTouches=0; - -var changeResponder=function(nextResponderID,blockNativeResponder){ -var oldResponderID=responderID; -responderID=nextResponderID; -if(ResponderEventPlugin.GlobalResponderHandler!==null){ -ResponderEventPlugin.GlobalResponderHandler.onChange( -oldResponderID, -nextResponderID, -blockNativeResponder);}}; - - - - -var eventTypes={ - - - - -startShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onStartShouldSetResponder:null}), -captured:keyOf({onStartShouldSetResponderCapture:null})}}, - - - - - - - - - - - - -scrollShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onScrollShouldSetResponder:null}), -captured:keyOf({onScrollShouldSetResponderCapture:null})}}, - - - - - - - - - - -selectionChangeShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onSelectionChangeShouldSetResponder:null}), -captured:keyOf({onSelectionChangeShouldSetResponderCapture:null})}}, - - - - - - - -moveShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onMoveShouldSetResponder:null}), -captured:keyOf({onMoveShouldSetResponderCapture:null})}}, - - - - - - -responderStart:{registrationName:keyOf({onResponderStart:null})}, -responderMove:{registrationName:keyOf({onResponderMove:null})}, -responderEnd:{registrationName:keyOf({onResponderEnd:null})}, -responderRelease:{registrationName:keyOf({onResponderRelease:null})}, -responderTerminationRequest:{ -registrationName:keyOf({onResponderTerminationRequest:null})}, - -responderGrant:{registrationName:keyOf({onResponderGrant:null})}, -responderReject:{registrationName:keyOf({onResponderReject:null})}, -responderTerminate:{registrationName:keyOf({onResponderTerminate:null})}}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function setResponderAndExtractTransfer( -topLevelType, -topLevelTargetID, -nativeEvent, -nativeEventTarget){ -var shouldSetEventType= -isStartish(topLevelType)?eventTypes.startShouldSetResponder: -isMoveish(topLevelType)?eventTypes.moveShouldSetResponder: -topLevelType===EventConstants.topLevelTypes.topSelectionChange? -eventTypes.selectionChangeShouldSetResponder: -eventTypes.scrollShouldSetResponder; - - -var bubbleShouldSetFrom=!responderID? -topLevelTargetID: -ReactInstanceHandles.getFirstCommonAncestorID(responderID,topLevelTargetID); - - - - - -var skipOverBubbleShouldSetFrom=bubbleShouldSetFrom===responderID; -var shouldSetEvent=ResponderSyntheticEvent.getPooled( -shouldSetEventType, -bubbleShouldSetFrom, -nativeEvent, -nativeEventTarget); - -shouldSetEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -if(skipOverBubbleShouldSetFrom){ -EventPropagators.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent);}else -{ -EventPropagators.accumulateTwoPhaseDispatches(shouldSetEvent);} - -var wantsResponderID=executeDispatchesInOrderStopAtTrue(shouldSetEvent); -if(!shouldSetEvent.isPersistent()){ -shouldSetEvent.constructor.release(shouldSetEvent);} - - -if(!wantsResponderID||wantsResponderID===responderID){ -return null;} - -var extracted; -var grantEvent=ResponderSyntheticEvent.getPooled( -eventTypes.responderGrant, -wantsResponderID, -nativeEvent, -nativeEventTarget); - -grantEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; - -EventPropagators.accumulateDirectDispatches(grantEvent); -var blockNativeResponder=executeDirectDispatch(grantEvent)===true; -if(responderID){ - -var terminationRequestEvent=ResponderSyntheticEvent.getPooled( -eventTypes.responderTerminationRequest, -responderID, -nativeEvent, -nativeEventTarget); - -terminationRequestEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(terminationRequestEvent); -var shouldSwitch=!hasDispatches(terminationRequestEvent)|| -executeDirectDispatch(terminationRequestEvent); -if(!terminationRequestEvent.isPersistent()){ -terminationRequestEvent.constructor.release(terminationRequestEvent);} - - -if(shouldSwitch){ -var terminateType=eventTypes.responderTerminate; -var terminateEvent=ResponderSyntheticEvent.getPooled( -terminateType, -responderID, -nativeEvent, -nativeEventTarget); - -terminateEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(terminateEvent); -extracted=accumulate(extracted,[grantEvent,terminateEvent]); -changeResponder(wantsResponderID,blockNativeResponder);}else -{ -var rejectEvent=ResponderSyntheticEvent.getPooled( -eventTypes.responderReject, -wantsResponderID, -nativeEvent, -nativeEventTarget); - -rejectEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(rejectEvent); -extracted=accumulate(extracted,rejectEvent);}}else - -{ -extracted=accumulate(extracted,grantEvent); -changeResponder(wantsResponderID,blockNativeResponder);} - -return extracted;} - - - - - - - - - - -function canTriggerTransfer(topLevelType,topLevelTargetID,nativeEvent){ -return topLevelTargetID&&( - - - -topLevelType===EventConstants.topLevelTypes.topScroll&& -!nativeEvent.responderIgnoreScroll|| -trackedTouchCount>0&& -topLevelType===EventConstants.topLevelTypes.topSelectionChange|| -isStartish(topLevelType)|| -isMoveish(topLevelType));} - - - - - - - - - - -function noResponderTouches(nativeEvent){ -var touches=nativeEvent.touches; -if(!touches||touches.length===0){ -return true;} - -for(var i=0;i=0, -'Ended a touch event which was not counted in trackedTouchCount.');} - - - -ResponderTouchHistoryStore.recordTouchTrack(topLevelType,nativeEvent,nativeEventTarget); - -var extracted=canTriggerTransfer(topLevelType,topLevelTargetID,nativeEvent)? -setResponderAndExtractTransfer( -topLevelType, -topLevelTargetID, -nativeEvent, -nativeEventTarget): -null; - - - - - - - - - - -var isResponderTouchStart=responderID&&isStartish(topLevelType); -var isResponderTouchMove=responderID&&isMoveish(topLevelType); -var isResponderTouchEnd=responderID&&isEndish(topLevelType); -var incrementalTouch= -isResponderTouchStart?eventTypes.responderStart: -isResponderTouchMove?eventTypes.responderMove: -isResponderTouchEnd?eventTypes.responderEnd: -null; - -if(incrementalTouch){ -var gesture= -ResponderSyntheticEvent.getPooled( -incrementalTouch, -responderID, -nativeEvent, -nativeEventTarget); - -gesture.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(gesture); -extracted=accumulate(extracted,gesture);} - - -var isResponderTerminate= -responderID&& -topLevelType===EventConstants.topLevelTypes.topTouchCancel; -var isResponderRelease= -responderID&& -!isResponderTerminate&& -isEndish(topLevelType)&& -noResponderTouches(nativeEvent); -var finalTouch= -isResponderTerminate?eventTypes.responderTerminate: -isResponderRelease?eventTypes.responderRelease: -null; -if(finalTouch){ -var finalEvent= -ResponderSyntheticEvent.getPooled(finalTouch,responderID,nativeEvent,nativeEventTarget); -finalEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(finalEvent); -extracted=accumulate(extracted,finalEvent); -changeResponder(null);} - - -var numberActiveTouches= -ResponderTouchHistoryStore.touchHistory.numberActiveTouches; -if(ResponderEventPlugin.GlobalInteractionHandler&& -numberActiveTouches!==previousActiveTouches){ -ResponderEventPlugin.GlobalInteractionHandler.onChange( -numberActiveTouches);} - - -previousActiveTouches=numberActiveTouches; - -return extracted;}, - - -GlobalResponderHandler:null, -GlobalInteractionHandler:null, - -injection:{ - - - - - -injectGlobalResponderHandler:function(GlobalResponderHandler){ -ResponderEventPlugin.GlobalResponderHandler=GlobalResponderHandler;}, - - - - - - -injectGlobalInteractionHandler:function(GlobalInteractionHandler){ -ResponderEventPlugin.GlobalInteractionHandler=GlobalInteractionHandler;}}}; - - - - -module.exports=ResponderEventPlugin; -}); -__d('ResponderSyntheticEvent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var SyntheticEvent=require('SyntheticEvent'); - - - - - - -var ResponderEventInterface={ -touchHistory:function(nativeEvent){ -return null;}}; - - - - - - - - - -function ResponderSyntheticEvent(dispatchConfig,dispatchMarker,nativeEvent,nativeEventTarget){ -SyntheticEvent.call(this,dispatchConfig,dispatchMarker,nativeEvent,nativeEventTarget);} - - -SyntheticEvent.augmentClass(ResponderSyntheticEvent,ResponderEventInterface); - -module.exports=ResponderSyntheticEvent; -}); -__d('ResponderTouchHistoryStore',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventPluginUtils=require('EventPluginUtils'); - -var invariant=require('invariant'); - -var isMoveish=EventPluginUtils.isMoveish; -var isStartish=EventPluginUtils.isStartish; -var isEndish=EventPluginUtils.isEndish; - -var MAX_TOUCH_BANK=20; - - - - - - - - - - - - - - - - -var touchHistory={ -touchBank:[], -numberActiveTouches:0, - - - -indexOfSingleActiveTouch:-1, -mostRecentTimeStamp:0}; - - -var timestampForTouch=function(touch){ - - - -return touch.timeStamp||touch.timestamp;}; - - - - - - - -var initializeTouchData=function(touch){ -return { -touchActive:true, -startTimeStamp:timestampForTouch(touch), -startPageX:touch.pageX, -startPageY:touch.pageY, -currentPageX:touch.pageX, -currentPageY:touch.pageY, -currentTimeStamp:timestampForTouch(touch), -previousPageX:touch.pageX, -previousPageY:touch.pageY, -previousTimeStamp:timestampForTouch(touch)};}; - - - -var reinitializeTouchTrack=function(touchTrack,touch){ -touchTrack.touchActive=true; -touchTrack.startTimeStamp=timestampForTouch(touch); -touchTrack.startPageX=touch.pageX; -touchTrack.startPageY=touch.pageY; -touchTrack.currentPageX=touch.pageX; -touchTrack.currentPageY=touch.pageY; -touchTrack.currentTimeStamp=timestampForTouch(touch); -touchTrack.previousPageX=touch.pageX; -touchTrack.previousPageY=touch.pageY; -touchTrack.previousTimeStamp=timestampForTouch(touch);}; - - -var validateTouch=function(touch){ -var identifier=touch.identifier; -invariant(identifier!=null,'Touch object is missing identifier'); -if(identifier>MAX_TOUCH_BANK){ -console.warn( -'Touch identifier '+identifier+' is greater than maximum '+ -'supported '+MAX_TOUCH_BANK+' which causes performance issues '+ -'backfilling array locations for all of the indices.');}}; - - - - -var recordStartTouchData=function(touch){ -var touchBank=touchHistory.touchBank; -var identifier=touch.identifier; -var touchTrack=touchBank[identifier]; -if(__DEV__){ -validateTouch(touch);} - -if(touchTrack){ -reinitializeTouchTrack(touchTrack,touch);}else -{ -touchBank[touch.identifier]=initializeTouchData(touch);} - -touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}; - - -var recordMoveTouchData=function(touch){ -var touchBank=touchHistory.touchBank; -var touchTrack=touchBank[touch.identifier]; -if(__DEV__){ -validateTouch(touch); -invariant(touchTrack,'Touch data should have been recorded on start');} - -touchTrack.touchActive=true; -touchTrack.previousPageX=touchTrack.currentPageX; -touchTrack.previousPageY=touchTrack.currentPageY; -touchTrack.previousTimeStamp=touchTrack.currentTimeStamp; -touchTrack.currentPageX=touch.pageX; -touchTrack.currentPageY=touch.pageY; -touchTrack.currentTimeStamp=timestampForTouch(touch); -touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}; - - -var recordEndTouchData=function(touch){ -var touchBank=touchHistory.touchBank; -var touchTrack=touchBank[touch.identifier]; -if(__DEV__){ -validateTouch(touch); -invariant(touchTrack,'Touch data should have been recorded on start');} - -touchTrack.previousPageX=touchTrack.currentPageX; -touchTrack.previousPageY=touchTrack.currentPageY; -touchTrack.previousTimeStamp=touchTrack.currentTimeStamp; -touchTrack.currentPageX=touch.pageX; -touchTrack.currentPageY=touch.pageY; -touchTrack.currentTimeStamp=timestampForTouch(touch); -touchTrack.touchActive=false; -touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}; - - -var ResponderTouchHistoryStore={ -recordTouchTrack:function(topLevelType,nativeEvent){ -var touchBank=touchHistory.touchBank; -if(isMoveish(topLevelType)){ -nativeEvent.changedTouches.forEach(recordMoveTouchData);}else -if(isStartish(topLevelType)){ -nativeEvent.changedTouches.forEach(recordStartTouchData); -touchHistory.numberActiveTouches=nativeEvent.touches.length; -if(touchHistory.numberActiveTouches===1){ -touchHistory.indexOfSingleActiveTouch=nativeEvent.touches[0].identifier;}}else - -if(isEndish(topLevelType)){ -nativeEvent.changedTouches.forEach(recordEndTouchData); -touchHistory.numberActiveTouches=nativeEvent.touches.length; -if(touchHistory.numberActiveTouches===1){ -for(var i=0;i1)t-=1; -if(t<1/6)return p+(q-p)*6*t; -if(t<1/2)return q; -if(t<2/3)return p+(q-p)*(2/3-t)*6; -return p;} - - -if(s===0){ -r=g=b=l;}else - -{ -var q=l<0.5?l*(1+s):l+s-l*s; -var p=2*l-q; -r=hue2rgb(p,q,h+1/3); -g=hue2rgb(p,q,h); -b=hue2rgb(p,q,h-1/3);} - - -return {r:r*255,g:g*255,b:b*255};} - - - - - - -function hsvToRgb(h,s,v){ -h=bound01(h,360)*6; -s=bound01(s,100); -v=bound01(v,100); - -var i=math.floor(h), -f=h-i, -p=v*(1-s), -q=v*(1-f*s), -t=v*(1-(1-f)*s), -mod=i%6, -r=[v,q,p,p,t,v][mod], -g=[t,v,v,q,p,p][mod], -b=[p,p,t,v,v,q][mod]; - -return {r:r*255,g:g*255,b:b*255};} - - - - - -var names=tinycolor.names={ -aliceblue:"f0f8ff", -antiquewhite:"faebd7", -aqua:"0ff", -aquamarine:"7fffd4", -azure:"f0ffff", -beige:"f5f5dc", -bisque:"ffe4c4", -black:"000", -blanchedalmond:"ffebcd", -blue:"00f", -blueviolet:"8a2be2", -brown:"a52a2a", -burlywood:"deb887", -burntsienna:"ea7e5d", -cadetblue:"5f9ea0", -chartreuse:"7fff00", -chocolate:"d2691e", -coral:"ff7f50", -cornflowerblue:"6495ed", -cornsilk:"fff8dc", -crimson:"dc143c", -cyan:"0ff", -darkblue:"00008b", -darkcyan:"008b8b", -darkgoldenrod:"b8860b", -darkgray:"a9a9a9", -darkgreen:"006400", -darkgrey:"a9a9a9", -darkkhaki:"bdb76b", -darkmagenta:"8b008b", -darkolivegreen:"556b2f", -darkorange:"ff8c00", -darkorchid:"9932cc", -darkred:"8b0000", -darksalmon:"e9967a", -darkseagreen:"8fbc8f", -darkslateblue:"483d8b", -darkslategray:"2f4f4f", -darkslategrey:"2f4f4f", -darkturquoise:"00ced1", -darkviolet:"9400d3", -deeppink:"ff1493", -deepskyblue:"00bfff", -dimgray:"696969", -dimgrey:"696969", -dodgerblue:"1e90ff", -firebrick:"b22222", -floralwhite:"fffaf0", -forestgreen:"228b22", -fuchsia:"f0f", -gainsboro:"dcdcdc", -ghostwhite:"f8f8ff", -gold:"ffd700", -goldenrod:"daa520", -gray:"808080", -green:"008000", -greenyellow:"adff2f", -grey:"808080", -honeydew:"f0fff0", -hotpink:"ff69b4", -indianred:"cd5c5c", -indigo:"4b0082", -ivory:"fffff0", -khaki:"f0e68c", -lavender:"e6e6fa", -lavenderblush:"fff0f5", -lawngreen:"7cfc00", -lemonchiffon:"fffacd", -lightblue:"add8e6", -lightcoral:"f08080", -lightcyan:"e0ffff", -lightgoldenrodyellow:"fafad2", -lightgray:"d3d3d3", -lightgreen:"90ee90", -lightgrey:"d3d3d3", -lightpink:"ffb6c1", -lightsalmon:"ffa07a", -lightseagreen:"20b2aa", -lightskyblue:"87cefa", -lightslategray:"789", -lightslategrey:"789", -lightsteelblue:"b0c4de", -lightyellow:"ffffe0", -lime:"0f0", -limegreen:"32cd32", -linen:"faf0e6", -magenta:"f0f", -maroon:"800000", -mediumaquamarine:"66cdaa", -mediumblue:"0000cd", -mediumorchid:"ba55d3", -mediumpurple:"9370db", -mediumseagreen:"3cb371", -mediumslateblue:"7b68ee", -mediumspringgreen:"00fa9a", -mediumturquoise:"48d1cc", -mediumvioletred:"c71585", -midnightblue:"191970", -mintcream:"f5fffa", -mistyrose:"ffe4e1", -moccasin:"ffe4b5", -navajowhite:"ffdead", -navy:"000080", -oldlace:"fdf5e6", -olive:"808000", -olivedrab:"6b8e23", -orange:"ffa500", -orangered:"ff4500", -orchid:"da70d6", -palegoldenrod:"eee8aa", -palegreen:"98fb98", -paleturquoise:"afeeee", -palevioletred:"db7093", -papayawhip:"ffefd5", -peachpuff:"ffdab9", -peru:"cd853f", -pink:"ffc0cb", -plum:"dda0dd", -powderblue:"b0e0e6", -purple:"800080", -rebeccapurple:"663399", -red:"f00", -rosybrown:"bc8f8f", -royalblue:"4169e1", -saddlebrown:"8b4513", -salmon:"fa8072", -sandybrown:"f4a460", -seagreen:"2e8b57", -seashell:"fff5ee", -sienna:"a0522d", -silver:"c0c0c0", -skyblue:"87ceeb", -slateblue:"6a5acd", -slategray:"708090", -slategrey:"708090", -snow:"fffafa", -springgreen:"00ff7f", -steelblue:"4682b4", -tan:"d2b48c", -teal:"008080", -thistle:"d8bfd8", -tomato:"ff6347", -turquoise:"40e0d0", -violet:"ee82ee", -wheat:"f5deb3", -white:"fff", -whitesmoke:"f5f5f5", -yellow:"ff0", -yellowgreen:"9acd32"}; - - - -function boundAlpha(a){ -a=parseFloat(a); - -if(isNaN(a)||a<0||a>1){ -a=1;} - - -return a;} - - - -function bound01(n,max){ -if(isOnePointZero(n)){n="100%";} - -var processPercent=isPercentage(n); -n=mathMin(max,mathMax(0,parseFloat(n))); - - -if(processPercent){ -n=parseInt(n*max,10)/100;} - - - -if(Math.abs(n-max)<0.000001){ -return 1;} - - - -return n%max/parseFloat(max);} - - - -function parseIntFromHex(val){ -return parseInt(val,16);} - - - - -function isOnePointZero(n){ -return typeof n=="string"&&n.indexOf('.')!=-1&&parseFloat(n)===1;} - - - -function isPercentage(n){ -return typeof n==="string"&&n.indexOf('%')!=-1;} - - - -function convertToPercentage(n){ -if(n<=1){ -n=n*100+"%";} - - -return n;} - - - -function convertHexToDecimal(h){ -return parseIntFromHex(h)/255;} - - -var matchers=(function(){ - -var CSS_INTEGER="[-\\+]?\\d+%?"; - - -var CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?"; - - -var CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")"; - - - - -var PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?"; -var PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?"; - -return { -rgb:new RegExp("rgb"+PERMISSIVE_MATCH3), -rgba:new RegExp("rgba"+PERMISSIVE_MATCH4), -hsl:new RegExp("hsl"+PERMISSIVE_MATCH3), -hsla:new RegExp("hsla"+PERMISSIVE_MATCH4), -hsv:new RegExp("hsv"+PERMISSIVE_MATCH3), -hsva:new RegExp("hsva"+PERMISSIVE_MATCH4), -hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, -hex4:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, -hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, -hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};})(); - - - - - - -function stringInputToObject(color){ -color=color.replace(trimLeft,'').replace(trimRight,'').toLowerCase(); -var named=false; -if(names[color]){ -color=names[color]; -named=true;}else - -if(color=='transparent'){ -return {r:0,g:0,b:0,a:0,format:"name"};} - - - - - - -var match; -if(match=matchers.rgb.exec(color)){ -return {r:match[1],g:match[2],b:match[3]};} - -if(match=matchers.rgba.exec(color)){ -return {r:match[1],g:match[2],b:match[3],a:match[4]};} - -if(match=matchers.hsl.exec(color)){ -return {h:match[1],s:match[2],l:match[3]};} - -if(match=matchers.hsla.exec(color)){ -return {h:match[1],s:match[2],l:match[3],a:match[4]};} - -if(match=matchers.hsv.exec(color)){ -return {h:match[1],s:match[2],v:match[3]};} - -if(match=matchers.hsva.exec(color)){ -return {h:match[1],s:match[2],v:match[3],a:match[4]};} - -if(match=matchers.hex8.exec(color)){ -return { -r:parseIntFromHex(match[1]), -g:parseIntFromHex(match[2]), -b:parseIntFromHex(match[3]), -a:convertHexToDecimal(match[4]), -format:named?"name":"hex"};} - - -if(match=matchers.hex6.exec(color)){ -return { -r:parseIntFromHex(match[1]), -g:parseIntFromHex(match[2]), -b:parseIntFromHex(match[3]), -format:named?"name":"hex"};} - - -if(match=matchers.hex4.exec(color)){ -return { -r:parseIntFromHex(match[1]+''+match[1]), -g:parseIntFromHex(match[2]+''+match[2]), -b:parseIntFromHex(match[3]+''+match[3]), -a:convertHexToDecimal(match[4]+''+match[4]), -format:named?"name":"hex"};} - - -if(match=matchers.hex3.exec(color)){ -return { -r:parseIntFromHex(match[1]+''+match[1]), -g:parseIntFromHex(match[2]+''+match[2]), -b:parseIntFromHex(match[3]+''+match[3]), -format:named?"name":"hex"};} - - - -return false;} - - -module.exports=tinycolor; -}); -__d('processTransform',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var MatrixMath=require('MatrixMath'); -var Platform=require('Platform'); - -var invariant=require('invariant'); -var stringifySafe=require('stringifySafe'); - - - - - - - - - -function processTransform(transform){ -var result=MatrixMath.createIdentityMatrix(); - -transform.forEach(function(transformation){ -var key=Object.keys(transformation)[0]; -var value=transformation[key]; -if(__DEV__){ -_validateTransform(key,value,transformation);} - - -switch(key){ -case 'matrix': -MatrixMath.multiplyInto(result,result,value); -break; -case 'perspective': -_multiplyTransform(result,MatrixMath.reusePerspectiveCommand,[value]); -break; -case 'rotateX': -_multiplyTransform(result,MatrixMath.reuseRotateXCommand,[_convertToRadians(value)]); -break; -case 'rotateY': -_multiplyTransform(result,MatrixMath.reuseRotateYCommand,[_convertToRadians(value)]); -break; -case 'rotate': -case 'rotateZ': -_multiplyTransform(result,MatrixMath.reuseRotateZCommand,[_convertToRadians(value)]); -break; -case 'scale': -_multiplyTransform(result,MatrixMath.reuseScaleCommand,[value]); -break; -case 'scaleX': -_multiplyTransform(result,MatrixMath.reuseScaleXCommand,[value]); -break; -case 'scaleY': -_multiplyTransform(result,MatrixMath.reuseScaleYCommand,[value]); -break; -case 'translate': -_multiplyTransform(result,MatrixMath.reuseTranslate3dCommand,[value[0],value[1],value[2]||0]); -break; -case 'translateX': -_multiplyTransform(result,MatrixMath.reuseTranslate2dCommand,[value,0]); -break; -case 'translateY': -_multiplyTransform(result,MatrixMath.reuseTranslate2dCommand,[0,value]); -break; -case 'skewX': -_multiplyTransform(result,MatrixMath.reuseSkewXCommand,[_convertToRadians(value)]); -break; -case 'skewY': -_multiplyTransform(result,MatrixMath.reuseSkewYCommand,[_convertToRadians(value)]); -break; -default: -throw new Error('Invalid transform name: '+key);}}); - - - - - - - -if(Platform.OS==='android'){ -return MatrixMath.decomposeMatrix(result);} - -return result;} - - - - - -function _multiplyTransform( -result, -matrixMathFunction, -args) -{ -var matrixToApply=MatrixMath.createIdentityMatrix(); -var argsWithIdentity=[matrixToApply].concat(args); -matrixMathFunction.apply(this,argsWithIdentity); -MatrixMath.multiplyInto(result,result,matrixToApply);} - - - - - - -function _convertToRadians(value){ -var floatValue=parseFloat(value,10); -return value.indexOf('rad')>-1?floatValue:floatValue*Math.PI/180;} - - -function _validateTransform(key,value,transformation){ -invariant( -!value.getValue, -'You passed an Animated.Value to a normal component. '+ -'You need to wrap that component in an Animated. For example, '+ -'replace by .'); - - -var multivalueTransforms=[ -'matrix', -'translate']; - -if(multivalueTransforms.indexOf(key)!==-1){ -invariant( -Array.isArray(value), -'Transform with key of %s must have an array as the value: %s', -key, -stringifySafe(transformation));} - - -switch(key){ -case 'matrix': -invariant( -value.length===9||value.length===16, -'Matrix transform must have a length of 9 (2d) or 16 (3d). '+ -'Provided matrix has a length of %s: %s', -value.length, -stringifySafe(transformation)); - -break; -case 'translate': -break; -case 'rotateX': -case 'rotateY': -case 'rotateZ': -case 'rotate': -case 'skewX': -case 'skewY': -invariant( -typeof value==='string', -'Transform with key of "%s" must be a string: %s', -key, -stringifySafe(transformation)); - -invariant( -value.indexOf('deg')>-1||value.indexOf('rad')>-1, -'Rotate transform must be expressed in degrees (deg) or radians '+ -'(rad): %s', -stringifySafe(transformation)); - -break; -default: -invariant( -typeof value==='number', -'Transform with key of "%s" must be a number: %s', -key, -stringifySafe(transformation));}} - - - - -module.exports=processTransform; -}); -__d('MatrixMath',function(global, require, module, exports) { 'use strict'; - - - - - - - - -var invariant=require('invariant'); - - - - - -var MatrixMath={ -createIdentityMatrix:function(){ -return [ -1,0,0,0, -0,1,0,0, -0,0,1,0, -0,0,0,1];}, - - - -createCopy:function(m){ -return [ -m[0],m[1],m[2],m[3], -m[4],m[5],m[6],m[7], -m[8],m[9],m[10],m[11], -m[12],m[13],m[14],m[15]];}, - - - -createOrthographic:function(left,right,bottom,top,near,far){ -var a=2/(right-left); -var b=2/(top-bottom); -var c=-2/(far-near); - -var tx=-(right+left)/(right-left); -var ty=-(top+bottom)/(top-bottom); -var tz=-(far+near)/(far-near); - -return [ -a,0,0,0, -0,b,0,0, -0,0,c,0, -tx,ty,tz,1];}, - - - -createFrustum:function(left,right,bottom,top,near,far){ -var r_width=1/(right-left); -var r_height=1/(top-bottom); -var r_depth=1/(near-far); -var x=2*(near*r_width); -var y=2*(near*r_height); -var A=(right+left)*r_width; -var B=(top+bottom)*r_height; -var C=(far+near)*r_depth; -var D=2*(far*near*r_depth); -return [ -x,0,0,0, -0,y,0,0, -A,B,C,-1, -0,0,D,0];}, - - - -createPerspective:function(fovInRadians,aspect,near,far){ -var h=1/Math.tan(fovInRadians); -var r_depth=1/(near-far); -var C=(far+near)*r_depth; -var D=2*(far*near*r_depth); -return [ -h/aspect,0,0,0, -0,h,0,0, -0,0,C,-1, -0,0,D,0];}, - - - -createTranslate2d:function(x,y){ -var mat=MatrixMath.createIdentityMatrix(); -MatrixMath.reuseTranslate2dCommand(mat,x,y); -return mat;}, - - -reuseTranslate2dCommand:function(matrixCommand,x,y){ -matrixCommand[12]=x; -matrixCommand[13]=y;}, - - -reuseTranslate3dCommand:function(matrixCommand,x,y,z){ -matrixCommand[12]=x; -matrixCommand[13]=y; -matrixCommand[14]=z;}, - - -createScale:function(factor){ -var mat=MatrixMath.createIdentityMatrix(); -MatrixMath.reuseScaleCommand(mat,factor); -return mat;}, - - -reuseScaleCommand:function(matrixCommand,factor){ -matrixCommand[0]=factor; -matrixCommand[5]=factor;}, - - -reuseScale3dCommand:function(matrixCommand,x,y,z){ -matrixCommand[0]=x; -matrixCommand[5]=y; -matrixCommand[10]=z;}, - - -reusePerspectiveCommand:function(matrixCommand,p){ -matrixCommand[11]=-1/p;}, - - -reuseScaleXCommand:function(matrixCommand,factor){ -matrixCommand[0]=factor;}, - - -reuseScaleYCommand:function(matrixCommand,factor){ -matrixCommand[5]=factor;}, - - -reuseScaleZCommand:function(matrixCommand,factor){ -matrixCommand[10]=factor;}, - - -reuseRotateXCommand:function(matrixCommand,radians){ -matrixCommand[5]=Math.cos(radians); -matrixCommand[6]=Math.sin(radians); -matrixCommand[9]=-Math.sin(radians); -matrixCommand[10]=Math.cos(radians);}, - - -reuseRotateYCommand:function(matrixCommand,amount){ -matrixCommand[0]=Math.cos(amount); -matrixCommand[2]=-Math.sin(amount); -matrixCommand[8]=Math.sin(amount); -matrixCommand[10]=Math.cos(amount);}, - - - -reuseRotateZCommand:function(matrixCommand,radians){ -matrixCommand[0]=Math.cos(radians); -matrixCommand[1]=Math.sin(radians); -matrixCommand[4]=-Math.sin(radians); -matrixCommand[5]=Math.cos(radians);}, - - -createRotateZ:function(radians){ -var mat=MatrixMath.createIdentityMatrix(); -MatrixMath.reuseRotateZCommand(mat,radians); -return mat;}, - - -reuseSkewXCommand:function(matrixCommand,radians){ -matrixCommand[4]=Math.sin(radians); -matrixCommand[5]=Math.cos(radians);}, - - -reuseSkewYCommand:function(matrixCommand,radians){ -matrixCommand[0]=Math.cos(radians); -matrixCommand[1]=Math.sin(radians);}, - - -multiplyInto:function(out,a,b){ -var a00=a[0],a01=a[1],a02=a[2],a03=a[3], -a10=a[4],a11=a[5],a12=a[6],a13=a[7], -a20=a[8],a21=a[9],a22=a[10],a23=a[11], -a30=a[12],a31=a[13],a32=a[14],a33=a[15]; - -var b0=b[0],b1=b[1],b2=b[2],b3=b[3]; -out[0]=b0*a00+b1*a10+b2*a20+b3*a30; -out[1]=b0*a01+b1*a11+b2*a21+b3*a31; -out[2]=b0*a02+b1*a12+b2*a22+b3*a32; -out[3]=b0*a03+b1*a13+b2*a23+b3*a33; - -b0=b[4];b1=b[5];b2=b[6];b3=b[7]; -out[4]=b0*a00+b1*a10+b2*a20+b3*a30; -out[5]=b0*a01+b1*a11+b2*a21+b3*a31; -out[6]=b0*a02+b1*a12+b2*a22+b3*a32; -out[7]=b0*a03+b1*a13+b2*a23+b3*a33; - -b0=b[8];b1=b[9];b2=b[10];b3=b[11]; -out[8]=b0*a00+b1*a10+b2*a20+b3*a30; -out[9]=b0*a01+b1*a11+b2*a21+b3*a31; -out[10]=b0*a02+b1*a12+b2*a22+b3*a32; -out[11]=b0*a03+b1*a13+b2*a23+b3*a33; - -b0=b[12];b1=b[13];b2=b[14];b3=b[15]; -out[12]=b0*a00+b1*a10+b2*a20+b3*a30; -out[13]=b0*a01+b1*a11+b2*a21+b3*a31; -out[14]=b0*a02+b1*a12+b2*a22+b3*a32; -out[15]=b0*a03+b1*a13+b2*a23+b3*a33;}, - - -determinant:function(matrix){var _matrix=babelHelpers.slicedToArray( - - - - - -matrix,16);var m00=_matrix[0];var m01=_matrix[1];var m02=_matrix[2];var m03=_matrix[3];var m10=_matrix[4];var m11=_matrix[5];var m12=_matrix[6];var m13=_matrix[7];var m20=_matrix[8];var m21=_matrix[9];var m22=_matrix[10];var m23=_matrix[11];var m30=_matrix[12];var m31=_matrix[13];var m32=_matrix[14];var m33=_matrix[15]; -return ( -m03*m12*m21*m30-m02*m13*m21*m30- -m03*m11*m22*m30+m01*m13*m22*m30+ -m02*m11*m23*m30-m01*m12*m23*m30- -m03*m12*m20*m31+m02*m13*m20*m31+ -m03*m10*m22*m31-m00*m13*m22*m31- -m02*m10*m23*m31+m00*m12*m23*m31+ -m03*m11*m20*m32-m01*m13*m20*m32- -m03*m10*m21*m32+m00*m13*m21*m32+ -m01*m10*m23*m32-m00*m11*m23*m32- -m02*m11*m20*m33+m01*m12*m20*m33+ -m02*m10*m21*m33-m00*m12*m21*m33- -m01*m10*m22*m33+m00*m11*m22*m33);}, - - - - - - - - - - -inverse:function(matrix){ -var det=MatrixMath.determinant(matrix); -if(!det){ -return matrix;}var _matrix2=babelHelpers.slicedToArray( - - - - - - -matrix,16);var m00=_matrix2[0];var m01=_matrix2[1];var m02=_matrix2[2];var m03=_matrix2[3];var m10=_matrix2[4];var m11=_matrix2[5];var m12=_matrix2[6];var m13=_matrix2[7];var m20=_matrix2[8];var m21=_matrix2[9];var m22=_matrix2[10];var m23=_matrix2[11];var m30=_matrix2[12];var m31=_matrix2[13];var m32=_matrix2[14];var m33=_matrix2[15]; -return [ -(m12*m23*m31-m13*m22*m31+m13*m21*m32-m11*m23*m32-m12*m21*m33+m11*m22*m33)/det, -(m03*m22*m31-m02*m23*m31-m03*m21*m32+m01*m23*m32+m02*m21*m33-m01*m22*m33)/det, -(m02*m13*m31-m03*m12*m31+m03*m11*m32-m01*m13*m32-m02*m11*m33+m01*m12*m33)/det, -(m03*m12*m21-m02*m13*m21-m03*m11*m22+m01*m13*m22+m02*m11*m23-m01*m12*m23)/det, -(m13*m22*m30-m12*m23*m30-m13*m20*m32+m10*m23*m32+m12*m20*m33-m10*m22*m33)/det, -(m02*m23*m30-m03*m22*m30+m03*m20*m32-m00*m23*m32-m02*m20*m33+m00*m22*m33)/det, -(m03*m12*m30-m02*m13*m30-m03*m10*m32+m00*m13*m32+m02*m10*m33-m00*m12*m33)/det, -(m02*m13*m20-m03*m12*m20+m03*m10*m22-m00*m13*m22-m02*m10*m23+m00*m12*m23)/det, -(m11*m23*m30-m13*m21*m30+m13*m20*m31-m10*m23*m31-m11*m20*m33+m10*m21*m33)/det, -(m03*m21*m30-m01*m23*m30-m03*m20*m31+m00*m23*m31+m01*m20*m33-m00*m21*m33)/det, -(m01*m13*m30-m03*m11*m30+m03*m10*m31-m00*m13*m31-m01*m10*m33+m00*m11*m33)/det, -(m03*m11*m20-m01*m13*m20-m03*m10*m21+m00*m13*m21+m01*m10*m23-m00*m11*m23)/det, -(m12*m21*m30-m11*m22*m30-m12*m20*m31+m10*m22*m31+m11*m20*m32-m10*m21*m32)/det, -(m01*m22*m30-m02*m21*m30+m02*m20*m31-m00*m22*m31-m01*m20*m32+m00*m21*m32)/det, -(m02*m11*m30-m01*m12*m30-m02*m10*m31+m00*m12*m31+m01*m10*m32-m00*m11*m32)/det, -(m01*m12*m20-m02*m11*m20+m02*m10*m21-m00*m12*m21-m01*m10*m22+m00*m11*m22)/det];}, - - - - - - -transpose:function(m){ -return [ -m[0],m[4],m[8],m[12], -m[1],m[5],m[9],m[13], -m[2],m[6],m[10],m[14], -m[3],m[7],m[11],m[15]];}, - - - - - - -multiplyVectorByMatrix:function( -v, -m) -{var _v=babelHelpers.slicedToArray( -v,4);var vx=_v[0];var vy=_v[1];var vz=_v[2];var vw=_v[3]; -return [ -vx*m[0]+vy*m[4]+vz*m[8]+vw*m[12], -vx*m[1]+vy*m[5]+vz*m[9]+vw*m[13], -vx*m[2]+vy*m[6]+vz*m[10]+vw*m[14], -vx*m[3]+vy*m[7]+vz*m[11]+vw*m[15]];}, - - - - - - -v3Length:function(a){ -return Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);}, - - - - - -v3Normalize:function( -vector, -v3Length) -{ -var im=1/(v3Length||MatrixMath.v3Length(vector)); -return [ -vector[0]*im, -vector[1]*im, -vector[2]*im];}, - - - - - - - -v3Dot:function(a,b){ -return a[0]*b[0]+ -a[1]*b[1]+ -a[2]*b[2];}, - - - - - - -v3Combine:function( -a, -b, -aScale, -bScale) -{ -return [ -aScale*a[0]+bScale*b[0], -aScale*a[1]+bScale*b[1], -aScale*a[2]+bScale*b[2]];}, - - - - - - - -v3Cross:function(a,b){ -return [ -a[1]*b[2]-a[2]*b[1], -a[2]*b[0]-a[0]*b[2], -a[0]*b[1]-a[1]*b[0]];}, - - - - - - - - - - - - - - - - - - - -quaternionToDegreesXYZ:function(q,matrix,row){var _q=babelHelpers.slicedToArray( -q,4);var qx=_q[0];var qy=_q[1];var qz=_q[2];var qw=_q[3]; -var qw2=qw*qw; -var qx2=qx*qx; -var qy2=qy*qy; -var qz2=qz*qz; -var test=qx*qy+qz*qw; -var unit=qw2+qx2+qy2+qz2; -var conv=180/Math.PI; - -if(test>0.49999*unit){ -return [0,2*Math.atan2(qx,qw)*conv,90];} - -if(test<-0.49999*unit){ -return [0,-2*Math.atan2(qx,qw)*conv,-90];} - - -return [ -MatrixMath.roundTo3Places( -Math.atan2(2*qx*qw-2*qy*qz,1-2*qx2-2*qz2)*conv), - -MatrixMath.roundTo3Places( -Math.atan2(2*qy*qw-2*qx*qz,1-2*qy2-2*qz2)*conv), - -MatrixMath.roundTo3Places( -Math.asin(2*qx*qy+2*qz*qw)*conv)];}, - - - - - - - - -roundTo3Places:function(n){ -var arr=n.toString().split('e'); -return Math.round(arr[0]+'e'+(arr[1]?+arr[1]-3:3))*0.001;}, - - - - - - - - - - - - - -decomposeMatrix:function(transformMatrix){ - -invariant( -transformMatrix.length===16, -'Matrix decomposition needs a list of 3d matrix values, received %s', -transformMatrix); - - - -var perspective=[]; -var quaternion=[]; -var scale=[]; -var skew=[]; -var translation=[]; - - - -if(!transformMatrix[15]){ -return;} - -var matrix=[]; -var perspectiveMatrix=[]; -for(var i=0;i<4;i++){ -matrix.push([]); -for(var j=0;j<4;j++){ -var value=transformMatrix[i*4+j]/transformMatrix[15]; -matrix[i].push(value); -perspectiveMatrix.push(j===3?0:value);}} - - -perspectiveMatrix[15]=1; - - -if(!MatrixMath.determinant(perspectiveMatrix)){ -return;} - - - -if(matrix[0][3]!==0||matrix[1][3]!==0||matrix[2][3]!==0){ - - -var rightHandSide=[ -matrix[0][3], -matrix[1][3], -matrix[2][3], -matrix[3][3]]; - - - - -var inversePerspectiveMatrix=MatrixMath.inverse( -perspectiveMatrix); - -var transposedInversePerspectiveMatrix=MatrixMath.transpose( -inversePerspectiveMatrix); - -var perspective=MatrixMath.multiplyVectorByMatrix( -rightHandSide, -transposedInversePerspectiveMatrix);}else - -{ - -perspective[0]=perspective[1]=perspective[2]=0; -perspective[3]=1;} - - - -for(var i=0;i<3;i++){ -translation[i]=matrix[3][i];} - - - - -var row=[]; -for(i=0;i<3;i++){ -row[i]=[ -matrix[i][0], -matrix[i][1], -matrix[i][2]];} - - - - -scale[0]=MatrixMath.v3Length(row[0]); -row[0]=MatrixMath.v3Normalize(row[0],scale[0]); - - -skew[0]=MatrixMath.v3Dot(row[0],row[1]); -row[1]=MatrixMath.v3Combine(row[1],row[0],1.0,-skew[0]); - - -skew[0]=MatrixMath.v3Dot(row[0],row[1]); -row[1]=MatrixMath.v3Combine(row[1],row[0],1.0,-skew[0]); - - -scale[1]=MatrixMath.v3Length(row[1]); -row[1]=MatrixMath.v3Normalize(row[1],scale[1]); -skew[0]/=scale[1]; - - -skew[1]=MatrixMath.v3Dot(row[0],row[2]); -row[2]=MatrixMath.v3Combine(row[2],row[0],1.0,-skew[1]); -skew[2]=MatrixMath.v3Dot(row[1],row[2]); -row[2]=MatrixMath.v3Combine(row[2],row[1],1.0,-skew[2]); - - -scale[2]=MatrixMath.v3Length(row[2]); -row[2]=MatrixMath.v3Normalize(row[2],scale[2]); -skew[1]/=scale[2]; -skew[2]/=scale[2]; - - - - -var pdum3=MatrixMath.v3Cross(row[1],row[2]); -if(MatrixMath.v3Dot(row[0],pdum3)<0){ -for(i=0;i<3;i++){ -scale[i]*=-1; -row[i][0]*=-1; -row[i][1]*=-1; -row[i][2]*=-1;}} - - - - -quaternion[0]= -0.5*Math.sqrt(Math.max(1+row[0][0]-row[1][1]-row[2][2],0)); -quaternion[1]= -0.5*Math.sqrt(Math.max(1-row[0][0]+row[1][1]-row[2][2],0)); -quaternion[2]= -0.5*Math.sqrt(Math.max(1-row[0][0]-row[1][1]+row[2][2],0)); -quaternion[3]= -0.5*Math.sqrt(Math.max(1+row[0][0]+row[1][1]+row[2][2],0)); - -if(row[2][1]>row[1][2]){ -quaternion[0]=-quaternion[0];} - -if(row[0][2]>row[2][0]){ -quaternion[1]=-quaternion[1];} - -if(row[1][0]>row[0][1]){ -quaternion[2]=-quaternion[2];} - - - -var rotationDegrees; -if( -quaternion[0]<0.001&&quaternion[0]>=0&& -quaternion[1]<0.001&&quaternion[1]>=0) -{ - -rotationDegrees=[0,0,MatrixMath.roundTo3Places( -Math.atan2(row[0][1],row[0][0])*180/Math.PI)];}else - -{ -rotationDegrees=MatrixMath.quaternionToDegreesXYZ(quaternion,matrix,row);} - - - -return { -rotationDegrees:rotationDegrees, -perspective:perspective, -quaternion:quaternion, -scale:scale, -skew:skew, -translation:translation, - -rotate:rotationDegrees[2], -rotateX:rotationDegrees[0], -rotateY:rotationDegrees[1], -scaleX:scale[0], -scaleY:scale[1], -translateX:translation[0], -translateY:translation[1]};}}; - - - - - -module.exports=MatrixMath; -}); -__d('sizesDiffer',function(global, require, module, exports) { 'use strict'; - - - - - - -var dummySize={width:undefined,height:undefined}; - -var sizesDiffer=function(one,two){ -one=one||dummySize; -two=two||dummySize; -return one!==two&&( -one.width!==two.width|| -one.height!==two.height);}; - - - -module.exports=sizesDiffer; -}); -__d('ReactNativeViewAttributes',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeStyleAttributes=require('ReactNativeStyleAttributes'); - -var ReactNativeViewAttributes={}; - -ReactNativeViewAttributes.UIView={ -pointerEvents:true, -accessible:true, -accessibilityLabel:true, -accessibilityComponentType:true, -accessibilityLiveRegion:true, -accessibilityTraits:true, -importantForAccessibility:true, -testID:true, -renderToHardwareTextureAndroid:true, -shouldRasterizeIOS:true, -onLayout:true, -onAccessibilityTap:true, -onMagicTap:true, -collapsable:true, -needsOffscreenAlphaCompositing:true, -style:ReactNativeStyleAttributes}; - - -ReactNativeViewAttributes.RCTView=babelHelpers.extends({}, -ReactNativeViewAttributes.UIView,{ - - - - - - -removeClippedSubviews:true}); - - -module.exports=ReactNativeViewAttributes; -}); -__d('StyleSheetPropType',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var createStrictShapeTypeChecker=require('createStrictShapeTypeChecker'); -var flattenStyle=require('flattenStyle'); - -function StyleSheetPropType( -shape) -{ -var shapePropType=createStrictShapeTypeChecker(shape); -return function(props,propName,componentName,location){ -var newProps=props; -if(props[propName]){ - -newProps={}; -newProps[propName]=flattenStyle(props[propName]);} - -return shapePropType(newProps,propName,componentName,location);};} - - - -module.exports=StyleSheetPropType; -}); -__d('createStrictShapeTypeChecker',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); - -var invariant=require('invariant'); -var merge=require('merge'); - -function createStrictShapeTypeChecker( -shapeTypes) -{ -function checkType(isRequired,props,propName,componentName,location){ -if(!props[propName]){ -if(isRequired){ -invariant( -false, -'Required object `'+propName+'` was not specified in '+('`'+ -componentName+'`.'));} - - -return;} - -var propValue=props[propName]; -var propType=typeof propValue; -var locationName= -location&&ReactPropTypeLocationNames[location]||'(unknown)'; -if(propType!=='object'){ -invariant( -false, -'Invalid '+locationName+' `'+propName+'` of type `'+propType+'` '+('supplied to `'+ -componentName+'`, expected `object`.'));} - - - - -var allKeys=merge(props[propName],shapeTypes); -for(var key in allKeys){ -var checker=shapeTypes[key]; -if(!checker){ -invariant( -false, -'Invalid props.'+propName+' key `'+key+'` supplied to `'+componentName+'`.'+'\nBad object: '+ -JSON.stringify(props[propName],null,' ')+'\nValid keys: '+ -JSON.stringify(Object.keys(shapeTypes),null,' '));} - - -var error=checker(propValue,key,componentName,location); -if(error){ -invariant( -false, -error.message+'\nBad object: '+ -JSON.stringify(props[propName],null,' '));}}} - - - - -function chainedCheckType( -props, -propName, -componentName, -location) -{ -return checkType(false,props,propName,componentName,location);} - -chainedCheckType.isRequired=checkType.bind(null,true); -return chainedCheckType;} - - -module.exports=createStrictShapeTypeChecker; -}); -__d('requireNativeComponent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeStyleAttributes=require('ReactNativeStyleAttributes'); -var UIManager=require('UIManager'); -var UnimplementedView=require('UnimplementedView'); - -var createReactNativeComponentClass=require('createReactNativeComponentClass'); - -var insetsDiffer=require('insetsDiffer'); -var pointsDiffer=require('pointsDiffer'); -var matricesDiffer=require('matricesDiffer'); -var processColor=require('processColor'); -var resolveAssetSource=require('resolveAssetSource'); -var sizesDiffer=require('sizesDiffer'); -var verifyPropTypes=require('verifyPropTypes'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - -function requireNativeComponent( -viewName, -componentInterface, -extraConfig) -{ -var viewConfig=UIManager[viewName]; -if(!viewConfig||!viewConfig.NativeProps){ -warning(false,'Native component for "%s" does not exist',viewName); -return UnimplementedView;} - -var nativeProps=babelHelpers.extends({}, -UIManager.RCTView.NativeProps, -viewConfig.NativeProps); - -viewConfig.uiViewClassName=viewName; -viewConfig.validAttributes={}; -viewConfig.propTypes=componentInterface&&componentInterface.propTypes; -for(var key in nativeProps){ -var useAttribute=false; -var attribute={}; - -var differ=TypeToDifferMap[nativeProps[key]]; -if(differ){ -attribute.diff=differ; -useAttribute=true;} - - -var processor=TypeToProcessorMap[nativeProps[key]]; -if(processor){ -attribute.process=processor; -useAttribute=true;} - - -viewConfig.validAttributes[key]=useAttribute?attribute:true;} - - - - - - - -viewConfig.validAttributes.style=ReactNativeStyleAttributes; - -if(__DEV__){ -componentInterface&&verifyPropTypes( -componentInterface, -viewConfig, -extraConfig&&extraConfig.nativeOnly);} - - -return createReactNativeComponentClass(viewConfig);} - - -var TypeToDifferMap={ - -CATransform3D:matricesDiffer, -CGPoint:pointsDiffer, -CGSize:sizesDiffer, -UIEdgeInsets:insetsDiffer}; - - - - -var TypeToProcessorMap={ - -CGColor:processColor, -CGColorArray:processColor, -UIColor:processColor, -UIColorArray:processColor, -CGImage:resolveAssetSource, -UIImage:resolveAssetSource, -RCTImageSource:resolveAssetSource, - -Color:processColor}; - - -module.exports=requireNativeComponent; -}); -__d('verifyPropTypes',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeStyleAttributes=require('ReactNativeStyleAttributes'); - - - - - - - -function verifyPropTypes( -componentInterface, -viewConfig, -nativePropsToIgnore) -{ -if(!viewConfig){ -return;} - -var componentName=componentInterface.name|| -componentInterface.displayName|| -'unknown'; -if(!componentInterface.propTypes){ -throw new Error( -'`'+componentName+'` has no propTypes defined`');} - - - -var nativeProps=viewConfig.NativeProps; -for(var prop in nativeProps){ -if(!componentInterface.propTypes[prop]&& -!ReactNativeStyleAttributes[prop]&&( -!nativePropsToIgnore||!nativePropsToIgnore[prop])){ -var message; -if(componentInterface.propTypes.hasOwnProperty(prop)){ -message='`'+componentName+'` has incorrectly defined propType for native prop `'+ -viewConfig.uiViewClassName+'.'+prop+'` of native type `'+nativeProps[prop];}else -{ -message='`'+componentName+'` has no propType for native prop `'+ -viewConfig.uiViewClassName+'.'+prop+'` of native type `'+ -nativeProps[prop]+'`';} -; -throw new Error(message);}}} - - - - -module.exports=verifyPropTypes; -}); -__d('UnimplementedView',function(global, require, module, exports) { 'use strict'; - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); - -var UnimplementedView=React.createClass({displayName:'UnimplementedView', -setNativeProps:function(){}, - - - - -render:function(){ - -var View=require('View'); -return ( -React.createElement(View,{style:[styles.unimplementedView,this.props.style]}, -this.props.children));}}); - - - - - -var styles=StyleSheet.create({ -unimplementedView:{ -borderWidth:1, -borderColor:'red', -alignSelf:'flex-start'}}); - - - -module.exports=UnimplementedView; -}); -__d('StyleSheet',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var StyleSheetRegistry=require('StyleSheetRegistry'); -var StyleSheetValidation=require('StyleSheetValidation'); -var flattenStyle=require('flattenStyle');var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -StyleSheet=(function(){function StyleSheet(){babelHelpers.classCallCheck(this,StyleSheet);}babelHelpers.createClass(StyleSheet,null,[{key:'create',value:function create( - - -obj){ -var result={}; -for(var key in obj){ -StyleSheetValidation.validateStyle(key,obj); -result[key]=StyleSheetRegistry.registerStyle(obj[key]);} - -return result;}}]);return StyleSheet;})(); - - - - -StyleSheet.flatten=flattenStyle; - -module.exports=StyleSheet; -}); -__d('StyleSheetValidation',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ImageStylePropTypes=require('ImageStylePropTypes'); -var ReactPropTypeLocations=require('ReactPropTypeLocations'); -var TextStylePropTypes=require('TextStylePropTypes'); -var ViewStylePropTypes=require('ViewStylePropTypes'); - -var invariant=require('invariant');var - -StyleSheetValidation=(function(){function StyleSheetValidation(){babelHelpers.classCallCheck(this,StyleSheetValidation);}babelHelpers.createClass(StyleSheetValidation,null,[{key:'validateStyleProp',value:function validateStyleProp( -prop,style,caller){ -if(!__DEV__){ -return;} - -if(allStylePropTypes[prop]===undefined){ -var message1='"'+prop+'" is not a valid style property.'; -var message2='\nValid style props: '+ -JSON.stringify(Object.keys(allStylePropTypes).sort(),null,' '); -styleError(message1,style,caller,message2);} - -var error=allStylePropTypes[prop]( -style, -prop, -caller, -ReactPropTypeLocations.prop); - -if(error){ -styleError(error.message,style,caller);}}},{key:'validateStyle',value:function validateStyle( - - - -name,styles){ -if(!__DEV__){ -return;} - -for(var prop in styles[name]){ -StyleSheetValidation.validateStyleProp(prop,styles[name],'StyleSheet '+name);}}},{key:'addValidStylePropTypes',value:function addValidStylePropTypes( - - - -stylePropTypes){ -for(var key in stylePropTypes){ -allStylePropTypes[key]=stylePropTypes[key];}}}]);return StyleSheetValidation;})(); - - - - -var styleError=function(message1,style,caller,message2){ -invariant( -false, -message1+'\n'+(caller||'<>')+': '+ -JSON.stringify(style,null,' ')+(message2||''));}; - - - -var allStylePropTypes={}; - -StyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes); -StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes); -StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes); - -module.exports=StyleSheetValidation; -}); -__d('createReactNativeComponentClass',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ReactNativeBaseComponent=require('ReactNativeBaseComponent'); - - - - - - - - - - - - -var createReactNativeComponentClass=function( -viewConfig) -{ -var Constructor=function(element){ -this._currentElement=element; - -this._rootNodeID=null; -this._renderedChildren=null;}; - -Constructor.displayName=viewConfig.uiViewClassName; -Constructor.viewConfig=viewConfig; -Constructor.propTypes=viewConfig.propTypes; -Constructor.prototype=new ReactNativeBaseComponent(viewConfig); -Constructor.prototype.constructor=Constructor; - -return Constructor;}; - - -module.exports=createReactNativeComponentClass; -}); -__d('ReactNativeBaseComponent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var ReactNativeAttributePayload=require('ReactNativeAttributePayload'); -var ReactNativeEventEmitter=require('ReactNativeEventEmitter'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var ReactMultiChild=require('ReactMultiChild'); -var UIManager=require('UIManager'); - -var deepFreezeAndThrowOnMutationInDev=require('deepFreezeAndThrowOnMutationInDev'); -var warning=require('warning'); - -var registrationNames=ReactNativeEventEmitter.registrationNames; -var putListener=ReactNativeEventEmitter.putListener; -var deleteListener=ReactNativeEventEmitter.deleteListener; -var deleteAllListeners=ReactNativeEventEmitter.deleteAllListeners; - - - - - - - - - - - - - - -var ReactNativeBaseComponent=function( -viewConfig) -{ -this.viewConfig=viewConfig;}; - - - - - - - - - - - - -var cachedIndexArray=function(size){ -var cachedResult=cachedIndexArray._cache[size]; -if(!cachedResult){ -var arr=[]; -for(var i=0;i=deviceScale){ -return scales[i];}} - - - - - - -return scales[scales.length-1]||1;} - - -function resolveAssetSource(source){ -if(typeof source==='object'){ -return source;} - - -var asset=AssetRegistry.getAssetByID(source); -if(asset){ -return assetToImageSource(asset);} - - -return null;} - - -function assetToImageSource(asset){ -var devServerURL=getDevServerURL(); -return { -__packager_asset:true, -width:asset.width, -height:asset.height, -uri:devServerURL?getPathOnDevserver(devServerURL,asset):getPathInArchive(asset), -scale:pickScale(asset.scales,PixelRatio.get())};} - - - -module.exports=resolveAssetSource; -module.exports.pickScale=pickScale; -}); -__d('AssetRegistry',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - -var assets=[]; - -function registerAsset(asset){ - - -return assets.push(asset);} - - -function getAssetByID(assetId){ -return assets[assetId-1];} - - -module.exports={registerAsset:registerAsset,getAssetByID:getAssetByID}; -}); -__d('PixelRatio',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Dimensions=require('Dimensions');var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -PixelRatio=(function(){function PixelRatio(){babelHelpers.classCallCheck(this,PixelRatio);}babelHelpers.createClass(PixelRatio,null,[{key:'get',value:function get() - - - - - - - - - - - - - - - - - - -{ -return Dimensions.get('window').scale;}},{key:'getFontScale',value:function getFontScale() - - - - - - - - - - - - - -{ -return Dimensions.get('window').fontScale||PixelRatio.get();}},{key:'getPixelSizeForLayoutSize',value:function getPixelSizeForLayoutSize( - - - - - - - -layoutSize){ -return Math.round(layoutSize*PixelRatio.get());}},{key:'startDetecting',value:function startDetecting() - - - -{}}]);return PixelRatio;})(); - - -module.exports=PixelRatio; -}); -__d('Dimensions',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var UIManager=require('UIManager'); - -var invariant=require('invariant'); - -var dimensions=UIManager.Dimensions; - - - - -if(dimensions&&dimensions.windowPhysicalPixels){ - -dimensions=JSON.parse(JSON.stringify(dimensions)); - -var windowPhysicalPixels=dimensions.windowPhysicalPixels; -dimensions.window={ -width:windowPhysicalPixels.width/windowPhysicalPixels.scale, -height:windowPhysicalPixels.height/windowPhysicalPixels.scale, -scale:windowPhysicalPixels.scale, -fontScale:windowPhysicalPixels.fontScale}; - - - -delete dimensions.windowPhysicalPixels;}var - - -Dimensions=(function(){function Dimensions(){babelHelpers.classCallCheck(this,Dimensions);}babelHelpers.createClass(Dimensions,null,[{key:'set',value:function set( - - - - - -dims){ -babelHelpers.extends(dimensions,dims); -return true;}},{key:'get',value:function get( - - - - - - - - - - - - - - - -dim){ -invariant(dimensions[dim],'No dimension set for key '+dim); -return dimensions[dim];}}]);return Dimensions;})(); - - - -module.exports=Dimensions; -}); -__d('ReactChildren',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var PooledClass=require('PooledClass'); -var ReactElement=require('ReactElement'); - -var emptyFunction=require('emptyFunction'); -var traverseAllChildren=require('traverseAllChildren'); - -var twoArgumentPooler=PooledClass.twoArgumentPooler; -var fourArgumentPooler=PooledClass.fourArgumentPooler; - - -var userProvidedKeyEscapeRegex=/\/(?!\/)/g; -function escapeUserProvidedKey(text){ -return (''+text).replace(userProvidedKeyEscapeRegex,'//');} - - - - - - - - - - - -function ForEachBookKeeping(forEachFunction,forEachContext){ -this.func=forEachFunction; -this.context=forEachContext; -this.count=0;} - -ForEachBookKeeping.prototype.destructor=function(){ -this.func=null; -this.context=null; -this.count=0;}; - -PooledClass.addPoolingTo(ForEachBookKeeping,twoArgumentPooler); - -function forEachSingleChild(bookKeeping,child,name){var -func=bookKeeping.func;var context=bookKeeping.context; -func.call(context,child,bookKeeping.count++);} - - - - - - - - - - - - -function forEachChildren(children,forEachFunc,forEachContext){ -if(children==null){ -return children;} - -var traverseContext= -ForEachBookKeeping.getPooled(forEachFunc,forEachContext); -traverseAllChildren(children,forEachSingleChild,traverseContext); -ForEachBookKeeping.release(traverseContext);} - - - - - - - - - - - - -function MapBookKeeping(mapResult,keyPrefix,mapFunction,mapContext){ -this.result=mapResult; -this.keyPrefix=keyPrefix; -this.func=mapFunction; -this.context=mapContext; -this.count=0;} - -MapBookKeeping.prototype.destructor=function(){ -this.result=null; -this.keyPrefix=null; -this.func=null; -this.context=null; -this.count=0;}; - -PooledClass.addPoolingTo(MapBookKeeping,fourArgumentPooler); - -function mapSingleChildIntoContext(bookKeeping,child,childKey){var -result=bookKeeping.result;var keyPrefix=bookKeeping.keyPrefix;var func=bookKeeping.func;var context=bookKeeping.context; - -var mappedChild=func.call(context,child,bookKeeping.count++); -if(Array.isArray(mappedChild)){ -mapIntoWithKeyPrefixInternal( -mappedChild, -result, -childKey, -emptyFunction.thatReturnsArgument);}else - -if(mappedChild!=null){ -if(ReactElement.isValidElement(mappedChild)){ -mappedChild=ReactElement.cloneAndReplaceKey( -mappedChild, - - -keyPrefix+( - -mappedChild!==child? -escapeUserProvidedKey(mappedChild.key||'')+'/': -'')+ - -childKey);} - - -result.push(mappedChild);}} - - - -function mapIntoWithKeyPrefixInternal(children,array,prefix,func,context){ -var escapedPrefix=''; -if(prefix!=null){ -escapedPrefix=escapeUserProvidedKey(prefix)+'/';} - -var traverseContext=MapBookKeeping.getPooled( -array, -escapedPrefix, -func, -context); - -traverseAllChildren(children,mapSingleChildIntoContext,traverseContext); -MapBookKeeping.release(traverseContext);} - - - - - - - - - - - - - -function mapChildren(children,func,context){ -if(children==null){ -return children;} - -var result=[]; -mapIntoWithKeyPrefixInternal(children,result,null,func,context); -return result;} - - - - -function forEachSingleChildDummy(traverseContext,child,name){ -return null;} - - - - - - - - - -function countChildren(children,context){ -return traverseAllChildren(children,forEachSingleChildDummy,null);} - - - - - - - -function toArray(children){ -var result=[]; -mapIntoWithKeyPrefixInternal( -children, -result, -null, -emptyFunction.thatReturnsArgument); - -return result;} - - - -var ReactChildren={ -forEach:forEachChildren, -map:mapChildren, -mapIntoWithKeyPrefixInternal:mapIntoWithKeyPrefixInternal, -count:countChildren, -toArray:toArray}; - - -module.exports=ReactChildren; -}); -__d('ReactClass',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactComponent=require('ReactComponent'); -var ReactElement=require('ReactElement'); -var ReactPropTypeLocations=require('ReactPropTypeLocations'); -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); -var ReactNoopUpdateQueue=require('ReactNoopUpdateQueue'); - -var assign=require('Object.assign'); -var emptyObject=require('emptyObject'); -var invariant=require('invariant'); -var keyMirror=require('keyMirror'); -var keyOf=require('keyOf'); -var warning=require('warning'); - -var MIXINS_KEY=keyOf({mixins:null}); - - - - -var SpecPolicy=keyMirror({ - - - -DEFINE_ONCE:null, - - - - -DEFINE_MANY:null, - - - -OVERRIDE_BASE:null, - - - - - -DEFINE_MANY_MERGED:null}); - - - -var injectedMixins=[]; - -var warnedSetProps=false; -function warnSetProps(){ -if(!warnedSetProps){ -warnedSetProps=true; -warning( -false, -'setProps(...) and replaceProps(...) are deprecated. '+ -'Instead, call render again at the top level.');}} - - - - - - - - - - - - - - - - - - - - - - - - - - -var ReactClassInterface={ - - - - - - - -mixins:SpecPolicy.DEFINE_MANY, - - - - - - - - -statics:SpecPolicy.DEFINE_MANY, - - - - - - - -propTypes:SpecPolicy.DEFINE_MANY, - - - - - - - -contextTypes:SpecPolicy.DEFINE_MANY, - - - - - - - -childContextTypes:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - -getDefaultProps:SpecPolicy.DEFINE_MANY_MERGED, - - - - - - - - - - - - - - - -getInitialState:SpecPolicy.DEFINE_MANY_MERGED, - - - - - -getChildContext:SpecPolicy.DEFINE_MANY_MERGED, - - - - - - - - - - - - - - - - - -render:SpecPolicy.DEFINE_ONCE, - - - - - - - - - - - - -componentWillMount:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - -componentDidMount:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - - - - - - - - -componentWillReceiveProps:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - - - - - - - - - -shouldComponentUpdate:SpecPolicy.DEFINE_ONCE, - - - - - - - - - - - - - - - - -componentWillUpdate:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - -componentDidUpdate:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - -componentWillUnmount:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - - - -updateComponent:SpecPolicy.OVERRIDE_BASE}; - - - - - - - - - - - - -var RESERVED_SPEC_KEYS={ -displayName:function(Constructor,displayName){ -Constructor.displayName=displayName;}, - -mixins:function(Constructor,mixins){ -if(mixins){ -for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];} - - - -if(newThis!==component&&newThis!==null){ -warning( -false, -'bind(): React component methods may only be bound to the '+ -'component instance. See %s', -componentName);}else - -if(!args.length){ -warning( -false, -'bind(): You are binding a component method to the component. '+ -'React does this for you automatically in a high-performance '+ -'way, so you can safely remove this call. See %s', -componentName); - -return boundMethod;} - -var reboundMethod=_bind.apply(boundMethod,arguments); -reboundMethod.__reactBoundContext=component; -reboundMethod.__reactBoundMethod=method; -reboundMethod.__reactBoundArguments=args; -return reboundMethod;};} - - - -return boundMethod;} - - - - - - - -function bindAutoBindMethods(component){ -for(var autoBindKey in component.__reactAutoBindMap){ -if(component.__reactAutoBindMap.hasOwnProperty(autoBindKey)){ -var method=component.__reactAutoBindMap[autoBindKey]; -component[autoBindKey]=bindAutoBindMethod( -component, -method);}}} - - - - - - - - - -var ReactClassMixin={ - - - - - -replaceState:function(newState,callback){ -this.updater.enqueueReplaceState(this,newState); -if(callback){ -this.updater.enqueueCallback(this,callback);}}, - - - - - - - - - -isMounted:function(){ -return this.updater.isMounted(this);}, - - - - - - - - - - - -setProps:function(partialProps,callback){ -if(__DEV__){ -warnSetProps();} - -this.updater.enqueueSetProps(this,partialProps); -if(callback){ -this.updater.enqueueCallback(this,callback);}}, - - - - - - - - - - - - -replaceProps:function(newProps,callback){ -if(__DEV__){ -warnSetProps();} - -this.updater.enqueueReplaceProps(this,newProps); -if(callback){ -this.updater.enqueueCallback(this,callback);}}}; - - - - -var ReactClassComponent=function(){}; -assign( -ReactClassComponent.prototype, -ReactComponent.prototype, -ReactClassMixin); - - - - - - - -var ReactClass={ - - - - - - - - -createClass:function(spec){ -var Constructor=function(props,context,updater){ - - - -if(__DEV__){ -warning( -this instanceof Constructor, -'Something is calling a React component directly. Use a factory or '+ -'JSX instead. See: https://fb.me/react-legacyfactory');} - - - - -if(this.__reactAutoBindMap){ -bindAutoBindMethods(this);} - - -this.props=props; -this.context=context; -this.refs=emptyObject; -this.updater=updater||ReactNoopUpdateQueue; - -this.state=null; - - - - -var initialState=this.getInitialState?this.getInitialState():null; -if(__DEV__){ - -if(typeof initialState==='undefined'&& -this.getInitialState._isMockFunction){ - - -initialState=null;}} - - -invariant( -typeof initialState==='object'&&!Array.isArray(initialState), -'%s.getInitialState(): must return an object or null', -Constructor.displayName||'ReactCompositeComponent'); - - -this.state=initialState;}; - -Constructor.prototype=new ReactClassComponent(); -Constructor.prototype.constructor=Constructor; - -injectedMixins.forEach( -mixSpecIntoComponent.bind(null,Constructor)); - - -mixSpecIntoComponent(Constructor,spec); - - -if(Constructor.getDefaultProps){ -Constructor.defaultProps=Constructor.getDefaultProps();} - - -if(__DEV__){ - - - - -if(Constructor.getDefaultProps){ -Constructor.getDefaultProps.isReactClassApproved={};} - -if(Constructor.prototype.getInitialState){ -Constructor.prototype.getInitialState.isReactClassApproved={};}} - - - -invariant( -Constructor.prototype.render, -'createClass(...): Class specification must implement a `render` method.'); - - -if(__DEV__){ -warning( -!Constructor.prototype.componentShouldUpdate, -'%s has a method called '+ -'componentShouldUpdate(). Did you mean shouldComponentUpdate()? '+ -'The name is phrased as a question because the function is '+ -'expected to return a value.', -spec.displayName||'A component'); - -warning( -!Constructor.prototype.componentWillRecieveProps, -'%s has a method called '+ -'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', -spec.displayName||'A component');} - - - - -for(var methodName in ReactClassInterface){ -if(!Constructor.prototype[methodName]){ -Constructor.prototype[methodName]=null;}} - - - -return Constructor;}, - - -injection:{ -injectMixin:function(mixin){ -injectedMixins.push(mixin);}}}; - - - - - -module.exports=ReactClass; -}); -__d('ReactComponent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNoopUpdateQueue=require('ReactNoopUpdateQueue'); - -var canDefineProperty=require('canDefineProperty'); -var emptyObject=require('emptyObject'); -var invariant=require('invariant'); -var warning=require('warning'); - - - - -function ReactComponent(props,context,updater){ -this.props=props; -this.context=context; -this.refs=emptyObject; - - -this.updater=updater||ReactNoopUpdateQueue;} - - -ReactComponent.prototype.isReactComponent={}; - - - - - - - - - - - - - - - - - - - - - - - - - - -ReactComponent.prototype.setState=function(partialState,callback){ -invariant( -typeof partialState==='object'|| -typeof partialState==='function'|| -partialState==null, -'setState(...): takes an object of state variables to update or a '+ -'function which returns an object of state variables.'); - -if(__DEV__){ -warning( -partialState!=null, -'setState(...): You passed an undefined or null state object; '+ -'instead, use forceUpdate().');} - - -this.updater.enqueueSetState(this,partialState); -if(callback){ -this.updater.enqueueCallback(this,callback);}}; - - - - - - - - - - - - - - - - - -ReactComponent.prototype.forceUpdate=function(callback){ -this.updater.enqueueForceUpdate(this); -if(callback){ -this.updater.enqueueCallback(this,callback);}}; - - - - - - - - -if(__DEV__){ -var deprecatedAPIs={ -getDOMNode:[ -'getDOMNode', -'Use ReactDOM.findDOMNode(component) instead.'], - -isMounted:[ -'isMounted', -'Instead, make sure to clean up subscriptions and pending requests in '+ -'componentWillUnmount to prevent memory leaks.'], - -replaceProps:[ -'replaceProps', -'Instead, call render again at the top level.'], - -replaceState:[ -'replaceState', -'Refactor your code to use setState instead (see '+ -'https://github.com/facebook/react/issues/3236).'], - -setProps:[ -'setProps', -'Instead, call render again at the top level.']}; - - -var defineDeprecationWarning=function(methodName,info){ -if(canDefineProperty){ -Object.defineProperty(ReactComponent.prototype,methodName,{ -get:function(){ -warning( -false, -'%s(...) is deprecated in plain JavaScript React classes. %s', -info[0], -info[1]); - -return undefined;}});}}; - - - - -for(var fnName in deprecatedAPIs){ -if(deprecatedAPIs.hasOwnProperty(fnName)){ -defineDeprecationWarning(fnName,deprecatedAPIs[fnName]);}}} - - - - -module.exports=ReactComponent; -}); -__d('ReactNoopUpdateQueue',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var warning=require('warning'); - -function warnTDZ(publicInstance,callerName){ -if(__DEV__){ -warning( -false, -'%s(...): Can only update a mounted or mounting component. '+ -'This usually means you called %s() on an unmounted component. '+ -'This is a no-op. Please check the code for the %s component.', -callerName, -callerName, -publicInstance.constructor&&publicInstance.constructor.displayName||'');}} - - - - - - - -var ReactNoopUpdateQueue={ - - - - - - - - -isMounted:function(publicInstance){ -return false;}, - - - - - - - - - - -enqueueCallback:function(publicInstance,callback){}, - - - - - - - - - - - - - - -enqueueForceUpdate:function(publicInstance){ -warnTDZ(publicInstance,'forceUpdate');}, - - - - - - - - - - - - - -enqueueReplaceState:function(publicInstance,completeState){ -warnTDZ(publicInstance,'replaceState');}, - - - - - - - - - - - - -enqueueSetState:function(publicInstance,partialState){ -warnTDZ(publicInstance,'setState');}, - - - - - - - - - -enqueueSetProps:function(publicInstance,partialProps){ -warnTDZ(publicInstance,'setProps');}, - - - - - - - - - -enqueueReplaceProps:function(publicInstance,props){ -warnTDZ(publicInstance,'replaceProps');}}; - - - - -module.exports=ReactNoopUpdateQueue; -}); -__d('ReactElementValidator',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - -var ReactElement=require('ReactElement'); -var ReactPropTypeLocations=require('ReactPropTypeLocations'); -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); -var ReactCurrentOwner=require('ReactCurrentOwner'); - -var canDefineProperty=require('canDefineProperty'); -var getIteratorFn=require('getIteratorFn'); -var invariant=require('invariant'); -var warning=require('warning'); - -function getDeclarationErrorAddendum(){ -if(ReactCurrentOwner.current){ -var name=ReactCurrentOwner.current.getName(); -if(name){ -return ' Check the render method of `'+name+'`.';}} - - -return '';} - - - - - - - -var ownerHasKeyUseWarning={}; - -var loggedTypeFailures={}; - - - - - - - - - - - -function validateExplicitKey(element,parentType){ -if(!element._store||element._store.validated||element.key!=null){ -return;} - -element._store.validated=true; - -var addenda=getAddendaForKeyUse('uniqueKey',element,parentType); -if(addenda===null){ - -return;} - -warning( -false, -'Each child in an array or iterator should have a unique "key" prop.'+ -'%s%s%s', -addenda.parentOrOwner||'', -addenda.childOwner||'', -addenda.url||'');} - - - - - - - - - - - - - -function getAddendaForKeyUse(messageType,element,parentType){ -var addendum=getDeclarationErrorAddendum(); -if(!addendum){ -var parentName=typeof parentType==='string'? -parentType:parentType.displayName||parentType.name; -if(parentName){ -addendum=' Check the top-level render call using <'+parentName+'>.';}} - - - -var memoizer=ownerHasKeyUseWarning[messageType]||( -ownerHasKeyUseWarning[messageType]={}); - -if(memoizer[addendum]){ -return null;} - -memoizer[addendum]=true; - -var addenda={ -parentOrOwner:addendum, -url:' See https://fb.me/react-warning-keys for more information.', -childOwner:null}; - - - - - -if(element&& -element._owner&& -element._owner!==ReactCurrentOwner.current){ - -addenda.childOwner=' It was passed a child from '+ -element._owner.getName()+'.';} - - -return addenda;} - - - - - - - - - - - -function validateChildKeys(node,parentType){ -if(typeof node!=='object'){ -return;} - -if(Array.isArray(node)){ -for(var i=0;ig){ -cx-=gx; -cy-=gy;}else -if(u>0&&g!=0){ -cx-=u/g*gx; -cy-=u/g*gy;} - - -v1=cx*cx+cy*cy; - -cx=c2x-sx;cy=c2y-sy; -u=cx*gx+cy*gy; - -if(u>g){ -cx-=gx; -cy-=gy;}else -if(u>0&&g!=0){ -cx-=u/g*gx; -cy-=u/g*gy;} - - -v2=cx*cx+cy*cy; - -if(v1<0.01&&v2<0.01){ -this.onLine(sx,sy,ex,ey); -return;} - - - -if(isNaN(v1)||isNaN(v2)){ -throw new Error('Bad input');} - - - -var s1x=(c1x+c2x)*0.5,s1y=(c1y+c2y)*0.5, -l1x=(c1x+sx)*0.5,l1y=(c1y+sy)*0.5, -l2x=(l1x+s1x)*0.5,l2y=(l1y+s1y)*0.5, -r2x=(ex+c2x)*0.5,r2y=(ey+c2y)*0.5, -r1x=(r2x+s1x)*0.5,r1y=(r2y+s1y)*0.5, -l2r1x=(l2x+r1x)*0.5,l2r1y=(l2y+r1y)*0.5; - - -this.onBezierCurve(sx,sy,l1x,l1y,l2x,l2y,l2r1x,l2r1y); -this.onBezierCurve(l2r1x,l2r1y,r1x,r1y,r2x,r2y,ex,ey);}, - - -onArc:function(sx,sy,ex,ey,cx,cy,rx,ry,sa,ea,ccw,rotation){ - -var rad=rotation?rotation*Math.PI/180:0,cos=Math.cos(rad),sin=Math.sin(rad), -xx=cos*rx,yx=-sin*ry, -xy=sin*rx,yy=cos*ry; - - -var arc=ea-sa; -if(arc<0&&!ccw)arc+=Math.PI*2;else -if(arc>0&&ccw)arc-=Math.PI*2; - -var n=Math.ceil(Math.abs(arc/(Math.PI/2))), -step=arc/n, -k=4/3*Math.tan(step/4); - -var x=Math.cos(sa),y=Math.sin(sa); - -for(var i=0;im.yy/m.xy?-1:1; -if(m.xx<0?m.xy>=0:m.xy<0)flip=-flip; -return this.rotate(deg-Math.atan2(flip*m.yx,flip*m.xx)*180/Math.PI,x,y);}, - - -scaleTo:function(x,y){ - -var m=this; - -var h=Math.sqrt(m.xx*m.xx+m.yx*m.yx); -m.xx/=h;m.yx/=h; - -h=Math.sqrt(m.yy*m.yy+m.xy*m.xy); -m.yy/=h;m.xy/=h; - -return this.scale(x,y);}, - - -resizeTo:function(width,height){ -var w=this.width,h=this.height; -if(!w||!h)return this; -return this.scaleTo(width/w,height/h);}, - - - - - - - - - - - - - - - - -inversePoint:function(x,y){ -var a=this.xx,b=this.yx, -c=this.xy,d=this.yy, -e=this.x,f=this.y; -var det=b*c-a*d; -if(det==0)return null; -return { -x:(d*(e-x)+c*(y-f))/det, -y:(a*(f-y)+b*(x-e))/det};}, - - - -point:function(x,y){ -var m=this; -return { -x:m.xx*x+m.xy*y+m.x, -y:m.yx*x+m.yy*y+m.y};}}); -}); -__d('DatePickerIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var RCTDatePickerIOSConsts=require('NativeModules').UIManager.RCTDatePicker.Constants; -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - - - - - - - - - - - -var DatePickerIOS=React.createClass({displayName:'DatePickerIOS', - -_picker:undefined, - -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -date:PropTypes.instanceOf(Date).isRequired, - - - - - - - - -onDateChange:PropTypes.func.isRequired, - - - - - - -maximumDate:PropTypes.instanceOf(Date), - - - - - - -minimumDate:PropTypes.instanceOf(Date), - - - - -mode:PropTypes.oneOf(['date','time','datetime']), - - - - -minuteInterval:PropTypes.oneOf([1,2,3,4,5,6,10,12,15,20,30]), - - - - - - - - -timeZoneOffsetInMinutes:PropTypes.number}), - - -getDefaultProps:function(){ -return { -mode:'datetime'};}, - - - -_onChange:function(event){ -var nativeTimeStamp=event.nativeEvent.timestamp; -this.props.onDateChange&&this.props.onDateChange( -new Date(nativeTimeStamp)); - -this.props.onChange&&this.props.onChange(event); - - - - - -var propsTimeStamp=this.props.date.getTime(); -if(this._picker&&nativeTimeStamp!==propsTimeStamp){ -this._picker.setNativeProps({ -date:propsTimeStamp});}}, - - - - -render:function(){var _this=this; -var props=this.props; -return ( -React.createElement(View,{style:props.style}, -React.createElement(RCTDatePickerIOS,{ -ref:function(picker){return _this._picker=picker;}, -style:styles.datePickerIOS, -date:props.date.getTime(), -maximumDate: -props.maximumDate?props.maximumDate.getTime():undefined, - -minimumDate: -props.minimumDate?props.minimumDate.getTime():undefined, - -mode:props.mode, -minuteInterval:props.minuteInterval, -timeZoneOffsetInMinutes:props.timeZoneOffsetInMinutes, -onChange:this._onChange})));}}); - - - - - - -var styles=StyleSheet.create({ -datePickerIOS:{ -height:RCTDatePickerIOSConsts.ComponentHeight, -width:RCTDatePickerIOSConsts.ComponentWidth}}); - - - -var RCTDatePickerIOS=requireNativeComponent('RCTDatePicker',DatePickerIOS,{ -nativeOnly:{onChange:true}}); - - -module.exports=DatePickerIOS; -}); -__d('DrawerLayoutAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('Image',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EdgeInsetsPropType=require('EdgeInsetsPropType'); -var ImageResizeMode=require('ImageResizeMode'); -var ImageStylePropTypes=require('ImageStylePropTypes'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var NativeModules=require('NativeModules'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var ReactNativeViewAttributes=require('ReactNativeViewAttributes'); -var View=require('View'); -var StyleSheet=require('StyleSheet'); -var StyleSheetPropType=require('StyleSheetPropType'); - -var flattenStyle=require('flattenStyle'); -var invariant=require('invariant'); -var requireNativeComponent=require('requireNativeComponent'); -var resolveAssetSource=require('resolveAssetSource'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - - - - - - - - -var Image=React.createClass({displayName:'Image', -propTypes:{ -style:StyleSheetPropType(ImageStylePropTypes), - - - - - -source:PropTypes.oneOfType([ -PropTypes.shape({ -uri:PropTypes.string}), - - -PropTypes.number]), - - - - - -defaultSource:PropTypes.oneOfType([ -PropTypes.shape({ -uri:PropTypes.string}), - - -PropTypes.number]), - - - - - -accessible:PropTypes.bool, - - - - - -accessibilityLabel:PropTypes.string, - - - - - - - - -capInsets:EdgeInsetsPropType, - - - - -resizeMode:PropTypes.oneOf(['cover','contain','stretch']), - - - - -testID:PropTypes.string, - - - - -onLayout:PropTypes.func, - - - -onLoadStart:PropTypes.func, - - - - -onProgress:PropTypes.func, - - - - -onError:PropTypes.func, - - - -onLoad:PropTypes.func, - - - -onLoadEnd:PropTypes.func}, - - -statics:{ -resizeMode:ImageResizeMode}, - - -mixins:[NativeMethodsMixin], - - - - - -viewConfig:{ -uiViewClassName:'UIView', -validAttributes:ReactNativeViewAttributes.UIView}, - - -contextTypes:{ -isInAParentText:React.PropTypes.bool}, - - -render:function(){ -var source=resolveAssetSource(this.props.source)||{};var -width=source.width;var height=source.height; -var style=flattenStyle([{width:width,height:height},styles.base,this.props.style])||{}; - -var isNetwork=source.uri&&source.uri.match(/^https?:/); -var RawImage=isNetwork?RCTNetworkImageView:RCTImageView; -var resizeMode=this.props.resizeMode||(style||{}).resizeMode||'cover'; -var tintColor=(style||{}).tintColor; - - - -if(isNetwork&&tintColor){ -RawImage=RCTImageView;} - - -if(this.context.isInAParentText){ -return React.createElement(RCTVirtualImage,{source:source});}else -{ -return ( -React.createElement(RawImage,babelHelpers.extends({}, -this.props,{ -style:style, -resizeMode:resizeMode, -tintColor:tintColor, -source:source})));}}}); - - - - - - -var styles=StyleSheet.create({ -base:{ -overflow:'hidden'}}); - - - -var RCTImageView=requireNativeComponent('RCTImageView',Image); -var RCTNetworkImageView=NativeModules.NetworkImageViewManager?requireNativeComponent('RCTNetworkImageView',Image):RCTImageView; -var RCTVirtualImage=requireNativeComponent('RCTVirtualImage',Image); - -module.exports=Image; -}); -__d('EdgeInsetsPropType',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var PropTypes=require('ReactPropTypes'); - -var createStrictShapeTypeChecker=require('createStrictShapeTypeChecker'); - -var EdgeInsetsPropType=createStrictShapeTypeChecker({ -top:PropTypes.number, -left:PropTypes.number, -bottom:PropTypes.number, -right:PropTypes.number}); - - -module.exports=EdgeInsetsPropType; -}); -__d('ListView',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ListViewDataSource=require('ListViewDataSource'); -var React=require('React'); -var RCTScrollViewManager=require('NativeModules').ScrollViewManager; -var ScrollView=require('ScrollView'); -var ScrollResponder=require('ScrollResponder'); -var StaticRenderer=require('StaticRenderer'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); - -var isEmpty=require('isEmpty'); -var logError=require('logError'); -var merge=require('merge'); - -var PropTypes=React.PropTypes; - -var DEFAULT_PAGE_SIZE=1; -var DEFAULT_INITIAL_ROWS=10; -var DEFAULT_SCROLL_RENDER_AHEAD=1000; -var DEFAULT_END_REACHED_THRESHOLD=1000; -var DEFAULT_SCROLL_CALLBACK_THROTTLE=50; -var SCROLLVIEW_REF='listviewscroll'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ListView=React.createClass({displayName:'ListView', -mixins:[ScrollResponder.Mixin,TimerMixin], - -statics:{ -DataSource:ListViewDataSource}, - - - - - - - - - -propTypes:babelHelpers.extends({}, -ScrollView.propTypes,{ - -dataSource:PropTypes.instanceOf(ListViewDataSource).isRequired, - - - - - - - - -renderSeparator:PropTypes.func, - - - - - - - - - - - -renderRow:PropTypes.func.isRequired, - - - - - -initialListSize:PropTypes.number, - - - - - -onEndReached:PropTypes.func, - - - -onEndReachedThreshold:PropTypes.number, - - - -pageSize:PropTypes.number, - - - - - - - - -renderFooter:PropTypes.func, -renderHeader:PropTypes.func, - - - - - - - - - -renderSectionHeader:PropTypes.func, - - - - - - -renderScrollComponent:React.PropTypes.func.isRequired, - - - - -scrollRenderAheadDistance:React.PropTypes.number, - - - - - - - - - -onChangeVisibleRows:React.PropTypes.func, - - - - - -removeClippedSubviews:React.PropTypes.bool}), - - - - - -getMetrics:function(){ -return { -contentLength:this.scrollProperties.contentLength, -totalRows:this.props.dataSource.getRowCount(), -renderedRows:this.state.curRenderedRowsCount, -visibleRows:Object.keys(this._visibleRows).length};}, - - - - - - - -getScrollResponder:function(){ -return this.refs[SCROLLVIEW_REF]&& -this.refs[SCROLLVIEW_REF].getScrollResponder&& -this.refs[SCROLLVIEW_REF].getScrollResponder();}, - - -setNativeProps:function(props){ -this.refs[SCROLLVIEW_REF].setNativeProps(props);}, - - - - - - -getDefaultProps:function(){ -return { -initialListSize:DEFAULT_INITIAL_ROWS, -pageSize:DEFAULT_PAGE_SIZE, -renderScrollComponent:function(props){return React.createElement(ScrollView,props);}, -scrollRenderAheadDistance:DEFAULT_SCROLL_RENDER_AHEAD, -onEndReachedThreshold:DEFAULT_END_REACHED_THRESHOLD};}, - - - -getInitialState:function(){ -return { -curRenderedRowsCount:this.props.initialListSize, -prevRenderedRowsCount:0, -highlightedRow:{}};}, - - - -getInnerViewNode:function(){ -return this.refs[SCROLLVIEW_REF].getInnerViewNode();}, - - -componentWillMount:function(){ - -this.scrollProperties={ -visibleLength:null, -contentLength:null, -offset:0}; - -this._childFrames=[]; -this._visibleRows={};}, - - -componentDidMount:function(){var _this=this; - - -this.requestAnimationFrame(function(){ -_this._measureAndUpdateScrollProps();});}, - - - -componentWillReceiveProps:function(nextProps){ -if(this.props.dataSource!==nextProps.dataSource){ -this.setState(function(state,props){ -var rowsToRender=Math.min( -state.curRenderedRowsCount+props.pageSize, -props.dataSource.getRowCount()); - -return { -prevRenderedRowsCount:0, -curRenderedRowsCount:rowsToRender};});}}, - - - - - -componentDidUpdate:function(){var _this2=this; -this.requestAnimationFrame(function(){ -_this2._measureAndUpdateScrollProps();});}, - - - -onRowHighlighted:function(sectionID,rowID){ -this.setState({highlightedRow:{sectionID:sectionID,rowID:rowID}});}, - - -render:function(){ -var bodyComponents=[]; - -var dataSource=this.props.dataSource; -var allRowIDs=dataSource.rowIdentities; -var rowCount=0; -var sectionHeaderIndices=[]; - -var header=this.props.renderHeader&&this.props.renderHeader(); -var footer=this.props.renderFooter&&this.props.renderFooter(); -var totalIndex=header?1:0; - -for(var sectionIdx=0;sectionIdx=this.state.prevRenderedRowsCount&& -dataSource.sectionHeaderShouldUpdate(sectionIdx); -bodyComponents.push( -React.createElement(StaticRenderer,{ -key:'s_'+sectionID, -shouldUpdate:!!shouldUpdateHeader, -render:this.props.renderSectionHeader.bind( -null, -dataSource.getSectionHeaderData(sectionIdx), -sectionID)})); - - - -sectionHeaderIndices.push(totalIndex++);} - - -for(var rowIdx=0;rowIdx=this.state.prevRenderedRowsCount&& -dataSource.rowShouldUpdate(sectionIdx,rowIdx); -var row= -React.createElement(StaticRenderer,{ -key:'r_'+comboID, -shouldUpdate:!!shouldUpdateRow, -render:this.props.renderRow.bind( -null, -dataSource.getRowData(sectionIdx,rowIdx), -sectionID, -rowID, -this.onRowHighlighted)}); - - -bodyComponents.push(row); -totalIndex++; - -if(this.props.renderSeparator&&( -rowIdx!==rowIDs.length-1||sectionIdx===allRowIDs.length-1)){ -var adjacentRowHighlighted= -this.state.highlightedRow.sectionID===sectionID&&( -this.state.highlightedRow.rowID===rowID|| -this.state.highlightedRow.rowID===rowIDs[rowIdx+1]); - -var separator=this.props.renderSeparator( -sectionID, -rowID, -adjacentRowHighlighted); - -bodyComponents.push(separator); -totalIndex++;} - -if(++rowCount===this.state.curRenderedRowsCount){ -break;}} - - -if(rowCount>=this.state.curRenderedRowsCount){ -break;}}var _props= - - - - - - -this.props;var renderScrollComponent=_props.renderScrollComponent;var props=babelHelpers.objectWithoutProperties(_props,['renderScrollComponent']); -if(!props.scrollEventThrottle){ -props.scrollEventThrottle=DEFAULT_SCROLL_CALLBACK_THROTTLE;} - -if(props.removeClippedSubviews===undefined){ -props.removeClippedSubviews=true;} - -babelHelpers.extends(props,{ -onScroll:this._onScroll, -stickyHeaderIndices:sectionHeaderIndices, - - - -onKeyboardWillShow:undefined, -onKeyboardWillHide:undefined, -onKeyboardDidShow:undefined, -onKeyboardDidHide:undefined}); - - - - -return React.cloneElement(renderScrollComponent(props),{ -ref:SCROLLVIEW_REF, -onContentSizeChange:this._onContentSizeChange, -onLayout:this._onLayout}, -header,bodyComponents,footer);}, - - - - - - -_measureAndUpdateScrollProps:function(){ -var scrollComponent=this.getScrollResponder(); -if(!scrollComponent||!scrollComponent.getInnerViewNode){ -return;} - - - - -RCTScrollViewManager&&RCTScrollViewManager.calculateChildFrames&& -RCTScrollViewManager.calculateChildFrames( -React.findNodeHandle(scrollComponent), -this._updateChildFrames);}, - - - -_onContentSizeChange:function(width,height){ -this.scrollProperties.contentLength=!this.props.horizontal? -height:width; -this._updateVisibleRows(); -this._renderMoreRowsIfNeeded();}, - - -_onLayout:function(event){var _event$nativeEvent$la= -event.nativeEvent.layout;var width=_event$nativeEvent$la.width;var height=_event$nativeEvent$la.height; -this.scrollProperties.visibleLength=!this.props.horizontal? -height:width; -this._updateVisibleRows(); -this._renderMoreRowsIfNeeded();}, - - -_setScrollVisibleLength:function(left,top,width,height){ -this.scrollProperties.visibleLength=!this.props.horizontal? -height:width; -this._updateVisibleRows(); -this._renderMoreRowsIfNeeded();}, - - -_updateChildFrames:function(childFrames){ -this._updateVisibleRows(childFrames);}, - - -_maybeCallOnEndReached:function(event){ -if(this.props.onEndReached&& -this.scrollProperties.contentLength!==this._sentEndForContentLength&& -this._getDistanceFromEnd(this.scrollProperties)visibleMax||maxthis.props.onEndReachedThreshold){ - -this._sentEndForContentLength=null;} - - -this.props.onScroll&&this.props.onScroll(e);}}); - - - -module.exports=ListView; -}); -__d('ListViewDataSource',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var invariant=require('invariant'); -var isEmpty=require('isEmpty'); -var warning=require('warning'); - -function defaultGetRowData( -dataBlob, -sectionID, -rowID) -{ -return dataBlob[sectionID][rowID];} - - -function defaultGetSectionHeaderData( -dataBlob, -sectionID) -{ -return dataBlob[sectionID];}var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ListViewDataSource=(function(){ - - - - - - - - - - - - - - - - - - - - - - - - - - -function ListViewDataSource(params){babelHelpers.classCallCheck(this,ListViewDataSource); -invariant( -params&&typeof params.rowHasChanged==='function', -'Must provide a rowHasChanged function.'); - -this._rowHasChanged=params.rowHasChanged; -this._getRowData=params.getRowData||defaultGetRowData; -this._sectionHeaderHasChanged=params.sectionHeaderHasChanged; -this._getSectionHeaderData= -params.getSectionHeaderData||defaultGetSectionHeaderData; - -this._dataBlob=null; -this._dirtyRows=[]; -this._dirtySections=[]; -this._cachedRowCount=0; - - - -this.rowIdentities=[]; -this.sectionIdentities=[];}babelHelpers.createClass(ListViewDataSource,[{key:'cloneWithRows',value:function cloneWithRows( - - - - - - - - - - - - - - - - - - - -dataBlob, -rowIdentities) -{ -var rowIds=rowIdentities?[rowIdentities]:null; -if(!this._sectionHeaderHasChanged){ -this._sectionHeaderHasChanged=function(){return false;};} - -return this.cloneWithRowsAndSections({s1:dataBlob},['s1'],rowIds);}},{key:'cloneWithRowsAndSections',value:function cloneWithRowsAndSections( - - - - - - - - - - - - - - -dataBlob, -sectionIdentities, -rowIdentities) -{ -invariant( -typeof this._sectionHeaderHasChanged==='function', -'Must provide a sectionHeaderHasChanged function with section data.'); - -var newSource=new ListViewDataSource({ -getRowData:this._getRowData, -getSectionHeaderData:this._getSectionHeaderData, -rowHasChanged:this._rowHasChanged, -sectionHeaderHasChanged:this._sectionHeaderHasChanged}); - -newSource._dataBlob=dataBlob; -if(sectionIdentities){ -newSource.sectionIdentities=sectionIdentities;}else -{ -newSource.sectionIdentities=Object.keys(dataBlob);} - -if(rowIdentities){ -newSource.rowIdentities=rowIdentities;}else -{ -newSource.rowIdentities=[]; -newSource.sectionIdentities.forEach(function(sectionID){ -newSource.rowIdentities.push(Object.keys(dataBlob[sectionID]));});} - - -newSource._cachedRowCount=countRows(newSource.rowIdentities); - -newSource._calculateDirtyArrays( -this._dataBlob, -this.sectionIdentities, -this.rowIdentities); - - -return newSource;}},{key:'getRowCount',value:function getRowCount() - - -{ -return this._cachedRowCount;}},{key:'rowShouldUpdate',value:function rowShouldUpdate( - - - - - -sectionIndex,rowIndex){ -var needsUpdate=this._dirtyRows[sectionIndex][rowIndex]; -warning(needsUpdate!==undefined, -'missing dirtyBit for section, row: '+sectionIndex+', '+rowIndex); -return needsUpdate;}},{key:'getRowData',value:function getRowData( - - - - - -sectionIndex,rowIndex){ -var sectionID=this.sectionIdentities[sectionIndex]; -var rowID=this.rowIdentities[sectionIndex][rowIndex]; -warning( -sectionID!==undefined&&rowID!==undefined, -'rendering invalid section, row: '+sectionIndex+', '+rowIndex); - -return this._getRowData(this._dataBlob,sectionID,rowID);}},{key:'getRowIDForFlatIndex',value:function getRowIDForFlatIndex( - - - - - - -index){ -var accessIndex=index; -for(var ii=0;ii=this.rowIdentities[ii].length){ -accessIndex-=this.rowIdentities[ii].length;}else -{ -return this.rowIdentities[ii][accessIndex];}} - - -return null;}},{key:'getSectionIDForFlatIndex',value:function getSectionIDForFlatIndex( - - - - - - -index){ -var accessIndex=index; -for(var ii=0;ii=this.rowIdentities[ii].length){ -accessIndex-=this.rowIdentities[ii].length;}else -{ -return this.sectionIdentities[ii];}} - - -return null;}},{key:'getSectionLengths',value:function getSectionLengths() - - - - - -{ -var results=[]; -for(var ii=0;ii but not '+ -'`scrollEventThrottle`. You will only receive one event. '+ -'Using `16` you get all the events but be aware that it may '+ -'cause frame drops, use a bigger number if you don\'t need as '+ -'much precision.');}} - - - -if(Platform.OS==='android'){ -if(this.props.keyboardDismissMode==='on-drag'){ -dismissKeyboard();}} - - -this.scrollResponderHandleScroll(e);}, - - -_handleContentOnLayout:function(e){var _e$nativeEvent$layout= -e.nativeEvent.layout;var width=_e$nativeEvent$layout.width;var height=_e$nativeEvent$layout.height; -this.props.onContentSizeChange&&this.props.onContentSizeChange(width,height);}, - - -render:function(){ -var contentContainerStyle=[ -this.props.horizontal&&styles.contentContainerHorizontal, -this.props.contentContainerStyle]; - -if(__DEV__&&this.props.style){ -var style=flattenStyle(this.props.style); -var childLayoutProps=['alignItems','justifyContent']. -filter(function(prop){return style&&style[prop]!==undefined;}); -invariant( -childLayoutProps.length===0, -'ScrollView child layout ('+JSON.stringify(childLayoutProps)+ -') must by applied through the contentContainerStyle prop.');} - - - -var contentSizeChangeProps={}; -if(this.props.onContentSizeChange){ -contentSizeChangeProps={ -onLayout:this._handleContentOnLayout};} - - - -var contentContainer= -React.createElement(View,babelHelpers.extends({}, -contentSizeChangeProps,{ -ref:INNERVIEW, -style:contentContainerStyle, -removeClippedSubviews:this.props.removeClippedSubviews, -collapsable:false}), -this.props.children); - - -var alwaysBounceHorizontal= -this.props.alwaysBounceHorizontal!==undefined? -this.props.alwaysBounceHorizontal: -this.props.horizontal; - -var alwaysBounceVertical= -this.props.alwaysBounceVertical!==undefined? -this.props.alwaysBounceVertical: -!this.props.horizontal; - -var props=babelHelpers.extends({}, -this.props,{ -alwaysBounceHorizontal:alwaysBounceHorizontal, -alwaysBounceVertical:alwaysBounceVertical, -style:[styles.base,this.props.style], -onTouchStart:this.scrollResponderHandleTouchStart, -onTouchMove:this.scrollResponderHandleTouchMove, -onTouchEnd:this.scrollResponderHandleTouchEnd, -onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag, -onScrollEndDrag:this.scrollResponderHandleScrollEndDrag, -onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin, -onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd, -onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder, -onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture, -onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder, -onScroll:this.handleScroll, -onResponderGrant:this.scrollResponderHandleResponderGrant, -onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest, -onResponderTerminate:this.scrollResponderHandleTerminate, -onResponderRelease:this.scrollResponderHandleResponderRelease, -onResponderReject:this.scrollResponderHandleResponderReject}); - - -var onRefreshStart=this.props.onRefreshStart; - - -props.onRefreshStart=onRefreshStart? -(function(){onRefreshStart&&onRefreshStart(this.endRefreshing);}).bind(this): -null; - -var ScrollViewClass; -if(Platform.OS==='ios'){ -ScrollViewClass=RCTScrollView;}else -if(Platform.OS==='android'){ -if(this.props.horizontal){ -ScrollViewClass=AndroidHorizontalScrollView;}else -{ -ScrollViewClass=AndroidScrollView;}} - - -invariant( -ScrollViewClass!==undefined, -'ScrollViewClass must not be undefined'); - - -return ( -React.createElement(ScrollViewClass,babelHelpers.extends({},props,{ref:SCROLLVIEW}), -contentContainer));}}); - - - - - -var styles=StyleSheet.create({ -base:{ -flex:1}, - -contentContainerHorizontal:{ -alignSelf:'flex-start', -flexDirection:'row'}}); - - - -var validAttributes=babelHelpers.extends({}, -ReactNativeViewAttributes.UIView,{ -alwaysBounceHorizontal:true, -alwaysBounceVertical:true, -automaticallyAdjustContentInsets:true, -bounces:true, -centerContent:true, -contentInset:{diff:insetsDiffer}, -contentOffset:{diff:pointsDiffer}, -decelerationRate:true, -horizontal:true, -keyboardDismissMode:true, -keyboardShouldPersistTaps:true, -maximumZoomScale:true, -minimumZoomScale:true, -pagingEnabled:true, -removeClippedSubviews:true, -scrollEnabled:true, -scrollIndicatorInsets:{diff:insetsDiffer}, -scrollsToTop:true, -showsHorizontalScrollIndicator:true, -showsVerticalScrollIndicator:true, -snapToInterval:true, -snapToAlignment:true, -stickyHeaderIndices:{diff:deepDiffer}, -scrollEventThrottle:true, -zoomScale:true}); - - -if(Platform.OS==='android'){ -var AndroidScrollView=requireNativeComponent('RCTScrollView',ScrollView); -var AndroidHorizontalScrollView=requireNativeComponent( -'AndroidHorizontalScrollView', -ScrollView);}else - -if(Platform.OS==='ios'){ -var RCTScrollView=requireNativeComponent('RCTScrollView',ScrollView);} - - -module.exports=ScrollView; -}); -__d('PointPropType',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var PropTypes=require('ReactPropTypes'); - -var createStrictShapeTypeChecker=require('createStrictShapeTypeChecker'); - -var PointPropType=createStrictShapeTypeChecker({ -x:PropTypes.number, -y:PropTypes.number}); - - -module.exports=PointPropType; -}); -__d('ScrollResponder',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var Platform=require('Platform'); -var RCTDeviceEventEmitter=require('RCTDeviceEventEmitter'); -var React=require('React'); -var Subscribable=require('Subscribable'); -var TextInputState=require('TextInputState');var _require= - -require('NativeModules');var UIManager=_require.UIManager;var ScrollViewManager=_require.ScrollViewManager; - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var IS_ANIMATING_TOUCH_START_THRESHOLD_MS=16; - - - - - - - - - - -var ScrollResponderMixin={ -mixins:[Subscribable.Mixin], -scrollResponderMixinGetInitialState:function(){ -return { -isTouching:false, -lastMomentumScrollBeginTime:0, -lastMomentumScrollEndTime:0, - - - - - - -observedScrollSinceBecomingResponder:false, -becameResponderWhileAnimating:false};}, - - - - - - -scrollResponderHandleScrollShouldSetResponder:function(){ -return this.state.isTouching;}, - - - - - - - - - - - - - - - - - - - - - - - - - - - -scrollResponderHandleStartShouldSetResponder:function(){ -return false;}, - - - - - - - - - - - - - -scrollResponderHandleStartShouldSetResponderCapture:function(e){ - -var currentlyFocusedTextInput=TextInputState.currentlyFocusedField(); -if(!this.props.keyboardShouldPersistTaps&& -currentlyFocusedTextInput!=null&& -e.target!==currentlyFocusedTextInput){ -return true;} - -return this.scrollResponderIsAnimating();}, - - - - - - - - - - - - -scrollResponderHandleResponderReject:function(){ -warning(false,"ScrollView doesn't take rejection well - scrolls anyway");}, - - - - - - - - - - - - - - - - - -scrollResponderHandleTerminationRequest:function(){ -return !this.state.observedScrollSinceBecomingResponder;}, - - - - - - - -scrollResponderHandleTouchEnd:function(e){ -var nativeEvent=e.nativeEvent; -this.state.isTouching=nativeEvent.touches.length!==0; -this.props.onTouchEnd&&this.props.onTouchEnd(e);}, - - - - - -scrollResponderHandleResponderRelease:function(e){ -this.props.onResponderRelease&&this.props.onResponderRelease(e); - - - -var currentlyFocusedTextInput=TextInputState.currentlyFocusedField(); -if(!this.props.keyboardShouldPersistTaps&& -currentlyFocusedTextInput!=null&& -e.target!==currentlyFocusedTextInput&& -!this.state.observedScrollSinceBecomingResponder&& -!this.state.becameResponderWhileAnimating){ -this.props.onScrollResponderKeyboardDismissed&& -this.props.onScrollResponderKeyboardDismissed(e); -TextInputState.blurTextInput(currentlyFocusedTextInput);}}, - - - -scrollResponderHandleScroll:function(e){ -this.state.observedScrollSinceBecomingResponder=true; -this.props.onScroll&&this.props.onScroll(e);}, - - - - - -scrollResponderHandleResponderGrant:function(e){ -this.state.observedScrollSinceBecomingResponder=false; -this.props.onResponderGrant&&this.props.onResponderGrant(e); -this.state.becameResponderWhileAnimating=this.scrollResponderIsAnimating();}, - - - - - - - - - -scrollResponderHandleScrollBeginDrag:function(e){ -this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e);}, - - - - - -scrollResponderHandleScrollEndDrag:function(e){ -this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e);}, - - - - - -scrollResponderHandleMomentumScrollBegin:function(e){ -this.state.lastMomentumScrollBeginTime=Date.now(); -this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e);}, - - - - - -scrollResponderHandleMomentumScrollEnd:function(e){ -this.state.lastMomentumScrollEndTime=Date.now(); -this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e);}, - - - - - - - - - - - - - -scrollResponderHandleTouchStart:function(e){ -this.state.isTouching=true; -this.props.onTouchStart&&this.props.onTouchStart(e);}, - - - - - - - - - - - - - -scrollResponderHandleTouchMove:function(e){ -this.props.onTouchMove&&this.props.onTouchMove(e);}, - - - - - - - -scrollResponderIsAnimating:function(){ -var now=Date.now(); -var timeSinceLastMomentumScrollEnd=now-this.state.lastMomentumScrollEndTime; -var isAnimating=timeSinceLastMomentumScrollEnd=1, -'Navigator requires props.initialRoute or props.initialRouteStack.'); - -var initialRouteIndex=routeStack.length-1; -if(this.props.initialRoute){ -initialRouteIndex=routeStack.indexOf(this.props.initialRoute); -invariant( -initialRouteIndex!==-1, -'initialRoute is not in initialRouteStack.');} - - -return { -sceneConfigStack:routeStack.map( -function(route){return _this.props.configureScene(route);}), - -routeStack:routeStack, -presentedIndex:initialRouteIndex, -transitionFromIndex:null, -activeGesture:null, -pendingGestureProgress:null, -transitionQueue:[]};}, - - - -componentWillMount:function(){var _this2=this; - -this.__defineGetter__('navigationContext',this._getNavigationContext); - -this._subRouteFocus=[]; -this.parentNavigator=this.props.navigator; -this._handlers={}; -this.springSystem=new rebound.SpringSystem(); -this.spring=this.springSystem.createSpring(); -this.spring.setRestSpeedThreshold(0.05); -this.spring.setCurrentValue(0).setAtRest(); -this.spring.addListener({ -onSpringEndStateChange:function(){ -if(!_this2._interactionHandle){ -_this2._interactionHandle=_this2.createInteractionHandle();}}, - - -onSpringUpdate:function(){ -_this2._handleSpringUpdate();}, - -onSpringAtRest:function(){ -_this2._completeTransition();}}); - - -this.panGesture=PanResponder.create({ -onMoveShouldSetPanResponder:this._handleMoveShouldSetPanResponder, -onPanResponderRelease:this._handlePanResponderRelease, -onPanResponderMove:this._handlePanResponderMove, -onPanResponderTerminate:this._handlePanResponderTerminate}); - -this._interactionHandle=null; -this._emitWillFocus(this.state.routeStack[this.state.presentedIndex]);}, - - -componentDidMount:function(){ -this._handleSpringUpdate(); -this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]);}, - - -componentWillUnmount:function(){ -if(this._navigationContext){ -this._navigationContext.dispose(); -this._navigationContext=null;} - - -this.spring.destroy(); - -if(this._interactionHandle){ -this.clearInteractionHandle(this._interactionHandle);}}, - - - - - - - - - - -immediatelyResetRouteStack:function(nextRouteStack){var _this3=this; -var destIndex=nextRouteStack.length-1; -this.setState({ -routeStack:nextRouteStack, -sceneConfigStack:nextRouteStack.map( -this.props.configureScene), - -presentedIndex:destIndex, -activeGesture:null, -transitionFromIndex:null, -transitionQueue:[]}, -function(){ -_this3._handleSpringUpdate();});}, - - - -_transitionTo:function(destIndex,velocity,jumpSpringTo,cb){ -if(destIndex===this.state.presentedIndex){ -return;} - -if(this.state.transitionFromIndex!==null){ -this.state.transitionQueue.push({ -destIndex:destIndex, -velocity:velocity, -cb:cb}); - -return;} - -this.state.transitionFromIndex=this.state.presentedIndex; -this.state.presentedIndex=destIndex; -this.state.transitionCb=cb; -this._onAnimationStart(); -if(AnimationsDebugModule){ -AnimationsDebugModule.startRecordingFps();} - -var sceneConfig=this.state.sceneConfigStack[this.state.transitionFromIndex]|| -this.state.sceneConfigStack[this.state.presentedIndex]; -invariant( -sceneConfig, -'Cannot configure scene at index '+this.state.transitionFromIndex); - -if(jumpSpringTo!=null){ -this.spring.setCurrentValue(jumpSpringTo);} - -this.spring.setOvershootClampingEnabled(true); -this.spring.getSpringConfig().friction=sceneConfig.springFriction; -this.spring.getSpringConfig().tension=sceneConfig.springTension; -this.spring.setVelocity(velocity||sceneConfig.defaultTransitionVelocity); -this.spring.setEndValue(1);}, - - - - - - -_handleSpringUpdate:function(){ -if(!this.isMounted()){ -return;} - - -if(this.state.transitionFromIndex!=null){ -this._transitionBetween( -this.state.transitionFromIndex, -this.state.presentedIndex, -this.spring.getCurrentValue());}else - -if(this.state.activeGesture!=null){ -var presentedToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._transitionBetween( -this.state.presentedIndex, -presentedToIndex, -this.spring.getCurrentValue());}}, - - - - - - - -_completeTransition:function(){ -if(!this.isMounted()){ -return;} - - -if(this.spring.getCurrentValue()!==1&&this.spring.getCurrentValue()!==0){ - - -if(this.state.pendingGestureProgress){ -this.state.pendingGestureProgress=null;} - -return;} - -this._onAnimationEnd(); -var presentedIndex=this.state.presentedIndex; -var didFocusRoute=this._subRouteFocus[presentedIndex]||this.state.routeStack[presentedIndex]; -this._emitDidFocus(didFocusRoute); -if(AnimationsDebugModule){ -AnimationsDebugModule.stopRecordingFps(Date.now());} - -this.state.transitionFromIndex=null; -this.spring.setCurrentValue(0).setAtRest(); -this._hideScenes(); -if(this.state.transitionCb){ -this.state.transitionCb(); -this.state.transitionCb=null;} - -if(this._interactionHandle){ -this.clearInteractionHandle(this._interactionHandle); -this._interactionHandle=null;} - -if(this.state.pendingGestureProgress){ - - -var gestureToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._enableScene(gestureToIndex); -this.spring.setEndValue(this.state.pendingGestureProgress); -return;} - -if(this.state.transitionQueue.length){ -var queuedTransition=this.state.transitionQueue.shift(); -this._enableScene(queuedTransition.destIndex); -this._emitWillFocus(this.state.routeStack[queuedTransition.destIndex]); -this._transitionTo( -queuedTransition.destIndex, -queuedTransition.velocity, -null, -queuedTransition.cb);}}, - - - - -_emitDidFocus:function(route){ -this.navigationContext.emit('didfocus',{route:route}); - -if(this.props.onDidFocus){ -this.props.onDidFocus(route);}}, - - - -_emitWillFocus:function(route){ -this.navigationContext.emit('willfocus',{route:route}); - -var navBar=this._navBar; -if(navBar&&navBar.handleWillFocus){ -navBar.handleWillFocus(route);} - -if(this.props.onWillFocus){ -this.props.onWillFocus(route);}}, - - - - - - -_hideScenes:function(){ -var gesturingToIndex=null; -if(this.state.activeGesture){ -gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);} - -for(var i=0;i=this.state.routeStack.length-1&& -gestureName==='jumpForward'; -return wouldOverswipeForward||wouldOverswipeBack;}, - - -_deltaForGestureAction:function(gestureAction){ -switch(gestureAction){ -case 'pop': -case 'jumpBack': -return -1; -case 'jumpForward': -return 1; -default: -invariant(false,'Unsupported gesture action '+gestureAction); -return;}}, - - - -_handlePanResponderRelease:function(e,gestureState){var _this4=this; -var sceneConfig=this.state.sceneConfigStack[this.state.presentedIndex]; -var releaseGestureAction=this.state.activeGesture; -if(!releaseGestureAction){ - -return;} - -var releaseGesture=sceneConfig.gestures[releaseGestureAction]; -var destIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -if(this.spring.getCurrentValue()===0){ - -this.spring.setCurrentValue(0).setAtRest(); -this._completeTransition(); -return;} - -var isTravelVertical=releaseGesture.direction==='top-to-bottom'||releaseGesture.direction==='bottom-to-top'; -var isTravelInverted=releaseGesture.direction==='right-to-left'||releaseGesture.direction==='bottom-to-top'; -var velocity,gestureDistance; -if(isTravelVertical){ -velocity=isTravelInverted?-gestureState.vy:gestureState.vy; -gestureDistance=isTravelInverted?-gestureState.dy:gestureState.dy;}else -{ -velocity=isTravelInverted?-gestureState.vx:gestureState.vx; -gestureDistance=isTravelInverted?-gestureState.dx:gestureState.dx;} - -var transitionVelocity=clamp(-10,velocity,10); -if(Math.abs(velocity)releaseGesture.fullDistance*releaseGesture.stillCompletionRatio; -transitionVelocity=hasGesturedEnoughToComplete?releaseGesture.snapVelocity:-releaseGesture.snapVelocity;} - -if(transitionVelocity<0||this._doesGestureOverswipe(releaseGestureAction)){ - - -if(this.state.transitionFromIndex==null){ - -var transitionBackToPresentedIndex=this.state.presentedIndex; - -this.state.presentedIndex=destIndex; -this._transitionTo( -transitionBackToPresentedIndex, --transitionVelocity, -1-this.spring.getCurrentValue());}}else - - -{ - -this._emitWillFocus(this.state.routeStack[destIndex]); -this._transitionTo( -destIndex, -transitionVelocity, -null, -function(){ -if(releaseGestureAction==='pop'){ -_this4._cleanScenesPastIndex(destIndex);}});} - - - - -this._detachGesture();}, - - -_handlePanResponderTerminate:function(e,gestureState){ -if(this.state.activeGesture==null){ -return;} - -var destIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._detachGesture(); -var transitionBackToPresentedIndex=this.state.presentedIndex; - -this.state.presentedIndex=destIndex; -this._transitionTo( -transitionBackToPresentedIndex, -null, -1-this.spring.getCurrentValue());}, - - - -_attachGesture:function(gestureId){ -this.state.activeGesture=gestureId; -var gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._enableScene(gesturingToIndex);}, - - -_detachGesture:function(){ -this.state.activeGesture=null; -this.state.pendingGestureProgress=null; -this._hideScenes();}, - - -_handlePanResponderMove:function(e,gestureState){ -if(this._isMoveGestureAttached!==undefined){ -invariant( -this._expectingGestureGrant, -'Responder granted unexpectedly.'); - -this._attachGesture(this._expectingGestureGrant); -this._onAnimationStart(); -this._expectingGestureGrant=undefined;} - - -var sceneConfig=this.state.sceneConfigStack[this.state.presentedIndex]; -if(this.state.activeGesture){ -var gesture=sceneConfig.gestures[this.state.activeGesture]; -return this._moveAttachedGesture(gesture,gestureState);} - -var matchedGesture=this._matchGestureAction(GESTURE_ACTIONS,sceneConfig.gestures,gestureState); -if(matchedGesture){ -this._attachGesture(matchedGesture);}}, - - - -_moveAttachedGesture:function(gesture,gestureState){ -var isTravelVertical=gesture.direction==='top-to-bottom'||gesture.direction==='bottom-to-top'; -var isTravelInverted=gesture.direction==='right-to-left'||gesture.direction==='bottom-to-top'; -var distance=isTravelVertical?gestureState.dy:gestureState.dx; -distance=isTravelInverted?-distance:distance; -var gestureDetectMovement=gesture.gestureDetectMovement; -var nextProgress=(distance-gestureDetectMovement)/( -gesture.fullDistance-gestureDetectMovement); -if(nextProgress<0&&gesture.isDetachable){ -var gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._transitionBetween(this.state.presentedIndex,gesturingToIndex,0); -this._detachGesture(); -if(this.state.pendingGestureProgress!=null){ -this.spring.setCurrentValue(0);} - -return;} - -if(this._doesGestureOverswipe(this.state.activeGesture)){ -var frictionConstant=gesture.overswipe.frictionConstant; -var frictionByDistance=gesture.overswipe.frictionByDistance; -var frictionRatio=1/(frictionConstant+Math.abs(nextProgress)*frictionByDistance); -nextProgress*=frictionRatio;} - -nextProgress=clamp(0,nextProgress,1); -if(this.state.transitionFromIndex!=null){ -this.state.pendingGestureProgress=nextProgress;}else -if(this.state.pendingGestureProgress){ -this.spring.setEndValue(nextProgress);}else -{ -this.spring.setCurrentValue(nextProgress);}}, - - - -_matchGestureAction:function(eligibleGestures,gestures,gestureState){var _this5=this; -if(!gestures){ -return null;} - -var matchedGesture=null; -eligibleGestures.some(function(gestureName,gestureIndex){ -var gesture=gestures[gestureName]; -if(!gesture){ -return;} - -if(gesture.overswipe==null&&_this5._doesGestureOverswipe(gestureName)){ - -return false;} - -var isTravelVertical=gesture.direction==='top-to-bottom'||gesture.direction==='bottom-to-top'; -var isTravelInverted=gesture.direction==='right-to-left'||gesture.direction==='bottom-to-top'; -var currentLoc=isTravelVertical?gestureState.moveY:gestureState.moveX; -var travelDist=isTravelVertical?gestureState.dy:gestureState.dx; -var oppositeAxisTravelDist= -isTravelVertical?gestureState.dx:gestureState.dy; -var edgeHitWidth=gesture.edgeHitWidth; -if(isTravelInverted){ -currentLoc=-currentLoc; -travelDist=-travelDist; -oppositeAxisTravelDist=-oppositeAxisTravelDist; -edgeHitWidth=isTravelVertical? --(SCREEN_HEIGHT-edgeHitWidth): --(SCREEN_WIDTH-edgeHitWidth);} - -var moveStartedInRegion=gesture.edgeHitWidth==null|| -currentLoc=gesture.gestureDetectMovement; -if(!moveTravelledFarEnough){ -return false;} - -var directionIsCorrect=Math.abs(travelDist)>Math.abs(oppositeAxisTravelDist)*gesture.directionRatio; -if(directionIsCorrect){ -matchedGesture=gestureName; -return true;}else -{ -_this5._eligibleGestures=_this5._eligibleGestures.slice().splice(gestureIndex,1);}}); - - -return matchedGesture||null;}, - - -_transitionSceneStyle:function(fromIndex,toIndex,progress,index){ -var viewAtIndex=this.refs['scene_'+index]; -if(viewAtIndex===null||viewAtIndex===undefined){ -return;} - - -var sceneConfigIndex=fromIndex=0&&fromIndex>=0){ -navBar.updateProgress(progress,fromIndex,toIndex);}}, - - - -_handleResponderTerminationRequest:function(){ -return false;}, - - -_getDestIndexWithinBounds:function(n){ -var currentIndex=this.state.presentedIndex; -var destIndex=currentIndex+n; -invariant( -destIndex>=0, -'Cannot jump before the first route.'); - -var maxIndex=this.state.routeStack.length-1; -invariant( -maxIndex>=destIndex, -'Cannot jump past the last route.'); - -return destIndex;}, - - -_jumpN:function(n){ -var destIndex=this._getDestIndexWithinBounds(n); -this._enableScene(destIndex); -this._emitWillFocus(this.state.routeStack[destIndex]); -this._transitionTo(destIndex);}, - - -jumpTo:function(route){ -var destIndex=this.state.routeStack.indexOf(route); -invariant( -destIndex!==-1, -'Cannot jump to route that is not in the route stack'); - -this._jumpN(destIndex-this.state.presentedIndex);}, - - -jumpForward:function(){ -this._jumpN(1);}, - - -jumpBack:function(){ -this._jumpN(-1);}, - - -push:function(route){var _this6=this; -invariant(!!route,'Must supply route to push'); -var activeLength=this.state.presentedIndex+1; -var activeStack=this.state.routeStack.slice(0,activeLength); -var activeAnimationConfigStack=this.state.sceneConfigStack.slice(0,activeLength); -var nextStack=activeStack.concat([route]); -var destIndex=nextStack.length-1; -var nextAnimationConfigStack=activeAnimationConfigStack.concat([ -this.props.configureScene(route)]); - -this._emitWillFocus(nextStack[destIndex]); -this.setState({ -routeStack:nextStack, -sceneConfigStack:nextAnimationConfigStack}, -function(){ -_this6._enableScene(destIndex); -_this6._transitionTo(destIndex);});}, - - - -_popN:function(n){var _this7=this; -if(n===0){ -return;} - -invariant( -this.state.presentedIndex-n>=0, -'Cannot pop below zero'); - -var popIndex=this.state.presentedIndex-n; -this._enableScene(popIndex); -this._emitWillFocus(this.state.routeStack[popIndex]); -this._transitionTo( -popIndex, -null, -null, -function(){ -_this7._cleanScenesPastIndex(popIndex);});}, - - - - -pop:function(){ -if(this.state.transitionQueue.length){ - - - - - - -return;} - - -if(this.state.presentedIndex>0){ -this._popN(1);}}, - - - - - - - - - -replaceAtIndex:function(route,index,cb){var _this8=this; -invariant(!!route,'Must supply route to replace'); -if(index<0){ -index+=this.state.routeStack.length;} - - -if(this.state.routeStack.length<=index){ -return;} - - -var nextRouteStack=this.state.routeStack.slice(); -var nextAnimationModeStack=this.state.sceneConfigStack.slice(); -nextRouteStack[index]=route; -nextAnimationModeStack[index]=this.props.configureScene(route); - -if(index===this.state.presentedIndex){ -this._emitWillFocus(route);} - -this.setState({ -routeStack:nextRouteStack, -sceneConfigStack:nextAnimationModeStack}, -function(){ -if(index===_this8.state.presentedIndex){ -_this8._emitDidFocus(route);} - -cb&&cb();});}, - - - - - - -replace:function(route){ -this.replaceAtIndex(route,this.state.presentedIndex);}, - - - - - -replacePrevious:function(route){ -this.replaceAtIndex(route,this.state.presentedIndex-1);}, - - -popToTop:function(){ -this.popToRoute(this.state.routeStack[0]);}, - - -popToRoute:function(route){ -var indexOfRoute=this.state.routeStack.indexOf(route); -invariant( -indexOfRoute!==-1, -'Calling popToRoute for a route that doesn\'t exist!'); - -var numToPop=this.state.presentedIndex-indexOfRoute; -this._popN(numToPop);}, - - -replacePreviousAndPop:function(route){ -if(this.state.routeStack.length<2){ -return;} - -this.replacePrevious(route); -this.pop();}, - - -resetTo:function(route){var _this9=this; -invariant(!!route,'Must supply route to push'); -this.replaceAtIndex(route,0,function(){ - - -if(_this9.state.presentedIndex>0){ -_this9._popN(_this9.state.presentedIndex);}});}, - - - - -getCurrentRoutes:function(){ - -return this.state.routeStack.slice();}, - - -_cleanScenesPastIndex:function(index){ -var newStackLength=index+1; - -if(newStackLength0){ - - -var args=Array.prototype.slice.call(arguments); -this._emitQueue.push(args); -return;} - - -this._emitCounter++; - -if(LegacyEventTypes.has(eventType)){ - -this.__emit( -eventType, -data, -null, -{ -defaultPrevented:false, -eventPhase:AT_TARGET, -propagationStopped:true, -target:this});}else - - -{ -var targets=[this]; -var parentTarget=this.parent; -while(parentTarget){ -targets.unshift(parentTarget); -parentTarget=parentTarget.parent;} - - -var propagationStopped=false; -var defaultPrevented=false; -var callback=function(event){ -propagationStopped=propagationStopped||event.isPropagationStopped(); -defaultPrevented=defaultPrevented||event.defaultPrevented;}; - - - -targets.some(function(currentTarget){ -if(propagationStopped){ -return true;} - - -var extraInfo={ -defaultPrevented:defaultPrevented, -eventPhase:CAPTURING_PHASE, -propagationStopped:propagationStopped, -target:_this}; - - -currentTarget.__emit(eventType,data,callback,extraInfo);}, -this); - - -targets.reverse().some(function(currentTarget){ -if(propagationStopped){ -return true;} - -var extraInfo={ -defaultPrevented:defaultPrevented, -eventPhase:BUBBLING_PHASE, -propagationStopped:propagationStopped, -target:_this}; - -currentTarget.__emit(eventType,data,callback,extraInfo);}, -this);} - - -if(didEmitCallback){ -var event=NavigationEvent.pool(eventType,this,data); -propagationStopped&&event.stopPropagation(); -defaultPrevented&&event.preventDefault(); -didEmitCallback.call(this,event); -event.dispose();} - - -this._emitCounter--; -while(this._emitQueue.length){ -var args=this._emitQueue.shift(); -this.emit.apply(this,args);}}},{key:'dispose',value:function dispose() - - - -{ - -this._bubbleEventEmitter&&this._bubbleEventEmitter.removeAllListeners(); -this._captureEventEmitter&&this._captureEventEmitter.removeAllListeners(); -this._bubbleEventEmitter=null; -this._captureEventEmitter=null; -this._currentRoute=null;}},{key:'__emit',value:function __emit( - - - - -eventType, -data, -didEmitCallback, -extraInfo) -{ -var emitter; -switch(extraInfo.eventPhase){ -case CAPTURING_PHASE: -emitter=this._captureEventEmitter; -break; - -case AT_TARGET: -emitter=this._bubbleEventEmitter; -break; - -case BUBBLING_PHASE: -emitter=this._bubbleEventEmitter; -break; - -default: -invariant(false,'invalid event phase %s',extraInfo.eventPhase);} - - -if(extraInfo.target===this){ - -extraInfo.eventPhase=AT_TARGET;} - - -if(emitter){ -emitter.emit( -eventType, -data, -didEmitCallback, -extraInfo);}}},{key:'_onFocus',value:function _onFocus( - - - - -event){ -invariant( -event.data&&event.data.hasOwnProperty('route'), -'event type "%s" should provide route', -event.type); - - -this._currentRoute=event.data.route;}},{key:'parent',get:function(){var parent=this.__node.getParent();return parent?parent.getValue():null;}},{key:'top',get:function(){var result=null;var parentNode=this.__node.getParent();while(parentNode){result=parentNode.getValue();parentNode=parentNode.getParent();}return result;}},{key:'currentRoute',get:function(){return this._currentRoute;}}]);return NavigationContext;})(); - - - -module.exports=NavigationContext; -}); -__d('NavigationEvent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var invariant=require('invariant');var - -NavigationEventPool=(function(){ - - -function NavigationEventPool(){babelHelpers.classCallCheck(this,NavigationEventPool); -this._list=[];}babelHelpers.createClass(NavigationEventPool,[{key:'get',value:function get( - - -type,currentTarget,data){ -var event; -if(this._list.length>0){ -event=this._list.pop(); -event.constructor.call(event,type,currentTarget,data);}else -{ -event=new NavigationEvent(type,currentTarget,data);} - -return event;}},{key:'put',value:function put( - - -event){ -this._list.push(event);}}]);return NavigationEventPool;})(); - - - -var _navigationEventPool=new NavigationEventPool();var - - - - - - - - - - - - - - - - - - - - - - - -NavigationEvent=(function(){babelHelpers.createClass(NavigationEvent,null,[{key:'pool',value:function pool( - - - - - - - - - - - - - - - - - - -type,currentTarget,data){ -return _navigationEventPool.get(type,currentTarget,data);}}]); - - -function NavigationEvent(type,currentTarget,data){babelHelpers.classCallCheck(this,NavigationEvent); -this.target=currentTarget; -this.eventPhase=NavigationEvent.NONE; - -this._type=type; -this._currentTarget=currentTarget; -this._data=data; -this._defaultPrevented=false; -this._disposed=false; -this._propagationStopped=false;}babelHelpers.createClass(NavigationEvent,[{key:'preventDefault',value:function preventDefault() - - - - - - - - - - - - - - - - - - - - - - -{ -this._defaultPrevented=true;}},{key:'stopPropagation',value:function stopPropagation() - - -{ -this._propagationStopped=true;}},{key:'stop',value:function stop() - - -{ -this.preventDefault(); -this.stopPropagation();}},{key:'isPropagationStopped',value:function isPropagationStopped() - - -{ -return this._propagationStopped;}},{key:'dispose',value:function dispose() - - - - - - - -{ -invariant(!this._disposed,'NavigationEvent is already disposed'); -this._disposed=true; - - -this.target=null; -this.eventPhase=NavigationEvent.NONE; -this._type=null; -this._currentTarget=null; -this._data=null; -this._defaultPrevented=false; - - -_navigationEventPool.put(this);}},{key:'type',get:function(){return this._type;}},{key:'currentTarget',get:function(){return this._currentTarget;}},{key:'data',get:function(){return this._data;}},{key:'defaultPrevented',get:function(){return this._defaultPrevented;}}]);return NavigationEvent;})(); - - - - - - - - - - -NavigationEvent.NONE=0; - - -NavigationEvent.CAPTURING_PHASE=1; - - - -NavigationEvent.AT_TARGET=2; - - - - - -NavigationEvent.BUBBLING_PHASE=3; - -module.exports=NavigationEvent; -}); -__d('NavigationEventEmitter',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var EventEmitter=require('EventEmitter'); -var NavigationEvent=require('NavigationEvent');var - - - - - - - - -NavigationEventEmitter=(function(_EventEmitter){babelHelpers.inherits(NavigationEventEmitter,_EventEmitter); - - - - -function NavigationEventEmitter(target){babelHelpers.classCallCheck(this,NavigationEventEmitter);var _this=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(NavigationEventEmitter).call(this)); - -_this._emitting=false; -_this._emitQueue=[]; -_this._target=target;return _this;}babelHelpers.createClass(NavigationEventEmitter,[{key:'emit',value:function emit( - - - -eventType, -data, -didEmitCallback, -extraInfo) -{ -if(this._emitting){ - - -var args=Array.prototype.slice.call(arguments); -this._emitQueue.unshift(args); -return;} - - -this._emitting=true; - -var event=NavigationEvent.pool(eventType,this._target,data); - -if(extraInfo){ -if(extraInfo.target){ -event.target=extraInfo.target;} - - -if(extraInfo.eventPhase){ -event.eventPhase=extraInfo.eventPhase;} - - -if(extraInfo.defaultPrevented){ -event.preventDefault();} - - -if(extraInfo.propagationStopped){ -event.stopPropagation();}} - - - - - -babelHelpers.get(Object.getPrototypeOf(NavigationEventEmitter.prototype),'emit',this).call(this,String(eventType),event); - -if(typeof didEmitCallback==='function'){ -didEmitCallback.call(this._target,event);} - -event.dispose(); - -this._emitting=false; - -while(this._emitQueue.length){ -var args=this._emitQueue.shift(); -this.emit.apply(this,args);}}}]);return NavigationEventEmitter;})(EventEmitter); - - - - -module.exports=NavigationEventEmitter; -}); -__d('NavigationTreeNode',function(global, require, module, exports) { 'use strict'; - - - - - - - - - -var invariant=require('invariant'); -var immutable=require('immutable/dist/immutable.js');var - -List=immutable.List;var - - - - - - -NavigationTreeNode=(function(){ - - - - - - -function NavigationTreeNode(value){babelHelpers.classCallCheck(this,NavigationTreeNode); -this.__parent=null; -this._children=new List(); -this._value=value;}babelHelpers.createClass(NavigationTreeNode,[{key:'getValue',value:function getValue() - - -{ -return this._value;}},{key:'getParent',value:function getParent() - - -{ -return this.__parent;}},{key:'getChildrenCount',value:function getChildrenCount() - - -{ -return this._children.size;}},{key:'getChildAt',value:function getChildAt( - - -index){ -return index>-1&&index-1, -'The node to be removed is not a child of this node.'); - - -child.__parent=null; - -this._children=this._children.splice(index,1);}},{key:'indexOf',value:function indexOf( - - -child){ -return this._children.indexOf(child);}},{key:'forEach',value:function forEach( - - -callback,context){ -this._children.forEach(callback,context);}},{key:'map',value:function map( - - -callback,context){ -return this._children.map(callback,context).toJS();}},{key:'some',value:function some( - - -callback,context){ -return this._children.some(callback,context);}}]);return NavigationTreeNode;})(); - - - - -module.exports=NavigationTreeNode; -}); -__d('immutable/dist/immutable.js',function(global, require, module, exports) { ( - - - - - - - - -function(global,factory){ -typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(): -typeof define==='function'&&define.amd?define(factory): -global.Immutable=factory();})( -this,function(){'use strict';var SLICE$0=Array.prototype.slice; - -function createClass(ctor,superClass){ -if(superClass){ -ctor.prototype=Object.create(superClass.prototype);} - -ctor.prototype.constructor=ctor;} - - -function Iterable(value){ -return isIterable(value)?value:Seq(value);} - - - -createClass(KeyedIterable,Iterable); -function KeyedIterable(value){ -return isKeyed(value)?value:KeyedSeq(value);} - - - -createClass(IndexedIterable,Iterable); -function IndexedIterable(value){ -return isIndexed(value)?value:IndexedSeq(value);} - - - -createClass(SetIterable,Iterable); -function SetIterable(value){ -return isIterable(value)&&!isAssociative(value)?value:SetSeq(value);} - - - - -function isIterable(maybeIterable){ -return !!(maybeIterable&&maybeIterable[IS_ITERABLE_SENTINEL]);} - - -function isKeyed(maybeKeyed){ -return !!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]);} - - -function isIndexed(maybeIndexed){ -return !!(maybeIndexed&&maybeIndexed[IS_INDEXED_SENTINEL]);} - - -function isAssociative(maybeAssociative){ -return isKeyed(maybeAssociative)||isIndexed(maybeAssociative);} - - -function isOrdered(maybeOrdered){ -return !!(maybeOrdered&&maybeOrdered[IS_ORDERED_SENTINEL]);} - - -Iterable.isIterable=isIterable; -Iterable.isKeyed=isKeyed; -Iterable.isIndexed=isIndexed; -Iterable.isAssociative=isAssociative; -Iterable.isOrdered=isOrdered; - -Iterable.Keyed=KeyedIterable; -Iterable.Indexed=IndexedIterable; -Iterable.Set=SetIterable; - - -var IS_ITERABLE_SENTINEL='@@__IMMUTABLE_ITERABLE__@@'; -var IS_KEYED_SENTINEL='@@__IMMUTABLE_KEYED__@@'; -var IS_INDEXED_SENTINEL='@@__IMMUTABLE_INDEXED__@@'; -var IS_ORDERED_SENTINEL='@@__IMMUTABLE_ORDERED__@@'; - - -var DELETE='delete'; - - -var SHIFT=5; -var SIZE=1<>>0; -if(''+uint32Index!==index||uint32Index===4294967295){ -return NaN;} - -index=uint32Index;} - -return index<0?ensureSize(iter)+index:index;} - - -function returnTrue(){ -return true;} - - -function wholeSlice(begin,end,size){ -return (begin===0||size!==undefined&&begin<=-size)&&( -end===undefined||size!==undefined&&end>=size);} - - -function resolveBegin(begin,size){ -return resolveIndex(begin,size,0);} - - -function resolveEnd(end,size){ -return resolveIndex(end,size,size);} - - -function resolveIndex(index,size,defaultIndex){ -return index===undefined? -defaultIndex: -index<0? -Math.max(0,size+index): -size===undefined? -index: -Math.min(size,index);} - - - - -var ITERATE_KEYS=0; -var ITERATE_VALUES=1; -var ITERATE_ENTRIES=2; - -var REAL_ITERATOR_SYMBOL=typeof Symbol==='function'&&Symbol.iterator; -var FAUX_ITERATOR_SYMBOL='@@iterator'; - -var ITERATOR_SYMBOL=REAL_ITERATOR_SYMBOL||FAUX_ITERATOR_SYMBOL; - - -function Iterator(next){ -this.next=next;} - - -Iterator.prototype.toString=function(){ -return '[Iterator]';}; - - - -Iterator.KEYS=ITERATE_KEYS; -Iterator.VALUES=ITERATE_VALUES; -Iterator.ENTRIES=ITERATE_ENTRIES; - -Iterator.prototype.inspect= -Iterator.prototype.toSource=function(){return this.toString();}; -Iterator.prototype[ITERATOR_SYMBOL]=function(){ -return this;}; - - - -function iteratorValue(type,k,v,iteratorResult){ -var value=type===0?k:type===1?v:[k,v]; -iteratorResult?iteratorResult.value=value:iteratorResult={ -value:value,done:false}; - -return iteratorResult;} - - -function iteratorDone(){ -return {value:undefined,done:true};} - - -function hasIterator(maybeIterable){ -return !!getIteratorFn(maybeIterable);} - - -function isIterator(maybeIterator){ -return maybeIterator&&typeof maybeIterator.next==='function';} - - -function getIterator(iterable){ -var iteratorFn=getIteratorFn(iterable); -return iteratorFn&&iteratorFn.call(iterable);} - - -function getIteratorFn(iterable){ -var iteratorFn=iterable&&( -REAL_ITERATOR_SYMBOL&&iterable[REAL_ITERATOR_SYMBOL]|| -iterable[FAUX_ITERATOR_SYMBOL]); - -if(typeof iteratorFn==='function'){ -return iteratorFn;}} - - - -function isArrayLike(value){ -return value&&typeof value.length==='number';} - - -createClass(Seq,Iterable); -function Seq(value){ -return value===null||value===undefined?emptySequence(): -isIterable(value)?value.toSeq():seqFromValue(value);} - - -Seq.of=function(){ -return Seq(arguments);}; - - -Seq.prototype.toSeq=function(){ -return this;}; - - -Seq.prototype.toString=function(){ -return this.__toString('Seq {','}');}; - - -Seq.prototype.cacheResult=function(){ -if(!this._cache&&this.__iterateUncached){ -this._cache=this.entrySeq().toArray(); -this.size=this._cache.length;} - -return this;}; - - - - -Seq.prototype.__iterate=function(fn,reverse){ -return seqIterate(this,fn,reverse,true);}; - - - - -Seq.prototype.__iterator=function(type,reverse){ -return seqIterator(this,type,reverse,true);}; - - - - -createClass(KeyedSeq,Seq); -function KeyedSeq(value){ -return value===null||value===undefined? -emptySequence().toKeyedSeq(): -isIterable(value)? -isKeyed(value)?value.toSeq():value.fromEntrySeq(): -keyedSeqFromValue(value);} - - -KeyedSeq.prototype.toKeyedSeq=function(){ -return this;}; - - - - -createClass(IndexedSeq,Seq); -function IndexedSeq(value){ -return value===null||value===undefined?emptySequence(): -!isIterable(value)?indexedSeqFromValue(value): -isKeyed(value)?value.entrySeq():value.toIndexedSeq();} - - -IndexedSeq.of=function(){ -return IndexedSeq(arguments);}; - - -IndexedSeq.prototype.toIndexedSeq=function(){ -return this;}; - - -IndexedSeq.prototype.toString=function(){ -return this.__toString('Seq [',']');}; - - -IndexedSeq.prototype.__iterate=function(fn,reverse){ -return seqIterate(this,fn,reverse,false);}; - - -IndexedSeq.prototype.__iterator=function(type,reverse){ -return seqIterator(this,type,reverse,false);}; - - - - -createClass(SetSeq,Seq); -function SetSeq(value){ -return ( -value===null||value===undefined?emptySequence(): -!isIterable(value)?indexedSeqFromValue(value): -isKeyed(value)?value.entrySeq():value). -toSetSeq();} - - -SetSeq.of=function(){ -return SetSeq(arguments);}; - - -SetSeq.prototype.toSetSeq=function(){ -return this;}; - - - - -Seq.isSeq=isSeq; -Seq.Keyed=KeyedSeq; -Seq.Set=SetSeq; -Seq.Indexed=IndexedSeq; - -var IS_SEQ_SENTINEL='@@__IMMUTABLE_SEQ__@@'; - -Seq.prototype[IS_SEQ_SENTINEL]=true; - - - -createClass(ArraySeq,IndexedSeq); -function ArraySeq(array){ -this._array=array; -this.size=array.length;} - - -ArraySeq.prototype.get=function(index,notSetValue){ -return this.has(index)?this._array[wrapIndex(this,index)]:notSetValue;}; - - -ArraySeq.prototype.__iterate=function(fn,reverse){ -var array=this._array; -var maxIndex=array.length-1; -for(var ii=0;ii<=maxIndex;ii++){ -if(fn(array[reverse?maxIndex-ii:ii],ii,this)===false){ -return ii+1;}} - - -return ii;}; - - -ArraySeq.prototype.__iterator=function(type,reverse){ -var array=this._array; -var maxIndex=array.length-1; -var ii=0; -return new Iterator(function() -{return ii>maxIndex? -iteratorDone(): -iteratorValue(type,ii,array[reverse?maxIndex-ii++:ii++]);});}; - - - - - -createClass(ObjectSeq,KeyedSeq); -function ObjectSeq(object){ -var keys=Object.keys(object); -this._object=object; -this._keys=keys; -this.size=keys.length;} - - -ObjectSeq.prototype.get=function(key,notSetValue){ -if(notSetValue!==undefined&&!this.has(key)){ -return notSetValue;} - -return this._object[key];}; - - -ObjectSeq.prototype.has=function(key){ -return this._object.hasOwnProperty(key);}; - - -ObjectSeq.prototype.__iterate=function(fn,reverse){ -var object=this._object; -var keys=this._keys; -var maxIndex=keys.length-1; -for(var ii=0;ii<=maxIndex;ii++){ -var key=keys[reverse?maxIndex-ii:ii]; -if(fn(object[key],key,this)===false){ -return ii+1;}} - - -return ii;}; - - -ObjectSeq.prototype.__iterator=function(type,reverse){ -var object=this._object; -var keys=this._keys; -var maxIndex=keys.length-1; -var ii=0; -return new Iterator(function(){ -var key=keys[reverse?maxIndex-ii:ii]; -return ii++>maxIndex? -iteratorDone(): -iteratorValue(type,key,object[key]);});}; - - - -ObjectSeq.prototype[IS_ORDERED_SENTINEL]=true; - - -createClass(IterableSeq,IndexedSeq); -function IterableSeq(iterable){ -this._iterable=iterable; -this.size=iterable.length||iterable.size;} - - -IterableSeq.prototype.__iterateUncached=function(fn,reverse){ -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var iterable=this._iterable; -var iterator=getIterator(iterable); -var iterations=0; -if(isIterator(iterator)){ -var step; -while(!(step=iterator.next()).done){ -if(fn(step.value,iterations++,this)===false){ -break;}}} - - - -return iterations;}; - - -IterableSeq.prototype.__iteratorUncached=function(type,reverse){ -if(reverse){ -return this.cacheResult().__iterator(type,reverse);} - -var iterable=this._iterable; -var iterator=getIterator(iterable); -if(!isIterator(iterator)){ -return new Iterator(iteratorDone);} - -var iterations=0; -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step:iteratorValue(type,iterations++,step.value);});}; - - - - - -createClass(IteratorSeq,IndexedSeq); -function IteratorSeq(iterator){ -this._iterator=iterator; -this._iteratorCache=[];} - - -IteratorSeq.prototype.__iterateUncached=function(fn,reverse){ -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var iterator=this._iterator; -var cache=this._iteratorCache; -var iterations=0; -while(iterations=cache.length){ -var step=iterator.next(); -if(step.done){ -return step;} - -cache[iterations]=step.value;} - -return iteratorValue(type,iterations,cache[iterations++]);});}; - - - - - - - - -function isSeq(maybeSeq){ -return !!(maybeSeq&&maybeSeq[IS_SEQ_SENTINEL]);} - - -var EMPTY_SEQ; - -function emptySequence(){ -return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]));} - - -function keyedSeqFromValue(value){ -var seq= -Array.isArray(value)?new ArraySeq(value).fromEntrySeq(): -isIterator(value)?new IteratorSeq(value).fromEntrySeq(): -hasIterator(value)?new IterableSeq(value).fromEntrySeq(): -typeof value==='object'?new ObjectSeq(value): -undefined; -if(!seq){ -throw new TypeError( -'Expected Array or iterable object of [k, v] entries, '+ -'or keyed object: '+value);} - - -return seq;} - - -function indexedSeqFromValue(value){ -var seq=maybeIndexedSeqFromValue(value); -if(!seq){ -throw new TypeError( -'Expected Array or iterable object of values: '+value);} - - -return seq;} - - -function seqFromValue(value){ -var seq=maybeIndexedSeqFromValue(value)|| -typeof value==='object'&&new ObjectSeq(value); -if(!seq){ -throw new TypeError( -'Expected Array or iterable object of values, or keyed object: '+value);} - - -return seq;} - - -function maybeIndexedSeqFromValue(value){ -return ( -isArrayLike(value)?new ArraySeq(value): -isIterator(value)?new IteratorSeq(value): -hasIterator(value)?new IterableSeq(value): -undefined);} - - - -function seqIterate(seq,fn,reverse,useKeys){ -var cache=seq._cache; -if(cache){ -var maxIndex=cache.length-1; -for(var ii=0;ii<=maxIndex;ii++){ -var entry=cache[reverse?maxIndex-ii:ii]; -if(fn(entry[1],useKeys?entry[0]:ii,seq)===false){ -return ii+1;}} - - -return ii;} - -return seq.__iterateUncached(fn,reverse);} - - -function seqIterator(seq,type,reverse,useKeys){ -var cache=seq._cache; -if(cache){ -var maxIndex=cache.length-1; -var ii=0; -return new Iterator(function(){ -var entry=cache[reverse?maxIndex-ii:ii]; -return ii++>maxIndex? -iteratorDone(): -iteratorValue(type,useKeys?entry[0]:ii-1,entry[1]);});} - - -return seq.__iteratorUncached(type,reverse);} - - -function fromJS(json,converter){ -return converter? -fromJSWith(converter,json,'',{'':json}): -fromJSDefault(json);} - - -function fromJSWith(converter,json,key,parentJSON){ -if(Array.isArray(json)){ -return converter.call(parentJSON,key,IndexedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json);}));} - -if(isPlainObj(json)){ -return converter.call(parentJSON,key,KeyedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json);}));} - -return json;} - - -function fromJSDefault(json){ -if(Array.isArray(json)){ -return IndexedSeq(json).map(fromJSDefault).toList();} - -if(isPlainObj(json)){ -return KeyedSeq(json).map(fromJSDefault).toMap();} - -return json;} - - -function isPlainObj(value){ -return value&&(value.constructor===Object||value.constructor===undefined);} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function is(valueA,valueB){ -if(valueA===valueB||valueA!==valueA&&valueB!==valueB){ -return true;} - -if(!valueA||!valueB){ -return false;} - -if(typeof valueA.valueOf==='function'&& -typeof valueB.valueOf==='function'){ -valueA=valueA.valueOf(); -valueB=valueB.valueOf(); -if(valueA===valueB||valueA!==valueA&&valueB!==valueB){ -return true;} - -if(!valueA||!valueB){ -return false;}} - - -if(typeof valueA.equals==='function'&& -typeof valueB.equals==='function'&& -valueA.equals(valueB)){ -return true;} - -return false;} - - -function deepEqual(a,b){ -if(a===b){ -return true;} - - -if( -!isIterable(b)|| -a.size!==undefined&&b.size!==undefined&&a.size!==b.size|| -a.__hash!==undefined&&b.__hash!==undefined&&a.__hash!==b.__hash|| -isKeyed(a)!==isKeyed(b)|| -isIndexed(a)!==isIndexed(b)|| -isOrdered(a)!==isOrdered(b)) -{ -return false;} - - -if(a.size===0&&b.size===0){ -return true;} - - -var notAssociative=!isAssociative(a); - -if(isOrdered(a)){ -var entries=a.entries(); -return b.every(function(v,k){ -var entry=entries.next().value; -return entry&&is(entry[1],v)&&(notAssociative||is(entry[0],k));})&& -entries.next().done;} - - -var flipped=false; - -if(a.size===undefined){ -if(b.size===undefined){ -if(typeof a.cacheResult==='function'){ -a.cacheResult();}}else - -{ -flipped=true; -var _=a; -a=b; -b=_;}} - - - -var allEqual=true; -var bSize=b.__iterate(function(v,k){ -if(notAssociative?!a.has(v): -flipped?!is(v,a.get(k,NOT_SET)):!is(a.get(k,NOT_SET),v)){ -allEqual=false; -return false;}}); - - - -return allEqual&&a.size===bSize;} - - -createClass(Repeat,IndexedSeq); - -function Repeat(value,times){ -if(!(this instanceof Repeat)){ -return new Repeat(value,times);} - -this._value=value; -this.size=times===undefined?Infinity:Math.max(0,times); -if(this.size===0){ -if(EMPTY_REPEAT){ -return EMPTY_REPEAT;} - -EMPTY_REPEAT=this;}} - - - -Repeat.prototype.toString=function(){ -if(this.size===0){ -return 'Repeat []';} - -return 'Repeat [ '+this._value+' '+this.size+' times ]';}; - - -Repeat.prototype.get=function(index,notSetValue){ -return this.has(index)?this._value:notSetValue;}; - - -Repeat.prototype.includes=function(searchValue){ -return is(this._value,searchValue);}; - - -Repeat.prototype.slice=function(begin,end){ -var size=this.size; -return wholeSlice(begin,end,size)?this: -new Repeat(this._value,resolveEnd(end,size)-resolveBegin(begin,size));}; - - -Repeat.prototype.reverse=function(){ -return this;}; - - -Repeat.prototype.indexOf=function(searchValue){ -if(is(this._value,searchValue)){ -return 0;} - -return -1;}; - - -Repeat.prototype.lastIndexOf=function(searchValue){ -if(is(this._value,searchValue)){ -return this.size;} - -return -1;}; - - -Repeat.prototype.__iterate=function(fn,reverse){ -for(var ii=0;ii1?' by '+this._step:'')+ -' ]';}; - - -Range.prototype.get=function(index,notSetValue){ -return this.has(index)? -this._start+wrapIndex(this,index)*this._step: -notSetValue;}; - - -Range.prototype.includes=function(searchValue){ -var possibleIndex=(searchValue-this._start)/this._step; -return possibleIndex>=0&& -possibleIndex=0&&indexmaxIndex?iteratorDone():iteratorValue(type,ii++,v);});}; - - - -Range.prototype.equals=function(other){ -return other instanceof Range? -this._start===other._start&& -this._end===other._end&& -this._step===other._step: -deepEqual(this,other);}; - - - -var EMPTY_RANGE; - -createClass(Collection,Iterable); -function Collection(){ -throw TypeError('Abstract');} - - - -createClass(KeyedCollection,Collection);function KeyedCollection(){} - -createClass(IndexedCollection,Collection);function IndexedCollection(){} - -createClass(SetCollection,Collection);function SetCollection(){} - - -Collection.Keyed=KeyedCollection; -Collection.Indexed=IndexedCollection; -Collection.Set=SetCollection; - -var imul= -typeof Math.imul==='function'&&Math.imul(0xffffffff,2)===-2? -Math.imul: -function imul(a,b){ -a=a|0; -b=b|0; -var c=a&0xffff; -var d=b&0xffff; - -return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0;}; - - - - - - -function smi(i32){ -return i32>>>1&0x40000000|i32&0xBFFFFFFF;} - - -function hash(o){ -if(o===false||o===null||o===undefined){ -return 0;} - -if(typeof o.valueOf==='function'){ -o=o.valueOf(); -if(o===false||o===null||o===undefined){ -return 0;}} - - -if(o===true){ -return 1;} - -var type=typeof o; -if(type==='number'){ -var h=o|0; -if(h!==o){ -h^=o*0xFFFFFFFF;} - -while(o>0xFFFFFFFF){ -o/=0xFFFFFFFF; -h^=o;} - -return smi(h);} - -if(type==='string'){ -return o.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(o):hashString(o);} - -if(typeof o.hashCode==='function'){ -return o.hashCode();} - -if(type==='object'){ -return hashJSObj(o);} - -if(typeof o.toString==='function'){ -return hashString(o.toString());} - -throw new Error('Value type '+type+' cannot be hashed.');} - - -function cachedHashString(string){ -var hash=stringHashCache[string]; -if(hash===undefined){ -hash=hashString(string); -if(STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE){ -STRING_HASH_CACHE_SIZE=0; -stringHashCache={};} - -STRING_HASH_CACHE_SIZE++; -stringHashCache[string]=hash;} - -return hash;} - - - -function hashString(string){ - - - - - - -var hash=0; -for(var ii=0;ii0){ -switch(node.nodeType){ -case 1: -return node.uniqueID; -case 9: -return node.documentElement&&node.documentElement.uniqueID;}}} - - - - - -var usingWeakMap=typeof WeakMap==='function'; -var weakMap; -if(usingWeakMap){ -weakMap=new WeakMap();} - - -var objHashUID=0; - -var UID_HASH_KEY='__immutablehash__'; -if(typeof Symbol==='function'){ -UID_HASH_KEY=Symbol(UID_HASH_KEY);} - - -var STRING_HASH_CACHE_MIN_STRLEN=16; -var STRING_HASH_CACHE_MAX_SIZE=255; -var STRING_HASH_CACHE_SIZE=0; -var stringHashCache={}; - -function assertNotInfinite(size){ -invariant( -size!==Infinity, -'Cannot perform this action with an infinite size.');} - - - -createClass(Map,KeyedCollection); - - - -function Map(value){ -return value===null||value===undefined?emptyMap(): -isMap(value)&&!isOrdered(value)?value: -emptyMap().withMutations(function(map){ -var iter=KeyedIterable(value); -assertNotInfinite(iter.size); -iter.forEach(function(v,k){return map.set(k,v);});});} - - - -Map.prototype.toString=function(){ -return this.__toString('Map {','}');}; - - - - -Map.prototype.get=function(k,notSetValue){ -return this._root? -this._root.get(0,undefined,k,notSetValue): -notSetValue;}; - - - - -Map.prototype.set=function(k,v){ -return updateMap(this,k,v);}; - - -Map.prototype.setIn=function(keyPath,v){ -return this.updateIn(keyPath,NOT_SET,function(){return v;});}; - - -Map.prototype.remove=function(k){ -return updateMap(this,k,NOT_SET);}; - - -Map.prototype.deleteIn=function(keyPath){ -return this.updateIn(keyPath,function(){return NOT_SET;});}; - - -Map.prototype.update=function(k,notSetValue,updater){ -return arguments.length===1? -k(this): -this.updateIn([k],notSetValue,updater);}; - - -Map.prototype.updateIn=function(keyPath,notSetValue,updater){ -if(!updater){ -updater=notSetValue; -notSetValue=undefined;} - -var updatedValue=updateInDeepMap( -this, -forceIterator(keyPath), -notSetValue, -updater); - -return updatedValue===NOT_SET?undefined:updatedValue;}; - - -Map.prototype.clear=function(){ -if(this.size===0){ -return this;} - -if(this.__ownerID){ -this.size=0; -this._root=null; -this.__hash=undefined; -this.__altered=true; -return this;} - -return emptyMap();}; - - - - -Map.prototype.merge=function(){ -return mergeIntoMapWith(this,undefined,arguments);}; - - -Map.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1); -return mergeIntoMapWith(this,merger,iters);}; - - -Map.prototype.mergeIn=function(keyPath){var iters=SLICE$0.call(arguments,1); -return this.updateIn( -keyPath, -emptyMap(), -function(m){return typeof m.merge==='function'? -m.merge.apply(m,iters): -iters[iters.length-1];});}; - - - -Map.prototype.mergeDeep=function(){ -return mergeIntoMapWith(this,deepMerger,arguments);}; - - -Map.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1); -return mergeIntoMapWith(this,deepMergerWith(merger),iters);}; - - -Map.prototype.mergeDeepIn=function(keyPath){var iters=SLICE$0.call(arguments,1); -return this.updateIn( -keyPath, -emptyMap(), -function(m){return typeof m.mergeDeep==='function'? -m.mergeDeep.apply(m,iters): -iters[iters.length-1];});}; - - - -Map.prototype.sort=function(comparator){ - -return OrderedMap(sortFactory(this,comparator));}; - - -Map.prototype.sortBy=function(mapper,comparator){ - -return OrderedMap(sortFactory(this,comparator,mapper));}; - - - - -Map.prototype.withMutations=function(fn){ -var mutable=this.asMutable(); -fn(mutable); -return mutable.wasAltered()?mutable.__ensureOwner(this.__ownerID):this;}; - - -Map.prototype.asMutable=function(){ -return this.__ownerID?this:this.__ensureOwner(new OwnerID());}; - - -Map.prototype.asImmutable=function(){ -return this.__ensureOwner();}; - - -Map.prototype.wasAltered=function(){ -return this.__altered;}; - - -Map.prototype.__iterator=function(type,reverse){ -return new MapIterator(this,type,reverse);}; - - -Map.prototype.__iterate=function(fn,reverse){var this$0=this; -var iterations=0; -this._root&&this._root.iterate(function(entry){ -iterations++; -return fn(entry[1],entry[0],this$0);}, -reverse); -return iterations;}; - - -Map.prototype.__ensureOwner=function(ownerID){ -if(ownerID===this.__ownerID){ -return this;} - -if(!ownerID){ -this.__ownerID=ownerID; -this.__altered=false; -return this;} - -return makeMap(this.size,this._root,ownerID,this.__hash);}; - - - -function isMap(maybeMap){ -return !!(maybeMap&&maybeMap[IS_MAP_SENTINEL]);} - - -Map.isMap=isMap; - -var IS_MAP_SENTINEL='@@__IMMUTABLE_MAP__@@'; - -var MapPrototype=Map.prototype; -MapPrototype[IS_MAP_SENTINEL]=true; -MapPrototype[DELETE]=MapPrototype.remove; -MapPrototype.removeIn=MapPrototype.deleteIn; - - - - - - -function ArrayMapNode(ownerID,entries){ -this.ownerID=ownerID; -this.entries=entries;} - - -ArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){ -var entries=this.entries; -for(var ii=0,len=entries.length;ii=MAX_ARRAY_MAP_SIZE){ -return createNodes(ownerID,entries,key,value);} - - -var isEditable=ownerID&&ownerID===this.ownerID; -var newEntries=isEditable?entries:arrCopy(entries); - -if(exists){ -if(removed){ -idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop();}else -{ -newEntries[idx]=[key,value];}}else - -{ -newEntries.push([key,value]);} - - -if(isEditable){ -this.entries=newEntries; -return this;} - - -return new ArrayMapNode(ownerID,newEntries);}; - - - - - -function BitmapIndexedNode(ownerID,bitmap,nodes){ -this.ownerID=ownerID; -this.bitmap=bitmap; -this.nodes=nodes;} - - -BitmapIndexedNode.prototype.get=function(shift,keyHash,key,notSetValue){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var bit=1<<((shift===0?keyHash:keyHash>>>shift)&MASK); -var bitmap=this.bitmap; -return (bitmap&bit)===0?notSetValue: -this.nodes[popCount(bitmap&bit-1)].get(shift+SHIFT,keyHash,key,notSetValue);}; - - -BitmapIndexedNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var keyHashFrag=(shift===0?keyHash:keyHash>>>shift)&MASK; -var bit=1<=MAX_BITMAP_INDEXED_SIZE){ -return expandNodes(ownerID,nodes,bitmap,keyHashFrag,newNode);} - - -if(exists&&!newNode&&nodes.length===2&&isLeafNode(nodes[idx^1])){ -return nodes[idx^1];} - - -if(exists&&newNode&&nodes.length===1&&isLeafNode(newNode)){ -return newNode;} - - -var isEditable=ownerID&&ownerID===this.ownerID; -var newBitmap=exists?newNode?bitmap:bitmap^bit:bitmap|bit; -var newNodes=exists?newNode? -setIn(nodes,idx,newNode,isEditable): -spliceOut(nodes,idx,isEditable): -spliceIn(nodes,idx,newNode,isEditable); - -if(isEditable){ -this.bitmap=newBitmap; -this.nodes=newNodes; -return this;} - - -return new BitmapIndexedNode(ownerID,newBitmap,newNodes);}; - - - - - -function HashArrayMapNode(ownerID,count,nodes){ -this.ownerID=ownerID; -this.count=count; -this.nodes=nodes;} - - -HashArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var idx=(shift===0?keyHash:keyHash>>>shift)&MASK; -var node=this.nodes[idx]; -return node?node.get(shift+SHIFT,keyHash,key,notSetValue):notSetValue;}; - - -HashArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var idx=(shift===0?keyHash:keyHash>>>shift)&MASK; -var removed=value===NOT_SET; -var nodes=this.nodes; -var node=nodes[idx]; - -if(removed&&!node){ -return this;} - - -var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter); -if(newNode===node){ -return this;} - - -var newCount=this.count; -if(!node){ -newCount++;}else -if(!newNode){ -newCount--; -if(newCount>>shift)&MASK; -var idx2=(shift===0?keyHash:keyHash>>>shift)&MASK; - -var newNode; -var nodes=idx1===idx2? -[mergeIntoNode(node,ownerID,shift+SHIFT,keyHash,entry)]:( -newNode=new ValueNode(ownerID,keyHash,entry),idx1>>=1){ -expandedNodes[ii]=bitmap&1?nodes[count++]:undefined;} - -expandedNodes[including]=node; -return new HashArrayMapNode(ownerID,count+1,expandedNodes);} - - -function mergeIntoMapWith(map,merger,iterables){ -var iters=[]; -for(var ii=0;ii>1&0x55555555); -x=(x&0x33333333)+(x>>2&0x33333333); -x=x+(x>>4)&0x0f0f0f0f; -x=x+(x>>8); -x=x+(x>>16); -return x&0x7f;} - - -function setIn(array,idx,val,canEdit){ -var newArray=canEdit?array:arrCopy(array); -newArray[idx]=val; -return newArray;} - - -function spliceIn(array,idx,val,canEdit){ -var newLen=array.length+1; -if(canEdit&&idx+1===newLen){ -array[idx]=val; -return array;} - -var newArray=new Array(newLen); -var after=0; -for(var ii=0;ii0&&size=0&&index>>level&MASK; -if(originIndex>=this.array.length){ -return new VNode([],ownerID);} - -var removingFirst=originIndex===0; -var newChild; -if(level>0){ -var oldChild=this.array[originIndex]; -newChild=oldChild&&oldChild.removeBefore(ownerID,level-SHIFT,index); -if(newChild===oldChild&&removingFirst){ -return this;}} - - -if(removingFirst&&!newChild){ -return this;} - -var editable=editableVNode(this,ownerID); -if(!removingFirst){ -for(var ii=0;ii>>level&MASK; -if(sizeIndex>=this.array.length){ -return this;} - - -var newChild; -if(level>0){ -var oldChild=this.array[sizeIndex]; -newChild=oldChild&&oldChild.removeAfter(ownerID,level-SHIFT,index); -if(newChild===oldChild&&sizeIndex===this.array.length-1){ -return this;}} - - - -var editable=editableVNode(this,ownerID); -editable.array.splice(sizeIndex+1); -if(newChild){ -editable.array[sizeIndex]=newChild;} - -return editable;}; - - - - -var DONE={}; - -function iterateList(list,reverse){ -var left=list._origin; -var right=list._capacity; -var tailPos=getTailOffset(right); -var tail=list._tail; - -return iterateNodeOrLeaf(list._root,list._level,0); - -function iterateNodeOrLeaf(node,level,offset){ -return level===0? -iterateLeaf(node,offset): -iterateNode(node,level,offset);} - - -function iterateLeaf(node,offset){ -var array=offset===tailPos?tail&&tail.array:node&&node.array; -var from=offset>left?0:left-offset; -var to=right-offset; -if(to>SIZE){ -to=SIZE;} - -return function(){ -if(from===to){ -return DONE;} - -var idx=reverse?--to:from++; -return array&&array[idx];};} - - - -function iterateNode(node,level,offset){ -var values; -var array=node&&node.array; -var from=offset>left?0:left-offset>>level; -var to=(right-offset>>level)+1; -if(to>SIZE){ -to=SIZE;} - -return function(){ -do { -if(values){ -var value=values(); -if(value!==DONE){ -return value;} - -values=null;} - -if(from===to){ -return DONE;} - -var idx=reverse?--to:from++; -values=iterateNodeOrLeaf( -array&&array[idx],level-SHIFT,offset+(idx<=list.size||index<0){ -return list.withMutations(function(list){ -index<0? -setListBounds(list,index).set(0,value): -setListBounds(list,0,index+1).set(index,value);});} - - - -index+=list._origin; - -var newTail=list._tail; -var newRoot=list._root; -var didAlter=MakeRef(DID_ALTER); -if(index>=getTailOffset(list._capacity)){ -newTail=updateVNode(newTail,list.__ownerID,0,index,value,didAlter);}else -{ -newRoot=updateVNode(newRoot,list.__ownerID,list._level,index,value,didAlter);} - - -if(!didAlter.value){ -return list;} - - -if(list.__ownerID){ -list._root=newRoot; -list._tail=newTail; -list.__hash=undefined; -list.__altered=true; -return list;} - -return makeList(list._origin,list._capacity,list._level,newRoot,newTail);} - - -function updateVNode(node,ownerID,level,index,value,didAlter){ -var idx=index>>>level&MASK; -var nodeHas=node&&idx0){ -var lowerNode=node&&node.array[idx]; -var newLowerNode=updateVNode(lowerNode,ownerID,level-SHIFT,index,value,didAlter); -if(newLowerNode===lowerNode){ -return node;} - -newNode=editableVNode(node,ownerID); -newNode.array[idx]=newLowerNode; -return newNode;} - - -if(nodeHas&&node.array[idx]===value){ -return node;} - - -SetRef(didAlter); - -newNode=editableVNode(node,ownerID); -if(value===undefined&&idx===newNode.array.length-1){ -newNode.array.pop();}else -{ -newNode.array[idx]=value;} - -return newNode;} - - -function editableVNode(node,ownerID){ -if(ownerID&&node&&ownerID===node.ownerID){ -return node;} - -return new VNode(node?node.array.slice():[],ownerID);} - - -function listNodeFor(list,rawIndex){ -if(rawIndex>=getTailOffset(list._capacity)){ -return list._tail;} - -if(rawIndex<1<0){ -node=node.array[rawIndex>>>level&MASK]; -level-=SHIFT;} - -return node;}} - - - -function setListBounds(list,begin,end){ - - -if(begin!==undefined){ -begin=begin|0;} - -if(end!==undefined){ -end=end|0;} - -var owner=list.__ownerID||new OwnerID(); -var oldOrigin=list._origin; -var oldCapacity=list._capacity; -var newOrigin=oldOrigin+begin; -var newCapacity=end===undefined?oldCapacity:end<0?oldCapacity+end:oldOrigin+end; -if(newOrigin===oldOrigin&&newCapacity===oldCapacity){ -return list;} - - - -if(newOrigin>=newCapacity){ -return list.clear();} - - -var newLevel=list._level; -var newRoot=list._root; - - -var offsetShift=0; -while(newOrigin+offsetShift<0){ -newRoot=new VNode(newRoot&&newRoot.array.length?[undefined,newRoot]:[],owner); -newLevel+=SHIFT; -offsetShift+=1<=1<oldTailOffset?new VNode([],owner):oldTail; - - -if(oldTail&&newTailOffset>oldTailOffset&&newOriginSHIFT;level-=SHIFT){ -var idx=oldTailOffset>>>level&MASK; -node=node.array[idx]=editableVNode(node.array[idx],owner);} - -node.array[oldTailOffset>>>SHIFT&MASK]=oldTail;} - - - -if(newCapacity=newTailOffset){ -newOrigin-=newTailOffset; -newCapacity-=newTailOffset; -newLevel=SHIFT; -newRoot=null; -newTail=newTail&&newTail.removeBefore(owner,0,newOrigin);}else - - -if(newOrigin>oldOrigin||newTailOffset>>newLevel&MASK; -if(beginIndex!==newTailOffset>>>newLevel&MASK){ -break;} - -if(beginIndex){ -offsetShift+=(1<oldOrigin){ -newRoot=newRoot.removeBefore(owner,newLevel,newOrigin-offsetShift);} - -if(newRoot&&newTailOffsetmaxSize){ -maxSize=iter.size;} - -if(!isIterable(value)){ -iter=iter.map(function(v){return fromJS(v);});} - -iters.push(iter);} - -if(maxSize>list.size){ -list=list.setSize(maxSize);} - -return mergeIntoCollectionWith(list,merger,iters);} - - -function getTailOffset(size){ -return size>>SHIFT<=SIZE&&list.size>=map.size*2){ -newList=list.filter(function(entry,idx){return entry!==undefined&&i!==idx;}); -newMap=newList.toKeyedSeq().map(function(entry){return entry[0];}).flip().toMap(); -if(omap.__ownerID){ -newMap.__ownerID=newList.__ownerID=omap.__ownerID;}}else - -{ -newMap=map.remove(k); -newList=i===list.size-1?list.pop():list.set(i,undefined);}}else - -{ -if(has){ -if(v===list.get(i)[1]){ -return omap;} - -newMap=map; -newList=list.set(i,[k,v]);}else -{ -newMap=map.set(k,list.size); -newList=list.set(list.size,[k,v]);}} - - -if(omap.__ownerID){ -omap.size=newMap.size; -omap._map=newMap; -omap._list=newList; -omap.__hash=undefined; -return omap;} - -return makeOrderedMap(newMap,newList);} - - -createClass(ToKeyedSequence,KeyedSeq); -function ToKeyedSequence(indexed,useKeys){ -this._iter=indexed; -this._useKeys=useKeys; -this.size=indexed.size;} - - -ToKeyedSequence.prototype.get=function(key,notSetValue){ -return this._iter.get(key,notSetValue);}; - - -ToKeyedSequence.prototype.has=function(key){ -return this._iter.has(key);}; - - -ToKeyedSequence.prototype.valueSeq=function(){ -return this._iter.valueSeq();}; - - -ToKeyedSequence.prototype.reverse=function(){var this$0=this; -var reversedSequence=reverseFactory(this,true); -if(!this._useKeys){ -reversedSequence.valueSeq=function(){return this$0._iter.toSeq().reverse();};} - -return reversedSequence;}; - - -ToKeyedSequence.prototype.map=function(mapper,context){var this$0=this; -var mappedSequence=mapFactory(this,mapper,context); -if(!this._useKeys){ -mappedSequence.valueSeq=function(){return this$0._iter.toSeq().map(mapper,context);};} - -return mappedSequence;}; - - -ToKeyedSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -var ii; -return this._iter.__iterate( -this._useKeys? -function(v,k){return fn(v,k,this$0);}:( -ii=reverse?resolveSize(this):0, -function(v){return fn(v,reverse?--ii:ii++,this$0);}), -reverse);}; - - - -ToKeyedSequence.prototype.__iterator=function(type,reverse){ -if(this._useKeys){ -return this._iter.__iterator(type,reverse);} - -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -var ii=reverse?resolveSize(this):0; -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step: -iteratorValue(type,reverse?--ii:ii++,step.value,step);});}; - - - -ToKeyedSequence.prototype[IS_ORDERED_SENTINEL]=true; - - -createClass(ToIndexedSequence,IndexedSeq); -function ToIndexedSequence(iter){ -this._iter=iter; -this.size=iter.size;} - - -ToIndexedSequence.prototype.includes=function(value){ -return this._iter.includes(value);}; - - -ToIndexedSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -var iterations=0; -return this._iter.__iterate(function(v){return fn(v,iterations++,this$0);},reverse);}; - - -ToIndexedSequence.prototype.__iterator=function(type,reverse){ -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -var iterations=0; -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step: -iteratorValue(type,iterations++,step.value,step);});}; - - - - - -createClass(ToSetSequence,SetSeq); -function ToSetSequence(iter){ -this._iter=iter; -this.size=iter.size;} - - -ToSetSequence.prototype.has=function(key){ -return this._iter.includes(key);}; - - -ToSetSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -return this._iter.__iterate(function(v){return fn(v,v,this$0);},reverse);}; - - -ToSetSequence.prototype.__iterator=function(type,reverse){ -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step: -iteratorValue(type,step.value,step.value,step);});}; - - - - - -createClass(FromEntriesSequence,KeyedSeq); -function FromEntriesSequence(entries){ -this._iter=entries; -this.size=entries.size;} - - -FromEntriesSequence.prototype.entrySeq=function(){ -return this._iter.toSeq();}; - - -FromEntriesSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -return this._iter.__iterate(function(entry){ - - -if(entry){ -validateEntry(entry); -var indexedIterable=isIterable(entry); -return fn( -indexedIterable?entry.get(1):entry[1], -indexedIterable?entry.get(0):entry[0], -this$0);}}, - - -reverse);}; - - -FromEntriesSequence.prototype.__iterator=function(type,reverse){ -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -return new Iterator(function(){ -while(true){ -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; - - -if(entry){ -validateEntry(entry); -var indexedIterable=isIterable(entry); -return iteratorValue( -type, -indexedIterable?entry.get(0):entry[0], -indexedIterable?entry.get(1):entry[1], -step);}}});}; - - - - - - - -ToIndexedSequence.prototype.cacheResult= -ToKeyedSequence.prototype.cacheResult= -ToSetSequence.prototype.cacheResult= -FromEntriesSequence.prototype.cacheResult= -cacheResultThrough; - - -function flipFactory(iterable){ -var flipSequence=makeSequence(iterable); -flipSequence._iter=iterable; -flipSequence.size=iterable.size; -flipSequence.flip=function(){return iterable;}; -flipSequence.reverse=function(){ -var reversedSequence=iterable.reverse.apply(this); -reversedSequence.flip=function(){return iterable.reverse();}; -return reversedSequence;}; - -flipSequence.has=function(key){return iterable.includes(key);}; -flipSequence.includes=function(key){return iterable.has(key);}; -flipSequence.cacheResult=cacheResultThrough; -flipSequence.__iterateUncached=function(fn,reverse){var this$0=this; -return iterable.__iterate(function(v,k){return fn(k,v,this$0)!==false;},reverse);}; - -flipSequence.__iteratorUncached=function(type,reverse){ -if(type===ITERATE_ENTRIES){ -var iterator=iterable.__iterator(type,reverse); -return new Iterator(function(){ -var step=iterator.next(); -if(!step.done){ -var k=step.value[0]; -step.value[0]=step.value[1]; -step.value[1]=k;} - -return step;});} - - -return iterable.__iterator( -type===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES, -reverse);}; - - -return flipSequence;} - - - -function mapFactory(iterable,mapper,context){ -var mappedSequence=makeSequence(iterable); -mappedSequence.size=iterable.size; -mappedSequence.has=function(key){return iterable.has(key);}; -mappedSequence.get=function(key,notSetValue){ -var v=iterable.get(key,NOT_SET); -return v===NOT_SET? -notSetValue: -mapper.call(context,v,key,iterable);}; - -mappedSequence.__iterateUncached=function(fn,reverse){var this$0=this; -return iterable.__iterate( -function(v,k,c){return fn(mapper.call(context,v,k,c),k,this$0)!==false;}, -reverse);}; - - -mappedSequence.__iteratorUncached=function(type,reverse){ -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -return new Iterator(function(){ -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; -var key=entry[0]; -return iteratorValue( -type, -key, -mapper.call(context,entry[1],key,iterable), -step);});}; - - - -return mappedSequence;} - - - -function reverseFactory(iterable,useKeys){ -var reversedSequence=makeSequence(iterable); -reversedSequence._iter=iterable; -reversedSequence.size=iterable.size; -reversedSequence.reverse=function(){return iterable;}; -if(iterable.flip){ -reversedSequence.flip=function(){ -var flipSequence=flipFactory(iterable); -flipSequence.reverse=function(){return iterable.flip();}; -return flipSequence;};} - - -reversedSequence.get=function(key,notSetValue) -{return iterable.get(useKeys?key:-1-key,notSetValue);}; -reversedSequence.has=function(key) -{return iterable.has(useKeys?key:-1-key);}; -reversedSequence.includes=function(value){return iterable.includes(value);}; -reversedSequence.cacheResult=cacheResultThrough; -reversedSequence.__iterate=function(fn,reverse){var this$0=this; -return iterable.__iterate(function(v,k){return fn(v,k,this$0);},!reverse);}; - -reversedSequence.__iterator= -function(type,reverse){return iterable.__iterator(type,!reverse);}; -return reversedSequence;} - - - -function filterFactory(iterable,predicate,context,useKeys){ -var filterSequence=makeSequence(iterable); -if(useKeys){ -filterSequence.has=function(key){ -var v=iterable.get(key,NOT_SET); -return v!==NOT_SET&&!!predicate.call(context,v,key,iterable);}; - -filterSequence.get=function(key,notSetValue){ -var v=iterable.get(key,NOT_SET); -return v!==NOT_SET&&predicate.call(context,v,key,iterable)? -v:notSetValue;};} - - -filterSequence.__iterateUncached=function(fn,reverse){var this$0=this; -var iterations=0; -iterable.__iterate(function(v,k,c){ -if(predicate.call(context,v,k,c)){ -iterations++; -return fn(v,useKeys?k:iterations-1,this$0);}}, - -reverse); -return iterations;}; - -filterSequence.__iteratorUncached=function(type,reverse){ -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -var iterations=0; -return new Iterator(function(){ -while(true){ -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; -var key=entry[0]; -var value=entry[1]; -if(predicate.call(context,value,key,iterable)){ -return iteratorValue(type,useKeys?key:iterations++,value,step);}}});}; - - - - -return filterSequence;} - - - -function countByFactory(iterable,grouper,context){ -var groups=Map().asMutable(); -iterable.__iterate(function(v,k){ -groups.update( -grouper.call(context,v,k,iterable), -0, -function(a){return a+1;});}); - - -return groups.asImmutable();} - - - -function groupByFactory(iterable,grouper,context){ -var isKeyedIter=isKeyed(iterable); -var groups=(isOrdered(iterable)?OrderedMap():Map()).asMutable(); -iterable.__iterate(function(v,k){ -groups.update( -grouper.call(context,v,k,iterable), -function(a){return a=a||[],a.push(isKeyedIter?[k,v]:v),a;});}); - - -var coerce=iterableClass(iterable); -return groups.map(function(arr){return reify(iterable,coerce(arr));});} - - - -function sliceFactory(iterable,begin,end,useKeys){ -var originalSize=iterable.size; - - - -if(begin!==undefined){ -begin=begin|0;} - -if(end!==undefined){ -end=end|0;} - - -if(wholeSlice(begin,end,originalSize)){ -return iterable;} - - -var resolvedBegin=resolveBegin(begin,originalSize); -var resolvedEnd=resolveEnd(end,originalSize); - - - - -if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd){ -return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys);} - - - - - - -var resolvedSize=resolvedEnd-resolvedBegin; -var sliceSize; -if(resolvedSize===resolvedSize){ -sliceSize=resolvedSize<0?0:resolvedSize;} - - -var sliceSeq=makeSequence(iterable); - - - -sliceSeq.size=sliceSize===0?sliceSize:iterable.size&&sliceSize||undefined; - -if(!useKeys&&isSeq(iterable)&&sliceSize>=0){ -sliceSeq.get=function(index,notSetValue){ -index=wrapIndex(this,index); -return index>=0&&indexsliceSize){ -return iteratorDone();} - -var step=iterator.next(); -if(useKeys||type===ITERATE_VALUES){ -return step;}else -if(type===ITERATE_KEYS){ -return iteratorValue(type,iterations-1,undefined,step);}else -{ -return iteratorValue(type,iterations-1,step.value[1],step);}});}; - - - - -return sliceSeq;} - - - -function takeWhileFactory(iterable,predicate,context){ -var takeSequence=makeSequence(iterable); -takeSequence.__iterateUncached=function(fn,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var iterations=0; -iterable.__iterate(function(v,k,c) -{return predicate.call(context,v,k,c)&&++iterations&&fn(v,k,this$0);}); - -return iterations;}; - -takeSequence.__iteratorUncached=function(type,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterator(type,reverse);} - -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -var iterating=true; -return new Iterator(function(){ -if(!iterating){ -return iteratorDone();} - -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; -var k=entry[0]; -var v=entry[1]; -if(!predicate.call(context,v,k,this$0)){ -iterating=false; -return iteratorDone();} - -return type===ITERATE_ENTRIES?step: -iteratorValue(type,k,v,step);});}; - - -return takeSequence;} - - - -function skipWhileFactory(iterable,predicate,context,useKeys){ -var skipSequence=makeSequence(iterable); -skipSequence.__iterateUncached=function(fn,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var isSkipping=true; -var iterations=0; -iterable.__iterate(function(v,k,c){ -if(!(isSkipping&&(isSkipping=predicate.call(context,v,k,c)))){ -iterations++; -return fn(v,useKeys?k:iterations-1,this$0);}}); - - -return iterations;}; - -skipSequence.__iteratorUncached=function(type,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterator(type,reverse);} - -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -var skipping=true; -var iterations=0; -return new Iterator(function(){ -var step,k,v; -do { -step=iterator.next(); -if(step.done){ -if(useKeys||type===ITERATE_VALUES){ -return step;}else -if(type===ITERATE_KEYS){ -return iteratorValue(type,iterations++,undefined,step);}else -{ -return iteratorValue(type,iterations++,step.value[1],step);}} - - -var entry=step.value; -k=entry[0]; -v=entry[1]; -skipping&&(skipping=predicate.call(context,v,k,this$0));}while( -skipping); -return type===ITERATE_ENTRIES?step: -iteratorValue(type,k,v,step);});}; - - -return skipSequence;} - - - -function concatFactory(iterable,values){ -var isKeyedIterable=isKeyed(iterable); -var iters=[iterable].concat(values).map(function(v){ -if(!isIterable(v)){ -v=isKeyedIterable? -keyedSeqFromValue(v): -indexedSeqFromValue(Array.isArray(v)?v:[v]);}else -if(isKeyedIterable){ -v=KeyedIterable(v);} - -return v;}). -filter(function(v){return v.size!==0;}); - -if(iters.length===0){ -return iterable;} - - -if(iters.length===1){ -var singleton=iters[0]; -if(singleton===iterable|| -isKeyedIterable&&isKeyed(singleton)|| -isIndexed(iterable)&&isIndexed(singleton)){ -return singleton;}} - - - -var concatSeq=new ArraySeq(iters); -if(isKeyedIterable){ -concatSeq=concatSeq.toKeyedSeq();}else -if(!isIndexed(iterable)){ -concatSeq=concatSeq.toSetSeq();} - -concatSeq=concatSeq.flatten(true); -concatSeq.size=iters.reduce( -function(sum,seq){ -if(sum!==undefined){ -var size=seq.size; -if(size!==undefined){ -return sum+size;}}}, - - - -0); - -return concatSeq;} - - - -function flattenFactory(iterable,depth,useKeys){ -var flatSequence=makeSequence(iterable); -flatSequence.__iterateUncached=function(fn,reverse){ -var iterations=0; -var stopped=false; -function flatDeep(iter,currentDepth){var this$0=this; -iter.__iterate(function(v,k){ -if((!depth||currentDepth0;} - - - -function zipWithFactory(keyIter,zipper,iters){ -var zipSequence=makeSequence(keyIter); -zipSequence.size=new ArraySeq(iters).map(function(i){return i.size;}).min(); - - -zipSequence.__iterate=function(fn,reverse){ - - - - - - - - - - - - - -var iterator=this.__iterator(ITERATE_VALUES,reverse); -var step; -var iterations=0; -while(!(step=iterator.next()).done){ -if(fn(step.value,iterations++,this)===false){ -break;}} - - -return iterations;}; - -zipSequence.__iteratorUncached=function(type,reverse){ -var iterators=iters.map(function(i) -{return i=Iterable(i),getIterator(reverse?i.reverse():i);}); - -var iterations=0; -var isDone=false; -return new Iterator(function(){ -var steps; -if(!isDone){ -steps=iterators.map(function(i){return i.next();}); -isDone=steps.some(function(s){return s.done;});} - -if(isDone){ -return iteratorDone();} - -return iteratorValue( -type, -iterations++, -zipper.apply(null,steps.map(function(s){return s.value;})));});}; - - - -return zipSequence;} - - - - - -function reify(iter,seq){ -return isSeq(iter)?seq:iter.constructor(seq);} - - -function validateEntry(entry){ -if(entry!==Object(entry)){ -throw new TypeError('Expected [K, V] tuple: '+entry);}} - - - -function resolveSize(iter){ -assertNotInfinite(iter.size); -return ensureSize(iter);} - - -function iterableClass(iterable){ -return isKeyed(iterable)?KeyedIterable: -isIndexed(iterable)?IndexedIterable: -SetIterable;} - - -function makeSequence(iterable){ -return Object.create( -( -isKeyed(iterable)?KeyedSeq: -isIndexed(iterable)?IndexedSeq: -SetSeq). -prototype);} - - - -function cacheResultThrough(){ -if(this._iter.cacheResult){ -this._iter.cacheResult(); -this.size=this._iter.size; -return this;}else -{ -return Seq.prototype.cacheResult.call(this);}} - - - -function defaultComparator(a,b){ -return a>b?1:a=0;ii--){ -head={ -value:arguments[ii], -next:head};} - - -if(this.__ownerID){ -this.size=newSize; -this._head=head; -this.__hash=undefined; -this.__altered=true; -return this;} - -return makeStack(newSize,head);}; - - -Stack.prototype.pushAll=function(iter){ -iter=IndexedIterable(iter); -if(iter.size===0){ -return this;} - -assertNotInfinite(iter.size); -var newSize=this.size; -var head=this._head; -iter.reverse().forEach(function(value){ -newSize++; -head={ -value:value, -next:head};}); - - -if(this.__ownerID){ -this.size=newSize; -this._head=head; -this.__hash=undefined; -this.__altered=true; -return this;} - -return makeStack(newSize,head);}; - - -Stack.prototype.pop=function(){ -return this.slice(1);}; - - -Stack.prototype.unshift=function(){ -return this.push.apply(this,arguments);}; - - -Stack.prototype.unshiftAll=function(iter){ -return this.pushAll(iter);}; - - -Stack.prototype.shift=function(){ -return this.pop.apply(this,arguments);}; - - -Stack.prototype.clear=function(){ -if(this.size===0){ -return this;} - -if(this.__ownerID){ -this.size=0; -this._head=undefined; -this.__hash=undefined; -this.__altered=true; -return this;} - -return emptyStack();}; - - -Stack.prototype.slice=function(begin,end){ -if(wholeSlice(begin,end,this.size)){ -return this;} - -var resolvedBegin=resolveBegin(begin,this.size); -var resolvedEnd=resolveEnd(end,this.size); -if(resolvedEnd!==this.size){ - -return IndexedCollection.prototype.slice.call(this,begin,end);} - -var newSize=this.size-resolvedBegin; -var head=this._head; -while(resolvedBegin--){ -head=head.next;} - -if(this.__ownerID){ -this.size=newSize; -this._head=head; -this.__hash=undefined; -this.__altered=true; -return this;} - -return makeStack(newSize,head);}; - - - - -Stack.prototype.__ensureOwner=function(ownerID){ -if(ownerID===this.__ownerID){ -return this;} - -if(!ownerID){ -this.__ownerID=ownerID; -this.__altered=false; -return this;} - -return makeStack(this.size,this._head,ownerID,this.__hash);}; - - - - -Stack.prototype.__iterate=function(fn,reverse){ -if(reverse){ -return this.reverse().__iterate(fn);} - -var iterations=0; -var node=this._head; -while(node){ -if(fn(node.value,iterations++,this)===false){ -break;} - -node=node.next;} - -return iterations;}; - - -Stack.prototype.__iterator=function(type,reverse){ -if(reverse){ -return this.reverse().__iterator(type);} - -var iterations=0; -var node=this._head; -return new Iterator(function(){ -if(node){ -var value=node.value; -node=node.next; -return iteratorValue(type,iterations++,value);} - -return iteratorDone();});}; - - - - -function isStack(maybeStack){ -return !!(maybeStack&&maybeStack[IS_STACK_SENTINEL]);} - - -Stack.isStack=isStack; - -var IS_STACK_SENTINEL='@@__IMMUTABLE_STACK__@@'; - -var StackPrototype=Stack.prototype; -StackPrototype[IS_STACK_SENTINEL]=true; -StackPrototype.withMutations=MapPrototype.withMutations; -StackPrototype.asMutable=MapPrototype.asMutable; -StackPrototype.asImmutable=MapPrototype.asImmutable; -StackPrototype.wasAltered=MapPrototype.wasAltered; - - -function makeStack(size,head,ownerID,hash){ -var map=Object.create(StackPrototype); -map.size=size; -map._head=head; -map.__ownerID=ownerID; -map.__hash=hash; -map.__altered=false; -return map;} - - -var EMPTY_STACK; -function emptyStack(){ -return EMPTY_STACK||(EMPTY_STACK=makeStack(0));} - - - - - -function mixin(ctor,methods){ -var keyCopier=function(key){ctor.prototype[key]=methods[key];}; -Object.keys(methods).forEach(keyCopier); -Object.getOwnPropertySymbols&& -Object.getOwnPropertySymbols(methods).forEach(keyCopier); -return ctor;} - - -Iterable.Iterator=Iterator; - -mixin(Iterable,{ - - - -toArray:function(){ -assertNotInfinite(this.size); -var array=new Array(this.size||0); -this.valueSeq().__iterate(function(v,i){array[i]=v;}); -return array;}, - - -toIndexedSeq:function(){ -return new ToIndexedSequence(this);}, - - -toJS:function(){ -return this.toSeq().map( -function(value){return value&&typeof value.toJS==='function'?value.toJS():value;}). -__toJS();}, - - -toJSON:function(){ -return this.toSeq().map( -function(value){return value&&typeof value.toJSON==='function'?value.toJSON():value;}). -__toJS();}, - - -toKeyedSeq:function(){ -return new ToKeyedSequence(this,true);}, - - -toMap:function(){ - -return Map(this.toKeyedSeq());}, - - -toObject:function(){ -assertNotInfinite(this.size); -var object={}; -this.__iterate(function(v,k){object[k]=v;}); -return object;}, - - -toOrderedMap:function(){ - -return OrderedMap(this.toKeyedSeq());}, - - -toOrderedSet:function(){ - -return OrderedSet(isKeyed(this)?this.valueSeq():this);}, - - -toSet:function(){ - -return Set(isKeyed(this)?this.valueSeq():this);}, - - -toSetSeq:function(){ -return new ToSetSequence(this);}, - - -toSeq:function(){ -return isIndexed(this)?this.toIndexedSeq(): -isKeyed(this)?this.toKeyedSeq(): -this.toSetSeq();}, - - -toStack:function(){ - -return Stack(isKeyed(this)?this.valueSeq():this);}, - - -toList:function(){ - -return List(isKeyed(this)?this.valueSeq():this);}, - - - - - -toString:function(){ -return '[Iterable]';}, - - -__toString:function(head,tail){ -if(this.size===0){ -return head+tail;} - -return head+' '+this.toSeq().map(this.__toStringMapper).join(', ')+' '+tail;}, - - - - - -concat:function(){var values=SLICE$0.call(arguments,0); -return reify(this,concatFactory(this,values));}, - - -includes:function(searchValue){ -return this.some(function(value){return is(value,searchValue);});}, - - -entries:function(){ -return this.__iterator(ITERATE_ENTRIES);}, - - -every:function(predicate,context){ -assertNotInfinite(this.size); -var returnValue=true; -this.__iterate(function(v,k,c){ -if(!predicate.call(context,v,k,c)){ -returnValue=false; -return false;}}); - - -return returnValue;}, - - -filter:function(predicate,context){ -return reify(this,filterFactory(this,predicate,context,true));}, - - -find:function(predicate,context,notSetValue){ -var entry=this.findEntry(predicate,context); -return entry?entry[1]:notSetValue;}, - - -findEntry:function(predicate,context){ -var found; -this.__iterate(function(v,k,c){ -if(predicate.call(context,v,k,c)){ -found=[k,v]; -return false;}}); - - -return found;}, - - -findLastEntry:function(predicate,context){ -return this.toSeq().reverse().findEntry(predicate,context);}, - - -forEach:function(sideEffect,context){ -assertNotInfinite(this.size); -return this.__iterate(context?sideEffect.bind(context):sideEffect);}, - - -join:function(separator){ -assertNotInfinite(this.size); -separator=separator!==undefined?''+separator:','; -var joined=''; -var isFirst=true; -this.__iterate(function(v){ -isFirst?isFirst=false:joined+=separator; -joined+=v!==null&&v!==undefined?v.toString():'';}); - -return joined;}, - - -keys:function(){ -return this.__iterator(ITERATE_KEYS);}, - - -map:function(mapper,context){ -return reify(this,mapFactory(this,mapper,context));}, - - -reduce:function(reducer,initialReduction,context){ -assertNotInfinite(this.size); -var reduction; -var useFirst; -if(arguments.length<2){ -useFirst=true;}else -{ -reduction=initialReduction;} - -this.__iterate(function(v,k,c){ -if(useFirst){ -useFirst=false; -reduction=v;}else -{ -reduction=reducer.call(context,reduction,v,k,c);}}); - - -return reduction;}, - - -reduceRight:function(reducer,initialReduction,context){ -var reversed=this.toKeyedSeq().reverse(); -return reversed.reduce.apply(reversed,arguments);}, - - -reverse:function(){ -return reify(this,reverseFactory(this,true));}, - - -slice:function(begin,end){ -return reify(this,sliceFactory(this,begin,end,true));}, - - -some:function(predicate,context){ -return !this.every(not(predicate),context);}, - - -sort:function(comparator){ -return reify(this,sortFactory(this,comparator));}, - - -values:function(){ -return this.__iterator(ITERATE_VALUES);}, - - - - - -butLast:function(){ -return this.slice(0,-1);}, - - -isEmpty:function(){ -return this.size!==undefined?this.size===0:!this.some(function(){return true;});}, - - -count:function(predicate,context){ -return ensureSize( -predicate?this.toSeq().filter(predicate,context):this);}, - - - -countBy:function(grouper,context){ -return countByFactory(this,grouper,context);}, - - -equals:function(other){ -return deepEqual(this,other);}, - - -entrySeq:function(){ -var iterable=this; -if(iterable._cache){ - -return new ArraySeq(iterable._cache);} - -var entriesSequence=iterable.toSeq().map(entryMapper).toIndexedSeq(); -entriesSequence.fromEntrySeq=function(){return iterable.toSeq();}; -return entriesSequence;}, - - -filterNot:function(predicate,context){ -return this.filter(not(predicate),context);}, - - -findLast:function(predicate,context,notSetValue){ -return this.toKeyedSeq().reverse().find(predicate,context,notSetValue);}, - - -first:function(){ -return this.find(returnTrue);}, - - -flatMap:function(mapper,context){ -return reify(this,flatMapFactory(this,mapper,context));}, - - -flatten:function(depth){ -return reify(this,flattenFactory(this,depth,true));}, - - -fromEntrySeq:function(){ -return new FromEntriesSequence(this);}, - - -get:function(searchKey,notSetValue){ -return this.find(function(_,key){return is(key,searchKey);},undefined,notSetValue);}, - - -getIn:function(searchKeyPath,notSetValue){ -var nested=this; - - -var iter=forceIterator(searchKeyPath); -var step; -while(!(step=iter.next()).done){ -var key=step.value; -nested=nested&&nested.get?nested.get(key,NOT_SET):NOT_SET; -if(nested===NOT_SET){ -return notSetValue;}} - - -return nested;}, - - -groupBy:function(grouper,context){ -return groupByFactory(this,grouper,context);}, - - -has:function(searchKey){ -return this.get(searchKey,NOT_SET)!==NOT_SET;}, - - -hasIn:function(searchKeyPath){ -return this.getIn(searchKeyPath,NOT_SET)!==NOT_SET;}, - - -isSubset:function(iter){ -iter=typeof iter.includes==='function'?iter:Iterable(iter); -return this.every(function(value){return iter.includes(value);});}, - - -isSuperset:function(iter){ -iter=typeof iter.isSubset==='function'?iter:Iterable(iter); -return iter.isSubset(this);}, - - -keySeq:function(){ -return this.toSeq().map(keyMapper).toIndexedSeq();}, - - -last:function(){ -return this.toSeq().reverse().first();}, - - -max:function(comparator){ -return maxFactory(this,comparator);}, - - -maxBy:function(mapper,comparator){ -return maxFactory(this,comparator,mapper);}, - - -min:function(comparator){ -return maxFactory(this,comparator?neg(comparator):defaultNegComparator);}, - - -minBy:function(mapper,comparator){ -return maxFactory(this,comparator?neg(comparator):defaultNegComparator,mapper);}, - - -rest:function(){ -return this.slice(1);}, - - -skip:function(amount){ -return this.slice(Math.max(0,amount));}, - - -skipLast:function(amount){ -return reify(this,this.toSeq().reverse().skip(amount).reverse());}, - - -skipWhile:function(predicate,context){ -return reify(this,skipWhileFactory(this,predicate,context,true));}, - - -skipUntil:function(predicate,context){ -return this.skipWhile(not(predicate),context);}, - - -sortBy:function(mapper,comparator){ -return reify(this,sortFactory(this,comparator,mapper));}, - - -take:function(amount){ -return this.slice(0,Math.max(0,amount));}, - - -takeLast:function(amount){ -return reify(this,this.toSeq().reverse().take(amount).reverse());}, - - -takeWhile:function(predicate,context){ -return reify(this,takeWhileFactory(this,predicate,context));}, - - -takeUntil:function(predicate,context){ -return this.takeWhile(not(predicate),context);}, - - -valueSeq:function(){ -return this.toIndexedSeq();}, - - - - - -hashCode:function(){ -return this.__hash||(this.__hash=hashIterable(this));}}); - - - - - - - - - - - - - - - -var IterablePrototype=Iterable.prototype; -IterablePrototype[IS_ITERABLE_SENTINEL]=true; -IterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.values; -IterablePrototype.__toJS=IterablePrototype.toArray; -IterablePrototype.__toStringMapper=quoteString; -IterablePrototype.inspect= -IterablePrototype.toSource=function(){return this.toString();}; -IterablePrototype.chain=IterablePrototype.flatMap; -IterablePrototype.contains=IterablePrototype.includes; - - -(function(){ -try{ -Object.defineProperty(IterablePrototype,'length',{ -get:function(){ -if(!Iterable.noLengthWarning){ -var stack; -try{ -throw new Error();} -catch(error) { -stack=error.stack;} - -if(stack.indexOf('_wrapObject')===-1){ -console&&console.warn&&console.warn( -'iterable.length has been deprecated, '+ -'use iterable.size or iterable.count(). '+ -'This warning will become a silent error in a future version. '+ -stack); - -return this.size;}}}});} - - - - -catch(e) {}})(); - - - - -mixin(KeyedIterable,{ - - - -flip:function(){ -return reify(this,flipFactory(this));}, - - -findKey:function(predicate,context){ -var entry=this.findEntry(predicate,context); -return entry&&entry[0];}, - - -findLastKey:function(predicate,context){ -return this.toSeq().reverse().findKey(predicate,context);}, - - -keyOf:function(searchValue){ -return this.findKey(function(value){return is(value,searchValue);});}, - - -lastKeyOf:function(searchValue){ -return this.findLastKey(function(value){return is(value,searchValue);});}, - - -mapEntries:function(mapper,context){var this$0=this; -var iterations=0; -return reify(this, -this.toSeq().map( -function(v,k){return mapper.call(context,[k,v],iterations++,this$0);}). -fromEntrySeq());}, - - - -mapKeys:function(mapper,context){var this$0=this; -return reify(this, -this.toSeq().flip().map( -function(k,v){return mapper.call(context,k,v,this$0);}). -flip());}}); - - - - - -var KeyedIterablePrototype=KeyedIterable.prototype; -KeyedIterablePrototype[IS_KEYED_SENTINEL]=true; -KeyedIterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.entries; -KeyedIterablePrototype.__toJS=IterablePrototype.toObject; -KeyedIterablePrototype.__toStringMapper=function(v,k){return JSON.stringify(k)+': '+quoteString(v);}; - - - -mixin(IndexedIterable,{ - - - -toKeyedSeq:function(){ -return new ToKeyedSequence(this,false);}, - - - - - -filter:function(predicate,context){ -return reify(this,filterFactory(this,predicate,context,false));}, - - -findIndex:function(predicate,context){ -var entry=this.findEntry(predicate,context); -return entry?entry[0]:-1;}, - - -indexOf:function(searchValue){ -var key=this.toKeyedSeq().keyOf(searchValue); -return key===undefined?-1:key;}, - - -lastIndexOf:function(searchValue){ -var key=this.toKeyedSeq().reverse().keyOf(searchValue); -return key===undefined?-1:key;}, - - - - - -reverse:function(){ -return reify(this,reverseFactory(this,false));}, - - -slice:function(begin,end){ -return reify(this,sliceFactory(this,begin,end,false));}, - - -splice:function(index,removeNum){ -var numArgs=arguments.length; -removeNum=Math.max(removeNum|0,0); -if(numArgs===0||numArgs===2&&!removeNum){ -return this;} - - - - -index=resolveBegin(index,index<0?this.count():this.size); -var spliced=this.slice(0,index); -return reify( -this, -numArgs===1? -spliced: -spliced.concat(arrCopy(arguments,2),this.slice(index+removeNum)));}, - - - - - - -findLastIndex:function(predicate,context){ -var key=this.toKeyedSeq().findLastKey(predicate,context); -return key===undefined?-1:key;}, - - -first:function(){ -return this.get(0);}, - - -flatten:function(depth){ -return reify(this,flattenFactory(this,depth,false));}, - - -get:function(index,notSetValue){ -index=wrapIndex(this,index); -return index<0||this.size===Infinity|| -this.size!==undefined&&index>this.size? -notSetValue: -this.find(function(_,key){return key===index;},undefined,notSetValue);}, - - -has:function(index){ -index=wrapIndex(this,index); -return index>=0&&(this.size!==undefined? -this.size===Infinity||indexb?-1:0;} - - -function hashIterable(iterable){ -if(iterable.size===Infinity){ -return 0;} - -var ordered=isOrdered(iterable); -var keyed=isKeyed(iterable); -var h=ordered?1:0; -var size=iterable.__iterate( -keyed? -ordered? -function(v,k){h=31*h+hashMerge(hash(v),hash(k))|0;}: -function(v,k){h=h+hashMerge(hash(v),hash(k))|0;}: -ordered? -function(v){h=31*h+hash(v)|0;}: -function(v){h=h+hash(v)|0;}); - -return murmurHashOfSize(size,h);} - - -function murmurHashOfSize(size,h){ -h=imul(h,0xCC9E2D51); -h=imul(h<<15|h>>>-15,0x1B873593); -h=imul(h<<13|h>>>-13,5); -h=(h+0xE6546B64|0)^size; -h=imul(h^h>>>16,0x85EBCA6B); -h=imul(h^h>>>13,0xC2B2AE35); -h=smi(h^h>>>16); -return h;} - - -function hashMerge(a,b){ -return a^b+0x9E3779B9+(a<<6)+(a>>2)|0;} - - -var Immutable={ - -Iterable:Iterable, - -Seq:Seq, -Collection:Collection, -Map:Map, -OrderedMap:OrderedMap, -List:List, -Stack:Stack, -Set:Set, -OrderedSet:OrderedSet, - -Record:Record, -Range:Range, -Repeat:Repeat, - -is:is, -fromJS:fromJS}; - - - -return Immutable;}); -}); -__d('NavigatorBreadcrumbNavigationBar',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var NavigatorBreadcrumbNavigationBarStyles=require('NavigatorBreadcrumbNavigationBarStyles'); -var NavigatorNavigationBarStylesAndroid=require('NavigatorNavigationBarStylesAndroid'); -var NavigatorNavigationBarStylesIOS=require('NavigatorNavigationBarStylesIOS'); -var Platform=require('Platform'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View');var _require= - -require('immutable/dist/immutable.js');var Map=_require.Map; - -var invariant=require('invariant'); - -var Interpolators=NavigatorBreadcrumbNavigationBarStyles.Interpolators; -var NavigatorNavigationBarStyles=Platform.OS==='android'? -NavigatorNavigationBarStylesAndroid:NavigatorNavigationBarStylesIOS; -var PropTypes=React.PropTypes; - - - - -var CRUMB_PROPS=Interpolators.map(function(){return {style:{}};}); -var ICON_PROPS=Interpolators.map(function(){return {style:{}};}); -var SEPARATOR_PROPS=Interpolators.map(function(){return {style:{}};}); -var TITLE_PROPS=Interpolators.map(function(){return {style:{}};}); -var RIGHT_BUTTON_PROPS=Interpolators.map(function(){return {style:{}};}); - - -var navStatePresentedIndex=function(navState){ -if(navState.presentedIndex!==undefined){ -return navState.presentedIndex;} - - -return navState.observedTopOfStack;}; - - - - - - - - - - -var initStyle=function(index,presentedIndex){ -return index===presentedIndex?NavigatorBreadcrumbNavigationBarStyles.Center[index]: -indexfromIndex?progress:1-progress; -var oldDistToCenter=index-fromIndex; -var newDistToCenter=index-toIndex; -var interpolate; -invariant( -Interpolators[index], -'Cannot find breadcrumb interpolators for '+index); - -if(oldDistToCenter>0&&newDistToCenter===0|| -newDistToCenter>0&&oldDistToCenter===0){ -interpolate=Interpolators[index].RightToCenter;}else -if(oldDistToCenter<0&&newDistToCenter===0|| -newDistToCenter<0&&oldDistToCenter===0){ -interpolate=Interpolators[index].CenterToLeft;}else -if(oldDistToCenter===newDistToCenter){ -interpolate=Interpolators[index].RightToCenter;}else -{ -interpolate=Interpolators[index].RightToLeft;} - - -if(interpolate.Crumb(CRUMB_PROPS[index].style,amount)){ -this._setPropsIfExists('crumb_'+index,CRUMB_PROPS[index]);} - -if(interpolate.Icon(ICON_PROPS[index].style,amount)){ -this._setPropsIfExists('icon_'+index,ICON_PROPS[index]);} - -if(interpolate.Separator(SEPARATOR_PROPS[index].style,amount)){ -this._setPropsIfExists('separator_'+index,SEPARATOR_PROPS[index]);} - -if(interpolate.Title(TITLE_PROPS[index].style,amount)){ -this._setPropsIfExists('title_'+index,TITLE_PROPS[index]);} - -var right=this.refs['right_'+index]; -if(right&& -interpolate.RightItem(RIGHT_BUTTON_PROPS[index].style,amount)){ -right.setNativeProps(RIGHT_BUTTON_PROPS[index]);}}, - - - -updateProgress:function(progress,fromIndex,toIndex){ -var max=Math.max(fromIndex,toIndex); -var min=Math.min(fromIndex,toIndex); -for(var index=min;index<=max;index++){ -this._updateIndexProgress(progress,index,fromIndex,toIndex);}}, - - - -onAnimationStart:function(fromIndex,toIndex){ -var max=Math.max(fromIndex,toIndex); -var min=Math.min(fromIndex,toIndex); -for(var index=min;index<=max;index++){ -this._setRenderViewsToHardwareTextureAndroid(index,true);}}, - - - -onAnimationEnd:function(){ -var max=this.props.navState.routeStack.length-1; -for(var index=0;index<=max;index++){ -this._setRenderViewsToHardwareTextureAndroid(index,false);}}, - - - -_setRenderViewsToHardwareTextureAndroid:function(index,renderToHardwareTexture){ -var props={ -renderToHardwareTextureAndroid:renderToHardwareTexture}; - - -this._setPropsIfExists('icon_'+index,props); -this._setPropsIfExists('separator_'+index,props); -this._setPropsIfExists('title_'+index,props); -this._setPropsIfExists('right_'+index,props);}, - - -componentWillMount:function(){ -this._descriptors={ -crumb:new Map(), -title:new Map(), -right:new Map()};}, - - - -render:function(){ -var navState=this.props.navState; -var icons=navState&&navState.routeStack.map(this._getBreadcrumb); -var titles=navState.routeStack.map(this._getTitle); -var buttons=navState.routeStack.map(this._getRightButton); -return ( -React.createElement(View,{style:[styles.breadCrumbContainer,this.props.style]}, -titles, -icons, -buttons));}, - - - - -_getBreadcrumb:function(route,index){ -if(this._descriptors.crumb.has(route)){ -return this._descriptors.crumb.get(route);} - - -var navBarRouteMapper=this.props.routeMapper; -var firstStyles=initStyle(index,navStatePresentedIndex(this.props.navState)); - -var breadcrumbDescriptor= -React.createElement(View,{ -key:'crumb_'+index, -ref:'crumb_'+index, -style:firstStyles.Crumb}, -React.createElement(View,{ref:'icon_'+index,style:firstStyles.Icon}, -navBarRouteMapper.iconForRoute(route,this.props.navigator)), - -React.createElement(View,{ref:'separator_'+index,style:firstStyles.Separator}, -navBarRouteMapper.separatorForRoute(route,this.props.navigator))); - - - - -this._descriptors.crumb=this._descriptors.crumb.set(route,breadcrumbDescriptor); -return breadcrumbDescriptor;}, - - -_getTitle:function(route,index){ -if(this._descriptors.title.has(route)){ -return this._descriptors.title.get(route);} - - -var titleContent=this.props.routeMapper.titleContentForRoute( -this.props.navState.routeStack[index], -this.props.navigator); - -var firstStyles=initStyle(index,navStatePresentedIndex(this.props.navState)); - -var titleDescriptor= -React.createElement(View,{ -key:'title_'+index, -ref:'title_'+index, -style:firstStyles.Title}, -titleContent); - - -this._descriptors.title=this._descriptors.title.set(route,titleDescriptor); -return titleDescriptor;}, - - -_getRightButton:function(route,index){ -if(this._descriptors.right.has(route)){ -return this._descriptors.right.get(route);} - -var rightContent=this.props.routeMapper.rightContentForRoute( -this.props.navState.routeStack[index], -this.props.navigator); - -if(!rightContent){ -this._descriptors.right=this._descriptors.right.set(route,null); -return null;} - -var firstStyles=initStyle(index,navStatePresentedIndex(this.props.navState)); -var rightButtonDescriptor= -React.createElement(View,{ -key:'right_'+index, -ref:'right_'+index, -style:firstStyles.RightItem}, -rightContent); - - -this._descriptors.right=this._descriptors.right.set(route,rightButtonDescriptor); -return rightButtonDescriptor;}, - - -_setPropsIfExists:function(ref,props){ -var ref=this.refs[ref]; -ref&&ref.setNativeProps(props);}}); - - - -var styles=StyleSheet.create({ -breadCrumbContainer:{ -overflow:'hidden', -position:'absolute', -height:NavigatorNavigationBarStyles.General.TotalNavHeight, -top:0, -left:0, -right:0}}); - - - -module.exports=NavigatorBreadcrumbNavigationBar; -}); -__d('NavigatorBreadcrumbNavigationBarStyles',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var NavigatorNavigationBarStylesIOS=require('NavigatorNavigationBarStylesIOS'); - -var buildStyleInterpolator=require('buildStyleInterpolator'); -var merge=require('merge'); - -var SCREEN_WIDTH=Dimensions.get('window').width; -var STATUS_BAR_HEIGHT=NavigatorNavigationBarStylesIOS.General.StatusBarHeight; -var NAV_BAR_HEIGHT=NavigatorNavigationBarStylesIOS.General.NavBarHeight; - -var SPACING=4; -var ICON_WIDTH=40; -var SEPARATOR_WIDTH=9; -var CRUMB_WIDTH=ICON_WIDTH+SEPARATOR_WIDTH; - -var OPACITY_RATIO=100; -var ICON_INACTIVE_OPACITY=0.6; -var MAX_BREADCRUMBS=10; - -var CRUMB_BASE={ -position:'absolute', -flexDirection:'row', -top:STATUS_BAR_HEIGHT, -width:CRUMB_WIDTH, -height:NAV_BAR_HEIGHT, -backgroundColor:'transparent'}; - - -var ICON_BASE={ -width:ICON_WIDTH, -height:NAV_BAR_HEIGHT}; - - -var SEPARATOR_BASE={ -width:SEPARATOR_WIDTH, -height:NAV_BAR_HEIGHT}; - - -var TITLE_BASE={ -position:'absolute', -top:STATUS_BAR_HEIGHT, -height:NAV_BAR_HEIGHT, -backgroundColor:'transparent'}; - - - -var FIRST_TITLE_BASE=merge(TITLE_BASE,{ -left:0, -right:0, -alignItems:'center', -height:NAV_BAR_HEIGHT}); - - -var RIGHT_BUTTON_BASE={ -position:'absolute', -top:STATUS_BAR_HEIGHT, -right:SPACING, -overflow:'hidden', -opacity:1, -height:NAV_BAR_HEIGHT, -backgroundColor:'transparent'}; - - - - - - -var LEFT=[]; -var CENTER=[]; -var RIGHT=[]; -for(var i=0;i= '+( -anim.threshold+' ? '+anim.to+' : '+anim.from)+';\n');}; - - - -var computeNextValIdentity=function(anim){ -return ' nextScalarVal = value;\n';}; - - -var operationVar=function(name){ -return name+'ReuseOp';}; - - -var createReusableOperationVars=function(anims){ -var ret=''; -for(var name in anims){ -if(ShouldAllocateReusableOperationVars[name]){ -ret+='var '+operationVar(name)+' = [];\n';}} - - -return ret;}; - - -var newlines=function(statements){ -return '\n'+statements.join('\n')+'\n';}; - - - - - - - - -var computeNextMatrixOperationField=function(anim,name,dimension,index){ -var fieldAccess=operationVar(name)+'['+index+']'; -if(anim.from[dimension]!==undefined&&anim.to[dimension]!==undefined){ -return ' '+anim.from[dimension]!==anim.to[dimension]? -computeNextValLinear(anim,anim.from[dimension],anim.to[dimension],fieldAccess): -fieldAccess+' = '+anim.from[dimension]+';';}else -{ -return ' '+fieldAccess+' = '+InitialOperationField[name][index]+';';}}; - - - -var unrolledVars=[]; -for(var varIndex=0;varIndex<16;varIndex++){ -unrolledVars.push('m'+varIndex);} - -var setNextMatrixAndDetectChange=function(orderedMatrixOperations){ -var fn=[ -' var transformMatrix = result.transformMatrix !== undefined ? '+ -'result.transformMatrix : (result.transformMatrix = []);']; - -fn.push.apply( -fn, -inline(MatrixOps.unroll,['transformMatrix'].concat(unrolledVars))); - -for(var i=0;ifromIndex?progress:1-progress; -var oldDistToCenter=index-fromIndex; -var newDistToCenter=index-toIndex; -var interpolate; -if(oldDistToCenter>0&&newDistToCenter===0|| -newDistToCenter>0&&oldDistToCenter===0){ -interpolate=this.props.navigationStyles.Interpolators.RightToCenter;}else -if(oldDistToCenter<0&&newDistToCenter===0|| -newDistToCenter<0&&oldDistToCenter===0){ -interpolate=this.props.navigationStyles.Interpolators.CenterToLeft;}else -if(oldDistToCenter===newDistToCenter){ -interpolate=this.props.navigationStyles.Interpolators.RightToCenter;}else -{ -interpolate=this.props.navigationStyles.Interpolators.RightToLeft;} - - -COMPONENT_NAMES.forEach(function(componentName){ -var component=this._components[componentName].get(this.props.navState.routeStack[index]); -var props=this._getReusableProps(componentName,index); -if(component&&interpolate[componentName](props.style,amount)){ -component.setNativeProps(props);}}, - -this);}, - - -updateProgress:function( -progress, -fromIndex, -toIndex) -{ -var max=Math.max(fromIndex,toIndex); -var min=Math.min(fromIndex,toIndex); -for(var index=min;index<=max;index++){ -this._updateIndexProgress(progress,index,fromIndex,toIndex);}}, - - - -render:function(){ -var navBarStyle={ -height:this.props.navigationStyles.General.TotalNavHeight}; - -var navState=this.props.navState; -var components=COMPONENT_NAMES.map(function(componentName){ -return navState.routeStack.map( -this._getComponent.bind(this,componentName));}, - -this); - -return ( -React.createElement(View,{style:[styles.navBarContainer,navBarStyle,this.props.style]}, -components));}, - - - - -_getComponent:function( -componentName, -route, -index) -{var _this2=this; -if(this._descriptors[componentName].includes(route)){ -return this._descriptors[componentName].get(route);} - - -var rendered=null; - -var content=this.props.routeMapper[componentName]( -this.props.navState.routeStack[index], -this.props.navigator, -index, -this.props.navState); - -if(!content){ -return null;} - - -var initialStage=index===navStatePresentedIndex(this.props.navState)? -this.props.navigationStyles.Stages.Center: -this.props.navigationStyles.Stages.Left; -rendered= -React.createElement(View,{ -ref:function(ref){ -_this2._components[componentName]=_this2._components[componentName].set(route,ref);}, - -style:initialStage[componentName]}, -content); - - - -this._descriptors[componentName]=this._descriptors[componentName].set(route,rendered); -return rendered;}}); - - - - - -var styles=StyleSheet.create({ -navBarContainer:{ -position:'absolute', -top:0, -left:0, -right:0, -backgroundColor:'transparent'}}); - - - -module.exports=NavigatorNavigationBar; -}); -__d('NavigatorSceneConfigs',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var PixelRatio=require('PixelRatio'); - -var buildStyleInterpolator=require('buildStyleInterpolator'); - -var SCREEN_WIDTH=Dimensions.get('window').width; -var SCREEN_HEIGHT=Dimensions.get('window').height; - -var FadeToTheLeft={ - - -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:-Math.round(Dimensions.get('window').width*0.3),y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - - - - - - - - - - - - -transformScale:{ -from:{x:1,y:1,z:1}, -to:{x:0.95,y:0.95,z:1}, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -opacity:{ -from:1, -to:0.3, -min:0, -max:1, -type:'linear', -extrapolate:false, -round:100}, - -translateX:{ -from:0, -to:-Math.round(Dimensions.get('window').width*0.3), -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -scaleX:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -scaleY:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}}; - - - -var FadeToTheRight=babelHelpers.extends({}, -FadeToTheLeft,{ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:Math.round(SCREEN_WIDTH*0.3),y:0,z:0}}, - -translateX:{ -from:0, -to:Math.round(SCREEN_WIDTH*0.3)}}); - - - -var FadeIn={ -opacity:{ -from:0, -to:1, -min:0.5, -max:1, -type:'linear', -extrapolate:false, -round:100}}; - - - -var FadeOut={ -opacity:{ -from:1, -to:0, -min:0, -max:0.5, -type:'linear', -extrapolate:false, -round:100}}; - - - -var ToTheLeft={ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:-Dimensions.get('window').width,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -opacity:{ -value:1.0, -type:'constant'}, - - -translateX:{ -from:0, -to:-Dimensions.get('window').width, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var ToTheUp={ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:0,y:-Dimensions.get('window').height,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -opacity:{ -value:1.0, -type:'constant'}, - -translateY:{ -from:0, -to:-Dimensions.get('window').height, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var ToTheDown={ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:0,y:Dimensions.get('window').height,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -opacity:{ -value:1.0, -type:'constant'}, - -translateY:{ -from:0, -to:Dimensions.get('window').height, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var FromTheRight={ -opacity:{ -value:1.0, -type:'constant'}, - - -transformTranslate:{ -from:{x:Dimensions.get('window').width,y:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - - -translateX:{ -from:Dimensions.get('window').width, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - - -scaleX:{ -value:1, -type:'constant'}, - -scaleY:{ -value:1, -type:'constant'}}; - - - -var FromTheLeft=babelHelpers.extends({}, -FromTheRight,{ -transformTranslate:{ -from:{x:-SCREEN_WIDTH,y:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateX:{ -from:-SCREEN_WIDTH, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}); - - - -var FromTheDown=babelHelpers.extends({}, -FromTheRight,{ -transformTranslate:{ -from:{y:SCREEN_HEIGHT,x:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:SCREEN_HEIGHT, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}); - - - -var FromTheTop=babelHelpers.extends({}, -FromTheRight,{ -transformTranslate:{ -from:{y:-SCREEN_HEIGHT,x:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:-SCREEN_HEIGHT, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}); - - - -var ToTheBack={ - - -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -transformScale:{ -from:{x:1,y:1,z:1}, -to:{x:0.95,y:0.95,z:1}, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -opacity:{ -from:1, -to:0.3, -min:0, -max:1, -type:'linear', -extrapolate:false, -round:100}, - -scaleX:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -scaleY:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}}; - - - -var FromTheFront={ -opacity:{ -value:1.0, -type:'constant'}, - - -transformTranslate:{ -from:{x:0,y:Dimensions.get('window').height,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:Dimensions.get('window').height, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -scaleX:{ -value:1, -type:'constant'}, - -scaleY:{ -value:1, -type:'constant'}}; - - - -var ToTheBackAndroid={ -opacity:{ -value:1, -type:'constant'}}; - - - -var FromTheFrontAndroid={ -opacity:{ -from:0, -to:1, -min:0.5, -max:1, -type:'linear', -extrapolate:false, -round:100}, - -transformTranslate:{ -from:{x:0,y:100,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:100, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var BaseOverswipeConfig={ -frictionConstant:1, -frictionByDistance:1.5}; - - -var BaseLeftToRightGesture={ - - -isDetachable:false, - - -gestureDetectMovement:2, - - -notMoving:0.3, - - -directionRatio:0.66, - - -snapVelocity:2, - - -edgeHitWidth:30, - - -stillCompletionRatio:3/5, - -fullDistance:SCREEN_WIDTH, - -direction:'left-to-right'}; - - - -var BaseRightToLeftGesture=babelHelpers.extends({}, -BaseLeftToRightGesture,{ -direction:'right-to-left'}); - - -var BaseDownUpGesture=babelHelpers.extends({}, -BaseLeftToRightGesture,{ -fullDistance:SCREEN_HEIGHT, -direction:'down-to-up'}); - - -var BaseUpDownGesture=babelHelpers.extends({}, -BaseLeftToRightGesture,{ -fullDistance:SCREEN_HEIGHT, -direction:'up-to-down'}); - - -var BaseConfig={ - -gestures:{ -pop:BaseLeftToRightGesture}, - - - -springFriction:26, -springTension:200, - - -defaultTransitionVelocity:1.5, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheRight), -out:buildStyleInterpolator(FadeToTheLeft)}}; - - - -var NavigatorSceneConfigs={ -PushFromRight:babelHelpers.extends({}, -BaseConfig), - - -FloatFromRight:babelHelpers.extends({}, -BaseConfig), - - -FloatFromLeft:babelHelpers.extends({}, -BaseConfig,{ -animationInterpolators:{ -into:buildStyleInterpolator(FromTheLeft), -out:buildStyleInterpolator(FadeToTheRight)}}), - - -FloatFromBottom:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -pop:babelHelpers.extends({}, -BaseLeftToRightGesture,{ -edgeHitWidth:150, -direction:'top-to-bottom', -fullDistance:SCREEN_HEIGHT})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheFront), -out:buildStyleInterpolator(ToTheBack)}}), - - -FloatFromBottomAndroid:babelHelpers.extends({}, -BaseConfig,{ -gestures:null, -defaultTransitionVelocity:3, -springFriction:20, -animationInterpolators:{ -into:buildStyleInterpolator(FromTheFrontAndroid), -out:buildStyleInterpolator(ToTheBackAndroid)}}), - - -FadeAndroid:babelHelpers.extends({}, -BaseConfig,{ -gestures:null, -animationInterpolators:{ -into:buildStyleInterpolator(FadeIn), -out:buildStyleInterpolator(FadeOut)}}), - - -HorizontalSwipeJump:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -jumpBack:babelHelpers.extends({}, -BaseLeftToRightGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true}), - -jumpForward:babelHelpers.extends({}, -BaseRightToLeftGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheRight), -out:buildStyleInterpolator(ToTheLeft)}}), - - -VerticalUpSwipeJump:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -jumpBack:babelHelpers.extends({}, -BaseDownUpGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true}), - -jumpForward:babelHelpers.extends({}, -BaseDownUpGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheDown), -out:buildStyleInterpolator(ToTheUp)}}), - - -VerticalDownSwipeJump:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -jumpBack:babelHelpers.extends({}, -BaseUpDownGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true}), - -jumpForward:babelHelpers.extends({}, -BaseUpDownGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheTop), -out:buildStyleInterpolator(ToTheDown)}})}; - - - - -module.exports=NavigatorSceneConfigs; -}); -__d('PanResponder',function(global, require, module, exports) { "use strict"; - - - - - -var TouchHistoryMath=require('TouchHistoryMath'); - -var currentCentroidXOfTouchesChangedAfter= -TouchHistoryMath.currentCentroidXOfTouchesChangedAfter; -var currentCentroidYOfTouchesChangedAfter= -TouchHistoryMath.currentCentroidYOfTouchesChangedAfter; -var previousCentroidXOfTouchesChangedAfter= -TouchHistoryMath.previousCentroidXOfTouchesChangedAfter; -var previousCentroidYOfTouchesChangedAfter= -TouchHistoryMath.previousCentroidYOfTouchesChangedAfter; -var currentCentroidX=TouchHistoryMath.currentCentroidX; -var currentCentroidY=TouchHistoryMath.currentCentroidY; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var PanResponder={ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_initializeGestureState:function(gestureState){ -gestureState.moveX=0; -gestureState.moveY=0; -gestureState.x0=0; -gestureState.y0=0; -gestureState.dx=0; -gestureState.dy=0; -gestureState.vx=0; -gestureState.vy=0; -gestureState.numberActiveTouches=0; - -gestureState._accountsForMovesUpTo=0;}, - - - - - - - - - - - - - - - - - - - - - - - - - - -_updateGestureStateOnMove:function(gestureState,touchHistory){ -gestureState.numberActiveTouches=touchHistory.numberActiveTouches; -gestureState.moveX=currentCentroidXOfTouchesChangedAfter( -touchHistory, -gestureState._accountsForMovesUpTo); - -gestureState.moveY=currentCentroidYOfTouchesChangedAfter( -touchHistory, -gestureState._accountsForMovesUpTo); - -var movedAfter=gestureState._accountsForMovesUpTo; -var prevX=previousCentroidXOfTouchesChangedAfter(touchHistory,movedAfter); -var x=currentCentroidXOfTouchesChangedAfter(touchHistory,movedAfter); -var prevY=previousCentroidYOfTouchesChangedAfter(touchHistory,movedAfter); -var y=currentCentroidYOfTouchesChangedAfter(touchHistory,movedAfter); -var nextDX=gestureState.dx+(x-prevX); -var nextDY=gestureState.dy+(y-prevY); - - -var dt= -touchHistory.mostRecentTimeStamp-gestureState._accountsForMovesUpTo; -gestureState.vx=(nextDX-gestureState.dx)/dt; -gestureState.vy=(nextDY-gestureState.dy)/dt; - -gestureState.dx=nextDX; -gestureState.dy=nextDY; -gestureState._accountsForMovesUpTo=touchHistory.mostRecentTimeStamp;}, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -create:function(config){ -var gestureState={ - -stateID:Math.random()}; - -PanResponder._initializeGestureState(gestureState); -var panHandlers={ -onStartShouldSetResponder:function(e){ -return config.onStartShouldSetPanResponder===undefined?false: -config.onStartShouldSetPanResponder(e,gestureState);}, - -onMoveShouldSetResponder:function(e){ -return config.onMoveShouldSetPanResponder===undefined?false: -config.onMoveShouldSetPanResponder(e,gestureState);}, - -onStartShouldSetResponderCapture:function(e){ - - -if(e.nativeEvent.touches.length===1){ -PanResponder._initializeGestureState(gestureState);} - -gestureState.numberActiveTouches=e.touchHistory.numberActiveTouches; -return config.onStartShouldSetPanResponderCapture!==undefined? -config.onStartShouldSetPanResponderCapture(e,gestureState):false;}, - - -onMoveShouldSetResponderCapture:function(e){ -var touchHistory=e.touchHistory; - - - -if(gestureState._accountsForMovesUpTo===touchHistory.mostRecentTimeStamp){ -return false;} - -PanResponder._updateGestureStateOnMove(gestureState,touchHistory); -return config.onMoveShouldSetPanResponderCapture? -config.onMoveShouldSetPanResponderCapture(e,gestureState):false;}, - - -onResponderGrant:function(e){ -gestureState.x0=currentCentroidX(e.touchHistory); -gestureState.y0=currentCentroidY(e.touchHistory); -gestureState.dx=0; -gestureState.dy=0; -config.onPanResponderGrant&&config.onPanResponderGrant(e,gestureState); - -return config.onShouldBlockNativeResponder===undefined?true: -config.onShouldBlockNativeResponder();}, - - -onResponderReject:function(e){ -config.onPanResponderReject&&config.onPanResponderReject(e,gestureState);}, - - -onResponderRelease:function(e){ -config.onPanResponderRelease&&config.onPanResponderRelease(e,gestureState); -PanResponder._initializeGestureState(gestureState);}, - - -onResponderStart:function(e){ -var touchHistory=e.touchHistory; -gestureState.numberActiveTouches=touchHistory.numberActiveTouches; -config.onPanResponderStart&&config.onPanResponderStart(e,gestureState);}, - - -onResponderMove:function(e){ -var touchHistory=e.touchHistory; - - -if(gestureState._accountsForMovesUpTo===touchHistory.mostRecentTimeStamp){ -return;} - - - -PanResponder._updateGestureStateOnMove(gestureState,touchHistory); -config.onPanResponderMove&&config.onPanResponderMove(e,gestureState);}, - - -onResponderEnd:function(e){ -var touchHistory=e.touchHistory; -gestureState.numberActiveTouches=touchHistory.numberActiveTouches; -config.onPanResponderEnd&&config.onPanResponderEnd(e,gestureState);}, - - -onResponderTerminate:function(e){ -config.onPanResponderTerminate&& -config.onPanResponderTerminate(e,gestureState); -PanResponder._initializeGestureState(gestureState);}, - - -onResponderTerminationRequest:function(e){ -return config.onPanResponderTerminationRequest===undefined?true: -config.onPanResponderTerminationRequest(e,gestureState);}}; - - -return {panHandlers:panHandlers};}}; - - - -module.exports=PanResponder; -}); -__d('TouchHistoryMath',function(global, require, module, exports) { "use strict"; - - - - - -var TouchHistoryMath={ - - - - - - - - - - - - - - - - -centroidDimension:function(touchHistory,touchesChangedAfter,isXAxis,ofCurrent){ -var touchBank=touchHistory.touchBank; -var total=0; -var count=0; - -var oneTouchData=touchHistory.numberActiveTouches===1? -touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]:null; - -if(oneTouchData!==null){ -if(oneTouchData.touchActive&&oneTouchData.currentTimeStamp>touchesChangedAfter){ -total+=ofCurrent&&isXAxis?oneTouchData.currentPageX: -ofCurrent&&!isXAxis?oneTouchData.currentPageY: -!ofCurrent&&isXAxis?oneTouchData.previousPageX: -oneTouchData.previousPageY; -count=1;}}else - -{ -for(var i=0;i=touchesChangedAfter){ -var toAdd; -if(ofCurrent&&isXAxis){ -toAdd=touchTrack.currentPageX;}else -if(ofCurrent&&!isXAxis){ -toAdd=touchTrack.currentPageY;}else -if(!ofCurrent&&isXAxis){ -toAdd=touchTrack.previousPageX;}else -{ -toAdd=touchTrack.previousPageY;} - -total+=toAdd; -count++;}}} - - - -return count>0?total/count:TouchHistoryMath.noCentroid;}, - - -currentCentroidXOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -true, -true);}, - - - -currentCentroidYOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -false, -true);}, - - - -previousCentroidXOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -true, -false);}, - - - -previousCentroidYOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -false, -false);}, - - - -currentCentroidX:function(touchHistory){ -return TouchHistoryMath.centroidDimension( -touchHistory, -0, -true, -true);}, - - - -currentCentroidY:function(touchHistory){ -return TouchHistoryMath.centroidDimension( -touchHistory, -0, -false, -true);}, - - - -noCentroid:-1}; - - -module.exports=TouchHistoryMath; -}); -__d('clamp',function(global, require, module, exports) { function - - - - - - - - - - - - - - - - - - - - - - - -clamp(min,value,max){ -if(valuemax){ -return max;} - -return value;} - - -module.exports=clamp; -}); -__d('rebound/rebound.js',function(global, require, module, exports) { ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function(){ -var rebound={}; -var util=rebound.util={}; -var concat=Array.prototype.concat; -var slice=Array.prototype.slice; - - -util.bind=function bind(func,context){ -var args=slice.call(arguments,2); -return function(){ -func.apply(context,concat.call(args,slice.call(arguments)));};}; - - - - -util.extend=function extend(target,source){ -for(var key in source){ -if(source.hasOwnProperty(key)){ -target[key]=source[key];}}}; - - - - - - - - - -var SpringSystem=rebound.SpringSystem=function SpringSystem(looper){ -this._springRegistry={}; -this._activeSprings=[]; -this.listeners=[]; -this._idleSpringIndices=[]; -this.looper=looper||new AnimationLooper(); -this.looper.springSystem=this;}; - - -util.extend(SpringSystem.prototype,{ - -_springRegistry:null, - -_isIdle:true, - -_lastTimeMillis:-1, - -_activeSprings:null, - -listeners:null, - -_idleSpringIndices:null, - - - - - - -setLooper:function(looper){ -this.looper=looper; -looper.springSystem=this;}, - - - - - - -createSpring:function(tension,friction){ -var springConfig; -if(tension===undefined||friction===undefined){ -springConfig=SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;}else -{ -springConfig= -SpringConfig.fromOrigamiTensionAndFriction(tension,friction);} - -return this.createSpringWithConfig(springConfig);}, - - - - - -createSpringWithBouncinessAndSpeed:function(bounciness,speed){ -var springConfig; -if(bounciness===undefined||speed===undefined){ -springConfig=SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;}else -{ -springConfig= -SpringConfig.fromBouncinessAndSpeed(bounciness,speed);} - -return this.createSpringWithConfig(springConfig);}, - - - -createSpringWithConfig:function(springConfig){ -var spring=new Spring(this); -this.registerSpring(spring); -spring.setSpringConfig(springConfig); -return spring;}, - - - - - - -getIsIdle:function(){ -return this._isIdle;}, - - - - - -getSpringById:function(id){ -return this._springRegistry[id];}, - - - - -getAllSprings:function(){ -var vals=[]; -for(var id in this._springRegistry){ -if(this._springRegistry.hasOwnProperty(id)){ -vals.push(this._springRegistry[id]);}} - - -return vals;}, - - - - - - -registerSpring:function(spring){ -this._springRegistry[spring.getId()]=spring;}, - - - - - - -deregisterSpring:function(spring){ -removeFirst(this._activeSprings,spring); -delete this._springRegistry[spring.getId()];}, - - -advance:function(time,deltaTime){ -while(this._idleSpringIndices.length>0){this._idleSpringIndices.pop();} -for(var i=0,len=this._activeSprings.length;i0){ -var idx=this._idleSpringIndices.pop(); -idx>=0&&this._activeSprings.splice(idx,1);}}, - - - - - - - - - - - - - - - - -loop:function(currentTimeMillis){ -var listener; -if(this._lastTimeMillis===-1){ -this._lastTimeMillis=currentTimeMillis-1;} - -var ellapsedMillis=currentTimeMillis-this._lastTimeMillis; -this._lastTimeMillis=currentTimeMillis; - -var i=0,len=this.listeners.length; -for(i=0;i0&&( -startend|| -start>end&&this.getCurrentValue()Spring.MAX_DELTA_TIME_SEC){ -adjustedDeltaTime=Spring.MAX_DELTA_TIME_SEC;} - - -this._timeAccumulator+=adjustedDeltaTime; - -var tension=this._springConfig.tension, -friction=this._springConfig.friction, - -position=this._currentState.position, -velocity=this._currentState.velocity, -tempPosition=this._tempState.position, -tempVelocity=this._tempState.velocity, - -aVelocity,aAcceleration, -bVelocity,bAcceleration, -cVelocity,cAcceleration, -dVelocity,dAcceleration, - -dxdt,dvdt; - -while(this._timeAccumulator>=Spring.SOLVER_TIMESTEP_SEC){ - -this._timeAccumulator-=Spring.SOLVER_TIMESTEP_SEC; - -if(this._timeAccumulator0){ -this._interpolate(this._timeAccumulator/Spring.SOLVER_TIMESTEP_SEC);} - - -if(this.isAtRest()|| -this._overshootClampingEnabled&&this.isOvershooting()){ - -if(this._springConfig.tension>0){ -this._startValue=this._endValue; -this._currentState.position=this._endValue;}else -{ -this._endValue=this._currentState.position; -this._startValue=this._endValue;} - -this.setVelocity(0); -isAtRest=true;} - - -var notifyActivate=false; -if(this._wasAtRest){ -this._wasAtRest=false; -notifyActivate=true;} - - -var notifyAtRest=false; -if(isAtRest){ -this._wasAtRest=true; -notifyAtRest=true;} - - -this.notifyPositionUpdated(notifyActivate,notifyAtRest);}, - - -notifyPositionUpdated:function(notifyActivate,notifyAtRest){ -for(var i=0,len=this.listeners.length;i18&&tension<=44){ -friction=this.b3Friction2(tension);}else -{ -friction=this.b3Friction3(tension);} - -return friction;}}); - - - -util.extend(SpringConfig,{ - - - - -fromOrigamiTensionAndFriction:function(tension,friction){ -return new SpringConfig( -OrigamiValueConverter.tensionFromOrigamiValue(tension), -OrigamiValueConverter.frictionFromOrigamiValue(friction));}, - - - - - -fromBouncinessAndSpeed:function(bounciness,speed){ -var bouncyConversion=new rebound.BouncyConversion(bounciness,speed); -return this.fromOrigamiTensionAndFriction( -bouncyConversion.bouncyTension, -bouncyConversion.bouncyFriction);}, - - - - -coastingConfigWithOrigamiFriction:function(friction){ -return new SpringConfig( -0, -OrigamiValueConverter.frictionFromOrigamiValue(friction));}}); - - - - -SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG= -SpringConfig.fromOrigamiTensionAndFriction(40,7); - -util.extend(SpringConfig.prototype,{friction:0,tension:0}); - - - - -var colorCache={}; -util.hexToRGB=function(color){ -if(colorCache[color]){ -return colorCache[color];} - -color=color.replace('#',''); -if(color.length===3){ -color=color[0]+color[0]+color[1]+color[1]+color[2]+color[2];} - -var parts=color.match(/.{2}/g); - -var ret={ -r:parseInt(parts[0],16), -g:parseInt(parts[1],16), -b:parseInt(parts[2],16)}; - - -colorCache[color]=ret; -return ret;}; - - -util.rgbToHex=function(r,g,b){ -r=r.toString(16); -g=g.toString(16); -b=b.toString(16); -r=r.length<2?'0'+r:r; -g=g.length<2?'0'+g:g; -b=b.length<2?'0'+b:b; -return '#'+r+g+b;}; - - -var MathUtil=rebound.MathUtil={ - - - - - - - - -mapValueInRange:function(value,fromLow,fromHigh,toLow,toHigh){ -var fromRangeSize=fromHigh-fromLow; -var toRangeSize=toHigh-toLow; -var valueScale=(value-fromLow)/fromRangeSize; -return toLow+valueScale*toRangeSize;}, - - - - - -interpolateColor: -function(val,startColor,endColor,fromLow,fromHigh,asRGB){ -fromLow=fromLow===undefined?0:fromLow; -fromHigh=fromHigh===undefined?1:fromHigh; -startColor=util.hexToRGB(startColor); -endColor=util.hexToRGB(endColor); -var r=Math.floor( -util.mapValueInRange(val,fromLow,fromHigh,startColor.r,endColor.r)); - -var g=Math.floor( -util.mapValueInRange(val,fromLow,fromHigh,startColor.g,endColor.g)); - -var b=Math.floor( -util.mapValueInRange(val,fromLow,fromHigh,startColor.b,endColor.b)); - -if(asRGB){ -return 'rgb('+r+','+g+','+b+')';}else -{ -return util.rgbToHex(r,g,b);}}, - - - -degreesToRadians:function(deg){ -return deg*Math.PI/180;}, - - -radiansToDegrees:function(rad){ -return rad*180/Math.PI;}}; - - - - -util.extend(util,MathUtil); - - - - - - - -function removeFirst(array,item){ -var idx=array.indexOf(item); -idx!=-1&&array.splice(idx,1);} - - -var _onFrame; -if(typeof window!=='undefined'){ -_onFrame=window.requestAnimationFrame|| -window.webkitRequestAnimationFrame|| -window.mozRequestAnimationFrame|| -window.msRequestAnimationFrame|| -window.oRequestAnimationFrame|| -function(callback){ -window.setTimeout(callback,1000/60);};} - - -if(!_onFrame&&typeof process!=='undefined'&&process.title==='node'){ -_onFrame=setImmediate;} - - - -util.onFrame=function onFrame(func){ -return _onFrame(func);}; - - - - -if(typeof exports!='undefined'){ -util.extend(exports,rebound);}else -if(typeof window!='undefined'){ -window.rebound=rebound;}})(); -}); -__d('NavigatorIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventEmitter=require('EventEmitter'); -var Image=require('Image'); -var NavigationContext=require('NavigationContext'); -var RCTNavigatorManager=require('NativeModules').NavigatorManager; -var React=require('React'); -var StaticContainer=require('StaticContainer.react'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var invariant=require('invariant'); -var logError=require('logError'); -var requireNativeComponent=require('requireNativeComponent'); -var resolveAssetSource=require('resolveAssetSource'); - -var TRANSITIONER_REF='transitionerRef'; - -var PropTypes=React.PropTypes; - -var __uid=0; -function getuid(){ -return __uid++;} - - -var NavigatorTransitionerIOS=React.createClass({displayName:'NavigatorTransitionerIOS', -requestSchedulingNavigation:function(cb){ -RCTNavigatorManager.requestSchedulingJavaScriptNavigation( -React.findNodeHandle(this), -logError, -cb);}, - - - -render:function(){ -return ( -React.createElement(RCTNavigator,this.props));}}); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var NavigatorIOS=React.createClass({displayName:'NavigatorIOS', - -propTypes:{ - - - - - - -initialRoute:PropTypes.shape({ - - - -component:PropTypes.func.isRequired, - - - - -title:PropTypes.string.isRequired, - - - - - -passProps:PropTypes.object, - - - - - - -backButtonIcon:Image.propTypes.source, - - - - - - -backButtonTitle:PropTypes.string, - - - - -leftButtonIcon:Image.propTypes.source, - - - - -leftButtonTitle:PropTypes.string, - - - - -onLeftButtonPress:PropTypes.func, - - - - -rightButtonIcon:Image.propTypes.source, - - - - -rightButtonTitle:PropTypes.string, - - - - -onRightButtonPress:PropTypes.func, - - - - -wrapperStyle:View.propTypes.style}). - -isRequired, - - - - -navigationBarHidden:PropTypes.bool, - - - - -shadowHidden:PropTypes.bool, - - - - - -itemWrapperStyle:View.propTypes.style, - - - - -tintColor:PropTypes.string, - - - - -barTintColor:PropTypes.string, - - - - -titleTextColor:PropTypes.string, - - - - -translucent:PropTypes.bool}, - - - -navigator:undefined, -navigationContext:new NavigationContext(), - -componentWillMount:function(){ - - -this.navigator={ -push:this.push, -pop:this.pop, -popN:this.popN, -replace:this.replace, -replacePrevious:this.replacePrevious, -replacePreviousAndPop:this.replacePreviousAndPop, -resetTo:this.resetTo, -popToRoute:this.popToRoute, -popToTop:this.popToTop, -navigationContext:this.navigationContext}; - -this._emitWillFocus(this.state.routeStack[this.state.observedTopOfStack]);}, - - -componentDidMount:function(){ -this._emitDidFocus(this.state.routeStack[this.state.observedTopOfStack]);}, - - -componentWillUnmount:function(){ -this.navigationContext.dispose(); -this.navigationContext=new NavigationContext();}, - - -getDefaultProps:function(){ -return { -translucent:true};}, - - - -getInitialState:function(){ -return { -idStack:[getuid()], -routeStack:[this.props.initialRoute], - -requestedTopOfStack:0, - - - - - - -observedTopOfStack:0, -progress:1, -fromIndex:0, -toIndex:0, - - -makingNavigatorRequest:false, - - - -updatingAllIndicesAtOrBeyond:0};}, - - - -_toFocusOnNavigationComplete:undefined, - -_handleFocusRequest:function(item){ -if(this.state.makingNavigatorRequest){ -this._toFocusOnNavigationComplete=item;}else -{ -this._getFocusEmitter().emit('focus',item);}}, - - - -_focusEmitter:undefined, - -_getFocusEmitter:function(){ - -var focusEmitter=this._focusEmitter; -if(!focusEmitter){ -focusEmitter=new EventEmitter(); -this._focusEmitter=focusEmitter;} - -return focusEmitter;}, - - -getChildContext:function() - - -{ -return { -onFocusRequested:this._handleFocusRequest, -focusEmitter:this._getFocusEmitter()};}, - - - -childContextTypes:{ -onFocusRequested:React.PropTypes.func, -focusEmitter:React.PropTypes.instanceOf(EventEmitter)}, - - -_tryLockNavigator:function(cb){ -this.refs[TRANSITIONER_REF].requestSchedulingNavigation( -function(acquiredLock){return acquiredLock&&cb();});}, - - - -_handleNavigatorStackChanged:function(e){ -var newObservedTopOfStack=e.nativeEvent.stackLength-1; -this._emitDidFocus(this.state.routeStack[newObservedTopOfStack]); - -invariant( -newObservedTopOfStack<=this.state.requestedTopOfStack, -'No navigator item should be pushed without JS knowing about it %s %s',newObservedTopOfStack,this.state.requestedTopOfStack); - -var wasWaitingForConfirmation= -this.state.requestedTopOfStack!==this.state.observedTopOfStack; -if(wasWaitingForConfirmation){ -invariant( -newObservedTopOfStack===this.state.requestedTopOfStack, -'If waiting for observedTopOfStack to reach requestedTopOfStack, '+ -'the only valid observedTopOfStack should be requestedTopOfStack.');} - - - - - - - - - - - -var nextState={ -observedTopOfStack:newObservedTopOfStack, -makingNavigatorRequest:false, -updatingAllIndicesAtOrBeyond:null, -progress:1, -toIndex:newObservedTopOfStack, -fromIndex:newObservedTopOfStack}; - -this.setState(nextState,this._eliminateUnneededChildren);}, - - -_eliminateUnneededChildren:function(){ - - - -var updatingAllIndicesAtOrBeyond= -this.state.routeStack.length>this.state.observedTopOfStack+1? -this.state.observedTopOfStack+1: -null; -this.setState({ -idStack:this.state.idStack.slice(0,this.state.observedTopOfStack+1), -routeStack:this.state.routeStack.slice(0,this.state.observedTopOfStack+1), - -requestedTopOfStack:this.state.observedTopOfStack, -makingNavigatorRequest:true, -updatingAllIndicesAtOrBeyond:updatingAllIndicesAtOrBeyond});}, - - - -_emitDidFocus:function(route){ -this.navigationContext.emit('didfocus',{route:route});}, - - -_emitWillFocus:function(route){ -this.navigationContext.emit('willfocus',{route:route});}, - - -push:function(route){var _this=this; -invariant(!!route,'Must supply route to push'); - -if(this.state.requestedTopOfStack===this.state.observedTopOfStack){ -this._tryLockNavigator(function(){ -_this._emitWillFocus(route); - -var nextStack=_this.state.routeStack.concat([route]); -var nextIDStack=_this.state.idStack.concat([getuid()]); -_this.setState({ - - -idStack:nextIDStack, -routeStack:nextStack, -requestedTopOfStack:nextStack.length-1, -makingNavigatorRequest:true, -updatingAllIndicesAtOrBeyond:nextStack.length-1});});}}, - - - - - -popN:function(n){var _this2=this; -if(n===0){ -return;} - - -if(this.state.requestedTopOfStack===this.state.observedTopOfStack){ -if(this.state.requestedTopOfStack>0){ -this._tryLockNavigator(function(){ -var newRequestedTopOfStack=_this2.state.requestedTopOfStack-n; -invariant(newRequestedTopOfStack>=0,'Cannot pop below 0'); -_this2._emitWillFocus(_this2.state.routeStack[newRequestedTopOfStack]); -_this2.setState({ -requestedTopOfStack:newRequestedTopOfStack, -makingNavigatorRequest:true, - - -updatingAllIndicesAtOrBeyond:null});});}}}, - - - - - - -pop:function(){ -this.popN(1);}, - - - - - - - - -replaceAtIndex:function(route,index){ -invariant(!!route,'Must supply route to replace'); -if(index<0){ -index+=this.state.routeStack.length;} - - -if(this.state.routeStack.length<=index){ -return;} - - - - -var nextIDStack=this.state.idStack.slice(); -var nextRouteStack=this.state.routeStack.slice(); -nextIDStack[index]=getuid(); -nextRouteStack[index]=route; - -this.setState({ -idStack:nextIDStack, -routeStack:nextRouteStack, -makingNavigatorRequest:false, -updatingAllIndicesAtOrBeyond:index}); - - -this._emitWillFocus(route); -this._emitDidFocus(route);}, - - - - - -replace:function(route){ -this.replaceAtIndex(route,-1);}, - - - - - -replacePrevious:function(route){ -this.replaceAtIndex(route,-2);}, - - -popToTop:function(){ -this.popToRoute(this.state.routeStack[0]);}, - - -popToRoute:function(route){ -var indexOfRoute=this.state.routeStack.indexOf(route); -invariant( -indexOfRoute!==-1, -'Calling pop to route for a route that doesn\'t exist!'); - -var numToPop=this.state.routeStack.length-indexOfRoute-1; -this.popN(numToPop);}, - - -replacePreviousAndPop:function(route){var _this3=this; - -if(this.state.requestedTopOfStack!==this.state.observedTopOfStack){ -return;} - -if(this.state.routeStack.length<2){ -return;} - -this._tryLockNavigator(function(){ -_this3.replacePrevious(route); -_this3.setState({ -requestedTopOfStack:_this3.state.requestedTopOfStack-1, -makingNavigatorRequest:true});});}, - - - - -resetTo:function(route){ -invariant(!!route,'Must supply route to push'); - -if(this.state.requestedTopOfStack!==this.state.observedTopOfStack){ -return;} - -this.replaceAtIndex(route,0); -this.popToRoute(route);}, - - -handleNavigationComplete:function(e){ -if(this._toFocusOnNavigationComplete){ -this._getFocusEmitter().emit('focus',this._toFocusOnNavigationComplete); -this._toFocusOnNavigationComplete=null;} - -this._handleNavigatorStackChanged(e);}, - - -_routeToStackItem:function(route,i){var -component=route.component;var wrapperStyle=route.wrapperStyle;var passProps=route.passProps;var route=babelHelpers.objectWithoutProperties(route,['component','wrapperStyle','passProps']);var _props= -this.props;var itemWrapperStyle=_props.itemWrapperStyle;var props=babelHelpers.objectWithoutProperties(_props,['itemWrapperStyle']); -var shouldUpdateChild= -this.state.updatingAllIndicesAtOrBeyond&& -this.state.updatingAllIndicesAtOrBeyond>=i; -var Component=component; -return ( -React.createElement(StaticContainer,{key:'nav'+i,shouldUpdate:shouldUpdateChild}, -React.createElement(RCTNavigatorItem,babelHelpers.extends({}, -route, -props,{ -style:[ -styles.stackItem, -itemWrapperStyle, -wrapperStyle]}), - -React.createElement(Component,babelHelpers.extends({ -navigator:this.navigator, -route:route}, -passProps)))));}, - - - - - - -renderNavigationStackItems:function(){ -var shouldRecurseToNavigator= -this.state.makingNavigatorRequest|| -this.state.updatingAllIndicesAtOrBeyond!==null; - - -var items=shouldRecurseToNavigator? -this.state.routeStack.map(this._routeToStackItem):null; -return ( -React.createElement(StaticContainer,{shouldUpdate:shouldRecurseToNavigator}, -React.createElement(NavigatorTransitionerIOS,{ -ref:TRANSITIONER_REF, -style:styles.transitioner, -vertical:this.props.vertical, -requestedTopOfStack:this.state.requestedTopOfStack, -onNavigationComplete:this.handleNavigationComplete}, -items)));}, - - - - - -render:function(){ -return ( -React.createElement(View,{style:this.props.style}, -this.renderNavigationStackItems()));}}); - - - - - -var styles=StyleSheet.create({ -stackItem:{ -backgroundColor:'white', -overflow:'hidden', -position:'absolute', -top:0, -left:0, -right:0, -bottom:0}, - -transitioner:{ -flex:1}}); - - - -var RCTNavigator=requireNativeComponent('RCTNavigator'); -var RCTNavigatorItem=requireNativeComponent('RCTNavItem'); - -module.exports=NavigatorIOS; -}); -__d('StaticContainer.react',function(global, require, module, exports) { var - - - - - - - - - - - - - - - - - - - - -React=require('React'); - -var onlyChild=require('onlyChild');var - - - - - - - - - - - - - - - - -StaticContainer=(function(_React$Component){babelHelpers.inherits(StaticContainer,_React$Component);function StaticContainer(){babelHelpers.classCallCheck(this,StaticContainer);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(StaticContainer).apply(this,arguments));}babelHelpers.createClass(StaticContainer,[{key:'shouldComponentUpdate',value:function shouldComponentUpdate( - -nextProps){ -return !!nextProps.shouldUpdate;}},{key:'render',value:function render() - - -{ -var child=this.props.children; -return child===null||child===false?null:onlyChild(child);}}]);return StaticContainer;})(React.Component); - - - - -module.exports=StaticContainer; -}); -__d('PickerIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var React=require('React'); -var ReactChildren=require('ReactChildren'); -var RCTPickerIOSConsts=require('NativeModules').UIManager.RCTPicker.Constants; -var StyleSheet=require('StyleSheet'); -var StyleSheetPropType=require('StyleSheetPropType'); -var TextStylePropTypes=require('TextStylePropTypes'); -var View=require('View'); - -var itemStylePropType=StyleSheetPropType(TextStylePropTypes); -var requireNativeComponent=require('requireNativeComponent'); - -var PickerIOS=React.createClass({displayName:'PickerIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ -itemStyle:itemStylePropType, -onValueChange:React.PropTypes.func, -selectedValue:React.PropTypes.any}), - - -getInitialState:function(){ -return this._stateFromProps(this.props);}, - - -componentWillReceiveProps:function(nextProps){ -this.setState(this._stateFromProps(nextProps));}, - - - -_stateFromProps:function(props){ -var selectedIndex=0; -var items=[]; -ReactChildren.forEach(props.children,function(child,index){ -if(child.props.value===props.selectedValue){ -selectedIndex=index;} - -items.push({value:child.props.value,label:child.props.label});}); - -return {selectedIndex:selectedIndex,items:items};}, - - -render:function(){var _this=this; -return ( -React.createElement(View,{style:this.props.style}, -React.createElement(RCTPickerIOS,{ -ref:function(picker){return _this._picker=picker;}, -style:[styles.pickerIOS,this.props.itemStyle], -items:this.state.items, -selectedIndex:this.state.selectedIndex, -onChange:this._onChange})));}, - - - - - -_onChange:function(event){ -if(this.props.onChange){ -this.props.onChange(event);} - -if(this.props.onValueChange){ -this.props.onValueChange(event.nativeEvent.newValue);} - - - - - - - - -if(this._picker&&this.state.selectedIndex!==event.nativeEvent.newIndex){ -this._picker.setNativeProps({ -selectedIndex:this.state.selectedIndex});}}}); - - - - - -PickerIOS.Item=React.createClass({displayName:'Item', -propTypes:{ -value:React.PropTypes.any, -label:React.PropTypes.string}, - - -render:function(){ - -return null;}}); - - - -var styles=StyleSheet.create({ -pickerIOS:{ - - - -height:RCTPickerIOSConsts.ComponentHeight}}); - - - -var RCTPickerIOS=requireNativeComponent('RCTPicker',{ -propTypes:{ -style:itemStylePropType}}, - -{ -nativeOnly:{ -items:true, -onChange:true, -selectedIndex:true}}); - - - -module.exports=PickerIOS; -}); -__d('ProgressBarAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('ProgressViewIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Image=require('Image'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var NativeModules=require('NativeModules'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - -var ProgressViewIOS=React.createClass({displayName:'ProgressViewIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -progressViewStyle:PropTypes.oneOf(['default','bar']), - - - - -progress:PropTypes.number, - - - - -progressTintColor:PropTypes.string, - - - - -trackTintColor:PropTypes.string, - - - - -progressImage:Image.propTypes.source, - - - - -trackImage:Image.propTypes.source}), - - -render:function(){ -return ( -React.createElement(RCTProgressView,babelHelpers.extends({}, -this.props,{ -style:[styles.progressView,this.props.style]})));}}); - - - - - -var styles=StyleSheet.create({ -progressView:{ -height:NativeModules.ProgressViewManager.ComponentHeight}}); - - - -var RCTProgressView=requireNativeComponent( -'RCTProgressView', -ProgressViewIOS); - - -module.exports=ProgressViewIOS; -}); -__d('SegmentedControlIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var NativeModules=require('NativeModules'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - - - -var SEGMENTED_CONTROL_REFERENCE='segmentedcontrol'; - - - - - - -var SegmentedControlIOS=React.createClass({displayName:'SegmentedControlIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -values:PropTypes.arrayOf(PropTypes.string), - - - - -selectedIndex:PropTypes.number, - - - - - -onValueChange:PropTypes.func, - - - - - -onChange:PropTypes.func, - - - - - -enabled:PropTypes.bool, - - - - -tintColor:PropTypes.string, - - - - - -momentary:PropTypes.bool}), - - -getDefaultProps:function(){ -return { -values:[], -enabled:true};}, - - - -_onChange:function(event){ -this.props.onChange&&this.props.onChange(event); -this.props.onValueChange&&this.props.onValueChange(event.nativeEvent.value);}, - - -render:function(){ -return ( -React.createElement(RCTSegmentedControl,babelHelpers.extends({}, -this.props,{ -ref:SEGMENTED_CONTROL_REFERENCE, -style:[styles.segmentedControl,this.props.style], -onChange:this._onChange})));}}); - - - - - -var styles=StyleSheet.create({ -segmentedControl:{ -height:NativeModules.SegmentedControlManager.ComponentHeight}}); - - - -var RCTSegmentedControl=requireNativeComponent( -'RCTSegmentedControl', -SegmentedControlIOS); - - -module.exports=SegmentedControlIOS; -}); -__d('SliderIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Image=require('Image'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - -var SliderIOS=React.createClass({displayName:'SliderIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - -style:View.propTypes.style, - - - - - - - - - -value:PropTypes.number, - - - - - - -step:PropTypes.number, - - - - -minimumValue:PropTypes.number, - - - - -maximumValue:PropTypes.number, - - - - - -minimumTrackTintColor:PropTypes.string, - - - - - -maximumTrackTintColor:PropTypes.string, - - - - - -disabled:PropTypes.bool, - - - - -trackImage:Image.propTypes.source, - - - - -thumbImage:Image.propTypes.source, - - - - -onValueChange:PropTypes.func, - - - - - -onSlidingComplete:PropTypes.func}), - - -getDefaultProps:function(){ -return { -disabled:false};}, - - - -render:function(){var _this=this; - -var onValueChange=this.props.onValueChange&&function(event){ -_this.props.onValueChange&& -_this.props.onValueChange(event.nativeEvent.value);}; - - -var onSlidingComplete=this.props.onSlidingComplete&&function(event){ -_this.props.onSlidingComplete&& -_this.props.onSlidingComplete(event.nativeEvent.value);};var _props= - - -this.props;var style=_props.style;var props=babelHelpers.objectWithoutProperties(_props,['style']); -style=[styles.slider,style]; - -return ( -React.createElement(RCTSlider,babelHelpers.extends({}, -props,{ -style:style, -onValueChange:onValueChange, -onSlidingComplete:onSlidingComplete})));}}); - - - - - -var styles=StyleSheet.create({ -slider:{ -height:40}}); - - - -var RCTSlider=requireNativeComponent('RCTSlider',SliderIOS); - -module.exports=SliderIOS; -}); -__d('SnapshotViewIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet');var _require= -require('NativeModules');var TestModule=_require.TestModule;var UIManager=_require.UIManager; -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var SnapshotViewIOS=React.createClass({displayName:'SnapshotViewIOS', -onDefaultAction:function(event){ -TestModule.verifySnapshot(TestModule.markTestPassed);}, - - -render:function(){ -var testIdentifier=this.props.testIdentifier||'test'; -var onSnapshotReady=this.props.onSnapshotReady||this.onDefaultAction; -return ( -React.createElement(RCTSnapshot,babelHelpers.extends({ -style:style.snapshot}, -this.props,{ -onSnapshotReady:onSnapshotReady, -testIdentifier:testIdentifier})));}, - - - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - -onSnapshotReady:React.PropTypes.func, - -testIdentifier:React.PropTypes.string})}); - - - -var style=StyleSheet.create({ -snapshot:{ -flex:1}}); - - - - - - -var RCTSnapshot=UIManager.RCTSnapshot? -requireNativeComponent('RCTSnapshot',SnapshotViewIOS): -View; - -module.exports=SnapshotViewIOS; -}); -__d('Switch',function(global, require, module, exports) { 'use strict'; - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var Platform=require('Platform'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - - - - - - -var Switch=React.createClass({displayName:'Switch', -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - -value:React.PropTypes.bool, - - - - -disabled:React.PropTypes.bool, - - - -onValueChange:React.PropTypes.func, - - - -testID:React.PropTypes.string, - - - - - -tintColor:React.PropTypes.string, - - - - -onTintColor:React.PropTypes.string, - - - - -thumbTintColor:React.PropTypes.string}), - - -getDefaultProps:function(){ -return { -value:false, -disabled:false};}, - - - -mixins:[NativeMethodsMixin], - -_rctSwitch:{}, -_onChange:function(event){ -this.props.onChange&&this.props.onChange(event); -this.props.onValueChange&&this.props.onValueChange(event.nativeEvent.value); - - - -if(Platform.OS==='android'){ -this._rctSwitch.setNativeProps({on:this.props.value});}else -{ -this._rctSwitch.setNativeProps({value:this.props.value});}}, - - - -render:function(){var _this=this; -var props=babelHelpers.extends({},this.props); -props.onStartShouldSetResponder=function(){return true;}; -props.onResponderTerminationRequest=function(){return false;}; -if(Platform.OS==='android'){ -props.enabled=!this.props.disabled; -props.on=this.props.value; -props.style=[styles.rctSwitchAndroid,this.props.style];}else -if(Platform.OS==='ios'){ -props.style=[styles.rctSwitchIOS,this.props.style];} - -return ( -React.createElement(RCTSwitch,babelHelpers.extends({}, -props,{ -ref:function(ref){_this._rctSwitch=ref;}, -onChange:this._onChange})));}}); - - - - - -var styles=StyleSheet.create({ -rctSwitchIOS:{ -height:31, -width:51}, - -rctSwitchAndroid:{ -height:27, -width:40}}); - - - -if(Platform.OS==='android'){ -var RCTSwitch=requireNativeComponent('AndroidSwitch',Switch,{ -nativeOnly:{onChange:true,on:true,enabled:true}});}else - -{ -var RCTSwitch=requireNativeComponent('RCTSwitch',Switch,{ -nativeOnly:{onChange:true}});} - - - -module.exports=Switch; -}); -__d('PullToRefreshViewAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('SwitchAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('SwitchIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var SWITCH='switch'; - - - - - - - - - - - - - - - -var SwitchIOS=React.createClass({displayName:'SwitchIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - -value:PropTypes.bool, - - - - - -disabled:PropTypes.bool, - - - - -onValueChange:PropTypes.func, - - - - -onTintColor:PropTypes.string, - - - - -thumbTintColor:PropTypes.string, - - - - -tintColor:PropTypes.string}), - - -getDefaultProps:function(){ -return { -value:false, -disabled:false};}, - - - -_onChange:function(event){ - - -this.refs[SWITCH].setNativeProps({value:this.props.value}); - -if(this.props.value===event.nativeEvent.value||this.props.disabled){ -return;} - - -this.props.onChange&&this.props.onChange(event); -this.props.onValueChange&&this.props.onValueChange(event.nativeEvent.value);}, - - -render:function(){ -return ( -React.createElement(RCTSwitch,babelHelpers.extends({}, -this.props,{ -ref:SWITCH, -onChange:this._onChange, -style:[styles.rkSwitch,this.props.style]})));}}); - - - - - -var styles=StyleSheet.create({ -rkSwitch:{ -height:31, -width:51}}); - - - -var RCTSwitch=requireNativeComponent('RCTSwitch',SwitchIOS,{ -nativeOnly:{onChange:true}}); - - -module.exports=SwitchIOS; -}); -__d('TabBarIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var TabBarItemIOS=require('TabBarItemIOS'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var TabBarIOS=React.createClass({displayName:'TabBarIOS', -statics:{ -Item:TabBarItemIOS}, - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ -style:View.propTypes.style, - - - -tintColor:React.PropTypes.string, - - - -barTintColor:React.PropTypes.string, - - - -translucent:React.PropTypes.bool}), - - -render:function(){ -return ( -React.createElement(RCTTabBar,{ -style:[styles.tabGroup,this.props.style], -tintColor:this.props.tintColor, -barTintColor:this.props.barTintColor, -translucent:this.props.translucent!==false}, -this.props.children));}}); - - - - - -var styles=StyleSheet.create({ -tabGroup:{ -flex:1}}); - - - -var RCTTabBar=requireNativeComponent('RCTTabBar',TabBarIOS); - -module.exports=TabBarIOS; -}); -__d('TabBarItemIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Image=require('Image'); -var React=require('React'); -var StaticContainer=require('StaticContainer.react'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var TabBarItemIOS=React.createClass({displayName:'TabBarItemIOS', -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -badge:React.PropTypes.oneOfType([ -React.PropTypes.string, -React.PropTypes.number]), - - - - - - -systemIcon:React.PropTypes.oneOf([ -'bookmarks', -'contacts', -'downloads', -'favorites', -'featured', -'history', -'more', -'most-recent', -'most-viewed', -'recents', -'search', -'top-rated']), - - - - -icon:Image.propTypes.source, - - - - -selectedIcon:Image.propTypes.source, - - - - -onPress:React.PropTypes.func, - - - - -selected:React.PropTypes.bool, - - - -style:View.propTypes.style, - - - - -title:React.PropTypes.string}), - - -getInitialState:function(){ -return { -hasBeenSelected:false};}, - - - -componentWillMount:function(){ -if(this.props.selected){ -this.setState({hasBeenSelected:true});}}, - - - -componentWillReceiveProps:function(nextProps){ -if(this.state.hasBeenSelected||nextProps.selected){ -this.setState({hasBeenSelected:true});}}, - - - -render:function(){var _props= -this.props;var style=_props.style;var children=_props.children;var props=babelHelpers.objectWithoutProperties(_props,['style','children']); - - - -if(this.state.hasBeenSelected){ -var tabContents= -React.createElement(StaticContainer,{shouldUpdate:this.props.selected}, -children);}else - -{ -var tabContents=React.createElement(View,null);} - - -return ( -React.createElement(RCTTabBarItem,babelHelpers.extends({}, -props,{ -style:[styles.tab,style]}), -tabContents));}}); - - - - - -var styles=StyleSheet.create({ -tab:{ -position:'absolute', -top:0, -right:0, -bottom:0, -left:0}}); - - - -var RCTTabBarItem=requireNativeComponent('RCTTabBarItem',TabBarItemIOS); - -module.exports=TabBarItemIOS; -}); -__d('Text',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var Platform=require('Platform'); -var React=require('React'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactNativeViewAttributes=require('ReactNativeViewAttributes'); -var StyleSheetPropType=require('StyleSheetPropType'); -var TextStylePropTypes=require('TextStylePropTypes'); -var Touchable=require('Touchable'); - -var createReactNativeComponentClass= -require('createReactNativeComponentClass'); -var merge=require('merge'); - -var stylePropType=StyleSheetPropType(TextStylePropTypes); - -var viewConfig={ -validAttributes:merge(ReactNativeViewAttributes.UIView,{ -isHighlighted:true, -numberOfLines:true, -allowFontScaling:true}), - -uiViewClassName:'RCTText'}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var Text=React.createClass({displayName:'Text', -propTypes:{ - - - - - -numberOfLines:React.PropTypes.number, - - - - - -onLayout:React.PropTypes.func, - - - -onPress:React.PropTypes.func, - - - - - -suppressHighlighting:React.PropTypes.bool, -style:stylePropType, - - - -testID:React.PropTypes.string, - - - -allowFontScaling:React.PropTypes.bool}, - -getDefaultProps:function(){ -return { -accessible:true, -allowFontScaling:true};}, - - -getInitialState:function(){ -return merge(Touchable.Mixin.touchableGetInitialState(),{ -isHighlighted:false});}, - - -mixins:[NativeMethodsMixin], -viewConfig:viewConfig, -getChildContext:function(){ -return {isInAParentText:true};}, - -childContextTypes:{ -isInAParentText:React.PropTypes.bool}, - -contextTypes:{ -isInAParentText:React.PropTypes.bool}, - - - - -_handlers:null, - - - - -touchableHandleActivePressIn:null, -touchableHandleActivePressOut:null, -touchableHandlePress:null, -touchableGetPressRectOffset:null, -render:function(){var _this=this; -var newProps=this.props; -if(this.props.onStartShouldSetResponder||this.props.onPress){ -if(!this._handlers){ -this._handlers={ -onStartShouldSetResponder:function(){ -var shouldSetFromProps=_this.props.onStartShouldSetResponder&& -_this.props.onStartShouldSetResponder(); -var setResponder=shouldSetFromProps||!!_this.props.onPress; -if(setResponder&&!_this.touchableHandleActivePressIn){ - - -for(var key in Touchable.Mixin){ -if(typeof Touchable.Mixin[key]==='function'){ -_this[key]=Touchable.Mixin[key].bind(_this);}} - - -_this.touchableHandleActivePressIn=function(){ -if(_this.props.suppressHighlighting||!_this.props.onPress){ -return;} - -_this.setState({ -isHighlighted:true});}; - - - -_this.touchableHandleActivePressOut=function(){ -if(_this.props.suppressHighlighting||!_this.props.onPress){ -return;} - -_this.setState({ -isHighlighted:false});}; - - - -_this.touchableHandlePress=function(){ -_this.props.onPress&&_this.props.onPress();}; - - -_this.touchableGetPressRectOffset=function(){ -return PRESS_RECT_OFFSET;};} - - -return setResponder;}, - -onResponderGrant:(function(e,dispatchID){ -this.touchableHandleResponderGrant(e,dispatchID); -this.props.onResponderGrant&& -this.props.onResponderGrant.apply(this,arguments);}). -bind(this), -onResponderMove:(function(e){ -this.touchableHandleResponderMove(e); -this.props.onResponderMove&& -this.props.onResponderMove.apply(this,arguments);}). -bind(this), -onResponderRelease:(function(e){ -this.touchableHandleResponderRelease(e); -this.props.onResponderRelease&& -this.props.onResponderRelease.apply(this,arguments);}). -bind(this), -onResponderTerminate:(function(e){ -this.touchableHandleResponderTerminate(e); -this.props.onResponderTerminate&& -this.props.onResponderTerminate.apply(this,arguments);}). -bind(this), -onResponderTerminationRequest:(function(){ - - -var allowTermination=this.touchableHandleResponderTerminationRequest(); -if(allowTermination&&this.props.onResponderTerminationRequest){ -allowTermination=this.props.onResponderTerminationRequest.apply(this,arguments);} - -return allowTermination;}). -bind(this)};} - - -newProps=babelHelpers.extends({}, -this.props, -this._handlers,{ -isHighlighted:this.state.isHighlighted});} - - -if(this.context.isInAParentText){ -return React.createElement(RCTVirtualText,newProps);}else -{ -return React.createElement(RCTText,newProps);}}}); - - - - - - - - - - - -var PRESS_RECT_OFFSET={top:20,left:20,right:20,bottom:30}; - -var RCTText=createReactNativeComponentClass(viewConfig); -var RCTVirtualText=RCTText; - -if(Platform.OS==='android'){ -RCTVirtualText=createReactNativeComponentClass({ -validAttributes:merge(ReactNativeViewAttributes.UIView,{ -isHighlighted:true}), - -uiViewClassName:'RCTVirtualText'});} - - - -module.exports=Text; -}); -__d('Touchable',function(global, require, module, exports) { 'use strict'; - - - - - -var BoundingDimensions=require('BoundingDimensions'); -var Position=require('Position'); -var TouchEventUtils=require('TouchEventUtils'); - -var keyMirror=require('keyMirror'); -var queryLayoutByID=require('queryLayoutByID'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var States=keyMirror({ -NOT_RESPONDER:null, -RESPONDER_INACTIVE_PRESS_IN:null, -RESPONDER_INACTIVE_PRESS_OUT:null, -RESPONDER_ACTIVE_PRESS_IN:null, -RESPONDER_ACTIVE_PRESS_OUT:null, -RESPONDER_ACTIVE_LONG_PRESS_IN:null, -RESPONDER_ACTIVE_LONG_PRESS_OUT:null, -ERROR:null}); - - - - - -var IsActive={ -RESPONDER_ACTIVE_PRESS_OUT:true, -RESPONDER_ACTIVE_PRESS_IN:true}; - - - - - - -var IsPressingIn={ -RESPONDER_INACTIVE_PRESS_IN:true, -RESPONDER_ACTIVE_PRESS_IN:true, -RESPONDER_ACTIVE_LONG_PRESS_IN:true}; - - -var IsLongPressingIn={ -RESPONDER_ACTIVE_LONG_PRESS_IN:true}; - - - - - -var Signals=keyMirror({ -DELAY:null, -RESPONDER_GRANT:null, -RESPONDER_RELEASE:null, -RESPONDER_TERMINATED:null, -ENTER_PRESS_RECT:null, -LEAVE_PRESS_RECT:null, -LONG_PRESS_DETECTED:null}); - - - - - -var Transitions={ -NOT_RESPONDER:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.RESPONDER_INACTIVE_PRESS_IN, -RESPONDER_RELEASE:States.ERROR, -RESPONDER_TERMINATED:States.ERROR, -ENTER_PRESS_RECT:States.ERROR, -LEAVE_PRESS_RECT:States.ERROR, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_INACTIVE_PRESS_IN:{ -DELAY:States.RESPONDER_ACTIVE_PRESS_IN, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_INACTIVE_PRESS_OUT:{ -DELAY:States.RESPONDER_ACTIVE_PRESS_OUT, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_ACTIVE_PRESS_IN:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.RESPONDER_ACTIVE_LONG_PRESS_IN}, - -RESPONDER_ACTIVE_PRESS_OUT:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_ACTIVE_LONG_PRESS_IN:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_OUT, -LONG_PRESS_DETECTED:States.RESPONDER_ACTIVE_LONG_PRESS_IN}, - -RESPONDER_ACTIVE_LONG_PRESS_OUT:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -error:{ -DELAY:States.NOT_RESPONDER, -RESPONDER_GRANT:States.RESPONDER_INACTIVE_PRESS_IN, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.NOT_RESPONDER, -LEAVE_PRESS_RECT:States.NOT_RESPONDER, -LONG_PRESS_DETECTED:States.NOT_RESPONDER}}; - - - - - - -var HIGHLIGHT_DELAY_MS=130; - -var PRESS_EXPAND_PX=20; - -var LONG_PRESS_THRESHOLD=500; - -var LONG_PRESS_DELAY_MS=LONG_PRESS_THRESHOLD-HIGHLIGHT_DELAY_MS; - -var LONG_PRESS_ALLOWED_MOVEMENT=10; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var TouchableMixin={ - - - -componentWillUnmount:function(){ -this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout); -this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout); -this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout);}, - - - - - - - - - -touchableGetInitialState:function(){ -return { -touchable:{touchState:undefined,responderID:null}};}, - - - - - - - -touchableHandleResponderTerminationRequest:function(){ -return !this.props.rejectResponderTermination;}, - - - - - -touchableHandleStartShouldSetResponder:function(){ -return true;}, - - - - - -touchableLongPressCancelsPress:function(){ -return true;}, - - - - - - - - -touchableHandleResponderGrant:function(e,dispatchID){ - - - -e.persist(); - -this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout); -this.pressOutDelayTimeout=null; - -this.state.touchable.touchState=States.NOT_RESPONDER; -this.state.touchable.responderID=dispatchID; -this._receiveSignal(Signals.RESPONDER_GRANT,e); -var delayMS= -this.touchableGetHighlightDelayMS!==undefined? -Math.max(this.touchableGetHighlightDelayMS(),0):HIGHLIGHT_DELAY_MS; -delayMS=isNaN(delayMS)?HIGHLIGHT_DELAY_MS:delayMS; -if(delayMS!==0){ -this.touchableDelayTimeout=setTimeout( -this._handleDelay.bind(this,e), -delayMS);}else - -{ -this._handleDelay(e);} - - -var longDelayMS= -this.touchableGetLongPressDelayMS!==undefined? -Math.max(this.touchableGetLongPressDelayMS(),10):LONG_PRESS_DELAY_MS; -longDelayMS=isNaN(longDelayMS)?LONG_PRESS_DELAY_MS:longDelayMS; -this.longPressDelayTimeout=setTimeout( -this._handleLongDelay.bind(this,e), -longDelayMS+delayMS);}, - - - - - - -touchableHandleResponderRelease:function(e){ -this._receiveSignal(Signals.RESPONDER_RELEASE,e);}, - - - - - -touchableHandleResponderTerminate:function(e){ -this._receiveSignal(Signals.RESPONDER_TERMINATED,e);}, - - - - - -touchableHandleResponderMove:function(e){ - - -if(this.state.touchable.touchState===States.RESPONDER_INACTIVE_PRESS_IN){ -return;} - - - -if(!this.state.touchable.positionOnActivate){ -return;} - - -var positionOnActivate=this.state.touchable.positionOnActivate; -var dimensionsOnActivate=this.state.touchable.dimensionsOnActivate; -var pressRectOffset=this.touchableGetPressRectOffset? -this.touchableGetPressRectOffset():{ -left:PRESS_EXPAND_PX, -right:PRESS_EXPAND_PX, -top:PRESS_EXPAND_PX, -bottom:PRESS_EXPAND_PX}; - - -var pressExpandLeft=pressRectOffset.left; -var pressExpandTop=pressRectOffset.top; -var pressExpandRight=pressRectOffset.right; -var pressExpandBottom=pressRectOffset.bottom; - -var touch=TouchEventUtils.extractSingleTouch(e.nativeEvent); -var pageX=touch&&touch.pageX; -var pageY=touch&&touch.pageY; - -if(this.pressInLocation){ -var movedDistance=this._getDistanceBetweenPoints(pageX,pageY,this.pressInLocation.pageX,this.pressInLocation.pageY); -if(movedDistance>LONG_PRESS_ALLOWED_MOVEMENT){ -this._cancelLongPressDelayTimeout();}} - - - -var isTouchWithinActive= -pageX>positionOnActivate.left-pressExpandLeft&& -pageY>positionOnActivate.top-pressExpandTop&& -pageX< -positionOnActivate.left+ -dimensionsOnActivate.width+ -pressExpandRight&& -pageY< -positionOnActivate.top+ -dimensionsOnActivate.height+ -pressExpandBottom; -if(isTouchWithinActive){ -this._receiveSignal(Signals.ENTER_PRESS_RECT,e); -var curState=this.state.touchable.touchState; -if(curState===States.RESPONDER_INACTIVE_PRESS_IN){ - -this._cancelLongPressDelayTimeout();}}else - -{ -this._cancelLongPressDelayTimeout(); -this._receiveSignal(Signals.LEAVE_PRESS_RECT,e);}}, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_remeasureMetricsOnActivation:function(){ -queryLayoutByID( -this.state.touchable.responderID, -null, -this._handleQueryLayout);}, - - - -_handleQueryLayout:function(l,t,w,h,globalX,globalY){ -this.state.touchable.positionOnActivate&& -Position.release(this.state.touchable.positionOnActivate); -this.state.touchable.dimensionsOnActivate&& -BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); -this.state.touchable.positionOnActivate=Position.getPooled(globalX,globalY); -this.state.touchable.dimensionsOnActivate=BoundingDimensions.getPooled(w,h);}, - - -_handleDelay:function(e){ -this.touchableDelayTimeout=null; -this._receiveSignal(Signals.DELAY,e);}, - - -_handleLongDelay:function(e){ -this.longPressDelayTimeout=null; -var curState=this.state.touchable.touchState; -if(curState!==States.RESPONDER_ACTIVE_PRESS_IN&& -curState!==States.RESPONDER_ACTIVE_LONG_PRESS_IN){ -console.error('Attempted to transition from state `'+curState+'` to `'+ -States.RESPONDER_ACTIVE_LONG_PRESS_IN+'`, which is not supported. This is '+ -'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');}else -{ -this._receiveSignal(Signals.LONG_PRESS_DETECTED,e);}}, - - - - - - - - - - - -_receiveSignal:function(signal,e){ -var curState=this.state.touchable.touchState; -var nextState=Transitions[curState]&&Transitions[curState][signal]; -if(!nextState){ -throw new Error( -'Unrecognized signal `'+signal+'` or state `'+curState+ -'` for Touchable responder `'+this.state.touchable.responderID+'`');} - - -if(nextState===States.ERROR){ -throw new Error( -'Touchable cannot transition from `'+curState+'` to `'+signal+ -'` for responder `'+this.state.touchable.responderID+'`');} - - -if(curState!==nextState){ -this._performSideEffectsForTransition(curState,nextState,signal,e); -this.state.touchable.touchState=nextState;}}, - - - -_cancelLongPressDelayTimeout:function(){ -this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout); -this.longPressDelayTimeout=null;}, - - -_isHighlight:function(state){ -return state===States.RESPONDER_ACTIVE_PRESS_IN|| -state===States.RESPONDER_ACTIVE_LONG_PRESS_IN;}, - - -_savePressInLocation:function(e){ -var touch=TouchEventUtils.extractSingleTouch(e.nativeEvent); -var pageX=touch&&touch.pageX; -var pageY=touch&&touch.pageY; -this.pressInLocation={pageX:pageX,pageY:pageY};}, - - -_getDistanceBetweenPoints:function(aX,aY,bX,bY){ -var deltaX=aX-bX; -var deltaY=aY-bY; -return Math.sqrt(deltaX*deltaX+deltaY*deltaY);}, - - - - - - - - - - - - - -_performSideEffectsForTransition:function(curState,nextState,signal,e){ -var curIsHighlight=this._isHighlight(curState); -var newIsHighlight=this._isHighlight(nextState); - -var isFinalSignal= -signal===Signals.RESPONDER_TERMINATED|| -signal===Signals.RESPONDER_RELEASE; - -if(isFinalSignal){ -this._cancelLongPressDelayTimeout();} - - -if(!IsActive[curState]&&IsActive[nextState]){ -this._remeasureMetricsOnActivation();} - - -if(IsPressingIn[curState]&&signal===Signals.LONG_PRESS_DETECTED){ -this.touchableHandleLongPress&&this.touchableHandleLongPress(e);} - - -if(newIsHighlight&&!curIsHighlight){ -this._savePressInLocation(e); -this.touchableHandleActivePressIn&&this.touchableHandleActivePressIn(e);}else -if(!newIsHighlight&&curIsHighlight&&this.touchableHandleActivePressOut){ -if(this.touchableGetPressOutDelayMS&&this.touchableGetPressOutDelayMS()){ -this.pressOutDelayTimeout=this.setTimeout(function(){ -this.touchableHandleActivePressOut(e);}, -this.touchableGetPressOutDelayMS());}else -{ -this.touchableHandleActivePressOut(e);}} - - - -if(IsPressingIn[curState]&&signal===Signals.RESPONDER_RELEASE){ -var hasLongPressHandler=!!this.props.onLongPress; -var pressIsLongButStillCallOnPress= -IsLongPressingIn[curState]&&( -!hasLongPressHandler|| -!this.touchableLongPressCancelsPress()); - - -var shouldInvokePress=!IsLongPressingIn[curState]||pressIsLongButStillCallOnPress; -if(shouldInvokePress&&this.touchableHandlePress){ -this.touchableHandlePress(e);}} - - - -this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout); -this.touchableDelayTimeout=null;}}; - - - - -var Touchable={ -Mixin:TouchableMixin}; - - -module.exports=Touchable; -}); -__d('BoundingDimensions',function(global, require, module, exports) { 'use strict'; - - - - - -var PooledClass=require('PooledClass'); - -var twoArgumentPooler=PooledClass.twoArgumentPooler; - - - - - - - - -function BoundingDimensions(width,height){ -this.width=width; -this.height=height;} - - -BoundingDimensions.prototype.destructor=function(){ -this.width=null; -this.height=null;}; - - - - - - -BoundingDimensions.getPooledFromElement=function(element){ -return BoundingDimensions.getPooled( -element.offsetWidth, -element.offsetHeight);}; - - - -PooledClass.addPoolingTo(BoundingDimensions,twoArgumentPooler); - -module.exports=BoundingDimensions; -}); -__d('Position',function(global, require, module, exports) { 'use strict'; - - - - - -var PooledClass=require('PooledClass'); - -var twoArgumentPooler=PooledClass.twoArgumentPooler; - - - - - - - - - -function Position(left,top){ -this.left=left; -this.top=top;} - - -Position.prototype.destructor=function(){ -this.left=null; -this.top=null;}; - - -PooledClass.addPoolingTo(Position,twoArgumentPooler); - -module.exports=Position; -}); -__d('TouchEventUtils',function(global, require, module, exports) { var - - - - - - - - - - -TouchEventUtils={ - - - - - - - - - - -extractSingleTouch:function(nativeEvent){ -var touches=nativeEvent.touches; -var changedTouches=nativeEvent.changedTouches; -var hasTouches=touches&&touches.length>0; -var hasChangedTouches=changedTouches&&changedTouches.length>0; - -return !hasTouches&&hasChangedTouches?changedTouches[0]: -hasTouches?touches[0]: -nativeEvent;}}; - - - -module.exports=TouchEventUtils; -}); -__d('queryLayoutByID',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var UIManager=require('UIManager'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var queryLayoutByID=function( -rootNodeID, -onError, -onSuccess) -{ - -UIManager.measure( -ReactNativeTagHandles.rootNodeIDToTag[rootNodeID], -onSuccess);}; - - - -module.exports=queryLayoutByID; -}); -__d('TextInput',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var DocumentSelectionState=require('DocumentSelectionState'); -var EventEmitter=require('EventEmitter'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var Platform=require('Platform'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var ReactChildren=require('ReactChildren'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var TextInputState=require('TextInputState'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); -var UIManager=require('UIManager'); -var View=require('View'); - -var createReactNativeComponentClass=require('createReactNativeComponentClass'); -var emptyFunction=require('emptyFunction'); -var invariant=require('invariant'); -var requireNativeComponent=require('requireNativeComponent'); - -var onlyMultiline={ -onTextInput:true, -children:true}; - - -var notMultiline={}; - - - -if(Platform.OS==='android'){ -var AndroidTextInput=requireNativeComponent('AndroidTextInput',null);}else -if(Platform.OS==='ios'){ -var RCTTextView=requireNativeComponent('RCTTextView',null); -var RCTTextField=requireNativeComponent('RCTTextField',null);} - - - - - - - - - - - - - - - - - - - - - - - - - -var TextInput=React.createClass({displayName:'TextInput', -statics:{ - -State:TextInputState}, - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - - - - - -autoCapitalize:PropTypes.oneOf([ -'none', -'sentences', -'words', -'characters']), - - - - -autoCorrect:PropTypes.bool, - - - - -autoFocus:PropTypes.bool, - - - - -textAlign:PropTypes.oneOf([ -'start', -'center', -'end']), - - - - - -textAlignVertical:PropTypes.oneOf([ -'top', -'center', -'bottom']), - - - - -editable:PropTypes.bool, - - - - - - - - -keyboardType:PropTypes.oneOf([ - -'default', -'numeric', -'email-address', - -'ascii-capable', -'numbers-and-punctuation', -'url', -'number-pad', -'phone-pad', -'name-phone-pad', -'decimal-pad', -'twitter', -'web-search']), - - - - - -keyboardAppearance:PropTypes.oneOf([ -'default', -'light', -'dark']), - - - - - -returnKeyType:PropTypes.oneOf([ -'default', -'go', -'google', -'join', -'next', -'route', -'search', -'send', -'yahoo', -'done', -'emergency-call']), - - - - - -maxLength:PropTypes.number, - - - - - -numberOfLines:PropTypes.number, - - - - - -enablesReturnKeyAutomatically:PropTypes.bool, - - - - -multiline:PropTypes.bool, - - - -onBlur:PropTypes.func, - - - -onFocus:PropTypes.func, - - - -onChange:PropTypes.func, - - - - -onChangeText:PropTypes.func, - - - -onEndEditing:PropTypes.func, - - - - -onSubmitEditing:PropTypes.func, - - - - - - -onKeyPress:PropTypes.func, - - - -onLayout:PropTypes.func, - - - -placeholder:PropTypes.string, - - - -placeholderTextColor:PropTypes.string, - - - - -secureTextEntry:PropTypes.bool, - - - - - -selectionState:PropTypes.instanceOf(DocumentSelectionState), - - - - - - - - - -value:PropTypes.string, - - - - - -defaultValue:PropTypes.string, - - - - -clearButtonMode:PropTypes.oneOf([ -'never', -'while-editing', -'unless-editing', -'always']), - - - - - -clearTextOnFocus:PropTypes.bool, - - - - -selectTextOnFocus:PropTypes.bool, - - - - - - - - -blurOnSubmit:PropTypes.bool, - - - -style:Text.propTypes.style, - - - -testID:PropTypes.string, - - - - -underlineColorAndroid:PropTypes.string}), - - - - - - -mixins:[NativeMethodsMixin,TimerMixin], - -viewConfig: -Platform.OS==='ios'&&RCTTextField? -RCTTextField.viewConfig: -Platform.OS==='android'&&AndroidTextInput? -AndroidTextInput.viewConfig: -{}, - -isFocused:function(){ -return TextInputState.currentlyFocusedField()=== -React.findNodeHandle(this.refs.input);}, - - -getInitialState:function(){ -return { -mostRecentEventCount:0};}, - - - -contextTypes:{ -onFocusRequested:React.PropTypes.func, -focusEmitter:React.PropTypes.instanceOf(EventEmitter)}, - - -_focusSubscription:undefined, - -componentDidMount:function(){var _this=this; -if(!this.context.focusEmitter){ -if(this.props.autoFocus){ -this.requestAnimationFrame(this.focus);} - -return;} - -this._focusSubscription=this.context.focusEmitter.addListener( -'focus', -function(el){ -if(_this===el){ -_this.requestAnimationFrame(_this.focus);}else -if(_this.isFocused()){ -_this.blur();}}); - - - -if(this.props.autoFocus){ -this.context.onFocusRequested(this);}}, - - - -componentWillUnmount:function(){ -this._focusSubscription&&this._focusSubscription.remove(); -if(this.isFocused()){ -this.blur();}}, - - - -getChildContext:function(){ -return {isInAParentText:true};}, - - -childContextTypes:{ -isInAParentText:React.PropTypes.bool}, - - -clear:function(){ -this.setNativeProps({text:''});}, - - -render:function(){ -if(Platform.OS==='ios'){ -return this._renderIOS();}else -if(Platform.OS==='android'){ -return this._renderAndroid();}}, - - - -_getText:function(){ -return typeof this.props.value==='string'? -this.props.value: -this.props.defaultValue;}, - - -_renderIOS:function(){var _this2=this; -var textContainer; - -var onSelectionChange; -if(this.props.selectionState||this.props.onSelectionChange){ -onSelectionChange=function(event){ -if(_this2.props.selectionState){ -var selection=event.nativeEvent.selection; -_this2.props.selectionState.update(selection.start,selection.end);} - -_this2.props.onSelectionChange&&_this2.props.onSelectionChange(event);};} - - - -var props=babelHelpers.extends({},this.props); -props.style=[styles.input,this.props.style]; -if(!props.multiline){ -for(var propKey in onlyMultiline){ -if(props[propKey]){ -throw new Error( -'TextInput prop `'+propKey+'` is only supported with multiline.');}} - - - -textContainer= -React.createElement(RCTTextField,babelHelpers.extends({ -ref:'input'}, -props,{ -onFocus:this._onFocus, -onBlur:this._onBlur, -onChange:this._onChange, -onSelectionChange:onSelectionChange, -onSelectionChangeShouldSetResponder:emptyFunction.thatReturnsTrue, -text:this._getText(), -mostRecentEventCount:this.state.mostRecentEventCount}));}else - -{ -for(var propKey in notMultiline){ -if(props[propKey]){ -throw new Error( -'TextInput prop `'+propKey+'` cannot be used with multiline.');}} - - - - -var children=props.children; -var childCount=0; -ReactChildren.forEach(children,function(){return ++childCount;}); -invariant( -!(props.value&&childCount), -'Cannot specify both value and children.'); - -if(childCount>1){ -children=React.createElement(Text,null,children);} - -if(props.inputView){ -children=[children,props.inputView];} - -textContainer= -React.createElement(RCTTextView,babelHelpers.extends({ -ref:'input'}, -props,{ -children:children, -mostRecentEventCount:this.state.mostRecentEventCount, -onFocus:this._onFocus, -onBlur:this._onBlur, -onChange:this._onChange, -onSelectionChange:onSelectionChange, -onTextInput:this._onTextInput, -onSelectionChangeShouldSetResponder:emptyFunction.thatReturnsTrue, -text:this._getText()}));} - - - -return ( -React.createElement(TouchableWithoutFeedback,{ -onPress:this._onPress, -rejectResponderTermination:true, -testID:props.testID}, -textContainer));}, - - - - -_renderAndroid:function(){ -var autoCapitalize=UIManager.UIText.AutocapitalizationType[this.props.autoCapitalize]; -var textAlign= -UIManager.AndroidTextInput.Constants.TextAlign[this.props.textAlign]; -var textAlignVertical= -UIManager.AndroidTextInput.Constants.TextAlignVertical[this.props.textAlignVertical]; -var children=this.props.children; -var childCount=0; -ReactChildren.forEach(children,function(){return ++childCount;}); -invariant( -!(this.props.value&&childCount), -'Cannot specify both value and children.'); - -if(childCount>1){ -children=React.createElement(Text,null,children);} - -var textContainer= -React.createElement(AndroidTextInput,{ -ref:'input', -style:[this.props.style], -autoCapitalize:autoCapitalize, -autoCorrect:this.props.autoCorrect, -textAlign:textAlign, -textAlignVertical:textAlignVertical, -keyboardType:this.props.keyboardType, -mostRecentEventCount:this.state.mostRecentEventCount, -multiline:this.props.multiline, -numberOfLines:this.props.numberOfLines, -maxLength:this.props.maxLength, -onFocus:this._onFocus, -onBlur:this._onBlur, -onChange:this._onChange, -onTextInput:this._onTextInput, -onEndEditing:this.props.onEndEditing, -onSubmitEditing:this.props.onSubmitEditing, -onLayout:this.props.onLayout, -password:this.props.password||this.props.secureTextEntry, -placeholder:this.props.placeholder, -placeholderTextColor:this.props.placeholderTextColor, -text:this._getText(), -underlineColorAndroid:this.props.underlineColorAndroid, -children:children, -editable:this.props.editable}); - - -return ( -React.createElement(TouchableWithoutFeedback,{ -onPress:this._onPress, -testID:this.props.testID}, -textContainer));}, - - - - -_onFocus:function(event){ -if(this.props.onFocus){ -this.props.onFocus(event);}}, - - - -_onPress:function(event){ -if(this.props.editable||this.props.editable===undefined){ -this.focus();}}, - - - -_onChange:function(event){var _this3=this; -if(Platform.OS==='android'){ - -this.refs.input.setNativeProps({ -mostRecentEventCount:event.nativeEvent.eventCount});} - - -var text=event.nativeEvent.text; -var eventCount=event.nativeEvent.eventCount; -this.props.onChange&&this.props.onChange(event); -this.props.onChangeText&&this.props.onChangeText(text); -this.setState({mostRecentEventCount:eventCount},function(){ - -if(Platform.OS==='android'){ - - - -if(text!==_this3.props.value&&typeof _this3.props.value==='string'){ -_this3.refs.input.setNativeProps({ -text:_this3.props.value});}}});}, - - - - - - -_onBlur:function(event){ -this.blur(); -if(this.props.onBlur){ -this.props.onBlur(event);}}, - - - -_onTextInput:function(event){ -this.props.onTextInput&&this.props.onTextInput(event);}}); - - - -var styles=StyleSheet.create({ -input:{ -alignSelf:'stretch'}}); - - - -module.exports=TextInput; -}); -__d('DocumentSelectionState',function(global, require, module, exports) { var - - - - - - - - - - - - - - - - - -mixInEventEmitter=require('mixInEventEmitter');var - - - - - - - - - - -DocumentSelectionState=(function(){ - - - - -function DocumentSelectionState(anchor,focus){babelHelpers.classCallCheck(this,DocumentSelectionState); -this._anchorOffset=anchor; -this._focusOffset=focus; -this._hasFocus=false;}babelHelpers.createClass(DocumentSelectionState,[{key:'update',value:function update( - - - - - - - - - -anchor,focus){ -if(this._anchorOffset!==anchor||this._focusOffset!==focus){ -this._anchorOffset=anchor; -this._focusOffset=focus; -this.emit('update');}}},{key:'constrainLength',value:function constrainLength( - - - - - - - - - -maxLength){ -this.update( -Math.min(this._anchorOffset,maxLength), -Math.min(this._focusOffset,maxLength));}},{key:'focus',value:function focus() - - - -{ -if(!this._hasFocus){ -this._hasFocus=true; -this.emit('focus');}}},{key:'blur',value:function blur() - - - -{ -if(this._hasFocus){ -this._hasFocus=false; -this.emit('blur');}}},{key:'hasFocus',value:function hasFocus() - - - - - - -{ -return this._hasFocus;}},{key:'isCollapsed',value:function isCollapsed() - - - - - -{ -return this._anchorOffset===this._focusOffset;}},{key:'isBackward',value:function isBackward() - - - - - -{ -return this._anchorOffset>this._focusOffset;}},{key:'getAnchorOffset',value:function getAnchorOffset() - - - - - -{ -return this._hasFocus?this._anchorOffset:null;}},{key:'getFocusOffset',value:function getFocusOffset() - - - - - -{ -return this._hasFocus?this._focusOffset:null;}},{key:'getStartOffset',value:function getStartOffset() - - - - - -{ -return ( -this._hasFocus?Math.min(this._anchorOffset,this._focusOffset):null);}},{key:'getEndOffset',value:function getEndOffset() - - - - - - -{ -return ( -this._hasFocus?Math.max(this._anchorOffset,this._focusOffset):null);}},{key:'overlaps',value:function overlaps( - - - - - - - - -start,end){ -return ( -this.hasFocus()&& -this.getStartOffset()<=end&&start<=this.getEndOffset());}}]);return DocumentSelectionState;})(); - - - - -mixInEventEmitter(DocumentSelectionState,{ -'blur':true, -'focus':true, -'update':true}); - - -module.exports=DocumentSelectionState; -}); -__d('mixInEventEmitter',function(global, require, module, exports) { var - - - - - - - - - - - - - - - - -EventEmitter=require('EventEmitter'); -var EventEmitterWithHolding=require('EventEmitterWithHolding'); -var EventHolder=require('EventHolder'); -var EventValidator=require('EventValidator'); - -var copyProperties=require('copyProperties'); -var invariant=require('invariant'); -var keyOf=require('keyOf'); - -var TYPES_KEY=keyOf({__types:true}); - - - - - - - - - - - - - - - - - - - - - - -function mixInEventEmitter(klass,types){ -invariant(types,'Must supply set of valid event types'); -invariant(!this.__eventEmitter,'An active emitter is already mixed in'); - - - -var target=klass.prototype||klass; - -var ctor=klass.constructor; -if(ctor){ -invariant( -ctor===Object||ctor===Function, -'Mix EventEmitter into a class, not an instance');} - - - - - -if(target.hasOwnProperty(TYPES_KEY)){ -copyProperties(target.__types,types);}else -if(target.__types){ -target.__types=copyProperties({},target.__types,types);}else -{ -target.__types=types;} - -copyProperties(target,EventEmitterMixin);} - - -var EventEmitterMixin={ -emit:function(eventType,a,b,c,d,e,_){ -return this.__getEventEmitter().emit(eventType,a,b,c,d,e,_);}, - - -emitAndHold:function(eventType,a,b,c,d,e,_){ -return this.__getEventEmitter().emitAndHold(eventType,a,b,c,d,e,_);}, - - -addListener:function(eventType,listener,context){ -return this.__getEventEmitter().addListener(eventType,listener,context);}, - - -once:function(eventType,listener,context){ -return this.__getEventEmitter().once(eventType,listener,context);}, - - -addRetroactiveListener:function(eventType,listener,context){ -return this.__getEventEmitter().addRetroactiveListener( -eventType, -listener, -context);}, - - - -addListenerMap:function(listenerMap,context){ -return this.__getEventEmitter().addListenerMap(listenerMap,context);}, - - -addRetroactiveListenerMap:function(listenerMap,context){ -return this.__getEventEmitter().addListenerMap(listenerMap,context);}, - - -removeAllListeners:function(){ -this.__getEventEmitter().removeAllListeners();}, - - -removeCurrentListener:function(){ -this.__getEventEmitter().removeCurrentListener();}, - - -releaseHeldEventType:function(eventType){ -this.__getEventEmitter().releaseHeldEventType(eventType);}, - - -__getEventEmitter:function(){ -if(!this.__eventEmitter){ -var emitter=new EventEmitter(); -emitter=EventValidator.addValidation(emitter,this.__types); - -var holder=new EventHolder(); -this.__eventEmitter=new EventEmitterWithHolding(emitter,holder);} - -return this.__eventEmitter;}}; - - - -module.exports=mixInEventEmitter; -}); -__d('EventEmitterWithHolding',function(global, require, module, exports) { 'use strict';var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EventEmitterWithHolding=(function(){ - - - - - - - -function EventEmitterWithHolding(emitter,holder){babelHelpers.classCallCheck(this,EventEmitterWithHolding); -this._emitter=emitter; -this._eventHolder=holder; -this._currentEventToken=null; -this._emittingHeldEvents=false;}babelHelpers.createClass(EventEmitterWithHolding,[{key:'addListener',value:function addListener( - - - - - -eventType,listener,context){ -return this._emitter.addListener(eventType,listener,context);}},{key:'once',value:function once( - - - - - -eventType,listener,context){ -return this._emitter.once(eventType,listener,context);}},{key:'addRetroactiveListener',value:function addRetroactiveListener( - - - - - - - - - - - - - - - - - - - - - - - -eventType,listener,context){ -var subscription=this._emitter.addListener(eventType,listener,context); - -this._emittingHeldEvents=true; -this._eventHolder.emitToListener(eventType,listener,context); -this._emittingHeldEvents=false; - -return subscription;}},{key:'removeAllListeners',value:function removeAllListeners( - - - - - -eventType){ -this._emitter.removeAllListeners(eventType);}},{key:'removeCurrentListener',value:function removeCurrentListener() - - - - - -{ -this._emitter.removeCurrentListener();}},{key:'listeners',value:function listeners( - - - - - -eventType){ -return this._emitter.listeners(eventType);}},{key:'emit',value:function emit( - - - - - -eventType,a,b,c,d,e,_){ -this._emitter.emit(eventType,a,b,c,d,e,_);}},{key:'emitAndHold',value:function emitAndHold( - - - - - - - - - - - - - - - - - -eventType,a,b,c,d,e,_){ -this._currentEventToken=this._eventHolder.holdEvent( -eventType, -a,b,c,d,e,_); - -this._emitter.emit(eventType,a,b,c,d,e,_); -this._currentEventToken=null;}},{key:'releaseCurrentEvent',value:function releaseCurrentEvent() - - - - - -{ -if(this._currentEventToken!==null){ -this._eventHolder.releaseEvent(this._currentEventToken);}else -if(this._emittingHeldEvents){ -this._eventHolder.releaseCurrentEvent();}}},{key:'releaseHeldEventType',value:function releaseHeldEventType( - - - - - - - -eventType){ -this._eventHolder.releaseEventType(eventType);}}]);return EventEmitterWithHolding;})(); - - - -module.exports=EventEmitterWithHolding; -}); -__d('EventHolder',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - -var invariant=require('invariant');var - -EventHolder=(function(){ -function EventHolder(){babelHelpers.classCallCheck(this,EventHolder); -this._heldEvents={}; -this._currentEventKey=null;}babelHelpers.createClass(EventHolder,[{key:'holdEvent',value:function holdEvent( - - - - - - - - - - - - - - - - - - - - - - - -eventType,a,b,c,d,e,_){ -this._heldEvents[eventType]=this._heldEvents[eventType]||[]; -var eventsOfType=this._heldEvents[eventType]; -var key={ -eventType:eventType, -index:eventsOfType.length}; - -eventsOfType.push([a,b,c,d,e,_]); -return key;}},{key:'emitToListener',value:function emitToListener( - - - - - - - - - - -eventType,listener,context){var _this=this; -var eventsOfType=this._heldEvents[eventType]; -if(!eventsOfType){ -return;} - -var origEventKey=this._currentEventKey; -eventsOfType.forEach(function(eventHeld,index){ -if(!eventHeld){ -return;} - -_this._currentEventKey={ -eventType:eventType, -index:index}; - -listener.apply(context,eventHeld);}); - -this._currentEventKey=origEventKey;}},{key:'releaseCurrentEvent',value:function releaseCurrentEvent() - - - - - - - - - - -{ -invariant( -this._currentEventKey!==null, -'Not in an emitting cycle; there is no current event'); - -this.releaseEvent(this._currentEventKey);}},{key:'releaseEvent',value:function releaseEvent( - - - - - - - - -token){ -delete this._heldEvents[token.eventType][token.index];}},{key:'releaseEventType',value:function releaseEventType( - - - - - - - -type){ -this._heldEvents[type]=[];}}]);return EventHolder;})(); - - - -module.exports=EventHolder; -}); -__d('EventValidator',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - -var copyProperties=require('copyProperties'); - - - - - - - - - - -var EventValidator={ - - - - - - - - - - -addValidation:function(emitter,types){ -var eventTypes=Object.keys(types); -var emitterWithValidation=Object.create(emitter); - -copyProperties(emitterWithValidation,{ -emit:function emit(type,a,b,c,d,e,_){ -assertAllowsEventType(type,eventTypes); -return emitter.emit.call(this,type,a,b,c,d,e,_);}}); - - - -return emitterWithValidation;}}; - - - -function assertAllowsEventType(type,allowedTypes){ -if(allowedTypes.indexOf(type)===-1){ -throw new TypeError(errorMessageFor(type,allowedTypes));}} - - - -function errorMessageFor(type,allowedTypes){ -var message='Unknown event type "'+type+'". '; -if(__DEV__){ -message+=recommendationFor(type,allowedTypes);} - -message+='Known event types: '+allowedTypes.join(', ')+'.'; -return message;} - - - -if(__DEV__){ -var recommendationFor=function(type,allowedTypes){ -var closestTypeRecommendation=closestTypeFor(type,allowedTypes); -if(isCloseEnough(closestTypeRecommendation,type)){ -return 'Did you mean "'+closestTypeRecommendation.type+'"? ';}else -{ -return '';}}; - - - -var closestTypeFor=function(type,allowedTypes){ -var typeRecommendations=allowedTypes.map( -typeRecommendationFor.bind(this,type)); - -return typeRecommendations.sort(recommendationSort)[0];}; - - -var typeRecommendationFor=function(type,recomendedType){ -return { -type:recomendedType, -distance:damerauLevenshteinDistance(type,recomendedType)};}; - - - -var recommendationSort=function(recommendationA,recommendationB){ -if(recommendationA.distancerecommendationB.distance){ -return 1;}else -{ -return 0;}}; - - - -var isCloseEnough=function(closestType,actualType){ -return closestType.distance/actualType.length<0.334;}; - - -var damerauLevenshteinDistance=function(a,b){ -var i,j; -var d=[]; - -for(i=0;i<=a.length;i++){ -d[i]=[i];} - - -for(j=1;j<=b.length;j++){ -d[0][j]=j;} - - -for(i=1;i<=a.length;i++){ -for(j=1;j<=b.length;j++){ -var cost=a.charAt(i-1)===b.charAt(j-1)?0:1; - -d[i][j]=Math.min( -d[i-1][j]+1, -d[i][j-1]+1, -d[i-1][j-1]+cost); - - -if(i>1&&j>1&& -a.charAt(i-1)==b.charAt(j-2)&& -a.charAt(i-2)==b.charAt(j-1)){ -d[i][j]=Math.min(d[i][j],d[i-2][j-2]+cost);}}} - - - - -return d[a.length][b.length];};} - - - -module.exports=EventValidator; -}); -__d('copyProperties',function(global, require, module, exports) { function - - - - - - - - - - - - - - - - - - - - - - - -copyProperties(obj,a,b,c,d,e,f){ -obj=obj||{}; - -if(__DEV__){ -if(f){ -throw new Error('Too many arguments passed to copyProperties');}} - - - -var args=[a,b,c,d,e]; -var ii=0,v; -while(args[ii]){ -v=args[ii++]; -for(var k in v){ -obj[k]=v[k];} - - - - -if(v.hasOwnProperty&&v.hasOwnProperty('toString')&& -typeof v.toString!='undefined'&&obj.toString!==v.toString){ -obj.toString=v.toString;}} - - - -return obj;} - - -module.exports=copyProperties; -}); -__d('TouchableWithoutFeedback',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var EdgeInsetsPropType=require('EdgeInsetsPropType'); -var React=require('React'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var Touchable=require('Touchable'); -var View=require('View'); -var ensurePositiveDelayProps=require('ensurePositiveDelayProps'); -var invariant=require('invariant'); -var onlyChild=require('onlyChild'); - - - -var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30}; - - - - - - -var TouchableWithoutFeedback=React.createClass({displayName:'TouchableWithoutFeedback', -mixins:[TimerMixin,Touchable.Mixin], - -propTypes:{ -accessible:React.PropTypes.bool, -accessibilityComponentType:React.PropTypes.oneOf(View.AccessibilityComponentType), -accessibilityTraits:React.PropTypes.oneOfType([ -React.PropTypes.oneOf(View.AccessibilityTraits), -React.PropTypes.arrayOf(React.PropTypes.oneOf(View.AccessibilityTraits))]), - - - - - -onPress:React.PropTypes.func, -onPressIn:React.PropTypes.func, -onPressOut:React.PropTypes.func, - - - - - -onLayout:React.PropTypes.func, - -onLongPress:React.PropTypes.func, - - - - -delayPressIn:React.PropTypes.number, - - - -delayPressOut:React.PropTypes.number, - - - -delayLongPress:React.PropTypes.number, - - - - - - - -pressRetentionOffset:EdgeInsetsPropType}, - - -getInitialState:function(){ -return this.touchableGetInitialState();}, - - -componentDidMount:function(){ -ensurePositiveDelayProps(this.props);}, - - -componentWillReceiveProps:function(nextProps){ -ensurePositiveDelayProps(nextProps);}, - - - - - - -touchableHandlePress:function(e){ -this.props.onPress&&this.props.onPress(e);}, - - -touchableHandleActivePressIn:function(e){ -this.props.onPressIn&&this.props.onPressIn(e);}, - - -touchableHandleActivePressOut:function(e){ -this.props.onPressOut&&this.props.onPressOut(e);}, - - -touchableHandleLongPress:function(e){ -this.props.onLongPress&&this.props.onLongPress(e);}, - - -touchableGetPressRectOffset:function(){ -return this.props.pressRetentionOffset||PRESS_RETENTION_OFFSET;}, - - -touchableGetHighlightDelayMS:function(){ -return this.props.delayPressIn||0;}, - - -touchableGetLongPressDelayMS:function(){ -return this.props.delayLongPress===0?0: -this.props.delayLongPress||500;}, - - -touchableGetPressOutDelayMS:function(){ -return this.props.delayPressOut||0;}, - - -render:function(){ - -return React.cloneElement(onlyChild(this.props.children),{ -accessible:this.props.accessible!==false, -accessibilityComponentType:this.props.accessibilityComponentType, -accessibilityTraits:this.props.accessibilityTraits, -testID:this.props.testID, -onLayout:this.props.onLayout, -onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder, -onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest, -onResponderGrant:this.touchableHandleResponderGrant, -onResponderMove:this.touchableHandleResponderMove, -onResponderRelease:this.touchableHandleResponderRelease, -onResponderTerminate:this.touchableHandleResponderTerminate});}}); - - - - -module.exports=TouchableWithoutFeedback; -}); -__d('ensurePositiveDelayProps',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); - -var ensurePositiveDelayProps=function(props){ -invariant( -!(props.delayPressIn<0||props.delayPressOut<0|| -props.delayLongPress<0), -'Touchable components cannot have negative delay properties');}; - - - -module.exports=ensurePositiveDelayProps; -}); -__d('ToastAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var warning=require('warning'); - -var ToastAndroid={ - -show:function( -message, -duration) -{ -warning(false,'Cannot use ToastAndroid on iOS.');}}; - - - - -module.exports=ToastAndroid; -}); -__d('ToolbarAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('TouchableHighlight',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var React=require('React'); -var ReactNativeViewAttributes=require('ReactNativeViewAttributes'); -var StyleSheet=require('StyleSheet'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var Touchable=require('Touchable'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); -var View=require('View'); - -var ensureComponentIsNative=require('ensureComponentIsNative'); -var ensurePositiveDelayProps=require('ensurePositiveDelayProps'); -var keyOf=require('keyOf'); -var merge=require('merge'); -var onlyChild=require('onlyChild'); - - - -var DEFAULT_PROPS={ -activeOpacity:0.8, -underlayColor:'black'}; - - -var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var TouchableHighlight=React.createClass({displayName:'TouchableHighlight', -propTypes:babelHelpers.extends({}, -TouchableWithoutFeedback.propTypes,{ - - - - -activeOpacity:React.PropTypes.number, - - - - -underlayColor:React.PropTypes.string, -style:View.propTypes.style, - - - -onShowUnderlay:React.PropTypes.func, - - - -onHideUnderlay:React.PropTypes.func}), - - -mixins:[NativeMethodsMixin,TimerMixin,Touchable.Mixin], - -getDefaultProps:function(){return DEFAULT_PROPS;}, - - -computeSyntheticState:function(props){ -return { -activeProps:{ -style:{ -opacity:props.activeOpacity}}, - - -activeUnderlayProps:{ -style:{ -backgroundColor:props.underlayColor}}, - - -underlayStyle:[ -INACTIVE_UNDERLAY_PROPS.style, -props.style]};}, - - - - -getInitialState:function(){ -return merge( -this.touchableGetInitialState(),this.computeSyntheticState(this.props));}, - - - -componentDidMount:function(){ -ensurePositiveDelayProps(this.props); -ensureComponentIsNative(this.refs[CHILD_REF]);}, - - -componentDidUpdate:function(){ -ensureComponentIsNative(this.refs[CHILD_REF]);}, - - -componentWillReceiveProps:function(nextProps){ -ensurePositiveDelayProps(nextProps); -if(nextProps.activeOpacity!==this.props.activeOpacity|| -nextProps.underlayColor!==this.props.underlayColor|| -nextProps.style!==this.props.style){ -this.setState(this.computeSyntheticState(nextProps));}}, - - - -viewConfig:{ -uiViewClassName:'RCTView', -validAttributes:ReactNativeViewAttributes.RCTView}, - - - - - - -touchableHandleActivePressIn:function(e){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -this._showUnderlay(); -this.props.onPressIn&&this.props.onPressIn(e);}, - - -touchableHandleActivePressOut:function(e){ -if(!this._hideTimeout){ -this._hideUnderlay();} - -this.props.onPressOut&&this.props.onPressOut(e);}, - - -touchableHandlePress:function(e){ -this.clearTimeout(this._hideTimeout); -this._showUnderlay(); -this._hideTimeout=this.setTimeout(this._hideUnderlay, -this.props.delayPressOut||100); -this.props.onPress&&this.props.onPress(e);}, - - -touchableHandleLongPress:function(e){ -this.props.onLongPress&&this.props.onLongPress(e);}, - - -touchableGetPressRectOffset:function(){ -return this.props.pressRetentionOffset||PRESS_RETENTION_OFFSET;}, - - -touchableGetHighlightDelayMS:function(){ -return this.props.delayPressIn;}, - - -touchableGetLongPressDelayMS:function(){ -return this.props.delayLongPress;}, - - -touchableGetPressOutDelayMS:function(){ -return this.props.delayPressOut;}, - - -_showUnderlay:function(){ -if(!this.isMounted()){ -return;} - - -this.refs[UNDERLAY_REF].setNativeProps(this.state.activeUnderlayProps); -this.refs[CHILD_REF].setNativeProps(this.state.activeProps); -this.props.onShowUnderlay&&this.props.onShowUnderlay();}, - - -_hideUnderlay:function(){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -if(this.refs[UNDERLAY_REF]){ -this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS); -this.refs[UNDERLAY_REF].setNativeProps(babelHelpers.extends({}, -INACTIVE_UNDERLAY_PROPS,{ -style:this.state.underlayStyle})); - -this.props.onHideUnderlay&&this.props.onHideUnderlay();}}, - - - -render:function(){ -return ( -React.createElement(View,{ -accessible:true, -accessibilityComponentType:this.props.accessibilityComponentType, -accessibilityTraits:this.props.accessibilityTraits, -ref:UNDERLAY_REF, -style:this.state.underlayStyle, -onLayout:this.props.onLayout, -onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder, -onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest, -onResponderGrant:this.touchableHandleResponderGrant, -onResponderMove:this.touchableHandleResponderMove, -onResponderRelease:this.touchableHandleResponderRelease, -onResponderTerminate:this.touchableHandleResponderTerminate, -testID:this.props.testID}, -React.cloneElement( -onlyChild(this.props.children), -{ -ref:CHILD_REF})));}}); - - - - - - - -var CHILD_REF=keyOf({childRef:null}); -var UNDERLAY_REF=keyOf({underlayRef:null}); -var INACTIVE_CHILD_PROPS={ -style:StyleSheet.create({x:{opacity:1.0}}).x}; - -var INACTIVE_UNDERLAY_PROPS={ -style:StyleSheet.create({x:{backgroundColor:'transparent'}}).x}; - - -module.exports=TouchableHighlight; -}); -__d('ensureComponentIsNative',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); - -var ensureComponentIsNative=function(component){ -invariant( -component&&typeof component.setNativeProps==='function', -'Touchable child must either be native or forward setNativeProps to a '+ -'native component');}; - - - -module.exports=ensureComponentIsNative; -}); -__d('TouchableNativeFeedback',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); - -var DummyTouchableNativeFeedback=React.createClass({displayName:'DummyTouchableNativeFeedback', -render:function(){ -return ( -React.createElement(View,{style:[styles.container,this.props.style]}, -React.createElement(Text,{style:styles.info},'TouchableNativeFeedback is not supported on this platform!')));}}); - - - - - -var styles=StyleSheet.create({ -container:{ -height:100, -width:300, -backgroundColor:'#ffbcbc', -borderWidth:1, -borderColor:'red', -alignItems:'center', -justifyContent:'center', -margin:10}, - -info:{ -color:'#333333', -margin:20}}); - - - -module.exports=DummyTouchableNativeFeedback; -}); -__d('TouchableOpacity',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var Animated=require('Animated'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var React=require('React'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var Touchable=require('Touchable'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); - -var ensurePositiveDelayProps=require('ensurePositiveDelayProps'); -var flattenStyle=require('flattenStyle'); - - - -var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30}; - - - - - - - - - - - - - - - - - - - - - - -var TouchableOpacity=React.createClass({displayName:'TouchableOpacity', -mixins:[TimerMixin,Touchable.Mixin,NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -TouchableWithoutFeedback.propTypes,{ - - - - -activeOpacity:React.PropTypes.number}), - - -getDefaultProps:function(){ -return { -activeOpacity:0.2};}, - - - -getInitialState:function(){ -return babelHelpers.extends({}, -this.touchableGetInitialState(),{ -anim:new Animated.Value(1)});}, - - - -componentDidMount:function(){ -ensurePositiveDelayProps(this.props);}, - - -componentWillReceiveProps:function(nextProps){ -ensurePositiveDelayProps(nextProps);}, - - -setOpacityTo:function(value){ -Animated.timing( -this.state.anim, -{toValue:value,duration:150}). -start();}, - - - - - - -touchableHandleActivePressIn:function(e){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -this._opacityActive(); -this.props.onPressIn&&this.props.onPressIn(e);}, - - -touchableHandleActivePressOut:function(e){ -if(!this._hideTimeout){ -this._opacityInactive();} - -this.props.onPressOut&&this.props.onPressOut(e);}, - - -touchableHandlePress:function(e){ -this.clearTimeout(this._hideTimeout); -this._opacityActive(); -this._hideTimeout=this.setTimeout( -this._opacityInactive, -this.props.delayPressOut||100); - -this.props.onPress&&this.props.onPress(e);}, - - -touchableHandleLongPress:function(e){ -this.props.onLongPress&&this.props.onLongPress(e);}, - - -touchableGetPressRectOffset:function(){ -return this.props.pressRetentionOffset||PRESS_RETENTION_OFFSET;}, - - -touchableGetHighlightDelayMS:function(){ -return this.props.delayPressIn||0;}, - - -touchableGetLongPressDelayMS:function(){ -return this.props.delayLongPress===0?0: -this.props.delayLongPress||500;}, - - -touchableGetPressOutDelayMS:function(){ -return this.props.delayPressOut;}, - - -_opacityActive:function(){ -this.setOpacityTo(this.props.activeOpacity);}, - - -_opacityInactive:function(){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -var childStyle=flattenStyle(this.props.style)||{}; -this.setOpacityTo( -childStyle.opacity===undefined?1:childStyle.opacity);}, - - - -render:function(){ -return ( -React.createElement(Animated.View,{ -accessible:true, -accessibilityComponentType:this.props.accessibilityComponentType, -accessibilityTraits:this.props.accessibilityTraits, -style:[this.props.style,{opacity:this.state.anim}], -testID:this.props.testID, -onLayout:this.props.onLayout, -onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder, -onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest, -onResponderGrant:this.touchableHandleResponderGrant, -onResponderMove:this.touchableHandleResponderMove, -onResponderRelease:this.touchableHandleResponderRelease, -onResponderTerminate:this.touchableHandleResponderTerminate}, -this.props.children));}}); - - - - - -module.exports=TouchableOpacity; -}); -__d('Animated',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var AnimatedImplementation=require('AnimatedImplementation'); -var Image=require('Image'); -var Text=require('Text'); -var View=require('View'); - -module.exports=babelHelpers.extends({}, -AnimatedImplementation,{ -View:AnimatedImplementation.createAnimatedComponent(View), -Text:AnimatedImplementation.createAnimatedComponent(Text), -Image:AnimatedImplementation.createAnimatedComponent(Image)}); -}); -__d('AnimatedImplementation',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Easing=require('Easing'); -var InteractionManager=require('InteractionManager'); -var Interpolation=require('Interpolation'); -var React=require('React'); -var Set=require('Set'); -var SpringConfig=require('SpringConfig'); -var ViewStylePropTypes=require('ViewStylePropTypes'); - -var flattenStyle=require('flattenStyle'); -var invariant=require('invariant'); -var requestAnimationFrame=require('requestAnimationFrame');var - - - - - - - - -Animated=(function(){function Animated(){babelHelpers.classCallCheck(this,Animated);}babelHelpers.createClass(Animated,[{key:'__attach',value:function __attach() -{}},{key:'__detach',value:function __detach() -{}},{key:'__getValue',value:function __getValue() -{}},{key:'__getAnimatedValue',value:function __getAnimatedValue() -{return this.__getValue();}},{key:'__addChild',value:function __addChild( -child){}},{key:'__removeChild',value:function __removeChild( -child){}},{key:'__getChildren',value:function __getChildren() -{return [];}}]);return Animated;})();var - - - - - - - - - -Animation=(function(){function Animation(){babelHelpers.classCallCheck(this,Animation);}babelHelpers.createClass(Animation,[{key:'start',value:function start( - - - - -fromValue, -onUpdate, -onEnd, -previousAnimation) -{}},{key:'stop',value:function stop() -{}},{key:'__debouncedOnEnd',value:function __debouncedOnEnd( - -result){ -var onEnd=this.__onEnd; -this.__onEnd=null; -onEnd&&onEnd(result);}}]);return Animation;})();var - - - -AnimatedWithChildren=(function(_Animated){babelHelpers.inherits(AnimatedWithChildren,_Animated); - - -function AnimatedWithChildren(){babelHelpers.classCallCheck(this,AnimatedWithChildren);var _this=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(AnimatedWithChildren).call(this)); - -_this._children=[];return _this;}babelHelpers.createClass(AnimatedWithChildren,[{key:'__addChild',value:function __addChild( - - -child){ -if(this._children.length===0){ -this.__attach();} - -this._children.push(child);}},{key:'__removeChild',value:function __removeChild( - - -child){ -var index=this._children.indexOf(child); -if(index===-1){ -console.warn('Trying to remove a child that doesn\'t exist'); -return;} - -this._children.splice(index,1); -if(this._children.length===0){ -this.__detach();}}},{key:'__getChildren',value:function __getChildren() - - - -{ -return this._children;}}]);return AnimatedWithChildren;})(Animated); - - - - - - - - - - - - - - - - - - - - - - - - - -function _flush(rootNode){ -var animatedStyles=new Set(); -function findAnimatedStyles(node){ -if(typeof node.update==='function'){ -animatedStyles.add(node);}else -{ -node.__getChildren().forEach(findAnimatedStyles);}} - - -findAnimatedStyles(rootNode); -animatedStyles.forEach(function(animatedStyle){return animatedStyle.update();});} - - - - - - - - - - - - - - - - -var easeInOut=Easing.inOut(Easing.ease);var - -TimingAnimation=(function(_Animation){babelHelpers.inherits(TimingAnimation,_Animation); - - - - - - - - - - -function TimingAnimation( -config) -{babelHelpers.classCallCheck(this,TimingAnimation);var _this2=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(TimingAnimation).call(this)); - -_this2._toValue=config.toValue; -_this2._easing=config.easing||easeInOut; -_this2._duration=config.duration!==undefined?config.duration:500; -_this2._delay=config.delay||0; -_this2.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;return _this2;}babelHelpers.createClass(TimingAnimation,[{key:'start',value:function start( - - - -fromValue, -onUpdate, -onEnd) -{var _this3=this; -this.__active=true; -this._fromValue=fromValue; -this._onUpdate=onUpdate; -this.__onEnd=onEnd; - -var start=function(){ -if(_this3._duration===0){ -_this3._onUpdate(_this3._toValue); -_this3.__debouncedOnEnd({finished:true});}else -{ -_this3._startTime=Date.now(); -_this3._animationFrame=requestAnimationFrame(_this3.onUpdate.bind(_this3));}}; - - -if(this._delay){ -this._timeout=setTimeout(start,this._delay);}else -{ -start();}}},{key:'onUpdate',value:function onUpdate() - - - -{ -var now=Date.now(); -if(now>=this._startTime+this._duration){ -if(this._duration===0){ -this._onUpdate(this._toValue);}else -{ -this._onUpdate( -this._fromValue+this._easing(1)*(this._toValue-this._fromValue));} - - -this.__debouncedOnEnd({finished:true}); -return;} - - -this._onUpdate( -this._fromValue+ -this._easing((now-this._startTime)/this._duration)*( -this._toValue-this._fromValue)); - -if(this.__active){ -this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'stop',value:function stop() - - - -{ -this.__active=false; -clearTimeout(this._timeout); -window.cancelAnimationFrame(this._animationFrame); -this.__debouncedOnEnd({finished:false});}}]);return TimingAnimation;})(Animation);var - - - - - - - - - - - - - -DecayAnimation=(function(_Animation2){babelHelpers.inherits(DecayAnimation,_Animation2); - - - - - - - - -function DecayAnimation( -config) -{babelHelpers.classCallCheck(this,DecayAnimation);var _this4=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(DecayAnimation).call(this)); - -_this4._deceleration=config.deceleration||0.998; -_this4._velocity=config.velocity; -_this4.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;return _this4;}babelHelpers.createClass(DecayAnimation,[{key:'start',value:function start( - - - -fromValue, -onUpdate, -onEnd) -{ -this.__active=true; -this._lastValue=fromValue; -this._fromValue=fromValue; -this._onUpdate=onUpdate; -this.__onEnd=onEnd; -this._startTime=Date.now(); -this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}},{key:'onUpdate',value:function onUpdate() - - -{ -var now=Date.now(); - -var value=this._fromValue+ -this._velocity/(1-this._deceleration)*( -1-Math.exp(-(1-this._deceleration)*(now-this._startTime))); - -this._onUpdate(value); - -if(Math.abs(this._lastValue-value)<0.1){ -this.__debouncedOnEnd({finished:true}); -return;} - - -this._lastValue=value; -if(this.__active){ -this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'stop',value:function stop() - - - -{ -this.__active=false; -window.cancelAnimationFrame(this._animationFrame); -this.__debouncedOnEnd({finished:false});}}]);return DecayAnimation;})(Animation); - - - - - - - - - - - - - - - - - - - - - - - - - - - -function withDefault(value,defaultValue){ -if(value===undefined||value===null){ -return defaultValue;} - -return value;}var - - -SpringAnimation=(function(_Animation3){babelHelpers.inherits(SpringAnimation,_Animation3); - - - - - - - - - - - - - - - -function SpringAnimation( -config) -{babelHelpers.classCallCheck(this,SpringAnimation);var _this5=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(SpringAnimation).call(this)); - - -_this5._overshootClamping=withDefault(config.overshootClamping,false); -_this5._restDisplacementThreshold=withDefault(config.restDisplacementThreshold,0.001); -_this5._restSpeedThreshold=withDefault(config.restSpeedThreshold,0.001); -_this5._initialVelocity=config.velocity; -_this5._lastVelocity=withDefault(config.velocity,0); -_this5._toValue=config.toValue; -_this5.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true; - -var springConfig; -if(config.bounciness!==undefined||config.speed!==undefined){ -invariant( -config.tension===undefined&&config.friction===undefined, -'You can only define bounciness/speed or tension/friction but not both'); - -springConfig=SpringConfig.fromBouncinessAndSpeed( -withDefault(config.bounciness,8), -withDefault(config.speed,12));}else - -{ -springConfig=SpringConfig.fromOrigamiTensionAndFriction( -withDefault(config.tension,40), -withDefault(config.friction,7));} - - -_this5._tension=springConfig.tension; -_this5._friction=springConfig.friction;return _this5;}babelHelpers.createClass(SpringAnimation,[{key:'start',value:function start( - - - -fromValue, -onUpdate, -onEnd, -previousAnimation) -{ -this.__active=true; -this._startPosition=fromValue; -this._lastPosition=this._startPosition; - -this._onUpdate=onUpdate; -this.__onEnd=onEnd; -this._lastTime=Date.now(); - -if(previousAnimation instanceof SpringAnimation){ -var internalState=previousAnimation.getInternalState(); -this._lastPosition=internalState.lastPosition; -this._lastVelocity=internalState.lastVelocity; -this._lastTime=internalState.lastTime;} - -if(this._initialVelocity!==undefined&& -this._initialVelocity!==null){ -this._lastVelocity=this._initialVelocity;} - -this.onUpdate();}},{key:'getInternalState',value:function getInternalState() - - -{ -return { -lastPosition:this._lastPosition, -lastVelocity:this._lastVelocity, -lastTime:this._lastTime};}},{key:'onUpdate',value:function onUpdate() - - - -{ -var position=this._lastPosition; -var velocity=this._lastVelocity; - -var tempPosition=this._lastPosition; -var tempVelocity=this._lastVelocity; - - - - - -var MAX_STEPS=64; -var now=Date.now(); -if(now>this._lastTime+MAX_STEPS){ -now=this._lastTime+MAX_STEPS;} - - - - - -var TIMESTEP_MSEC=1; -var numSteps=Math.floor((now-this._lastTime)/TIMESTEP_MSEC); - -for(var i=0;ithis._toValue;}else -{ -isOvershooting=positioninputMax){ -if(extrapolateRight==='identity'){ -return result;}else -if(extrapolateRight==='clamp'){ -result=inputMax;}else -if(extrapolateRight==='extend'){}} - - - - -if(outputMin===outputMax){ -return outputMin;} - - -if(inputMin===inputMax){ -if(input<=inputMin){ -return outputMin;} - -return outputMax;} - - - -if(inputMin===-Infinity){ -result=-result;}else -if(inputMax===Infinity){ -result=result-inputMin;}else -{ -result=(result-inputMin)/(inputMax-inputMin);} - - - -result=easing(result); - - -if(outputMin===-Infinity){ -result=-result;}else -if(outputMax===Infinity){ -result=result+outputMin;}else -{ -result=result*(outputMax-outputMin)+outputMin;} - - -return result;} - - -function colorToRgba( -input) -{ -var color=tinycolor(input); -if(color.isValid()){var _color$toRgb= -color.toRgb();var r=_color$toRgb.r;var g=_color$toRgb.g;var b=_color$toRgb.b;var a=_color$toRgb.a; -return 'rgba('+r+', '+g+', '+b+', '+(a===undefined?1:a)+')';}else -{ -return input;}} - - - -var stringShapeRegex=/[0-9\.-]+/g; - - - - - - - - - -function createInterpolationFromStringOutputRange( -config) -{ -var outputRange=config.outputRange; -invariant(outputRange.length>=2,'Bad output range'); -outputRange=outputRange.map(colorToRgba); -checkPattern(outputRange); - - - - - - - - - - - - -var outputRanges=outputRange[0].match(stringShapeRegex).map(function(){return [];}); -outputRange.forEach(function(value){ - - - -value.match(stringShapeRegex).forEach(function(number,i){ -outputRanges[i].push(+number);});}); - - - - - - -var interpolations=outputRange[0].match(stringShapeRegex).map(function(value,i){ -return Interpolation.create(babelHelpers.extends({}, -config,{ -outputRange:outputRanges[i]}));}); - - - -return function(input){ -var i=0; - - - -return outputRange[0].replace(stringShapeRegex,function(){ -return String(interpolations[i++](input));});};} - - - - -function checkPattern(arr){ -var pattern=arr[0].replace(stringShapeRegex,''); -for(var i=1;i=input){ -break;}} - - -return i-1;} - - -function checkValidInputRange(arr){ -invariant(arr.length>=2,'inputRange must have at least 2 elements'); -for(var i=1;i=arr[i-1], - - - - - - -'inputRange must be monotonically increasing '+arr);}} - - - - -function checkInfiniteRange(name,arr){ -invariant(arr.length>=2,name+' must have at least 2 elements'); -invariant( -arr.length!==2||arr[0]!==-Infinity||arr[1]!==Infinity, - - - - - - -name+'cannot be ]-infinity;+infinity[ '+arr);} - - - -module.exports=Interpolation; -}); -__d('Easing',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var _bezier=require('bezier');var - - - - - - -Easing=(function(){function Easing(){babelHelpers.classCallCheck(this,Easing);}babelHelpers.createClass(Easing,null,[{key:'step0',value:function step0( -n){ -return n>0?1:0;}},{key:'step1',value:function step1( - - -n){ -return n>=1?1:0;}},{key:'linear',value:function linear( - - -t){ -return t;}},{key:'ease',value:function ease( - - -t){ -return _ease(t);}},{key:'quad',value:function quad( - - -t){ -return t*t;}},{key:'cubic',value:function cubic( - - -t){ -return t*t*t;}},{key:'poly',value:function poly( - - -n){ -return function(t){return Math.pow(t,n);};}},{key:'sin',value:function sin( - - -t){ -return 1-Math.cos(t*Math.PI/2);}},{key:'circle',value:function circle( - - -t){ -return 1-Math.sqrt(1-t*t);}},{key:'exp',value:function exp( - - -t){ -return Math.pow(2,10*(t-1));}},{key:'elastic',value:function elastic() - - - - - - - - - - - - -{var bounciness=arguments.length<=0||arguments[0]===undefined?1:arguments[0]; -var p=bounciness*Math.PI; -return function(t){return 1-Math.pow(Math.cos(t*Math.PI/2),3)*Math.cos(t*p);};}},{key:'back',value:function back( - - -s){ -if(s===undefined){ -s=1.70158;} - -return function(t){return t*t*((s+1)*t-s);};}},{key:'bounce',value:function bounce( - - -t){ -if(t<1/2.75){ -return 7.5625*t*t;} - - -if(t<2/2.75){ -t-=1.5/2.75; -return 7.5625*t*t+0.75;} - - -if(t<2.5/2.75){ -t-=2.25/2.75; -return 7.5625*t*t+0.9375;} - - -t-=2.625/2.75; -return 7.5625*t*t+0.984375;}},{key:'bezier',value:function bezier( - - - -x1, -y1, -x2, -y2, -epsilon) -{ -if(epsilon===undefined){ - - -var duration=500; -epsilon=1000/60/duration/4;} - - -return _bezier(x1,y1,x2,y2,epsilon);}},{key:'in',value:function _in( - - - -easing) -{ -return easing;}},{key:'out',value:function out( - - - - - - -easing) -{ -return function(t){return 1-easing(1-t);};}},{key:'inOut',value:function inOut( - - - - - - -easing) -{ -return function(t){ -if(t<0.5){ -return easing(t*2)/2;} - -return 1-easing((1-t)*2)/2;};}}]);return Easing;})(); - - - - -var _ease=Easing.bezier(0.42,0,1,1); - - - -module.exports=Easing; -}); -__d('bezier',function(global, require, module, exports) { module. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -exports=function(x1,y1,x2,y2,epsilon){ - -var curveX=function(t){ -var v=1-t; -return 3*v*v*t*x1+3*v*t*t*x2+t*t*t;}; - - -var curveY=function(t){ -var v=1-t; -return 3*v*v*t*y1+3*v*t*t*y2+t*t*t;}; - - -var derivativeCurveX=function(t){ -var v=1-t; -return 3*(2*(t-1)*t+v*v)*x1+3*(-t*t*t+2*v*t)*x2;}; - - -return function(t){ - -var x=t,t0,t1,t2,x2,d2,i; - - -for(t2=x,i=0;i<8;i++){ -x2=curveX(t2)-x; -if(Math.abs(x2)t1)return curveY(t1); - - -while(t0x2)t0=t2;else -t1=t2; -t2=(t1-t0)*.5+t0;} - - - -return curveY(t2);};}; -}); -__d('SpringConfig',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - -function tensionFromOrigamiValue(oValue){ -return (oValue-30)*3.62+194;} - - -function frictionFromOrigamiValue(oValue){ -return (oValue-8)*3+25;} - - -function fromOrigamiTensionAndFriction( -tension, -friction) -{ -return { -tension:tensionFromOrigamiValue(tension), -friction:frictionFromOrigamiValue(friction)};} - - - -function fromBouncinessAndSpeed( -bounciness, -speed) -{ -function normalize(value,startValue,endValue){ -return (value-startValue)/(endValue-startValue);} - - -function projectNormal(n,start,end){ -return start+n*(end-start);} - - -function linearInterpolation(t,start,end){ -return t*end+(1-t)*start;} - - -function quadraticOutInterpolation(t,start,end){ -return linearInterpolation(2*t-t*t,start,end);} - - -function b3Friction1(x){ -return 0.0007*Math.pow(x,3)- -0.031*Math.pow(x,2)+0.64*x+1.28;} - - -function b3Friction2(x){ -return 0.000044*Math.pow(x,3)- -0.006*Math.pow(x,2)+0.36*x+2;} - - -function b3Friction3(x){ -return 0.00000045*Math.pow(x,3)- -0.000332*Math.pow(x,2)+0.1078*x+5.84;} - - -function b3Nobounce(tension){ -if(tension<=18){ -return b3Friction1(tension);}else -if(tension>18&&tension<=44){ -return b3Friction2(tension);}else -{ -return b3Friction3(tension);}} - - - -var b=normalize(bounciness/1.7,0,20); -b=projectNormal(b,0,0.8); -var s=normalize(speed/1.7,0,20); -var bouncyTension=projectNormal(s,0.5,200); -var bouncyFriction=quadraticOutInterpolation( -b, -b3Nobounce(bouncyTension), -0.01); - - -return { -tension:tensionFromOrigamiValue(bouncyTension), -friction:frictionFromOrigamiValue(bouncyFriction)};} - - - -module.exports={ -fromOrigamiTensionAndFriction:fromOrigamiTensionAndFriction, -fromBouncinessAndSpeed:fromBouncinessAndSpeed}; -}); -__d('requestAnimationFrame',function(global, require, module, exports) { var - - - - - - - - - - -emptyFunction=require('emptyFunction'); -var nativeRequestAnimationFrame=require('nativeRequestAnimationFrame'); - -var lastTime=0; - -var requestAnimationFrame= -nativeRequestAnimationFrame|| -function(callback){ -var currTime=Date.now(); -var timeDelay=Math.max(0,16-(currTime-lastTime)); -lastTime=currTime+timeDelay; -return global.setTimeout(function(){ -callback(Date.now());}, -timeDelay);}; - - - -requestAnimationFrame(emptyFunction); - -module.exports=requestAnimationFrame; -}); -__d('nativeRequestAnimationFrame',function(global, require, module, exports) { var - - - - - - - - - - -nativeRequestAnimationFrame= -global.requestAnimationFrame|| -global.webkitRequestAnimationFrame|| -global.mozRequestAnimationFrame|| -global.oRequestAnimationFrame|| -global.msRequestAnimationFrame; - -module.exports=nativeRequestAnimationFrame; -}); -__d('ViewPagerAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('WebView',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ActivityIndicatorIOS=require('ActivityIndicatorIOS'); -var EdgeInsetsPropType=require('EdgeInsetsPropType'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); - -var invariant=require('invariant'); -var keyMirror=require('keyMirror'); -var requireNativeComponent=require('requireNativeComponent'); - -var PropTypes=React.PropTypes; -var RCTWebViewManager=require('NativeModules').WebViewManager; - -var BGWASH='rgba(255,255,255,0.8)'; -var RCT_WEBVIEW_REF='webview'; - -var WebViewState=keyMirror({ -IDLE:null, -LOADING:null, -ERROR:null}); - - -var NavigationType={ -click:RCTWebViewManager.NavigationType.LinkClicked, -formsubmit:RCTWebViewManager.NavigationType.FormSubmitted, -backforward:RCTWebViewManager.NavigationType.BackForward, -reload:RCTWebViewManager.NavigationType.Reload, -formresubmit:RCTWebViewManager.NavigationType.FormResubmitted, -other:RCTWebViewManager.NavigationType.Other}; - - -var JSNavigationScheme=RCTWebViewManager.JSNavigationScheme; - - - - - - - - - -var defaultRenderLoading=function(){return ( -React.createElement(View,{style:styles.loadingView}, -React.createElement(ActivityIndicatorIOS,null)));}; - - -var defaultRenderError=function(errorDomain,errorCode,errorDesc){return ( -React.createElement(View,{style:styles.errorContainer}, -React.createElement(Text,{style:styles.errorTextTitle},'Error loading page'), - - -React.createElement(Text,{style:styles.errorText}, -'Domain: '+errorDomain), - -React.createElement(Text,{style:styles.errorText}, -'Error Code: '+errorCode), - -React.createElement(Text,{style:styles.errorText}, -'Description: '+errorDesc)));}; - - - - - - - -var WebView=React.createClass({displayName:'WebView', -statics:{ -JSNavigationScheme:JSNavigationScheme, -NavigationType:NavigationType}, - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ -url:PropTypes.string, -html:PropTypes.string, - - - -renderError:PropTypes.func, - - - -renderLoading:PropTypes.func, - - - -bounces:PropTypes.bool, - - - -scrollEnabled:PropTypes.bool, -automaticallyAdjustContentInsets:PropTypes.bool, -contentInset:EdgeInsetsPropType, -onNavigationStateChange:PropTypes.func, -startInLoadingState:PropTypes.bool, -style:View.propTypes.style, - - - - - -javaScriptEnabledAndroid:PropTypes.bool, - - - - -injectedJavaScript:PropTypes.string, - - - - - -scalesPageToFit:PropTypes.bool, - - - - - - -onShouldStartLoadWithRequest:PropTypes.func, - - - - - - - - - - -allowsInlineMediaPlayback:PropTypes.bool}), - - -getInitialState:function(){ -return { -viewState:WebViewState.IDLE, -lastErrorEvent:null, -startInLoadingState:true};}, - - - -componentWillMount:function(){ -if(this.props.startInLoadingState){ -this.setState({viewState:WebViewState.LOADING});}}, - - - -render:function(){var _this=this; -var otherView=null; - -if(this.state.viewState===WebViewState.LOADING){ -otherView=(this.props.renderLoading||defaultRenderLoading)();}else -if(this.state.viewState===WebViewState.ERROR){ -var errorEvent=this.state.lastErrorEvent; -invariant( -errorEvent!=null, -'lastErrorEvent expected to be non-null'); - -otherView=(this.props.renderError||defaultRenderError)( -errorEvent.domain, -errorEvent.code, -errorEvent.description);}else - -if(this.state.viewState!==WebViewState.IDLE){ -console.error( -'RCTWebView invalid state encountered: '+this.state.loading);} - - - -var webViewStyles=[styles.container,styles.webView,this.props.style]; -if(this.state.viewState===WebViewState.LOADING|| -this.state.viewState===WebViewState.ERROR){ - -webViewStyles.push(styles.hidden);} - - -var onShouldStartLoadWithRequest=this.props.onShouldStartLoadWithRequest&&function(event){ -var shouldStart=_this.props.onShouldStartLoadWithRequest&& -_this.props.onShouldStartLoadWithRequest(event.nativeEvent); -RCTWebViewManager.startLoadWithResult(!!shouldStart,event.nativeEvent.lockIdentifier);}; - - -var webView= -React.createElement(RCTWebView,{ -ref:RCT_WEBVIEW_REF, -key:'webViewKey', -style:webViewStyles, -url:this.props.url, -html:this.props.html, -injectedJavaScript:this.props.injectedJavaScript, -bounces:this.props.bounces, -scrollEnabled:this.props.scrollEnabled, -contentInset:this.props.contentInset, -automaticallyAdjustContentInsets:this.props.automaticallyAdjustContentInsets, -onLoadingStart:this.onLoadingStart, -onLoadingFinish:this.onLoadingFinish, -onLoadingError:this.onLoadingError, -onShouldStartLoadWithRequest:onShouldStartLoadWithRequest, -scalesPageToFit:this.props.scalesPageToFit, -allowsInlineMediaPlayback:this.props.allowsInlineMediaPlayback}); - - -return ( -React.createElement(View,{style:styles.container}, -webView, -otherView));}, - - - - -goForward:function(){ -RCTWebViewManager.goForward(this.getWebViewHandle());}, - - -goBack:function(){ -RCTWebViewManager.goBack(this.getWebViewHandle());}, - - -reload:function(){ -RCTWebViewManager.reload(this.getWebViewHandle());}, - - - - - - -updateNavigationState:function(event){ -if(this.props.onNavigationStateChange){ -this.props.onNavigationStateChange(event.nativeEvent);}}, - - - -getWebViewHandle:function(){ -return React.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);}, - - -onLoadingStart:function(event){ -this.updateNavigationState(event);}, - - -onLoadingError:function(event){ -event.persist(); -console.warn('Encountered an error loading page',event.nativeEvent); - -this.setState({ -lastErrorEvent:event.nativeEvent, -viewState:WebViewState.ERROR});}, - - - -onLoadingFinish:function(event){ -this.setState({ -viewState:WebViewState.IDLE}); - -this.updateNavigationState(event);}}); - - - -var RCTWebView=requireNativeComponent('RCTWebView',WebView,{ -nativeOnly:{ -onLoadingStart:true, -onLoadingError:true, -onLoadingFinish:true}}); - - - -var styles=StyleSheet.create({ -container:{ -flex:1}, - -errorContainer:{ -flex:1, -justifyContent:'center', -alignItems:'center', -backgroundColor:BGWASH}, - -errorText:{ -fontSize:14, -textAlign:'center', -marginBottom:2}, - -errorTextTitle:{ -fontSize:15, -fontWeight:'500', -marginBottom:10}, - -hidden:{ -height:0, -flex:0}, - -loadingView:{ -backgroundColor:BGWASH, -flex:1, -justifyContent:'center', -alignItems:'center'}, - -webView:{ -backgroundColor:'#ffffff'}}); - - - -module.exports=WebView; -}); -__d('ActionSheetIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTActionSheetManager=require('NativeModules').ActionSheetManager; - -var invariant=require('invariant'); -var processColor=require('processColor'); - -var ActionSheetIOS={ -showActionSheetWithOptions:function(options,callback){ -invariant( -typeof options==='object'&&options!==null, -'Options must a valid object'); - -invariant( -typeof callback==='function', -'Must provide a valid callback'); - -RCTActionSheetManager.showActionSheetWithOptions(babelHelpers.extends({}, -options,{tintColor:processColor(options.tintColor)}), -callback);}, - - - -showShareActionSheetWithOptions:function( -options, -failureCallback, -successCallback) -{ -invariant( -typeof options==='object'&&options!==null, -'Options must a valid object'); - -invariant( -typeof failureCallback==='function', -'Must provide a valid failureCallback'); - -invariant( -typeof successCallback==='function', -'Must provide a valid successCallback'); - -RCTActionSheetManager.showShareActionSheetWithOptions(babelHelpers.extends({}, -options,{tintColor:processColor(options.tintColor)}), -failureCallback, -successCallback);}}; - - - - -module.exports=ActionSheetIOS; -}); -__d('AdSupportIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var AdSupport=require('NativeModules').AdSupport; - -module.exports={ -getAdvertisingId:function(onSuccess,onFailure){ -AdSupport.getAdvertisingId(onSuccess,onFailure);}, - - -getAdvertisingTrackingEnabled:function(onSuccess,onFailure){ -AdSupport.getAdvertisingTrackingEnabled(onSuccess,onFailure);}}; -}); -__d('Alert',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var AlertIOS=require('AlertIOS'); -var Platform=require('Platform'); -var DialogModuleAndroid=require('NativeModules').DialogManagerAndroid;var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Alert=(function(){function Alert(){babelHelpers.classCallCheck(this,Alert);}babelHelpers.createClass(Alert,null,[{key:'alert',value:function alert( - - -title, -message, -buttons, -type) -{ -if(Platform.OS==='ios'){ -AlertIOS.alert(title,message,buttons,type);}else -if(Platform.OS==='android'){ -AlertAndroid.alert(title,message,buttons);}}}]);return Alert;})();var - - - - - - - -AlertAndroid=(function(){function AlertAndroid(){babelHelpers.classCallCheck(this,AlertAndroid);}babelHelpers.createClass(AlertAndroid,null,[{key:'alert',value:function alert( - - -title, -message, -buttons) -{ -var config={ -title:title||'', -message:message||''}; - - - -var validButtons=buttons?buttons.slice(0,3):[{text:'OK'}]; -var buttonPositive=validButtons.pop(); -var buttonNegative=validButtons.pop(); -var buttonNeutral=validButtons.pop(); -if(buttonNeutral){ -config=babelHelpers.extends({},config,{buttonNeutral:buttonNeutral.text||''});} - -if(buttonNegative){ -config=babelHelpers.extends({},config,{buttonNegative:buttonNegative.text||''});} - -if(buttonPositive){ -config=babelHelpers.extends({},config,{buttonPositive:buttonPositive.text||''});} - -DialogModuleAndroid.showAlert( -config, -function(errorMessage){return console.warn(message);}, -function(action,buttonKey){ -if(action!==DialogModuleAndroid.buttonClicked){ -return;} - -if(buttonKey===DialogModuleAndroid.buttonNeutral){ -buttonNeutral.onPress&&buttonNeutral.onPress();}else -if(buttonKey===DialogModuleAndroid.buttonNegative){ -buttonNegative.onPress&&buttonNegative.onPress();}else -if(buttonKey===DialogModuleAndroid.buttonPositive){ -buttonPositive.onPress&&buttonPositive.onPress();}});}}]);return AlertAndroid;})(); - - - - - - -module.exports=Alert; -}); -__d('AlertIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTAlertManager=require('NativeModules').AlertManager; -var invariant=require('invariant');var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AlertIOS=(function(){function AlertIOS(){babelHelpers.classCallCheck(this,AlertIOS);}babelHelpers.createClass(AlertIOS,null,[{key:'alert',value:function alert( - -title, -message, -buttons, - - - - -type) -{ -var callbacks=[]; -var buttonsSpec=[]; -var cancelButtonKey; -var destructiveButtonKey; -buttons&&buttons.forEach(function(btn,index){ -callbacks[index]=btn.onPress; -if(btn.style=='cancel'){ -cancelButtonKey=String(index);}else -if(btn.style=='destructive'){ -destructiveButtonKey=String(index);} - -if(btn.text||index<(buttons||[]).length-1){ -var btnDef={}; -btnDef[index]=btn.text||''; -buttonsSpec.push(btnDef);}}); - - -RCTAlertManager.alertWithArgs({ -title:title||undefined, -message:message||undefined, -buttons:buttonsSpec, -type:type||undefined, -cancelButtonKey:cancelButtonKey, -destructiveButtonKey:destructiveButtonKey}, -function(id,value){ -var cb=callbacks[id]; -cb&&cb(value);});}},{key:'prompt',value:function prompt( - - - - -title, -value, -buttons, - - - - -callback) -{ -if(arguments.length===2){ -if(typeof value==='object'){ -buttons=value; -value=undefined;}else -if(typeof value==='function'){ -callback=value; -value=undefined;}}else - -if(arguments.length===3&&typeof buttons==='function'){ -callback=buttons; -buttons=undefined;} - - -invariant( -!(callback&&buttons)&&(callback||buttons), -'Must provide either a button list or a callback, but not both'); - - -if(!buttons){ -buttons=[{onPress:callback}];} - -this.alert(title,value,buttons,'plain-text');}}]);return AlertIOS;})(); - - - -module.exports=AlertIOS; -}); -__d('AppRegistry',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var BatchedBridge=require('BatchedBridge'); -var ReactNative=require('ReactNative'); - -var invariant=require('invariant'); -var renderApplication=require('renderApplication'); - -if(__DEV__){ - - -require('RCTRenderingPerf');} - - -var runnables={}; - - - - - - - - - - - - - - - - - - - - - - - - -var AppRegistry={ -registerConfig:function(config){ -for(var i=0;iDimensions.get('window').height/2?'top':'bottom', -selection:hierarchy.length-1, -hierarchy:hierarchy, -inspected:{ -style:props.style||{}, -frame:frame}});}},{key:'setPerfing',value:function setPerfing( - - - - -val){ -this.setState({ -perfing:val, -inspecting:false, -inspected:null});}},{key:'setInspecting',value:function setInspecting( - - - -val){ -this.setState({ -inspecting:val, -inspected:null});}},{key:'render',value:function render() - - - -{ -var panelContainerStyle=this.state.panelPos==='bottom'?{bottom:0}:{top:0}; -return ( -React.createElement(View,{style:styles.container,pointerEvents:'box-none'}, -this.state.inspecting&& -React.createElement(InspectorOverlay,{ -rootTag:this.props.rootTag, -inspected:this.state.inspected, -inspectedViewTag:this.props.inspectedViewTag, -onTouchInstance:this.onTouchInstance.bind(this)}), - -React.createElement(View,{style:[styles.panelContainer,panelContainerStyle]}, -React.createElement(InspectorPanel,{ -devtoolsIsOpen:!!this.state.devtoolsAgent, -inspecting:this.state.inspecting, -perfing:this.state.perfing, -setPerfing:this.setPerfing.bind(this), -setInspecting:this.setInspecting.bind(this), -inspected:this.state.inspected, -hierarchy:this.state.hierarchy, -selection:this.state.selection, -setSelection:this.setSelection.bind(this)}))));}}]);return Inspector;})(React.Component); - - - - - - - -var styles=StyleSheet.create({ -container:{ -position:'absolute', -backgroundColor:'transparent', -top:0, -left:0, -right:0, -bottom:0}, - -panelContainer:{ -position:'absolute', -left:0, -right:0}}); - - - -module.exports=Inspector; -}); -__d('InspectorOverlay',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var InspectorUtils=require('InspectorUtils'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var UIManager=require('NativeModules').UIManager; -var View=require('View'); -var ElementBox=require('ElementBox'); - -var PropTypes=React.PropTypes; - - - - - -var InspectorOverlay=React.createClass({displayName:'InspectorOverlay', -propTypes:{ -inspected:PropTypes.shape({ -frame:PropTypes.object, -style:PropTypes.any}), - -inspectedViewTag:PropTypes.number, -onTouchInstance:PropTypes.func.isRequired}, - - -findViewForTouchEvent:function(e){var _this=this;var _e$nativeEvent$touche= -e.nativeEvent.touches[0];var locationX=_e$nativeEvent$touche.locationX;var locationY=_e$nativeEvent$touche.locationY; -UIManager.findSubviewIn( -this.props.inspectedViewTag, -[locationX,locationY], -function(nativeViewTag,left,top,width,height){ -var instance=InspectorUtils.findInstanceByNativeTag(_this.props.rootTag,nativeViewTag); -if(!instance){ -return;} - -_this.props.onTouchInstance(instance,{left:left,top:top,width:width,height:height},locationY);});}, - - - - -shouldSetResponser:function(e){ -this.findViewForTouchEvent(e); -return true;}, - - -render:function(){ -var content=null; -if(this.props.inspected){ -content=React.createElement(ElementBox,{frame:this.props.inspected.frame,style:this.props.inspected.style});} - - -return ( -React.createElement(View,{ -onStartShouldSetResponder:this.shouldSetResponser, -onResponderMove:this.findViewForTouchEvent, -style:[styles.inspector,{height:Dimensions.get('window').height}]}, -content));}}); - - - - - -var styles=StyleSheet.create({ -inspector:{ -backgroundColor:'transparent', -position:'absolute', -left:0, -top:0, -right:0}}); - - - -module.exports=InspectorOverlay; -}); -__d('ElementBox',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var View=require('View'); -var StyleSheet=require('StyleSheet'); -var BorderBox=require('BorderBox'); -var resolveBoxStyle=require('resolveBoxStyle'); - -var flattenStyle=require('flattenStyle');var - -ElementBox=(function(_React$Component){babelHelpers.inherits(ElementBox,_React$Component);function ElementBox(){babelHelpers.classCallCheck(this,ElementBox);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(ElementBox).apply(this,arguments));}babelHelpers.createClass(ElementBox,[{key:'render',value:function render() -{ -var style=flattenStyle(this.props.style)||{}; -var margin=resolveBoxStyle('margin',style); -var padding=resolveBoxStyle('padding',style); -var frameStyle=this.props.frame; -if(margin){ -frameStyle={ -top:frameStyle.top-margin.top, -left:frameStyle.left-margin.left, -height:frameStyle.height+margin.top+margin.bottom, -width:frameStyle.width+margin.left+margin.right};} - - -var contentStyle={ -width:this.props.frame.width, -height:this.props.frame.height}; - -if(padding){ -contentStyle={ -width:contentStyle.width-padding.left-padding.right, -height:contentStyle.height-padding.top-padding.bottom};} - - -return ( -React.createElement(View,{style:[styles.frame,frameStyle],pointerEvents:'none'}, -React.createElement(BorderBox,{box:margin,style:styles.margin}, -React.createElement(BorderBox,{box:padding,style:styles.padding}, -React.createElement(View,{style:[styles.content,contentStyle]})))));}}]);return ElementBox;})(React.Component); - - - - - - - -var styles=StyleSheet.create({ -frame:{ -position:'absolute'}, - -content:{ -backgroundColor:'rgba(200, 230, 255, 0.8)'}, - -padding:{ -borderColor:'rgba(77, 255, 0, 0.3)'}, - -margin:{ -borderColor:'rgba(255, 132, 0, 0.3)'}}); - - - -module.exports=ElementBox; -}); -__d('BorderBox',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var View=require('View');var - -BorderBox=(function(_React$Component){babelHelpers.inherits(BorderBox,_React$Component);function BorderBox(){babelHelpers.classCallCheck(this,BorderBox);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(BorderBox).apply(this,arguments));}babelHelpers.createClass(BorderBox,[{key:'render',value:function render() -{ -var box=this.props.box; -if(!box){ -return this.props.children;} - -var style={ -borderTopWidth:box.top, -borderBottomWidth:box.bottom, -borderLeftWidth:box.left, -borderRightWidth:box.right}; - -return ( -React.createElement(View,{style:[style,this.props.style]}, -this.props.children));}}]);return BorderBox;})(React.Component); - - - - - -module.exports=BorderBox; -}); -__d('resolveBoxStyle',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - -function resolveBoxStyle(prefix,style){ -var res={}; -var subs=['top','left','bottom','right']; -var set=false; -subs.forEach(function(sub){ -res[sub]=style[prefix]||0;}); - -if(style[prefix]){ -set=true;} - -if(style[prefix+'Vertical']){ -res.top=res.bottom=style[prefix+'Vertical']; -set=true;} - -if(style[prefix+'Horizontal']){ -res.left=res.right=style[prefix+'Horizontal']; -set=true;} - -subs.forEach(function(sub){ -var val=style[prefix+capFirst(sub)]; -if(val){ -res[sub]=val; -set=true;}}); - - -if(!set){ -return;} - -return res;} - - -function capFirst(text){ -return text[0].toUpperCase()+text.slice(1);} - - -module.exports=resolveBoxStyle; -}); -__d('InspectorPanel',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); -var ElementProperties=require('ElementProperties'); -var PerformanceOverlay=require('PerformanceOverlay'); -var TouchableHighlight=require('TouchableHighlight'); - -var PropTypes=React.PropTypes;var - -InspectorPanel=(function(_React$Component){babelHelpers.inherits(InspectorPanel,_React$Component);function InspectorPanel(){babelHelpers.classCallCheck(this,InspectorPanel);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(InspectorPanel).apply(this,arguments));}babelHelpers.createClass(InspectorPanel,[{key:'renderWaiting',value:function renderWaiting() -{ -if(this.props.inspecting){ -return ( -React.createElement(Text,{style:styles.waitingText},'Tap something to inspect it'));} - - - - -return React.createElement(Text,{style:styles.waitingText},'Nothing is inspected');}},{key:'render',value:function render() - - -{ -var contents; -if(this.props.inspected){ -contents= -React.createElement(ElementProperties,{ -style:this.props.inspected.style, -frame:this.props.inspected.frame, -hierarchy:this.props.hierarchy, -selection:this.props.selection, -setSelection:this.props.setSelection});}else - - -if(this.props.perfing){ -contents= -React.createElement(PerformanceOverlay,null);}else - -{ -contents= -React.createElement(View,{style:styles.waiting}, -this.renderWaiting());} - - - -return ( -React.createElement(View,{style:styles.container}, -!this.props.devtoolsIsOpen&&contents, -React.createElement(View,{style:styles.buttonRow}, -React.createElement(Button,{ -title:'Inspect', -pressed:this.props.inspecting, -onClick:this.props.setInspecting}), - -React.createElement(Button,{title:'Perf', -pressed:this.props.perfing, -onClick:this.props.setPerfing}))));}}]);return InspectorPanel;})(React.Component); - - - - - - - -InspectorPanel.propTypes={ -devtoolsIsOpen:PropTypes.bool, -inspecting:PropTypes.bool, -setInspecting:PropTypes.func, -inspected:PropTypes.object, -perfing:PropTypes.bool, -setPerfing:PropTypes.func};var - - -Button=(function(_React$Component2){babelHelpers.inherits(Button,_React$Component2);function Button(){babelHelpers.classCallCheck(this,Button);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(Button).apply(this,arguments));}babelHelpers.createClass(Button,[{key:'render',value:function render() -{var _this3=this; -return ( -React.createElement(TouchableHighlight,{onPress:function(){return _this3.props.onClick(!_this3.props.pressed);},style:[ -styles.button, -this.props.pressed&&styles.buttonPressed]}, - -React.createElement(Text,{style:styles.buttonText},this.props.title)));}}]);return Button;})(React.Component); - - - - - -var styles=StyleSheet.create({ -buttonRow:{ -flexDirection:'row'}, - -button:{ -backgroundColor:'rgba(0, 0, 0, 0.3)', -margin:2, -height:30, -justifyContent:'center', -alignItems:'center'}, - -buttonPressed:{ -backgroundColor:'rgba(255, 255, 255, 0.3)'}, - -buttonText:{ -textAlign:'center', -color:'white', -margin:5}, - -container:{ -backgroundColor:'rgba(0, 0, 0, 0.7)'}, - -waiting:{ -height:100}, - -waitingText:{ -fontSize:20, -textAlign:'center', -marginVertical:20}}); - - - -module.exports=InspectorPanel; -}); -__d('ElementProperties',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var BoxInspector=require('BoxInspector'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleInspector=require('StyleInspector'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var TouchableHighlight=require('TouchableHighlight'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); -var View=require('View'); - -var flattenStyle=require('flattenStyle'); -var mapWithSeparator=require('mapWithSeparator'); - -var ElementProperties=React.createClass({displayName:'ElementProperties', -propTypes:{ -hierarchy:PropTypes.array.isRequired, -style:PropTypes.oneOfType([ -PropTypes.object, -PropTypes.array, -PropTypes.number])}, - - - -render:function(){var _this=this; -var style=flattenStyle(this.props.style); -var selection=this.props.selection; - - -return ( -React.createElement(TouchableWithoutFeedback,null, -React.createElement(View,{style:styles.info}, -React.createElement(View,{style:styles.breadcrumb}, -mapWithSeparator( -this.props.hierarchy, -function(item,i){return ( -React.createElement(TouchableHighlight,{ -style:[styles.breadItem,i===selection&&styles.selected], -onPress:function(){return _this.props.setSelection(i);}}, -React.createElement(Text,{style:styles.breadItemText}, -item.getName?item.getName():'Unknown')));}, - - - -function(){return React.createElement(Text,{style:styles.breadSep},'â–¸');})), - - -React.createElement(View,{style:styles.row}, -React.createElement(StyleInspector,{style:style}), -React.createElement(BoxInspector,{style:style,frame:this.props.frame})))));}}); - - - - - - - -var styles=StyleSheet.create({ -breadSep:{ -fontSize:8, -color:'white'}, - -breadcrumb:{ -flexDirection:'row', -flexWrap:'wrap', -marginBottom:5}, - -selected:{ -borderColor:'white', -borderRadius:5}, - -breadItem:{ -borderWidth:1, -borderColor:'transparent', -marginHorizontal:2}, - -breadItemText:{ -fontSize:10, -color:'white', -marginHorizontal:5}, - -row:{ -flexDirection:'row', -alignItems:'center', -justifyContent:'space-between'}, - -info:{ -padding:10}, - -path:{ -color:'white', -fontSize:9}}); - - - -module.exports=ElementProperties; -}); -__d('BoxInspector',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); -var resolveBoxStyle=require('resolveBoxStyle'); - -var blank={ -top:0, -left:0, -right:0, -bottom:0};var - - -BoxInspector=(function(_React$Component){babelHelpers.inherits(BoxInspector,_React$Component);function BoxInspector(){babelHelpers.classCallCheck(this,BoxInspector);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(BoxInspector).apply(this,arguments));}babelHelpers.createClass(BoxInspector,[{key:'render',value:function render() -{ -var frame=this.props.frame; -var style=this.props.style; -var margin=style&&resolveBoxStyle('margin',style)||blank; -var padding=style&&resolveBoxStyle('padding',style)||blank; -return ( -React.createElement(BoxContainer,{title:'margin',titleStyle:styles.marginLabel,box:margin}, -React.createElement(BoxContainer,{title:'padding',box:padding}, -React.createElement(View,null, -React.createElement(Text,{style:styles.innerText},'(', -frame.left,', ',frame.top,')'), - -React.createElement(Text,{style:styles.innerText}, -frame.width,' × ',frame.height)))));}}]);return BoxInspector;})(React.Component);var - - - - - - - - -BoxContainer=(function(_React$Component2){babelHelpers.inherits(BoxContainer,_React$Component2);function BoxContainer(){babelHelpers.classCallCheck(this,BoxContainer);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(BoxContainer).apply(this,arguments));}babelHelpers.createClass(BoxContainer,[{key:'render',value:function render() -{ -var box=this.props.box; -return ( -React.createElement(View,{style:styles.box}, -React.createElement(View,{style:styles.row}, -React.createElement(Text,{style:[this.props.titleStyle,styles.label]},this.props.title), -React.createElement(Text,{style:styles.boxText},box.top)), - -React.createElement(View,{style:styles.row}, -React.createElement(Text,{style:styles.boxText},box.left), -this.props.children, -React.createElement(Text,{style:styles.boxText},box.right)), - -React.createElement(Text,{style:styles.boxText},box.bottom)));}}]);return BoxContainer;})(React.Component); - - - - - -var styles=StyleSheet.create({ -row:{ -flexDirection:'row', -alignItems:'center', -justifyContent:'space-around'}, - -marginLabel:{ -width:60}, - -label:{ -fontSize:10, -color:'rgb(255,100,0)', -marginLeft:5, -flex:1, -textAlign:'left', -top:-3}, - -buffer:{ -fontSize:10, -color:'yellow', -flex:1, -textAlign:'center'}, - -innerText:{ -color:'yellow', -fontSize:12, -textAlign:'center', -width:70}, - -box:{ -borderWidth:1, -borderColor:'grey'}, - -boxText:{ -color:'white', -fontSize:12, -marginHorizontal:3, -marginVertical:2, -textAlign:'center'}}); - - - -module.exports=BoxInspector; -}); -__d('StyleInspector',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View');var - -StyleInspector=(function(_React$Component){babelHelpers.inherits(StyleInspector,_React$Component);function StyleInspector(){babelHelpers.classCallCheck(this,StyleInspector);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(StyleInspector).apply(this,arguments));}babelHelpers.createClass(StyleInspector,[{key:'render',value:function render() -{var _this2=this; -if(!this.props.style){ -return React.createElement(Text,{style:styles.noStyle},'No style');} - -var names=Object.keys(this.props.style); -return ( -React.createElement(View,{style:styles.container}, -React.createElement(View,null, -names.map(function(name){return React.createElement(Text,{style:styles.attr},name,':');})), - -React.createElement(View,null, -names.map(function(name){return React.createElement(Text,{style:styles.value},_this2.props.style[name]);}))));}}]);return StyleInspector;})(React.Component); - - - - - - -var styles=StyleSheet.create({ -container:{ -flexDirection:'row'}, - -row:{ -flexDirection:'row', -alignItems:'center', -justifyContent:'space-around'}, - -attr:{ -fontSize:10, -color:'#ccc'}, - -value:{ -fontSize:10, -color:'white', -marginLeft:10}, - -noStyle:{ -color:'white', -fontSize:10}}); - - - -module.exports=StyleInspector; -}); -__d('mapWithSeparator',function(global, require, module, exports) { 'use strict'; - - - - - - -function mapWithSeparator(array,valueFunction,separatorFunction){ -var results=[]; -for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];} -var index=0; -return format.replace(/%s/g,function(match){return args[index++];});} - - -function updateWarningMap(format){ -var stringifySafe=require('stringifySafe'); - -format=String(format); -var argCount=(format.match(/%s/g)||[]).length;for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];} -var warning=[ -sprintf.apply(undefined,[format].concat(babelHelpers.toConsumableArray(args.slice(0,argCount))))].concat(babelHelpers.toConsumableArray( -args.slice(argCount).map(stringifySafe))). -join(' '); - -var count=_warningMap.has(warning)?_warningMap.get(warning):0; -_warningMap.set(warning,count+2); -_warningEmitter.emit('warning',_warningMap);} - - -function isWarningIgnored(warning){ -return ( -Array.isArray(console.ignoredYellowBox)&& -console.ignoredYellowBox.some( -function(ignorePrefix){return warning.startsWith(ignorePrefix);}));} - - - - -var WarningRow=function(_ref){var count=_ref.count;var warning=_ref.warning;var onPress=_ref.onPress; -var Text=require('Text'); -var TouchableHighlight=require('TouchableHighlight'); -var View=require('View'); - -var countText=count>1? -React.createElement(Text,{style:styles.listRowCount},'('+count+') '): -null; - -return ( -React.createElement(View,{style:styles.listRow}, -React.createElement(TouchableHighlight,{ -activeOpacity:0.5, -onPress:onPress, -style:styles.listRowContent, -underlayColor:'transparent'}, -React.createElement(Text,{style:styles.listRowText,numberOfLines:2}, -countText, -warning))));}; - - - - - - -var WarningInspector=function(_ref2) - - - - - -{var count=_ref2.count;var warning=_ref2.warning;var onClose=_ref2.onClose;var onDismiss=_ref2.onDismiss;var onDismissAll=_ref2.onDismissAll; -var ScrollView=require('ScrollView'); -var Text=require('Text'); -var TouchableHighlight=require('TouchableHighlight'); -var View=require('View'); - -var countSentence= -'Warning encountered '+count+' time'+(count-1?'s':'')+'.'; - -return ( -React.createElement(TouchableHighlight,{ -activeOpacity:0.95, -underlayColor:backgroundColor(0.8), -onPress:onClose, -style:styles.inspector}, -React.createElement(View,{style:styles.inspectorContent}, -React.createElement(View,{style:styles.inspectorCount}, -React.createElement(Text,{style:styles.inspectorCountText},countSentence)), - -React.createElement(ScrollView,{style:styles.inspectorWarning}, -React.createElement(Text,{style:styles.inspectorWarningText},warning)), - -React.createElement(View,{style:styles.inspectorButtons}, -React.createElement(TouchableHighlight,{ -activeOpacity:0.5, -onPress:onDismiss, -style:styles.inspectorButton, -underlayColor:'transparent'}, -React.createElement(Text,{style:styles.inspectorButtonText},'Dismiss')), - - - -React.createElement(TouchableHighlight,{ -activeOpacity:0.5, -onPress:onDismissAll, -style:styles.inspectorButton, -underlayColor:'transparent'}, -React.createElement(Text,{style:styles.inspectorButtonText},'Dismiss All'))))));};var - - - - - - - - - -YellowBox=(function(_React$Component){babelHelpers.inherits(YellowBox,_React$Component); - - - - - - -function YellowBox(props,context){babelHelpers.classCallCheck(this,YellowBox);var _this=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(YellowBox).call(this, -props,context)); -_this.state={ -inspecting:null, -warningMap:_warningMap}; - -_this.dismissWarning=function(warning){var _this$state= -_this.state;var inspecting=_this$state.inspecting;var warningMap=_this$state.warningMap; -if(warning){ -warningMap.delete(warning);}else -{ -warningMap.clear();} - -_this.setState({ -inspecting:warning&&inspecting!==warning?inspecting:null, -warningMap:warningMap});};return _this;}babelHelpers.createClass(YellowBox,[{key:'componentDidMount',value:function componentDidMount() - - - - -{var _this2=this; -var scheduled=null; -this._listener=_warningEmitter.addListener('warning',function(warningMap){ - - -scheduled=scheduled||setImmediate(function(){ -scheduled=null; -_this2.setState({ -warningMap:warningMap});});});}},{key:'componentWillUnmount',value:function componentWillUnmount() - - - - - -{ -if(this._listener){ -this._listener.remove();}}},{key:'render',value:function render() - - - -{var _this3=this; -if(console.disableYellowBox||this.state.warningMap.size===0){ -return null;} - -var ScrollView=require('ScrollView'); -var View=require('View'); - -var inspecting=this.state.inspecting; -var inspector=inspecting!==null? -React.createElement(WarningInspector,{ -count:this.state.warningMap.get(inspecting), -warning:inspecting, -onClose:function(){return _this3.setState({inspecting:null});}, -onDismiss:function(){return _this3.dismissWarning(inspecting);}, -onDismissAll:function(){return _this3.dismissWarning(null);}}): - -null; - -var rows=[]; -this.state.warningMap.forEach(function(count,warning){ -if(!isWarningIgnored(warning)){ -rows.push( -React.createElement(WarningRow,{ -key:warning, -count:count, -warning:warning, -onPress:function(){return _this3.setState({inspecting:warning});}, -onDismiss:function(){return _this3.dismissWarning(warning);}}));}}); - - - - - -var listStyle=[ -styles.list, - -{height:Math.min(rows.length,4.4)*(rowGutter+rowHeight)}]; - -return ( -React.createElement(View,{style:inspector?styles.fullScreen:listStyle}, -React.createElement(ScrollView,{style:listStyle}, -rows), - -inspector));}}]);return YellowBox;})(React.Component); - - - - - -var backgroundColor=function(opacity){return 'rgba(250, 186, 48, '+opacity+')';}; -var textColor='white'; -var rowGutter=1; -var rowHeight=46; - -var styles=StyleSheet.create({ -fullScreen:{ -backgroundColor:'transparent', -position:'absolute', -left:0, -right:0, -top:0, -bottom:0}, - -inspector:{ -backgroundColor:backgroundColor(0.95), -flex:1}, - -inspectorContainer:{ -flex:1}, - -inspectorButtons:{ -flexDirection:'row', -position:'absolute', -left:0, -right:0, -bottom:0}, - -inspectorButton:{ -flex:1, -padding:22}, - -inspectorButtonText:{ -color:textColor, -fontSize:14, -opacity:0.8, -textAlign:'center'}, - -inspectorContent:{ -flex:1, -paddingTop:5}, - -inspectorCount:{ -padding:15, -paddingBottom:0}, - -inspectorCountText:{ -color:textColor, -fontSize:14}, - -inspectorWarning:{ -padding:15, -position:'absolute', -top:39, -bottom:60}, - -inspectorWarningText:{ -color:textColor, -fontSize:16, -fontWeight:'600'}, - -list:{ -backgroundColor:'transparent', -position:'absolute', -left:0, -right:0, -bottom:0}, - -listRow:{ -position:'relative', -backgroundColor:backgroundColor(0.95), -flex:1, -height:rowHeight, -marginTop:rowGutter}, - -listRowContent:{ -flex:1}, - -listRowCount:{ -color:'rgba(255, 255, 255, 0.5)'}, - -listRowText:{ -color:textColor, -position:'absolute', -left:0, -top:Platform.OS==='android'?5:7, -marginLeft:15, -marginRight:15}}); - - - -module.exports=YellowBox; -}); -__d('RCTRenderingPerf',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactDefaultPerf=require('ReactDefaultPerf'); - -var invariant=require('invariant'); - - - - - - -var perfModules=[]; -var enabled=false; - -var RCTRenderingPerf={ - -toggle:function(){ -console.log('Render perfomance measurements enabled'); -enabled=true;}, - - -start:function(){ -if(!enabled){ -return;} - - -ReactDefaultPerf.start(); -perfModules.forEach(function(module){return module.start();});}, - - -stop:function(){ -if(!enabled){ -return;} - - -ReactDefaultPerf.stop(); -ReactDefaultPerf.printInclusive(); -ReactDefaultPerf.printWasted(); - -var totalRender=0; -var totalTime=0; -var measurements=ReactDefaultPerf.getLastMeasurements(); -for(var ii=0;ii component':item.componentName, -'Inclusive time (ms)':roundFloat(item.time), -'Instances':item.count};})); - - -console.log( -'Total time:', -ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2)+' ms');}, - - - -getMeasurementsSummaryMap:function(measurements){ -var summary=ReactDefaultPerfAnalysis.getInclusiveSummary( -measurements, -true); - -return summary.map(function(item){ -return { -'Owner > component':item.componentName, -'Wasted time (ms)':item.time, -'Instances':item.count};});}, - - - - -printWasted:function(measurements){ -measurements=measurements||ReactDefaultPerf._allMeasurements; -console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements)); -console.log( -'Total time:', -ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2)+' ms');}, - - - -printDOM:function(measurements){ -measurements=measurements||ReactDefaultPerf._allMeasurements; -var summary=ReactDefaultPerfAnalysis.getDOMSummary(measurements); -console.table(summary.map(function(item){ -var result={}; -result[DOMProperty.ID_ATTRIBUTE_NAME]=item.id; -result.type=item.type; -result.args=JSON.stringify(item.args); -return result;})); - -console.log( -'Total time:', -ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2)+' ms');}, - - - -_recordWrite:function(id,fnName,totalTime,args){ - -var writes= -ReactDefaultPerf. -_allMeasurements[ReactDefaultPerf._allMeasurements.length-1]. -writes; -writes[id]=writes[id]||[]; -writes[id].push({ -type:fnName, -time:totalTime, -args:args});}, - - - -measure:function(moduleName,fnName,func){ -return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];} -var totalTime; -var rv; -var start; - -if(fnName==='_renderNewRootComponent'|| -fnName==='flushBatchedUpdates'){ - - - - -ReactDefaultPerf._allMeasurements.push({ -exclusive:{}, -inclusive:{}, -render:{}, -counts:{}, -writes:{}, -displayNames:{}, -totalTime:0, -created:{}}); - -start=performanceNow(); -rv=func.apply(this,args); -ReactDefaultPerf._allMeasurements[ -ReactDefaultPerf._allMeasurements.length-1]. -totalTime=performanceNow()-start; -return rv;}else -if(fnName==='_mountImageIntoNode'|| -moduleName==='ReactBrowserEventEmitter'|| -moduleName==='ReactDOMIDOperations'|| -moduleName==='CSSPropertyOperations'|| -moduleName==='DOMChildrenOperations'|| -moduleName==='DOMPropertyOperations'){ -start=performanceNow(); -rv=func.apply(this,args); -totalTime=performanceNow()-start; - -if(fnName==='_mountImageIntoNode'){ -var mountID=ReactMount.getID(args[1]); -ReactDefaultPerf._recordWrite(mountID,fnName,totalTime,args[0]);}else -if(fnName==='dangerouslyProcessChildrenUpdates'){ - -args[0].forEach(function(update){ -var writeArgs={}; -if(update.fromIndex!==null){ -writeArgs.fromIndex=update.fromIndex;} - -if(update.toIndex!==null){ -writeArgs.toIndex=update.toIndex;} - -if(update.textContent!==null){ -writeArgs.textContent=update.textContent;} - -if(update.markupIndex!==null){ -writeArgs.markup=args[1][update.markupIndex];} - -ReactDefaultPerf._recordWrite( -update.parentID, -update.type, -totalTime, -writeArgs);});}else - - -{ - -var id=args[0]; -if(typeof id==='object'){ -id=ReactMount.getID(args[0]);} - -ReactDefaultPerf._recordWrite( -id, -fnName, -totalTime, -Array.prototype.slice.call(args,1));} - - -return rv;}else -if(moduleName==='ReactCompositeComponent'&&( -fnName==='mountComponent'|| -fnName==='updateComponent'|| -fnName==='_renderValidatedComponent')){ - -if(this._currentElement.type===ReactMount.TopLevelWrapper){ -return func.apply(this,args);} - - -var rootNodeID=fnName==='mountComponent'? -args[0]: -this._rootNodeID; -var isRender=fnName==='_renderValidatedComponent'; -var isMount=fnName==='mountComponent'; - -var mountStack=ReactDefaultPerf._mountStack; -var entry=ReactDefaultPerf._allMeasurements[ -ReactDefaultPerf._allMeasurements.length-1]; - - -if(isRender){ -addValue(entry.counts,rootNodeID,1);}else -if(isMount){ -entry.created[rootNodeID]=true; -mountStack.push(0);} - - -start=performanceNow(); -rv=func.apply(this,args); -totalTime=performanceNow()-start; - -if(isRender){ -addValue(entry.render,rootNodeID,totalTime);}else -if(isMount){ -var subMountTime=mountStack.pop(); -mountStack[mountStack.length-1]+=totalTime; -addValue(entry.exclusive,rootNodeID,totalTime-subMountTime); -addValue(entry.inclusive,rootNodeID,totalTime);}else -{ -addValue(entry.inclusive,rootNodeID,totalTime);} - - -entry.displayNames[rootNodeID]={ -current:this.getName(), -owner:this._currentElement._owner? -this._currentElement._owner.getName(): -''}; - - -return rv;}else -{ -return func.apply(this,args);}};}}; - - - - - -module.exports=ReactDefaultPerf; -}); -__d('DOMProperty',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var invariant=require('invariant'); - -function checkMask(value,bitmask){ -return (value&bitmask)===bitmask;} - - -var DOMPropertyInjection={ - - - - -MUST_USE_ATTRIBUTE:0x1, -MUST_USE_PROPERTY:0x2, -HAS_SIDE_EFFECTS:0x4, -HAS_BOOLEAN_VALUE:0x8, -HAS_NUMERIC_VALUE:0x10, -HAS_POSITIVE_NUMERIC_VALUE:0x20|0x10, -HAS_OVERLOADED_BOOLEAN_VALUE:0x40, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -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){ -invariant( -!DOMProperty.properties.hasOwnProperty(propName), -'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); - - -var lowerCased=propName.toLowerCase(); -var propConfig=Properties[propName]; - -var propertyInfo={ -attributeName:lowerCased, -attributeNamespace:null, -propertyName:propName, -mutationMethod:null, - -mustUseAttribute:checkMask(propConfig,Injection.MUST_USE_ATTRIBUTE), -mustUseProperty:checkMask(propConfig,Injection.MUST_USE_PROPERTY), -hasSideEffects:checkMask(propConfig,Injection.HAS_SIDE_EFFECTS), -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)}; - - -invariant( -!propertyInfo.mustUseAttribute||!propertyInfo.mustUseProperty, -'DOMProperty: Cannot require using both attribute and property: %s', -propName); - -invariant( -propertyInfo.mustUseProperty||!propertyInfo.hasSideEffects, -'DOMProperty: Properties that have side effects must use property: %s', -propName); - -invariant( -propertyInfo.hasBooleanValue+propertyInfo.hasNumericValue+ -propertyInfo.hasOverloadedBooleanValue<=1, -'DOMProperty: Value can be one of boolean, overloaded boolean, or '+ -'numeric value, but not a combination: %s', -propName); - - -if(__DEV__){ -DOMProperty.getPossibleStandardName[lowerCased]=propName;} - - -if(DOMAttributeNames.hasOwnProperty(propName)){ -var attributeName=DOMAttributeNames[propName]; -propertyInfo.attributeName=attributeName; -if(__DEV__){ -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;}}}; - - - -var defaultValueCache={}; - - - - - - - - - - - - - - -var DOMProperty={ - -ID_ATTRIBUTE_NAME:'data-reactid', - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -properties:{}, - - - - - - -getPossibleStandardName:__DEV__?{}:null, - - - - -_isCustomAttributeFunctions:[], - - - - - -isCustomAttribute:function(attributeName){ -for(var i=0;i=DONT_CARE_THRESHOLD){ -arr.push(candidates[displayName]);}} - - - -arr.sort(function(a,b){ -return b.exclusive-a.exclusive;}); - - -return arr;} - - -function getInclusiveSummary(measurements,onlyClean){ -var candidates={}; -var inclusiveKey; - -for(var i=0;i '+displayName.current; - -candidates[inclusiveKey]=candidates[inclusiveKey]||{ -componentName:inclusiveKey, -time:0, -count:0}; - - -if(measurement.inclusive[id]){ -candidates[inclusiveKey].time+=measurement.inclusive[id];} - -if(measurement.counts[id]){ -candidates[inclusiveKey].count+=measurement.counts[id];}}} - - - - - -var arr=[]; -for(inclusiveKey in candidates){ -if(candidates[inclusiveKey].time>=DONT_CARE_THRESHOLD){ -arr.push(candidates[inclusiveKey]);}} - - - -arr.sort(function(a,b){ -return b.time-a.time;}); - - -return arr;} - - -function getUnchangedComponents(measurement){ - - - -var cleanComponents={}; -var dirtyLeafIDs=Object.keys(measurement.writes); -var allIDs=assign({},measurement.exclusive,measurement.inclusive); - -for(var id in allIDs){ -var isDirty=false; - - -for(var i=0;i0){ -cleanComponents[id]=true;}} - - -return cleanComponents;} - - -var ReactDefaultPerfAnalysis={ -getExclusiveSummary:getExclusiveSummary, -getInclusiveSummary:getInclusiveSummary, -getDOMSummary:getDOMSummary, -getTotalTime:getTotalTime}; - - -module.exports=ReactDefaultPerfAnalysis; -}); -__d('ReactMount',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var DOMProperty=require('DOMProperty'); -var ReactBrowserEventEmitter=require('ReactBrowserEventEmitter'); -var ReactCurrentOwner=require('ReactCurrentOwner'); -var ReactDOMFeatureFlags=require('ReactDOMFeatureFlags'); -var ReactElement=require('ReactElement'); -var ReactEmptyComponentRegistry=require('ReactEmptyComponentRegistry'); -var ReactInstanceHandles=require('ReactInstanceHandles'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactMarkupChecksum=require('ReactMarkupChecksum'); -var ReactPerf=require('ReactPerf'); -var ReactReconciler=require('ReactReconciler'); -var ReactUpdateQueue=require('ReactUpdateQueue'); -var ReactUpdates=require('ReactUpdates'); - -var assign=require('Object.assign'); -var emptyObject=require('emptyObject'); -var containsNode=require('containsNode'); -var instantiateReactComponent=require('instantiateReactComponent'); -var invariant=require('invariant'); -var setInnerHTML=require('setInnerHTML'); -var shouldUpdateReactComponent=require('shouldUpdateReactComponent'); -var validateDOMNesting=require('validateDOMNesting'); -var warning=require('warning'); - -var ATTR_NAME=DOMProperty.ID_ATTRIBUTE_NAME; -var nodeCache={}; - -var ELEMENT_NODE_TYPE=1; -var DOC_NODE_TYPE=9; -var DOCUMENT_FRAGMENT_NODE_TYPE=11; - -var ownerDocumentContextKey= -'__ReactMount_ownerDocument$'+Math.random().toString(36).slice(2); - - - -var instancesByReactRootID={}; - - -var containersByReactRootID={}; - -if(__DEV__){ - -var rootElementsByReactRootID={};} - - - -var findComponentRootReusableArray=[]; - - - - - - - -function firstDifferenceIndex(string1,string2){ -var minLen=Math.min(string1.length,string2.length); -for(var i=0;i when using tables, nesting tags '+ -'like
,

, or , or using non-SVG elements in an '+ -'parent. '+ -'Try inspecting the child nodes of the element with React ID `%s`.', -targetID, -ReactMount.getID(ancestorNode));}, - - - -_mountImageIntoNode:function( -markup, -container, -shouldReuseMarkup, -transaction) -{ -invariant( -container&&( -container.nodeType===ELEMENT_NODE_TYPE|| -container.nodeType===DOC_NODE_TYPE|| -container.nodeType===DOCUMENT_FRAGMENT_NODE_TYPE), - -'mountComponentIntoNode(...): Target container is not valid.'); - - -if(shouldReuseMarkup){ -var rootElement=getReactRootElementInContainer(container); -if(ReactMarkupChecksum.canReuseMarkup(markup,rootElement)){ -return;}else -{ -var checksum=rootElement.getAttribute( -ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - -rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - -var rootMarkup=rootElement.outerHTML; -rootElement.setAttribute( -ReactMarkupChecksum.CHECKSUM_ATTR_NAME, -checksum); - - -var normalizedMarkup=markup; -if(__DEV__){ - - - - -var normalizer; -if(container.nodeType===ELEMENT_NODE_TYPE){ -normalizer=document.createElement('div'); -normalizer.innerHTML=markup; -normalizedMarkup=normalizer.innerHTML;}else -{ -normalizer=document.createElement('iframe'); -document.body.appendChild(normalizer); -normalizer.contentDocument.write(markup); -normalizedMarkup=normalizer.contentDocument.documentElement.outerHTML; -document.body.removeChild(normalizer);}} - - - -var diffIndex=firstDifferenceIndex(normalizedMarkup,rootMarkup); -var difference=' (client) '+ -normalizedMarkup.substring(diffIndex-20,diffIndex+20)+ -'\n (server) '+rootMarkup.substring(diffIndex-20,diffIndex+20); - -invariant( -container.nodeType!==DOC_NODE_TYPE, -'You\'re trying to render a component to the document using '+ -'server rendering but the checksum was invalid. This usually '+ -'means you rendered a different component type or props on '+ -'the client from the one on the server, or your render() '+ -'methods are impure. React cannot handle this case due to '+ -'cross-browser quirks by rendering at the document root. You '+ -'should look for environment dependent code in your components '+ -'and ensure the props are the same client and server side:\n%s', -difference); - - -if(__DEV__){ -warning( -false, -'React attempted to reuse markup in a container but the '+ -'checksum was invalid. This generally means that you are '+ -'using server rendering and the markup generated on the '+ -'server was not what the client was expecting. React injected '+ -'new markup to compensate which works but you have lost many '+ -'of the benefits of server rendering. Instead, figure out '+ -'why the markup being generated is different on the client '+ -'or server:\n%s', -difference);}}} - - - - - -invariant( -container.nodeType!==DOC_NODE_TYPE, -'You\'re trying to render a component to the document but '+ -'you didn\'t use server rendering. We can\'t do this '+ -'without using server rendering due to cross-browser quirks. '+ -'See ReactDOMServer.renderToString() for server rendering.'); - - -if(transaction.useCreateElement){ -while(container.lastChild){ -container.removeChild(container.lastChild);} - -container.appendChild(markup);}else -{ -setInnerHTML(container,markup);}}, - - - -ownerDocumentContextKey:ownerDocumentContextKey, - - - - - -getReactRootID:getReactRootID, - -getID:getID, - -setID:setID, - -getNode:getNode, - -getNodeFromInstance:getNodeFromInstance, - -isValid:isValid, - -purgeID:purgeID}; - - -ReactPerf.measureMethods(ReactMount,'ReactMount',{ -_renderNewRootComponent:'_renderNewRootComponent', -_mountImageIntoNode:'_mountImageIntoNode'}); - - -module.exports=ReactMount; -}); -__d('ReactBrowserEventEmitter',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var EventConstants=require('EventConstants'); -var EventPluginHub=require('EventPluginHub'); -var EventPluginRegistry=require('EventPluginRegistry'); -var ReactEventEmitterMixin=require('ReactEventEmitterMixin'); -var ReactPerf=require('ReactPerf'); -var ViewportMetrics=require('ViewportMetrics'); - -var assign=require('Object.assign'); -var isEventSupported=require('isEventSupported'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var alreadyListeningTo={}; -var isMonitoringScrollValue=false; -var reactTopListenersCounter=0; - - - - -var topEventMapping={ -topAbort:'abort', -topBlur:'blur', -topCanPlay:'canplay', -topCanPlayThrough:'canplaythrough', -topChange:'change', -topClick:'click', -topCompositionEnd:'compositionend', -topCompositionStart:'compositionstart', -topCompositionUpdate:'compositionupdate', -topContextMenu:'contextmenu', -topCopy:'copy', -topCut:'cut', -topDoubleClick:'dblclick', -topDrag:'drag', -topDragEnd:'dragend', -topDragEnter:'dragenter', -topDragExit:'dragexit', -topDragLeave:'dragleave', -topDragOver:'dragover', -topDragStart:'dragstart', -topDrop:'drop', -topDurationChange:'durationchange', -topEmptied:'emptied', -topEncrypted:'encrypted', -topEnded:'ended', -topError:'error', -topFocus:'focus', -topInput:'input', -topKeyDown:'keydown', -topKeyPress:'keypress', -topKeyUp:'keyup', -topLoadedData:'loadeddata', -topLoadedMetadata:'loadedmetadata', -topLoadStart:'loadstart', -topMouseDown:'mousedown', -topMouseMove:'mousemove', -topMouseOut:'mouseout', -topMouseOver:'mouseover', -topMouseUp:'mouseup', -topPaste:'paste', -topPause:'pause', -topPlay:'play', -topPlaying:'playing', -topProgress:'progress', -topRateChange:'ratechange', -topScroll:'scroll', -topSeeked:'seeked', -topSeeking:'seeking', -topSelectionChange:'selectionchange', -topStalled:'stalled', -topSuspend:'suspend', -topTextInput:'textInput', -topTimeUpdate:'timeupdate', -topTouchCancel:'touchcancel', -topTouchEnd:'touchend', -topTouchMove:'touchmove', -topTouchStart:'touchstart', -topVolumeChange:'volumechange', -topWaiting:'waiting', -topWheel:'wheel'}; - - - - - -var topListenersIDKey='_reactListenersID'+String(Math.random()).slice(2); - -function getListeningForDocument(mountAt){ - - -if(!Object.prototype.hasOwnProperty.call(mountAt,topListenersIDKey)){ -mountAt[topListenersIDKey]=reactTopListenersCounter++; -alreadyListeningTo[mountAt[topListenersIDKey]]={};} - -return alreadyListeningTo[mountAt[topListenersIDKey]];} - - - - - - - - - - - - -var ReactBrowserEventEmitter=assign({},ReactEventEmitterMixin,{ - - - - -ReactEventListener:null, - -injection:{ - - - -injectReactEventListener:function(ReactEventListener){ -ReactEventListener.setHandleTopLevel( -ReactBrowserEventEmitter.handleTopLevel); - -ReactBrowserEventEmitter.ReactEventListener=ReactEventListener;}}, - - - - - - - - -setEnabled:function(enabled){ -if(ReactBrowserEventEmitter.ReactEventListener){ -ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);}}, - - - - - - -isEnabled:function(){ -return !!( -ReactBrowserEventEmitter.ReactEventListener&& -ReactBrowserEventEmitter.ReactEventListener.isEnabled());}, - - - - - - - - - - - - - - - - - - - - - - - - -listenTo:function(registrationName,contentDocumentHandle){ -var mountAt=contentDocumentHandle; -var isListening=getListeningForDocument(mountAt); -var dependencies= -EventPluginRegistry.registrationNameDependencies[registrationName]; - -var topLevelTypes=EventConstants.topLevelTypes; -for(var i=0;i/; - -var ReactMarkupChecksum={ -CHECKSUM_ATTR_NAME:'data-react-checksum', - - - - - -addChecksumToMarkup:function(markup){ -var checksum=adler32(markup); - - -return markup.replace( -TAG_END, -' '+ReactMarkupChecksum.CHECKSUM_ATTR_NAME+'="'+checksum+'"$&');}, - - - - - - - - -canReuseMarkup:function(markup,element){ -var existingChecksum=element.getAttribute( -ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - -existingChecksum=existingChecksum&&parseInt(existingChecksum,10); -var markupChecksum=adler32(markup); -return markupChecksum===existingChecksum;}}; - - - -module.exports=ReactMarkupChecksum; -}); -__d('adler32',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var MOD=65521; - - - - - - -function adler32(data){ -var a=1; -var b=0; -var i=0; -var l=data.length; -var m=l&~0x3; -while(i]/; - - - - - - - - - -var setInnerHTML=function(node,html){ -node.innerHTML=html;}; - - - -if(typeof MSApp!=='undefined'&&MSApp.execUnsafeLocalFunction){ -setInnerHTML=function(node,html){ -MSApp.execUnsafeLocalFunction(function(){ -node.innerHTML=html;});};} - - - - -if(ExecutionEnvironment.canUseDOM){ - - - - - - -var testElement=document.createElement('div'); -testElement.innerHTML=' '; -if(testElement.innerHTML===''){ -setInnerHTML=function(node,html){ - - - - - -if(node.parentNode){ -node.parentNode.replaceChild(node,node);} - - - - - - -if(WHITESPACE_TEST.test(html)|| -html[0]==='<'&&NONVISIBLE_TEST.test(html)){ - - - - - - -node.innerHTML=String.fromCharCode(0xFEFF)+html; - - - -var textNode=node.firstChild; -if(textNode.data.length===1){ -node.removeChild(textNode);}else -{ -textNode.deleteData(0,1);}}else - -{ -node.innerHTML=html;}};}} - - - - - -module.exports=setInnerHTML; -}); -__d('validateDOMNesting',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var assign=require('Object.assign'); -var emptyFunction=require('emptyFunction'); -var warning=require('warning'); - -var validateDOMNesting=emptyFunction; - -if(__DEV__){ - - - - - - - - - - - - -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']; - - - -var inScopeTags=[ -'applet','caption','html','table','td','th','marquee','object', -'template', - - - - -'foreignObject','desc','title']; - - - -var buttonScopeTags=inScopeTags.concat(['button']); - - -var impliedEndTags= -['dd','dt','li','option','optgroup','p','rp','rt']; - -var emptyAncestorInfo={ -parentTag: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;} - - - - -if( -specialTags.indexOf(tag)!==-1&& -tag!=='address'&&tag!=='div'&&tag!=='p') -{ -ancestorInfo.listItemTagAutoclosing=null; -ancestorInfo.dlItemTagAutoclosing=null;} - - -ancestorInfo.parentTag=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;}; - - - - - -var isTagValidWithParent=function(tag,parentTag){ - -switch(parentTag){ - -case 'select': -return tag==='option'||tag==='optgroup'||tag==='#text'; -case 'optgroup': -return tag==='option'||tag==='#text'; - - -case 'option': -return tag==='#text'; - - - - - - - -case 'tr': -return ( -tag==='th'||tag==='td'||tag==='style'||tag==='script'|| -tag==='template'); - - - -case 'tbody': -case 'thead': -case 'tfoot': -return ( -tag==='tr'||tag==='style'||tag==='script'|| -tag==='template'); - - - -case 'colgroup': -return tag==='col'||tag==='template'; - - -case 'table': -return ( -tag==='caption'||tag==='colgroup'||tag==='tbody'|| -tag==='tfoot'||tag==='thead'||tag==='style'|| -tag==='script'||tag==='template'); - - - -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'); - - - -case 'html': -return tag==='head'||tag==='body';} - - - - - -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 'caption': -case 'col': -case 'colgroup': -case 'frame': -case 'head': -case 'tbody': -case 'td': -case 'tfoot': -case 'th': -case 'thead': -case 'tr': - - - - -return parentTag==null;} - - -return true;}; - - - - - -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': - - -return ancestorInfo.aTagInScope; - -case 'nobr': -return ancestorInfo.nobrTagInScope;} - - -return null;}; - - - - - - -var findOwnerStack=function(instance){ -if(!instance){ -return [];} - - -var stack=[]; - -do { - -stack.push(instance);}while( -instance=instance._currentElement._owner); -stack.reverse(); -return stack;}; - - -var didWarn={}; - -validateDOMNesting=function(childTag,childInstance,ancestorInfo){ -ancestorInfo=ancestorInfo||emptyAncestorInfo; -var parentInfo=ancestorInfo.parentTag; -var parentTag=parentInfo&&parentInfo.tag; - -var invalidParent= -isTagValidWithParent(childTag,parentTag)?null:parentInfo; -var invalidAncestor= -invalidParent?null:findInvalidAncestorForTag(childTag,ancestorInfo); -var problematic=invalidParent||invalidAncestor; - -if(problematic){ -var ancestorTag=problematic.tag; -var ancestorInstance=problematic.instance; - -var childOwner=childInstance&&childInstance._currentElement._owner; -var ancestorOwner= -ancestorInstance&&ancestorInstance._currentElement._owner; - -var childOwners=findOwnerStack(childOwner); -var ancestorOwners=findOwnerStack(ancestorOwner); - -var minStackLen=Math.min(childOwners.length,ancestorOwners.length); -var i; - -var deepestCommon=-1; -for(i=0;i '); - -var warnKey= -!!invalidParent+'|'+childTag+'|'+ancestorTag+'|'+ownerInfo; -if(didWarn[warnKey]){ -return;} - -didWarn[warnKey]=true; - -if(invalidParent){ -var info=''; -if(ancestorTag==='table'&&childTag==='tr'){ -info+= -' Add a to your code to match the DOM tree generated by '+ -'the browser.';} - -warning( -false, -'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. '+ -'See %s.%s', -childTag, -ancestorTag, -ownerInfo, -info);}else - -{ -warning( -false, -'validateDOMNesting(...): <%s> cannot appear as a descendant of '+ -'<%s>. See %s.', -childTag, -ancestorTag, -ownerInfo);}}}; - - - - - -validateDOMNesting.ancestorInfoContextKey= -'__validateDOMNesting_ancestorInfo$'+Math.random().toString(36).slice(2); - -validateDOMNesting.updatedAncestorInfo=updatedAncestorInfo; - - -validateDOMNesting.isTagValidInContext=function(tag,ancestorInfo){ -ancestorInfo=ancestorInfo||emptyAncestorInfo; -var parentInfo=ancestorInfo.parentTag; -var parentTag=parentInfo&&parentInfo.tag; -return ( -isTagValidWithParent(tag,parentTag)&& -!findInvalidAncestorForTag(tag,ancestorInfo));};} - - - - -module.exports=validateDOMNesting; -}); -__d('AppStateIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Map=require('Map'); -var NativeModules=require('NativeModules'); -var RCTDeviceEventEmitter=require('RCTDeviceEventEmitter'); -var RCTAppState=NativeModules.AppState; - -var logError=require('logError'); -var invariant=require('invariant'); - -var _eventHandlers={ -change:new Map(), -memoryWarning:new Map()}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var AppStateIOS={ - - - - - -addEventListener:function( -type, -handler) -{ -invariant( -['change','memoryWarning'].indexOf(type)!==-1, -'Trying to subscribe to unknown event: "%s"',type); - -if(type==='change'){ -_eventHandlers[type].set(handler,RCTDeviceEventEmitter.addListener( -'appStateDidChange', -function(appStateData){ -handler(appStateData.app_state);}));}else - - -if(type==='memoryWarning'){ -_eventHandlers[type].set(handler,RCTDeviceEventEmitter.addListener( -'memoryWarning', -handler));}}, - - - - - - - -removeEventListener:function( -type, -handler) -{ -invariant( -['change','memoryWarning'].indexOf(type)!==-1, -'Trying to remove listener for unknown event: "%s"',type); - -if(!_eventHandlers[type].has(handler)){ -return;} - -_eventHandlers[type].get(handler).remove(); -_eventHandlers[type].delete(handler);}, - - - - - - -currentState:'active'}; - - - -RCTDeviceEventEmitter.addListener( -'appStateDidChange', -function(appStateData){ -AppStateIOS.currentState=appStateData.app_state;}); - - - -RCTAppState.getCurrentAppState( -function(appStateData){ -AppStateIOS.currentState=appStateData.app_state;}, - -logError); - - -module.exports=AppStateIOS; -}); -__d('AsyncStorage',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var NativeModules=require('NativeModules'); -var RCTAsyncSQLiteStorage=NativeModules.AsyncSQLiteDBStorage; -var RCTAsyncRocksDBStorage=NativeModules.AsyncRocksDBStorage; -var RCTAsyncFileStorage=NativeModules.AsyncLocalStorage; - - -var RCTAsyncStorage=RCTAsyncRocksDBStorage||RCTAsyncSQLiteStorage||RCTAsyncFileStorage; - - - - - - - - - - - - - -var AsyncStorage={ -_getRequests:[], -_getKeys:[], -_immediate:null, - - - - - -getItem:function( -key, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiGet([key],function(errors,result){ - -var value=result&&result[0]&&result[0][1]?result[0][1]:null; -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0],value); -if(errs){ -reject(errs[0]);}else -{ -resolve(value);}});});}, - - - - - - - - - -setItem:function( -key, -value, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiSet([[key,value]],function(errors){ -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0]); -if(errs){ -reject(errs[0]);}else -{ -resolve(null);}});});}, - - - - - - - - -removeItem:function( -key, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiRemove([key],function(errors){ -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0]); -if(errs){ -reject(errs[0]);}else -{ -resolve(null);}});});}, - - - - - - - - - -mergeItem:function( -key, -value, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiMerge([[key,value]],function(errors){ -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0]); -if(errs){ -reject(errs[0]);}else -{ -resolve(null);}});});}, - - - - - - - - - - -clear:function(callback){ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.clear(function(error){ -callback&&callback(convertError(error)); -if(error&&convertError(error)){ -reject(convertError(error));}else -{ -resolve(null);}});});}, - - - - - - - - -getAllKeys:function(callback){ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.getAllKeys(function(error,keys){ -callback&&callback(convertError(error),keys); -if(error){ -reject(convertError(error));}else -{ -resolve(keys);}});});}, - - - - - - - - - - - - - - - - -flushGetRequests:function(){ -var getRequests=this._getRequests; -var getKeys=this._getKeys; - -this._getRequests=[]; -this._getKeys=[]; - -RCTAsyncStorage.multiGet(getKeys,function(errors,result){ - - - -var reqLength=getRequests.length;var _loop=function( -i){ -var request=getRequests[i]; -var requestKeys=request.keys; -requestResult=result.filter(function(resultPair){ -return requestKeys.indexOf(resultPair[0])!==-1;}); - - -request.callback&&request.callback(null,requestResult); -request.resolve&&request.resolve(requestResult);};for(var i=0;i1){ -for(var ii=1;ii - Hello Eric! -{(this.state && this.state.value) - ? - : undefined} - -{(this.state && this.state.longText) - ? - : undefined} - - - - - - this.toggleChangeEventHandler()} -style={{marginBottom: 10}} -value={this.state.switchState} /> - - + Hello Eric! + {(this.state && this.state.value) + ? + : undefined} + {(this.state && this.state.longText) + ? + : undefined} + + + + + + this.toggleChangeEventHandler()} + style={{marginBottom: 10}} + value={this.state.switchState} /> + + ); -} + } }); AppRegistry.registerComponent('ReactRoot', () => ReactRoot); \ No newline at end of file diff --git a/ReactWindows/ReactNative.Tests/ReactNative.Tests.csproj b/ReactWindows/ReactNative.Tests/ReactNative.Tests.csproj index 4a21a47225e..67e91374e22 100644 --- a/ReactWindows/ReactNative.Tests/ReactNative.Tests.csproj +++ b/ReactWindows/ReactNative.Tests/ReactNative.Tests.csproj @@ -128,7 +128,6 @@ - diff --git a/ReactWindows/ReactNative.Tests/UIManager/LayoutAnimation/LayoutAnimationManagerTests.cs b/ReactWindows/ReactNative.Tests/UIManager/LayoutAnimation/LayoutAnimationManagerTests.cs deleted file mode 100644 index 1cbb2d3b9e1..00000000000 --- a/ReactWindows/ReactNative.Tests/UIManager/LayoutAnimation/LayoutAnimationManagerTests.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; -using Newtonsoft.Json.Linq; -using ReactNative.UIManager.LayoutAnimation; - -namespace ReactNative.Tests.UIManager.LayoutAnimation -{ - [TestClass] - public class LayoutAnimationManagerTests - { - [TestMethod] - public void LayoutAnimationManager_InvokeTests() - { - var layoutAnimator = new LayoutAnimationManager(); - var config = JObject.FromObject(new - { - duration = 1000, - create = JObject.FromObject(new { property = "scaleXY" }) - }); - - layoutAnimator.InitializeFromConfig(config); - - Assert.AreEqual(layoutAnimator.Storyboard(AnimationState.Create).PropertyType, AnimatedPropertyType.ScaleXY); - } - } -} diff --git a/ReactWindows/ReactNative/Animation/AnimationManager.cs b/ReactWindows/ReactNative/Animation/AnimationManager.cs deleted file mode 100644 index c018455e62f..00000000000 --- a/ReactWindows/ReactNative/Animation/AnimationManager.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml; - -namespace ReactNative.Animation -{ - public abstract class AnimationManager - { - private readonly IAnimationPropertyUpdater _PropertyUpdater; - - public AnimationManager(int animationID, IAnimationPropertyUpdater propertyUpdater) - { - AnimationId = animationID; - _PropertyUpdater = propertyUpdater; - } - - public IAnimationListener AnimationListener{ get; set; } - - public int AnimationId { get; set; } - - public abstract void Run(); - - public void Start(FrameworkElement view) - { - View = view; - _PropertyUpdater.Prepare(view); - Run(); - } - - /// - /// Cancels the animation. - /// - public void Cancel() - { - if (Finished || Cancelled) - { - // If we were already finished, ignore - return; - } - - Cancelled = true; - if (AnimationListener != null) - { - AnimationListener.OnCancel(); - } - } - - /// - /// Animation engine should call this method for every animation frame passing animation progress - /// value as a parameter. Animation progress should be within the range 0..1 (the exception here - /// would be a spring animation engine which may slightly exceed start and end progress values). - /// - /// This method will return false if the animation has been cancelled. In that case animation - /// engine should not attempt to call this method again. Otherwise this method will return true. - /// - /// - /// - - - protected FrameworkElement View { get; private set; } - - protected bool OnUpdate(float value) - { - if (!Cancelled && View != null) - { - _PropertyUpdater.OnUpdate(View, value); - } - - return !Cancelled; - } - - /// - /// Animation engine should call this method when the animation is finished. Should be called only once. - /// - protected void Finish() - { - if (Finished) - { - throw new InvalidOperationException("Calling finish while the animation engine is already in finished state."); - } - - Finished = true; - if (!Cancelled) - { - if (View != null) - { - _PropertyUpdater.onFinish(View); - } - if (AnimationListener != null) - { - AnimationListener.OnFinished(); - } - } - } - - private bool Cancelled { get; set; } - - private bool Finished { get; set; } - } -} diff --git a/ReactWindows/ReactNative/Animation/AnimationRegistry.cs b/ReactWindows/ReactNative/Animation/AnimationRegistry.cs deleted file mode 100644 index bbd7e076551..00000000000 --- a/ReactWindows/ReactNative/Animation/AnimationRegistry.cs +++ /dev/null @@ -1,60 +0,0 @@ -using ReactNative.Bridge; -using System.Collections.Generic; - -namespace ReactNative.Animation -{ - /// - /// Coordinates catalyst animations driven by . - /// - public class AnimationRegistry - { - private readonly IDictionary _animationRegistry; - - public AnimationRegistry() { } - - public AnimationRegistry(AnimationManager animation) - { - DispatcherHelpers.AssertOnDispatcher(); - - _animationRegistry = new Dictionary() { - { animation.AnimationId, animation} - }; - } - - public AnimationManager GetAnimation(int animationID) - { - DispatcherHelpers.AssertOnDispatcher(); - var animation = default(AnimationManager); - - if (_animationRegistry.TryGetValue(animationID, out animation)) - { - return animation; - } - else - { - return null; - } - } - - public void RegisterAnimation(AnimationManager animation) - { - DispatcherHelpers.AssertOnDispatcher(); - - _animationRegistry[animation.AnimationId] = animation; - } - - public AnimationManager RemoveAnimation(int animationID) - { - DispatcherHelpers.AssertOnDispatcher(); - - var animation = default(AnimationManager); - - if (_animationRegistry.TryGetValue(animationID, out animation)) - { - _animationRegistry.Remove(animationID); - } - - return animation; - } - } -} \ No newline at end of file diff --git a/ReactWindows/ReactNative/Animation/Events/AnimationCancelledEventArgs.cs b/ReactWindows/ReactNative/Animation/Events/AnimationCancelledEventArgs.cs new file mode 100644 index 00000000000..ddbeec16b50 --- /dev/null +++ b/ReactWindows/ReactNative/Animation/Events/AnimationCancelledEventArgs.cs @@ -0,0 +1,11 @@ +using System; + +namespace ReactNative.Animation.Events +{ + /// + /// Event arguments for animation cancelled. + /// + public class AnimationCancelledEventArgs : EventArgs + { + } +} diff --git a/ReactWindows/ReactNative/Animation/Events/AnimationFinishedEventHandler.cs b/ReactWindows/ReactNative/Animation/Events/AnimationFinishedEventHandler.cs new file mode 100644 index 00000000000..b3c47735cf7 --- /dev/null +++ b/ReactWindows/ReactNative/Animation/Events/AnimationFinishedEventHandler.cs @@ -0,0 +1,11 @@ +using System; + +namespace ReactNative.Animation.Events +{ + /// + /// Event arguments for animation finished. + /// + public class AnimationFinishedEventArgs : EventArgs + { + } +} diff --git a/ReactWindows/ReactNative/Animation/IAnimationListener.cs b/ReactWindows/ReactNative/Animation/IAnimationListener.cs index 135155a9eac..5df48714062 100644 --- a/ReactWindows/ReactNative/Animation/IAnimationListener.cs +++ b/ReactWindows/ReactNative/Animation/IAnimationListener.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ReactNative.Animation +namespace ReactNative.Animation { /// /// Interface for getting animation lifecycle updates. It is guaranteed that for a given animation, diff --git a/ReactWindows/ReactNative/Animation/IAnimationPropertyUpdater.cs b/ReactWindows/ReactNative/Animation/IAnimationPropertyUpdater.cs index 2b095b5aaf5..53f6c92cbac 100644 --- a/ReactWindows/ReactNative/Animation/IAnimationPropertyUpdater.cs +++ b/ReactWindows/ReactNative/Animation/IAnimationPropertyUpdater.cs @@ -1,38 +1,36 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml; +using Windows.UI.Xaml; namespace ReactNative.Animation { /// - /// Interface used to update particular property types during animation. While animation is in progress instance will - /// call several times with a value representing animation progress. Normally value will be from 0..1 range, - /// but for spring animation it can slightly exceed that limit due to bounce effect at the start/end of animation. + /// Interface used to update particular property types during animation. + /// While animation is in progress, the + /// instance will call + /// several times with a value representing animation progress. /// public interface IAnimationPropertyUpdater { /// - /// This method will be called before animation starts. + /// Called before the animation starts to prepare the view. /// - /// View that will be animated. + /// The view to update. void Prepare(FrameworkElement view); /// - /// This method will be called for each animation frame. + /// Called for each animation frame. /// - /// View to update property. - /// Animation progress from 0..1 range retrieved from engine. - void OnUpdate(FrameworkElement view, float progress); + /// The view to update. + /// The progress. + void OnUpdate(FrameworkElement view, double value); /// - /// This method will be called at the end of animation. It should be used to set the final values - /// or animated properties in order to avoid floating point inacurracy calculated in - /// by passing value close to 1.0 or in a case some frames got dropped. + /// Called at the end of the animation frame. /// - /// View to update property. - void onFinish(FrameworkElement view); + /// + /// This method should be used to set the final values for animated + /// properties in order to avoid floating point inaccuracies. + /// + /// The view to update. + void OnFinish(FrameworkElement view); } } diff --git a/ReactWindows/ReactNative/Animation/ReactAnimation.cs b/ReactWindows/ReactNative/Animation/ReactAnimation.cs new file mode 100644 index 00000000000..6d06a013472 --- /dev/null +++ b/ReactWindows/ReactNative/Animation/ReactAnimation.cs @@ -0,0 +1,155 @@ +using ReactNative.Animation.Events; +using System; +using Windows.UI.Xaml; + +namespace ReactNative.Animation +{ + /// + /// Base class for various animation engines. Subclasses should implement + /// , which should bootstrap the animation. Then in each + /// animation frame, we expect the animation engine to call + /// with a float progress which then will be + /// transferred to the underlying + /// instance. + /// + /// The animation engine should support animation cancellation by + /// monitoring the returned value of . In + /// case the result is false, the animation should be + /// cancelled and the engine should not attempt to call + /// again. + /// + public abstract class ReactAnimation + { + private readonly int _animationId; + private readonly IAnimationPropertyUpdater _propertyUpdater; + + private bool _cancelled; + private bool _isFinished; + private FrameworkElement _animatedView; + + ///

+ /// Instantiates the . + /// + /// The animation identifier. + /// The property updater. + protected ReactAnimation(int animationId, IAnimationPropertyUpdater propertyUpdater) + { + _animationId = animationId; + _propertyUpdater = propertyUpdater; + } + + /// + /// An event triggered when the animation is cancelled. + /// + public event EventHandler AnimationCancelled; + + /// + /// An event triggered when the animation completes. + /// + public event EventHandler AnimationFinished; + + /// + /// The animation identifier. + /// + public int AnimationId { get; } + + /// + /// Start the animation on the given framework element. + /// + /// The view to animate. + public void Start(FrameworkElement view) + { + _animatedView = view; + _propertyUpdater.Prepare(view); + Run(); + } + + /// + /// Cancels the animation. + /// + /// + /// Cancellation after the animation is finished is handled gracefully. + /// + public void Cancel() + { + if (_isFinished || _cancelled) + { + return; + } + + _cancelled = true; + + var animationCancelled = AnimationCancelled; + if (animationCancelled != null) + { + animationCancelled(this, new AnimationCancelledEventArgs()); + } + } + + /// + /// The method to bootstrap the animation. + /// + protected abstract void Run(); + + /// + /// The animation engine should call this method for each animation + /// frame, passing animation progress as a parameter. Animation + /// progress should be within the range from 0 to 1. + /// + /// The progress value. + /// + /// false if the animation has been cancelled, in which + /// case the engine should not call this method again; otherwise, + /// true. + /// + protected bool OnUpdate(double value) + { + AssertNotFinished(); + + if (!_cancelled) + { + var animatedView = _animatedView; + if (animatedView == null) + { + throw new InvalidOperationException("Animated view must not be null."); + } + + _propertyUpdater.OnUpdate(animatedView, value); + } + + return !_cancelled; + } + + /// + /// Animation engine should call this method when the animation is + /// finished. Should be called only once. + /// + protected void Finish() + { + AssertNotFinished(); + _isFinished = true; + if (!_cancelled) + { + var animatedView = _animatedView; + if (animatedView != null) + { + _propertyUpdater.OnFinish(animatedView); + } + + var animationFinished = AnimationFinished; + if (animationFinished != null) + { + animationFinished(this, new AnimationFinishedEventArgs()); + } + } + } + + private void AssertNotFinished() + { + if (_isFinished) + { + throw new InvalidOperationException("Animation is already finished."); + } + } + } +} diff --git a/ReactWindows/ReactNative/Animation/ReactAnimationRegistry.cs b/ReactWindows/ReactNative/Animation/ReactAnimationRegistry.cs new file mode 100644 index 00000000000..293af91c116 --- /dev/null +++ b/ReactWindows/ReactNative/Animation/ReactAnimationRegistry.cs @@ -0,0 +1,58 @@ +using ReactNative.Bridge; +using System.Collections.Generic; + +namespace ReactNative.Animation +{ + /// + /// Coordinates animations driven by the . + /// + public class ReactAnimationRegistry + { + private readonly IDictionary _registry = + new Dictionary(); + + /// + /// Registers an animation. + /// + /// The animation. + public void RegisterAnimation(ReactAnimation animation) + { + DispatcherHelpers.AssertOnDispatcher(); + _registry.Add(animation.AnimationId, animation); + } + + /// + /// Gets the animation with the given identifier. + /// + /// The animation identifier. + /// The animation with the given identifier. + public ReactAnimation GetAnimation(int animationId) + { + DispatcherHelpers.AssertOnDispatcher(); + var result = default(ReactAnimation); + if (_registry.TryGetValue(animationId, out result)) + { + return result; + } + + return null; + } + + /// + /// Removes the animation with the given identifier. + /// + /// The animation identifier. + /// The animation with the given identifier. + public ReactAnimation RemoveAnimation(int animationId) + { + DispatcherHelpers.AssertOnDispatcher(); + var animation = GetAnimation(animationId); + if (animation != null) + { + _registry.Remove(animationId); + } + + return animation; + } + } +} \ No newline at end of file diff --git a/ReactWindows/ReactNative/ReactNative.csproj b/ReactWindows/ReactNative/ReactNative.csproj index 1d153272a8f..162c313c18d 100644 --- a/ReactWindows/ReactNative/ReactNative.csproj +++ b/ReactWindows/ReactNative/ReactNative.csproj @@ -108,7 +108,9 @@ - + + + @@ -227,7 +229,7 @@ - + @@ -245,8 +247,8 @@ - - + + @@ -254,7 +256,7 @@ - + @@ -340,6 +342,7 @@ MSBuild:Compile + 14.0 diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimatedPropertyType.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimatedPropertyType.cs index 72898bae45f..7f80ed39219 100644 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimatedPropertyType.cs +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimatedPropertyType.cs @@ -1,13 +1,24 @@ - -namespace ReactNative.UIManager.LayoutAnimation +namespace ReactNative.UIManager.LayoutAnimation { /// - /// The enum types to indicate the type of animation that needs to be invoked for the LayoutAnimation API. + /// The enum types to indicate the type of animation that needs to be + /// invoked for the LayoutAnimation API. /// public enum AnimatedPropertyType { + /// + /// None. + /// None, + + /// + /// The opacity property. + /// Opacity, + + /// + /// The X,Y scale property. + /// ScaleXY, } } diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimationState.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimationState.cs deleted file mode 100644 index bc6f645ef49..00000000000 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/AnimationState.cs +++ /dev/null @@ -1,9 +0,0 @@ - -namespace ReactNative.UIManager.LayoutAnimation -{ - public enum AnimationState - { - Create, - Update - } -} diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationType.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationType.cs new file mode 100644 index 00000000000..347b18333a7 --- /dev/null +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationType.cs @@ -0,0 +1,38 @@ +namespace ReactNative.UIManager.LayoutAnimation +{ + /// + /// An enum signaling the interpolation type. + /// + public enum InterpolationType + { + /// + /// None. + /// + None, + + /// + /// Linear interpolation type. + /// + Linear, + + /// + /// Ease-in interpolation type. + /// + EaseIn, + + /// + /// Ease-out interpolation type. + /// + EaseOut, + + /// + /// Ease-in, ease-out interpolation type. + /// + EaseInEaseOut, + + /// + /// Spring interpolation type. + /// + Spring + } +} diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationTypeExtensions.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationTypeExtensions.cs new file mode 100644 index 00000000000..3517784750b --- /dev/null +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationTypeExtensions.cs @@ -0,0 +1,49 @@ +using System; +using Windows.UI.Xaml.Media.Animation; + +namespace ReactNative.UIManager.LayoutAnimation +{ + static class InterpolationTypeExtensions + { + private static readonly EasingFunctionBase s_easeIn = new BackEase + { + EasingMode = EasingMode.EaseIn, + Amplitude = 0.5 + }; + + private static readonly EasingFunctionBase s_easeOut = new BackEase + { + EasingMode = EasingMode.EaseOut, + Amplitude = 0.5 + }; + + private static readonly EasingFunctionBase s_easeInOut = new BackEase + { + EasingMode = EasingMode.EaseInOut, + Amplitude = 0.5 + }; + + private static readonly EasingFunctionBase s_spring = new ElasticEase { Oscillations = 3 }; + + public static EasingFunctionBase EasingFunction(this InterpolationType interpolationType) + { + var storyboard = new Storyboard(); + + switch (interpolationType) + { + case InterpolationType.EaseIn: + return s_easeIn; + case InterpolationType.EaseOut: + return s_easeOut; + case InterpolationType.EaseInEaseOut: + return s_easeInOut; + case InterpolationType.Spring: + return s_spring; + case InterpolationType.Linear: + case InterpolationType.None: + default: + throw new NotImplementedException(); + } + } + } +} diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationTypesExtensions.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationTypesExtensions.cs deleted file mode 100644 index 84a2dcc7cfc..00000000000 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/InterpolationTypesExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using ReactNative.Views.Image; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Media.Animation; - -namespace ReactNative.UIManager.LayoutAnimation -{ - static class InterpolationTypesExtensions - { - private static IReadOnlyDictionary EasingFunctions - { - get - { - return new Dictionary() { - { InterpolationType.EaseIn, new BackEase() { EasingMode = EasingMode.EaseIn, Amplitude = .5 } }, - { InterpolationType.EaseOut, new BackEase() { EasingMode = EasingMode.EaseOut, Amplitude = .5} }, - { InterpolationType.EaseInEaseOut, new BackEase() { EasingMode = EasingMode.EaseInOut, Amplitude = .5} }, - { InterpolationType.Linear, null }, - { InterpolationType.Spring, new ElasticEase() { Oscillations = 3 } } - }; - } - } - - /// - /// Determines the of the . - /// - public static EasingFunctionBase EasingFunction(this InterpolationType typeInstance) - { - var transitionFunction = default(EasingFunctionBase); - - if (EasingFunctions.TryGetValue(typeInstance, out transitionFunction)) - { - return transitionFunction; - } - else - { - return null; - } - } - } -} diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationManager.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationManager.cs index 61603c34772..f40f645534f 100644 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationManager.cs +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationManager.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json.Linq; using ReactNative.Bridge; -using System.Collections.Generic; +using System; using Windows.UI.Xaml; namespace ReactNative.UIManager.LayoutAnimation @@ -10,15 +10,13 @@ namespace ReactNative.UIManager.LayoutAnimation /// public class LayoutAnimationManager { - private const string CONFIG_PROP_DURATION = "duration"; - public const string CONFIG_PROP_ACTION_CREATE = "create"; - private const string CONFIG_PROP_ACTION_UPDATE = "update"; + private readonly StoryboardAnimation _layoutCreateAnimation = new LayoutCreateAnimation(); + private readonly StoryboardAnimation _layoutUpdateAnimation = new LayoutUpdateAnimation(); - private Dictionary _animationLayoutDictionary; private bool _shouldAnimateLayout; /// - /// Setup the initial settings of the initial and follow-on (s). + /// Setup the initial settings of the initial and follow-on (s). /// /// The JSON config of the animation. public void InitializeFromConfig(JObject config) @@ -28,12 +26,6 @@ public void InitializeFromConfig(JObject config) var actionTypeUpdateToken = default(JToken); var globalDuration = default(int); - _animationLayoutDictionary = new Dictionary() - { - { AnimationState.Create, new LayoutCreateAnimation() }, - { AnimationState.Update, new LayoutUpdateAnimation() }, - }; - if (config == null) { Reset(); @@ -41,57 +33,41 @@ public void InitializeFromConfig(JObject config) } _shouldAnimateLayout = false; - globalDuration = config.TryGetValue(CONFIG_PROP_DURATION, out durationToken) ? durationToken.ToObject() : 0; + globalDuration = config.TryGetValue("duration", out durationToken) ? durationToken.Value() : 0; - if (config.TryGetValue(CONFIG_PROP_ACTION_CREATE, out actionTypeCreateToken)) + if (config.TryGetValue("create", out actionTypeCreateToken)) { - this.Storyboard(AnimationState.Create).InitializeFromConfig(actionTypeCreateToken.ToObject(), globalDuration); + GetAnimator(LayoutAnimationType.Create) + .InitializeFromConfig( + actionTypeCreateToken.Value(), + globalDuration); _shouldAnimateLayout = true; } - if (config.TryGetValue(CONFIG_PROP_ACTION_UPDATE, out actionTypeUpdateToken)) + if (config.TryGetValue("update", out actionTypeUpdateToken)) { - this.Storyboard(AnimationState.Update).InitializeFromConfig(actionTypeUpdateToken.ToObject(), globalDuration); + GetAnimator(LayoutAnimationType.Update) + .InitializeFromConfig( + actionTypeUpdateToken.ToObject(), globalDuration); _shouldAnimateLayout = true; } } /// - /// Returns the to animate based on the . Currently there is one for animating the initial state - /// of a and another for updating the layout change(i.e. update). - /// - /// The desired . - /// Thre reference. - public StoryboardAnimation Storyboard(AnimationState type) - { - var animation = default(StoryboardAnimation); - - if (_animationLayoutDictionary != null && _animationLayoutDictionary.TryGetValue(type, out animation)) - { - return animation; - } - else - { - return null; - } - } - - /// - /// Determines if should apply the animation . + /// Determines if should apply layout animation. /// /// The view to animate. - /// - public bool ShouldAnimateLayout(FrameworkElement view) { return _shouldAnimateLayout && view.Parent != null; } - - public void Reset() + /// + /// true if the layout operation should be animated, + /// otherwise false. + /// + public bool ShouldAnimateLayout(FrameworkElement view) { - this.Storyboard(AnimationState.Create)?.Reset(); - this.Storyboard(AnimationState.Update)?.Reset(); - _shouldAnimateLayout = false; + return _shouldAnimateLayout && view.Parent != null; } /// - /// Create the animation and kick off the binded (s). + /// Create the animation and kick off the binded (s). /// /// The native view to animate. /// The new X position to animate to. @@ -102,12 +78,41 @@ public void ApplyLayoutUpdate(FrameworkElement view, int x, int y, int width, in { DispatcherHelpers.AssertOnDispatcher(); - var animationState = view.ActualWidth == 0 || view.ActualHeight == 0 ? AnimationState.Create : AnimationState.Update; - var storyboard = this.Storyboard(animationState).CreateAnimation(view, x, y, width, height); + var animationState = view.ActualWidth == 0 || view.ActualHeight == 0 + ? LayoutAnimationType.Create + : LayoutAnimationType.Update; + + GetAnimator(animationState) + .CreateAnimation(view, x, y, width, height)? + .Begin(); + } - if (storyboard != null) + /// + /// Reset the animation manager. + /// + public void Reset() + { + _layoutCreateAnimation.Reset(); + _layoutUpdateAnimation.Reset(); + _shouldAnimateLayout = false; + } + + /// + /// Returns the to animate based on the . Currently there is one for animating the initial state + /// of a and another for updating the layout change(i.e. update). + /// + /// The desired . + /// Thre reference. + private StoryboardAnimation GetAnimator(LayoutAnimationType animationState) + { + switch (animationState) { - storyboard.Begin(); + case LayoutAnimationType.Create: + return _layoutCreateAnimation; + case LayoutAnimationType.Update: + return _layoutUpdateAnimation; + default: + throw new NotImplementedException(); } } } diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationType.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationType.cs new file mode 100644 index 00000000000..9aa2695d468 --- /dev/null +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutAnimationType.cs @@ -0,0 +1,18 @@ +namespace ReactNative.UIManager.LayoutAnimation +{ + /// + /// An enum for layout animation type. + /// + public enum LayoutAnimationType + { + /// + /// Create animation type. + /// + Create, + + /// + /// Update animation type. + /// + Update + } +} diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutCreateAnimation.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutCreateAnimation.cs index f47fa37013b..e6932ab5a88 100644 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutCreateAnimation.cs +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutCreateAnimation.cs @@ -5,10 +5,23 @@ namespace ReactNative.UIManager.LayoutAnimation { /// - /// Base Layout animation manager responsible for establishing the basic animation . + /// Base Layout animation manager responsible for establishing the basic + /// animation . /// class LayoutCreateAnimation : StoryboardAnimation { + /// + /// Indicates if the animation frame is valid for rendering. + /// + protected override bool IsValid + { + get + { + return DurationMS > 0; + } + } + + /// /// The animation creation implementation for the next animation layout configuration cycle. /// @@ -17,21 +30,21 @@ class LayoutCreateAnimation : StoryboardAnimation /// The new Y coordinate. /// The new width for . /// The new height for the . - /// + /// The animation storyboard. public override Storyboard CreateAnimationImpl(FrameworkElement view, int x, int y, int width, int height) { var animation = default(Storyboard); - if (base.PropertyType != AnimatedPropertyType.None) + if (PropertyType != AnimatedPropertyType.None) { animation = new Storyboard(); float fromValue = 0, toValue = 1; - if (base.PropertyType == AnimatedPropertyType.Opacity) + if (PropertyType == AnimatedPropertyType.Opacity) { animation.SetOpacityTimeline(base.Type.EasingFunction(), view, fromValue, toValue, base.DurationMS); } - else if (base.PropertyType == AnimatedPropertyType.ScaleXY) + else if (PropertyType == AnimatedPropertyType.ScaleXY) { view.RenderTransform = new TranslateTransform(); animation.SetRepositionTimelines(base.Type.EasingFunction(), view, x, y, width, height, base.DurationMS); @@ -45,14 +58,5 @@ public override Storyboard CreateAnimationImpl(FrameworkElement view, int x, int return animation; } - - /// - /// Indicates if the animation frame is valid for rendering. - /// - /// - public override bool IsValid() - { - return base.DurationMS > 0; - } } } diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutUpdateAnimation.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutUpdateAnimation.cs index 467b4f5b87a..bf220a52194 100644 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutUpdateAnimation.cs +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/LayoutUpdateAnimation.cs @@ -5,18 +5,17 @@ namespace ReactNative.UIManager.LayoutAnimation { /// - /// Defines which should be used for animating layout updates for . + /// Defines which should be used for animating + /// layout updates for . /// - public class LayoutUpdateAnimation : StoryboardAnimation + class LayoutUpdateAnimation : StoryboardAnimation { - private double GetXDistance(TranslateTransform transform) + protected override bool IsValid { - return transform != null ? transform.X : 0; - } - - private double GetYDistance(TranslateTransform transform) - { - return transform != null ? transform.Y : 0; + get + { + return DurationMS > 0; + } } public override Storyboard CreateAnimationImpl(FrameworkElement view, int x, int y, int width, int height) @@ -36,9 +35,14 @@ public override Storyboard CreateAnimationImpl(FrameworkElement view, int x, int return animation; } - public override bool IsValid() + private double GetXDistance(TranslateTransform transform) + { + return transform != null ? transform.X : 0; + } + + private double GetYDistance(TranslateTransform transform) { - return base.DurationMS > 0; + return transform != null ? transform.Y : 0; } } } diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryBoardExtensions.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryBoardExtensions.cs index fe2b2d110a7..717f377c0ac 100644 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryBoardExtensions.cs +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryBoardExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using Windows.Foundation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -26,10 +27,21 @@ static class StoryboardExtensions /// The starting point factor. /// The end point factor of the transition. /// The total play duration in milliseconds for the . - public static void SetOpacityTimeline(this Storyboard storyboard, EasingFunctionBase easingFunc, FrameworkElement view, - float startingfactor, float endFactor, int duration) + public static void SetOpacityTimeline( + this Storyboard storyboard, + EasingFunctionBase easingFunc, + FrameworkElement view, + float startingfactor, + float endFactor, + int duration) { - var timeline = new DoubleAnimation() { EasingFunction = easingFunc, From = startingfactor, To = endFactor, Duration = TimeSpan.FromMilliseconds(duration) }; + var timeline = new DoubleAnimation + { + EasingFunction = easingFunc, + From = startingfactor, + To = endFactor, + Duration = TimeSpan.FromMilliseconds(duration) + }; Storyboard.SetTarget(timeline, view); Storyboard.SetTargetProperty(timeline, "Opacity"); @@ -47,15 +59,41 @@ public static void SetOpacityTimeline(this Storyboard storyboard, EasingFunction /// The end point factor of the transition. /// The rate at which time progresses for this . /// The total play duration in milliseconds for the . - public static void SetScalingTimeline(this Storyboard storyboard, EasingFunctionBase easingFunc, FrameworkElement view, - float startingfactor, float endFactor, double speedRateRatio, int duration) + public static void SetScalingTimeline( + this Storyboard storyboard, + EasingFunctionBase easingFunc, + FrameworkElement view, + float startingfactor, + float endFactor, + double speedRateRatio, + int duration) { - var transformation = new ScaleTransform() { ScaleX = 1, ScaleY = 1 }; + var transformation = new ScaleTransform + { + ScaleX = 1, + ScaleY = 1, + }; + view.RenderTransform = transformation; view.RenderTransformOrigin = new Point(ScalingTransitionStartXPoint, ScalingTransitionStartYPoint); - var timelineY = new DoubleAnimation() { From = startingfactor, To = endFactor, EasingFunction = easingFunc, Duration = TimeSpan.FromMilliseconds(duration), SpeedRatio = speedRateRatio }; - var timelineX = new DoubleAnimation() { From = startingfactor, To = endFactor, EasingFunction = easingFunc, Duration = TimeSpan.FromMilliseconds(duration), SpeedRatio = speedRateRatio }; + var timelineY = new DoubleAnimation + { + From = startingfactor, + To = endFactor, + EasingFunction = easingFunc, + Duration = TimeSpan.FromMilliseconds(duration), + SpeedRatio = speedRateRatio + }; + + var timelineX = new DoubleAnimation + { + From = startingfactor, + To = endFactor, + EasingFunction = easingFunc, + Duration = TimeSpan.FromMilliseconds(duration), + SpeedRatio = speedRateRatio + }; Storyboard.SetTarget(timelineX, view); Storyboard.SetTarget(timelineY, view); @@ -78,8 +116,15 @@ public static void SetScalingTimeline(this Storyboard storyboard, EasingFunction /// The new targeted width for the . /// The new targeted height for the . /// The total play duration in milliseconds for the timeline. - public static void SetRepositionTimelines(this Storyboard storyboard, EasingFunctionBase easingFunc, FrameworkElement view, - float newX, float newY, float newWidth, float newHeight, int duration) + public static void SetRepositionTimelines( + this Storyboard storyboard, + EasingFunctionBase easingFunc, + FrameworkElement view, + float newX, + float newY, + float newWidth, + float newHeight, + int duration) { var transform = view.RenderTransform as TranslateTransform; var currentX = Canvas.GetLeft(view); @@ -87,26 +132,30 @@ public static void SetRepositionTimelines(this Storyboard storyboard, EasingFunc if (HasChanged(currentX, newX)) { - storyboard.Children.Add(CreateTranslateTransformTimeline(view, currentX, newX, easingFunc, - string.Format(RespositionTargetPropertyTypeNameFormat, "X"), duration)); + var propertyName = string.Format(CultureInfo.InvariantCulture, RespositionTargetPropertyTypeNameFormat, "X"); + storyboard.Children.Add( + CreateTranslateTransformTimeline(view, currentX, newX, easingFunc, propertyName, duration)); } if (HasChanged(currentY, newY)) { - storyboard.Children.Add(CreateTranslateTransformTimeline(view, currentY, newY, easingFunc, - string.Format(RespositionTargetPropertyTypeNameFormat, "Y"), duration)); + var propertyName = string.Format(CultureInfo.InvariantCulture, RespositionTargetPropertyTypeNameFormat, "Y"); + storyboard.Children.Add( + CreateTranslateTransformTimeline(view, currentY, newY, easingFunc, propertyName, duration)); } if (HasChanged(view.Width, newWidth)) { - var timelineWidth = CreateTranslateTransformTimeline(view, (int)Math.Round(view.ActualWidth), newWidth, easingFunc, "Width", duration); - timelineWidth.EnableDependentAnimation = true; + var timelineWidth = CreateTranslateTransformTimeline( + view, view.ActualWidth, newWidth, easingFunc, "Width", duration); + timelineWidth.EnableDependentAnimation = true; storyboard.Children.Add(timelineWidth); } if (HasChanged(view.Height, newHeight)) { - var timelineHeight = CreateTranslateTransformTimeline(view, (int)Math.Round(view.ActualHeight), newHeight, easingFunc, "Height", duration); + var timelineHeight = CreateTranslateTransformTimeline( + view, view.ActualHeight, newHeight, easingFunc, "Height", duration); timelineHeight.EnableDependentAnimation = true; storyboard.Children.Add(timelineHeight); } @@ -117,10 +166,22 @@ private static bool HasChanged(double currentValue, double newValue) return currentValue != newValue; } - private static DoubleAnimation CreateTranslateTransformTimeline(FrameworkElement view, double from, double to, EasingFunctionBase easingFunc, - string targetPropertyName, int durationMS) + private static DoubleAnimation CreateTranslateTransformTimeline( + FrameworkElement view, + double from, + double to, + EasingFunctionBase easingFunc, + string targetPropertyName, + int durationMS) { - var timeline = new DoubleAnimation() { From = from, To = to, Duration = TimeSpan.FromMilliseconds(durationMS), EasingFunction = easingFunc }; + var timeline = new DoubleAnimation + { + From = from, + To = to, + Duration = TimeSpan.FromMilliseconds(durationMS), + EasingFunction = easingFunc + }; + Storyboard.SetTarget(timeline, view); Storyboard.SetTargetProperty(timeline, targetPropertyName); diff --git a/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryboardAnimation.cs b/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryboardAnimation.cs index fa2e642ab1a..8a9bc47dc2d 100644 --- a/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryboardAnimation.cs +++ b/ReactWindows/ReactNative/UIManager/LayoutAnimation/StoryboardAnimation.cs @@ -1,8 +1,6 @@ using Newtonsoft.Json.Linq; using ReactNative.Reflection; -using ReactNative.Views.Image; using System; -using System.Collections.Generic; using Windows.UI.Xaml; using Windows.UI.Xaml.Media.Animation; @@ -11,7 +9,7 @@ namespace ReactNative.UIManager.LayoutAnimation /// /// Base class responsible for parsing the animation JSON config and creating a animation. /// - public abstract class StoryboardAnimation + abstract class StoryboardAnimation { private const string CONFIG_PROPERTY = "property"; private const string CONFIG_DURATION = "duration"; @@ -19,12 +17,10 @@ public abstract class StoryboardAnimation private const string CONFIG_TYPE = "type"; private const string CONFIG_SPRING_INTENSITY = "springDamping"; - public abstract bool IsValid(); - - public abstract Storyboard CreateAnimationImpl(FrameworkElement view, int x, int y, int width, int height); - public AnimatedPropertyType PropertyType { private set; get; } + protected abstract bool IsValid { get; } + /// /// Sets/Gets the of the . /// @@ -45,6 +41,8 @@ public abstract class StoryboardAnimation /// protected InterpolationType Type { private set; get; } + public abstract Storyboard CreateAnimationImpl(FrameworkElement view, int x, int y, int width, int height); + /// /// Initliazes all the member properties based on the style config of the animation. /// @@ -59,7 +57,7 @@ public void InitializeFromConfig(JObject config, int globalDuration) if (config.TryGetValue(CONFIG_PROPERTY, out token)) { - PropertyType = EnumHelpers.Parse(token.ToObject()); + PropertyType = EnumHelpers.Parse(token.Value()); } else { @@ -70,7 +68,7 @@ public void InitializeFromConfig(JObject config, int globalDuration) { //The Springiness property of the Elastic easing function works with only absolute int values //iOS and Android use floating point numbers. - SpringIntensity = (int)springDamping.ToObject() * 10; + SpringIntensity = (int)springDamping.Value() * 10; } else { @@ -79,19 +77,14 @@ public void InitializeFromConfig(JObject config, int globalDuration) ((ElasticEase)InterpolationType.Spring.EasingFunction()).Springiness = SpringIntensity; - if (config.TryGetValue(CONFIG_TYPE, out type)) - { - Type = EnumHelpers.Parse(type.ToObject()); - } - else - { - Type = InterpolationType.None; - } + Type = config.TryGetValue(CONFIG_TYPE, out type) + ? EnumHelpers.Parse(type.Value()) + : InterpolationType.None; - DurationMS = config.TryGetValue(CONFIG_DURATION, out duration) ? duration.ToObject() : globalDuration; - DelayMS = config.TryGetValue(CONFIG_DELAY, out delay) ? delay.ToObject() : 0; + DurationMS = config.TryGetValue(CONFIG_DURATION, out duration) ? duration.Value() : globalDuration; + DelayMS = config.TryGetValue(CONFIG_DELAY, out delay) ? delay.Value() : 0; - if (!IsValid()) + if (!IsValid) { throw new InvalidOperationException(string.Format("Invalid layout animation exception. Likely due to duration of {0} not being set", DurationMS)); } @@ -108,7 +101,7 @@ public void InitializeFromConfig(JObject config, int globalDuration) /// public Storyboard CreateAnimation(FrameworkElement view, int x, int y, int width, int height) { - if (!IsValid()) + if (!IsValid) { return null; } diff --git a/ReactWindows/ReactNative/UIManager/NativeViewHierarchyManager.cs b/ReactWindows/ReactNative/UIManager/NativeViewHierarchyManager.cs index 2c41e0f6f1f..dca9a2289f2 100644 --- a/ReactWindows/ReactNative/UIManager/NativeViewHierarchyManager.cs +++ b/ReactWindows/ReactNative/UIManager/NativeViewHierarchyManager.cs @@ -54,7 +54,6 @@ public class NativeViewHierarchyManager private readonly ViewManagerRegistry _viewManagers; private readonly JavaScriptResponderHandler _jsResponderHandler; private readonly RootViewManager _rootViewManager; - private readonly AnimationRegistry _animationRegistry; private readonly LayoutAnimationManager _layoutAnimator; /// diff --git a/ReactWindows/ReactNative/UIManager/UIImplementation.cs b/ReactWindows/ReactNative/UIManager/UIImplementation.cs index 01e1c10b9d3..6517a1ca46d 100644 --- a/ReactWindows/ReactNative/UIManager/UIImplementation.cs +++ b/ReactWindows/ReactNative/UIManager/UIImplementation.cs @@ -161,8 +161,8 @@ public void CreateView(int tag, string className, int rootViewTag, JObject prope /// Invoked by React to create a new node with a given tag, class name and properties. /// /// the animation configuration properties. - /// Success callback JS function. - /// Callback function called on exceptions. + /// Success callback. + /// Error callback. public void ConfigureNextLayoutAnimation(JObject config, ICallback success, ICallback error) { _operationsQueue.EnqueueConfigureLayoutAnimation(config, success, error); diff --git a/ReactWindows/ReactNative/UIManager/UIViewOperationQueue.cs b/ReactWindows/ReactNative/UIManager/UIViewOperationQueue.cs index e15a374c4d0..203b3524b6e 100644 --- a/ReactWindows/ReactNative/UIManager/UIViewOperationQueue.cs +++ b/ReactWindows/ReactNative/UIManager/UIViewOperationQueue.cs @@ -182,6 +182,12 @@ public void ClearAnimationLayout() _nativeViewHierarchyManager.ClearLayoutAnimation(); } + /// + /// Enqueue a configure layout animation operation. + /// + /// The configuration. + /// The success callback. + /// The error callback. public void EnqueueConfigureLayoutAnimation(JObject config, ICallback success, ICallback error) { EnqueueOperation(() => _nativeViewHierarchyManager.ConfigureLayoutAnimation(config, success, error)); @@ -348,14 +354,9 @@ internal void ExecuteOperations(int batchId) { operation(); } - - OnOperationGroupExecuted(); } } - } - internal void OnOperationGroupExecuted() - { _nativeViewHierarchyManager.ClearLayoutAnimation(); } diff --git a/ReactWindows/ReactNative/Views/Image/ImageExtensions.cs b/ReactWindows/ReactNative/Views/Image/ImageExtensions.cs index b86acb1196f..ce66e6d247f 100644 --- a/ReactWindows/ReactNative/Views/Image/ImageExtensions.cs +++ b/ReactWindows/ReactNative/Views/Image/ImageExtensions.cs @@ -38,27 +38,26 @@ public static void CreateBackgroundBitmapImage(this Border border, Uri image) public static async void CreateColorBlendedImageSource(this Border border, Uri imagePath, Color blendColor) { using (var device = CanvasDevice.GetSharedDevice()) - { - var image = await CanvasBitmap.LoadAsync(device, imagePath); + using (var image = await CanvasBitmap.LoadAsync(device, imagePath)) + { var imageSource = new CanvasImageSource(device, image.SizeInPixels.Width, image.SizeInPixels.Height, image.Dpi); - using (var effect = new BlendEffect() + var effect = new BlendEffect() { Background = image, - Foreground = new ColorSourceEffect() { Color = blendColor }, - Mode = BlendEffectMode.Multiply - }) + Foreground = new ColorSourceEffect { Color = blendColor }, + Mode = BlendEffectMode.Multiply, + }; + + using (effect) + using (var ds = imageSource.CreateDrawingSession(Colors.Transparent)) { - using (var ds = imageSource.CreateDrawingSession(Colors.Transparent)) + ds.DrawImage(effect); + border.Background = new ImageBrush { - ds.DrawImage(effect); - border.Background = new ImageBrush() - { - ImageSource = imageSource - }; - } + ImageSource = imageSource + }; } - image.Dispose(); } } } diff --git a/ReactWindows/ReactNative/Views/Image/InterpolationType.cs b/ReactWindows/ReactNative/Views/Image/InterpolationType.cs deleted file mode 100644 index fbb571d23f3..00000000000 --- a/ReactWindows/ReactNative/Views/Image/InterpolationType.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ReactNative.Views.Image -{ - public enum InterpolationType - { - None, - Linear, - EaseIn, - EaseOut, - EaseInEaseOut, - Spring - } -} diff --git a/ReactWindows/ReactNative/Views/Image/ReactImageManager.cs b/ReactWindows/ReactNative/Views/Image/ReactImageManager.cs index 49be2221f18..e0fbfbe3b2b 100644 --- a/ReactWindows/ReactNative/Views/Image/ReactImageManager.cs +++ b/ReactWindows/ReactNative/Views/Image/ReactImageManager.cs @@ -1,23 +1,17 @@ using ReactNative.UIManager; using ReactNative.UIManager.Events; -using ReactNative.UIManager.LayoutAnimation; using System; using System.Collections.Generic; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Media.Animation; using Windows.UI.Xaml.Media.Imaging; -using Microsoft.Graphics.Canvas; -using Microsoft.Graphics.Canvas.Effects; -using Microsoft.Graphics.Canvas.UI.Xaml; -using Windows.UI; namespace ReactNative.Views.Image { /// /// The view manager responsible for rendering native . - /// TODO: Implememt tintColor property and fadeDuration animation support. + /// TODO: fadeDuration animation support? /// public class ReactImageManager : SimpleViewManager { @@ -25,8 +19,6 @@ public class ReactImageManager : SimpleViewManager private const string PROP_SOURCE = "source"; private const string PROP_URI = "uri"; - //Defaulting to 3000 MS for testing purpose until Image.windows.js is modified. - private int _fadeDurationMS = 3000; private Uri _imageSource; private uint? _tintColor; @@ -108,9 +100,8 @@ public void SetBorderColor(Border view, uint? color) /// The border panel. /// The color hex code. [ReactProperty("tintColor", CustomType = "Color")] - public void SetTintColor(Border view, uint? color) { - var backgroundType = view.Background?.GetType(); - + public void SetTintColor(Border view, uint? color) + { if (color.HasValue) { _tintColor = color.Value; @@ -133,22 +124,6 @@ protected override void OnAfterUpdateTransaction(Border view) view.CreateBackgroundBitmapImage(_imageSource); } } - - /// - /// Set the fade in animation effect duration of the . - /// - /// The view panel. - /// The property index. - /// The color hex code. - //Fadeduration is only supported on android, and commenting out until we can modify the Image Def in Libraries/Image/Image.windows.js - //[ReactProperty("fadeDuration")] - public void SetFadeDurationMS(Border view, int? fadeDurationMS) - { - if (fadeDurationMS.HasValue) - { - _fadeDurationMS = fadeDurationMS.Value; - } - } /// /// Sets the border thickness of the . @@ -211,15 +186,16 @@ protected void OnInterceptImageLoadingEvent(FrameworkElement sender, object e) { var border = (Border)sender; var imageBrush = GetImageBrush(border); - if (imageBrush != null && imageBrush.ImageSource.GetType() == typeof(BitmapImage)) + var bitmapImage = imageBrush?.ImageSource as BitmapImage; + if (imageBrush != null && bitmapImage != null) { - var bitmapImage = imageBrush.ImageSource as BitmapImage; bitmapImage.DecodePixelHeight = (int)sender.Height; bitmapImage.DecodePixelWidth = (int)sender.Width; imageBrush.Stretch = Stretch.Fill; } - GetEventDispatcher(border).DispatchEvent(new ReactImageLoadEvent(border.GetTag(), ReactImageLoadEvent.OnLoadStart)); + GetEventDispatcher(border).DispatchEvent( + new ReactImageLoadEvent(border.GetTag(), ReactImageLoadEvent.OnLoadStart)); } /// @@ -230,15 +206,8 @@ protected void OnInterceptImageLoadingEvent(FrameworkElement sender, object e) protected void OnInterceptImageLoadedEvent(object sender, RoutedEventArgs e) { var senderImage = (Border)sender; - if (_fadeDurationMS > 0) - { - var fadeStoryBoard = new Storyboard() { }; - var easingFunction = new BackEase() { EasingMode = EasingMode.EaseIn, Amplitude = .5 }; - fadeStoryBoard.SetOpacityTimeline(easingFunction, senderImage, 0, 1, _fadeDurationMS); - fadeStoryBoard.Begin(); - } - - GetEventDispatcher(senderImage).DispatchEvent(new ReactImageLoadEvent(senderImage.GetTag(), ReactImageLoadEvent.OnLoadEnd)); + GetEventDispatcher(senderImage).DispatchEvent( + new ReactImageLoadEvent(senderImage.GetTag(), ReactImageLoadEvent.OnLoadEnd)); } private ImageBrush GetImageBrush(Border border) diff --git a/windows-packager/main.dev.jsbundle b/windows-packager/main.dev.jsbundle deleted file mode 100644 index 7e702396230..00000000000 --- a/windows-packager/main.dev.jsbundle +++ /dev/null @@ -1,57378 +0,0 @@ -__DEV__= -true; - - -__BUNDLE_START_TIME__=Date.now(); -( -function(global){ -var modules=Object.create(null); -var inGuard=false; - -function define(id,factory){ -modules[id]={ -factory:factory, -module:{exports:{}}, -isInitialized:false, -hasError:false};} - - - -function require(id){ -var mod=modules[id]; -if(mod&&mod.isInitialized){ -return mod.module.exports;} - - -return requireImpl(id);} - - -function requireImpl(id){ -if(global.ErrorUtils&&!inGuard){ -inGuard=true; -var returnValue; -try{ -returnValue=requireImpl.apply(this,arguments);} -catch(e) { -global.ErrorUtils.reportFatalError(e);} - -inGuard=false; -return returnValue;} - - -var mod=modules[id]; -if(!mod){ -var msg='Requiring unknown module "'+id+'"'; -if(__DEV__){ -msg+='. If you are sure the module is there, try restarting the packager.';} - -throw new Error(msg);} - - -if(mod.hasError){ -throw new Error( -'Requiring module "'+id+'" which threw an exception');} - - - -try{ - - -mod.isInitialized=true; - -__DEV__&&BridgeProfiling().profile('JS_require_'+id); - - - -mod.factory.call(global,global,require,mod.module,mod.module.exports); - -__DEV__&&BridgeProfiling().profileEnd();} -catch(e) { -mod.hasError=true; -mod.isInitialized=false; -throw e;} - - -return mod.module.exports;} - - -var BridgeProfiling=__DEV__&&function(){ -var _BridgeProfiling; -try{ -_BridgeProfiling=require('BridgeProfiling');} -catch(e) {} - -return _BridgeProfiling&&_BridgeProfiling.profile? -_BridgeProfiling:{profile:function(){},profileEnd:function(){}};}; - - -global.__d=define; -global.require=require;})( -this); -Object. - - - - - - - - - - - - - - - - - -assign=function(target,sources){ -if(__DEV__){ -if(target==null){ -throw new TypeError('Object.assign target cannot be null or undefined');} - -if(typeof target!=='object'&&typeof target!=='function'){ -throw new TypeError( -'In this environment the target of assign MUST be an object.'+ -'This error is a performance optimization and not spec compliant.');}} - - - - -for(var nextIndex=1;nextIndex=0||keys.indexOf('description')>=0)){ -return formatError(value);} - - - -if(keys.length===0){ -if(isFunction(value)){ -var name=value.name?': '+value.name:''; -return ctx.stylize('[Function'+name+']','special');} - -if(isRegExp(value)){ -return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');} - -if(isDate(value)){ -return ctx.stylize(Date.prototype.toString.call(value),'date');} - -if(isError(value)){ -return formatError(value);}} - - - -var base='',array=false,braces=['{','}']; - - -if(isArray(value)){ -array=true; -braces=['[',']'];} - - - -if(isFunction(value)){ -var n=value.name?': '+value.name:''; -base=' [Function'+n+']';} - - - -if(isRegExp(value)){ -base=' '+RegExp.prototype.toString.call(value);} - - - -if(isDate(value)){ -base=' '+Date.prototype.toUTCString.call(value);} - - - -if(isError(value)){ -base=' '+formatError(value);} - - -if(keys.length===0&&(!array||value.length==0)){ -return braces[0]+base+braces[1];} - - -if(recurseTimes<0){ -if(isRegExp(value)){ -return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}else -{ -return ctx.stylize('[Object]','special');}} - - - -ctx.seen.push(value); - -var output; -if(array){ -output=formatArray(ctx,value,recurseTimes,visibleKeys,keys);}else -{ -output=keys.map(function(key){ -return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array);});} - - - -ctx.seen.pop(); - -return reduceToSingleString(output,base,braces);} - - - -function formatPrimitive(ctx,value){ -if(isUndefined(value)) -return ctx.stylize('undefined','undefined'); -if(isString(value)){ -var simple='\''+JSON.stringify(value).replace(/^"|"$/g,''). -replace(/'/g,"\\'"). -replace(/\\"/g,'"')+'\''; -return ctx.stylize(simple,'string');} - -if(isNumber(value)) -return ctx.stylize(''+value,'number'); -if(isBoolean(value)) -return ctx.stylize(''+value,'boolean'); - -if(isNull(value)) -return ctx.stylize('null','null');} - - - -function formatError(value){ -return '['+Error.prototype.toString.call(value)+']';} - - - -function formatArray(ctx,value,recurseTimes,visibleKeys,keys){ -var output=[]; -for(var i=0,l=value.length;i-1){ -if(array){ -str=str.split('\n').map(function(line){ -return ' '+line;}). -join('\n').substr(2);}else -{ -str='\n'+str.split('\n').map(function(line){ -return ' '+line;}). -join('\n');}}}else - - -{ -str=ctx.stylize('[Circular]','special');}} - - -if(isUndefined(name)){ -if(array&&key.match(/^\d+$/)){ -return str;} - -name=JSON.stringify(''+key); -if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){ -name=name.substr(1,name.length-2); -name=ctx.stylize(name,'name');}else -{ -name=name.replace(/'/g,"\\'"). -replace(/\\"/g,'"'). -replace(/(^"|"$)/g,"'"); -name=ctx.stylize(name,'string');}} - - - -return name+': '+str;} - - - -function reduceToSingleString(output,base,braces){ -var numLinesEst=0; -var length=output.reduce(function(prev,cur){ -numLinesEst++; -if(cur.indexOf('\n')>=0)numLinesEst++; -return prev+cur.replace(/\u001b\[\d\d?m/g,'').length+1;}, -0); - -if(length>60){ -return braces[0]+( -base===''?'':base+'\n ')+ -' '+ -output.join(',\n ')+ -' '+ -braces[1];} - - -return braces[0]+base+' '+output.join(', ')+' '+braces[1];} - - - - - -function isArray(ar){ -return Array.isArray(ar);} - - -function isBoolean(arg){ -return typeof arg==='boolean';} - - -function isNull(arg){ -return arg===null;} - - -function isNullOrUndefined(arg){ -return arg==null;} - - -function isNumber(arg){ -return typeof arg==='number';} - - -function isString(arg){ -return typeof arg==='string';} - - -function isSymbol(arg){ -return typeof arg==='symbol';} - - -function isUndefined(arg){ -return arg===void 0;} - - -function isRegExp(re){ -return isObject(re)&&objectToString(re)==='[object RegExp]';} - - -function isObject(arg){ -return typeof arg==='object'&&arg!==null;} - - -function isDate(d){ -return isObject(d)&&objectToString(d)==='[object Date]';} - - -function isError(e){ -return isObject(e)&&( -objectToString(e)==='[object Error]'||e instanceof Error);} - - -function isFunction(arg){ -return typeof arg==='function';} - - -function isPrimitive(arg){ -return arg===null|| -typeof arg==='boolean'|| -typeof arg==='number'|| -typeof arg==='string'|| -typeof arg==='symbol'|| -typeof arg==='undefined';} - - -function objectToString(o){ -return Object.prototype.toString.call(o);} - - -function hasOwnProperty(obj,prop){ -return Object.prototype.hasOwnProperty.call(obj,prop);} - - -return inspect;})(); - - - -var OBJECT_COLUMN_NAME='(index)'; -var LOG_LEVELS={ -trace:0, -info:1, -warn:2, -error:3}; - - -function setupConsole(global){ -var originalConsole=global.console; - -if(!global.nativeLoggingHook){ -return;} - - -function getNativeLogFunction(level){ -return function(){ -var str; -if(arguments.length===1&&typeof arguments[0]==='string'){ -str=arguments[0];}else -{ -str=Array.prototype.map.call(arguments,function(arg){ -return inspect(arg,{depth:10});}). -join(', ');} - - -var logLevel=level; -if(str.slice(0,9)==='Warning: '&&logLevel>=LOG_LEVELS.error){ - - - -logLevel=LOG_LEVELS.warn;} - -global.nativeLoggingHook(str,logLevel);};} - - - -var repeat=function(element,n){ -return Array.apply(null,Array(n)).map(function(){return element;});}; - - -function consoleTablePolyfill(rows){ - -if(!Array.isArray(rows)){ -var data=rows; -rows=[]; -for(var key in data){ -if(data.hasOwnProperty(key)){ -var row=data[key]; -row[OBJECT_COLUMN_NAME]=key; -rows.push(row);}}} - - - -if(rows.length===0){ -global.nativeLoggingHook('',LOG_LEVELS.info); -return;} - - -var columns=Object.keys(rows[0]).sort(); -var stringRows=[]; -var columnWidths=[]; - - - -columns.forEach(function(k,i){ -columnWidths[i]=k.length; -for(var j=0;j'; -function guarded(){ -return ( -ErrorUtils.applyWithGuard( -fun, -context||this, -arguments, -null, -name));} - - - - -return guarded;}}; - - -global.ErrorUtils=ErrorUtils; - - - - - -function setupErrorGuard(){ -var onError=function(e){ -global.console.error( -'Error: '+ -'\n stack: '+e.stack+ -'\n line: '+e.line+ -'\n message: '+e.message, -e);}; - - -global.ErrorUtils.setGlobalHandler(onError);} - - -setupErrorGuard();})( -this); -if( - - - - - - - - - - - -!String.prototype.startsWith){ -String.prototype.startsWith=function(search){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -var pos=arguments.length>1? -Number(arguments[1])||0:0; -var start=Math.min(Math.max(pos,0),string.length); -return string.indexOf(String(search),pos)===start;};} - - - -if(!String.prototype.endsWith){ -String.prototype.endsWith=function(search){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -var stringLength=string.length; -var searchString=String(search); -var pos=arguments.length>1? -Number(arguments[1])||0:stringLength; -var end=Math.min(Math.max(pos,0),stringLength); -var start=end-searchString.length; -if(start<0){ -return false;} - -return string.lastIndexOf(searchString,start)===start;};} - - - -if(!String.prototype.contains){ -String.prototype.contains=function(search){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -var pos=arguments.length>1? -Number(arguments[1])||0:0; -return string.indexOf(String(search),pos)!==-1;};} - - - -if(!String.prototype.repeat){ -String.prototype.repeat=function(count){ -'use strict'; -if(this==null){ -throw TypeError();} - -var string=String(this); -count=Number(count)||0; -if(count<0||count===Infinity){ -throw RangeError();} - -if(count===1){ -return string;} - -var result=''; -while(count){ -if(count&1){ -result+=string;} - -if(count>>=1){ -string+=string;}} - - -return result;};} -( - - - - - - - - - -function(undefined){ - -function findIndex(predicate,context){ -if(this==null){ -throw new TypeError( -'Array.prototype.findIndex called on null or undefined');} - - -if(typeof predicate!=='function'){ -throw new TypeError('predicate must be a function');} - -var list=Object(this); -var length=list.length>>>0; -for(var i=0;i=0)continue; -if(!Object.prototype.hasOwnProperty.call(obj,i))continue; -target[i]=obj[i];} - - -return target;}; - - -babelHelpers.possibleConstructorReturn=function(self,call){ -if(!self){ -throw new ReferenceError("this hasn't been initialised - super() hasn't been called");} - - -return call&&(typeof call==="object"||typeof call==="function")?call:self;}; - - -babelHelpers.slicedToArray=(function(){ -function sliceIterator(arr,i){ -var _arr=[]; -var _n=true; -var _d=false; -var _e=undefined; - -try{ -for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){ -_arr.push(_s.value); - -if(i&&_arr.length===i)break;}} - -catch(err) { -_d=true; -_e=err;}finally -{ -try{ -if(!_n&&_i["return"])_i["return"]();}finally -{ -if(_d)throw _e;}} - - - -return _arr;} - - -return function(arr,i){ -if(Array.isArray(arr)){ -return arr;}else -if(Symbol.iterator in Object(arr)){ -return sliceIterator(arr,i);}else -{ -throw new TypeError("Invalid attempt to destructure non-iterable instance");}};})(); - - - - -babelHelpers.taggedTemplateLiteral=function(strings,raw){ -return Object.freeze(Object.defineProperties(strings,{ -raw:{ -value:Object.freeze(raw)}}));}; - - - - -babelHelpers.toConsumableArray=function(arr){ -if(Array.isArray(arr)){ -for(var i=0,arr2=Array(arr.length);i1<<5&&( -this._debugInfo[this._callbackID>>5]=null); - -this._debugInfo[this._callbackID>>1]=[module,method]; -onFail&¶ms.push(this._callbackID); -this._callbacks[this._callbackID++]=onFail; -onSucc&¶ms.push(this._callbackID); -this._callbacks[this._callbackID++]=onSucc;} - -this._queue[MODULE_IDS].push(module); -this._queue[METHOD_IDS].push(method); -this._queue[PARAMS].push(params); - -var now=new Date().getTime(); -if(global.nativeFlushQueueImmediate&& -now-this._lastFlush>=MIN_TIME_BETWEEN_FLUSHES_MS){ -global.nativeFlushQueueImmediate(this._queue); -this._queue=[[],[],[]]; -this._lastFlush=now;} - -if(__DEV__&&SPY_MODE&&isFinite(module)){ -console.log('JS->N : '+this._remoteModuleTable[module]+'.'+ -this._remoteMethodTable[module][method]+'('+JSON.stringify(params)+')');}}},{key:'__callFunction',value:function __callFunction( - - - -module,method,args){ -this._lastFlush=new Date().getTime(); -if(isFinite(module)){ -method=this._methodTable[module][method]; -module=this._moduleTable[module];} - -BridgeProfiling.profile(function(){return module+'.'+method+'('+stringifySafe(args)+')';}); -if(__DEV__&&SPY_MODE){ -console.log('N->JS : '+module+'.'+method+'('+JSON.stringify(args)+')');} - -var moduleMethods=this._callableModules[module]; -if(!moduleMethods){ - - - -console.warn('Module is not registered:',module); -moduleMethods=require(module);} - - - - - - - - -moduleMethods[method].apply(moduleMethods,args); -BridgeProfiling.profileEnd();}},{key:'__invokeCallback',value:function __invokeCallback( - - -cbID,args){ -BridgeProfiling.profile( -function(){return 'MessageQueue.invokeCallback('+cbID+', '+stringifySafe(args)+')';}); -this._lastFlush=new Date().getTime(); -var callback=this._callbacks[cbID]; -if(!callback||__DEV__){ -var debug=this._debugInfo[cbID>>1]; -var _module=debug&&this._remoteModuleTable[debug[0]]; -var method=debug&&this._remoteMethodTable[debug[0]][debug[1]]; -invariant( -callback,'Callback with id '+ -cbID+': '+_module+'.'+method+'() not found'); - -if(callback&&SPY_MODE){ -console.log('N->JS : ('+JSON.stringify(args)+')');}} - - -this._callbacks[cbID&~1]=null; -this._callbacks[cbID|1]=null; -callback.apply(null,args); -BridgeProfiling.profileEnd();}},{key:'_genModulesConfig',value:function _genModulesConfig( - - - - - - - - - - - -modules){ -if(Array.isArray(modules)){ -return modules;}else -{ -var moduleArray=[]; -var moduleNames=Object.keys(modules); -for(var i=0,l=moduleNames.length;i0?args[args.length-1]:null; -var secondLastArg=args.length>1?args[args.length-2]:null; -var hasSuccCB=typeof lastArg==='function'; -var hasErrorCB=typeof secondLastArg==='function'; -hasErrorCB&&invariant( -hasSuccCB, -'Cannot have a non-function arg after a function arg.'); - -var numCBs=hasSuccCB+hasErrorCB; -var onSucc=hasSuccCB?lastArg:null; -var onFail=hasErrorCB?secondLastArg:null; -args=args.slice(0,args.length-numCBs); -return self.__nativeCall(module,method,args,onFail,onSucc);};} - - -fn.type=type; -return fn;}},{key:'registerCallableModule',value:function registerCallableModule( - - -name,methods){ -this._callableModules[name]=methods;}}]);return MessageQueue;})(); - - - - -function moduleHasConstants(moduleArray){ -return !Array.isArray(moduleArray[1]);} - - -function arrayContains(array,value){ -return array.indexOf(value)!==-1;} - - -function createErrorFromErrorData(errorData){var - -message= - -errorData.message;var extraErrorInfo=babelHelpers.objectWithoutProperties(errorData,['message']); -var error=new Error(message); -error.framesToPop=1; -return babelHelpers.extends(error,extraErrorInfo);} - - -module.exports=MessageQueue; -}); -__d('BridgeProfiling',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - -var GLOBAL=GLOBAL||this; -var TRACE_TAG_REACT_APPS=1<<17; -var TRACE_TAG_JSC_CALLS=1<<27; - -var _enabled=false; -var _asyncCookie=0; -var _ReactPerf=null; -function ReactPerf(){ -if(!_ReactPerf){ -_ReactPerf=require('ReactPerf');} - -return _ReactPerf;} - - -var BridgeProfiling={ -setEnabled:function(enabled){ -if(_enabled!==enabled){ -if(enabled){ -global.nativeTraceBeginLegacy&&global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS);}else -{ -global.nativeTraceEndLegacy&&global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS);}} - - -_enabled=enabled; - -ReactPerf().enableMeasure=enabled;}, - - - - - -profile:function(profileName){ -if(_enabled){ -profileName=typeof profileName==='function'? -profileName():profileName; -global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS,profileName);}}, - - - -profileEnd:function(){ -if(_enabled){ -global.nativeTraceEndSection(TRACE_TAG_REACT_APPS);}}, - - - - - - - - -profileAsync:function(profileName){ -var cookie=_asyncCookie; -if(_enabled){ -_asyncCookie++; -profileName=typeof profileName==='function'? -profileName():profileName; -global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS,profileName,cookie,0);} - -return cookie;}, - - -profileAsyncEnd:function(profileName,cookie){ -if(_enabled){ -profileName=typeof profileName==='function'? -profileName():profileName; -global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS,profileName,cookie,0);}}, - - - -reactPerfMeasure:function(objName,fnName,func){ -return function(component){ -if(!_enabled){ -return func.apply(this,arguments);} - - -var name=objName==='ReactCompositeComponent'&&this.getName()||''; -BridgeProfiling.profile(objName+'.'+fnName+'('+name+')'); -var ret=func.apply(this,arguments); -BridgeProfiling.profileEnd(); -return ret;};}, - - - -swizzleReactPerf:function(){ -ReactPerf().injection.injectMeasure(BridgeProfiling.reactPerfMeasure);}, - - - - - - -attachToRelayProfiler:function(relayProfiler){ -relayProfiler.attachProfileHandler('*',function(name){ -var cookie=BridgeProfiling.profileAsync(name); -return function(){ -BridgeProfiling.profileAsyncEnd(name,cookie);};});}, - - - - - - -swizzleJSON:function(){ -BridgeProfiling.measureMethods(JSON,'JSON',[ -'parse', -'stringify']);}, - - - - - - - - - - - -measureMethods:function(object,objectName,methodNames){ -if(!__DEV__){ -return;} - - -methodNames.forEach(function(methodName){ -object[methodName]=BridgeProfiling.measure( -objectName, -methodName, -object[methodName]);});}, - - - - - - - - - - - - - -measure:function(objName,fnName,func){ -if(!__DEV__){ -return func;} - - -var profileName=objName+'.'+fnName; -return function(){ -if(!_enabled){ -return func.apply(this,arguments);} - - -BridgeProfiling.profile(profileName); -var ret=func.apply(this,arguments); -BridgeProfiling.profileEnd(); -return ret;};}}; - - - - -BridgeProfiling.setEnabled(global.__RCTProfileIsProfiling||false); - -module.exports=BridgeProfiling; -}); -__d('ReactPerf',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - -var ReactPerf={ - - - - -enableMeasure:false, - - - - - -storedMeasure:_noMeasure, - - - - - - -measureMethods:function(object,objectName,methodNames){ -if(__DEV__){ -for(var key in methodNames){ -if(!methodNames.hasOwnProperty(key)){ -continue;} - -object[key]=ReactPerf.measure( -objectName, -methodNames[key], -object[key]);}}}, - - - - - - - - - - - - - -measure:function(objName,fnName,func){ -if(__DEV__){ -var measuredFunc=null; -var wrapper=function(){ -if(ReactPerf.enableMeasure){ -if(!measuredFunc){ -measuredFunc=ReactPerf.storedMeasure(objName,fnName,func);} - -return measuredFunc.apply(this,arguments);} - -return func.apply(this,arguments);}; - -wrapper.displayName=objName+'_'+fnName; -return wrapper;} - -return func;}, - - -injection:{ - - - -injectMeasure:function(measure){ -ReactPerf.storedMeasure=measure;}}}; - - - - - - - - - - - - -function _noMeasure(objName,fnName,func){ -return func;} - - -module.exports=ReactPerf; -}); -__d('ErrorUtils',function(global, require, module, exports) { var - - - - - - - - - - - -GLOBAL=this; - - - - - - - - - - - - - -module.exports=GLOBAL.ErrorUtils; -}); -__d('JSTimersExecution',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -var invariant=require('invariant'); -var keyMirror=require('keyMirror'); -var performanceNow=require('performanceNow'); -var warning=require('warning'); -var BridgeProfiling=require('BridgeProfiling'); - - - - - - -var JSTimersExecution={ -GUID:1, -Type:keyMirror({ -setTimeout:null, -setInterval:null, -requestAnimationFrame:null, -setImmediate:null}), - - - -callbacks:[], -types:[], -timerIDs:[], -immediates:[], - - - - - - -callTimer:function(timerID){ -warning(timerID<=JSTimersExecution.GUID,'Tried to call timer with ID '+timerID+' but no such timer exists'); -var timerIndex=JSTimersExecution.timerIDs.indexOf(timerID); - - - - - -if(timerIndex===-1){ -return;} - -var type=JSTimersExecution.types[timerIndex]; -var callback=JSTimersExecution.callbacks[timerIndex]; - - -if(type===JSTimersExecution.Type.setTimeout|| -type===JSTimersExecution.Type.setImmediate|| -type===JSTimersExecution.Type.requestAnimationFrame){ -JSTimersExecution._clearIndex(timerIndex);} - - -try{ -if(type===JSTimersExecution.Type.setTimeout|| -type===JSTimersExecution.Type.setInterval|| -type===JSTimersExecution.Type.setImmediate){ -callback();}else -if(type===JSTimersExecution.Type.requestAnimationFrame){ -var currentTime=performanceNow(); -callback(currentTime);}else -{ -console.error('Tried to call a callback with invalid type: '+type); -return;}} - -catch(e) { - -JSTimersExecution.errors=JSTimersExecution.errors||[]; -JSTimersExecution.errors.push(e);}}, - - - - - - - -callTimers:function(timerIDs){ -invariant(timerIDs.length!==0,'Probably shouldn\'t call "callTimers" with no timerIDs'); - -JSTimersExecution.errors=null; -timerIDs.forEach(JSTimersExecution.callTimer); - -var errors=JSTimersExecution.errors; -if(errors){ -var errorCount=errors.length; -if(errorCount>1){ - - -for(var ii=1;ii0){ -var passImmediates=JSTimersExecution.immediates.slice(); -JSTimersExecution.immediates=[]; - - - -for(var i=0;i0;}, - - - - - - -callImmediates:function(){ -JSTimersExecution.errors=null; -while(JSTimersExecution.callImmediatesPass()){} -if(JSTimersExecution.errors){ -JSTimersExecution.errors.forEach(function(error){return ( -require('JSTimers').setTimeout(function(){throw error;},0));});}}, - - - - -_clearIndex:function(i){ -JSTimersExecution.timerIDs[i]=null; -JSTimersExecution.callbacks[i]=null; -JSTimersExecution.types[i]=null;}}; - - - -module.exports=JSTimersExecution; -}); -__d('keyMirror',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var invariant=require('invariant'); - - - - - - - - - - - - - - - - - - - -var keyMirror=function(obj){ -var ret={}; -var key; -invariant( -obj instanceof Object&&!Array.isArray(obj), -'keyMirror(...): Argument must be an object.'); - -for(key in obj){ -if(!obj.hasOwnProperty(key)){ -continue;} - -ret[key]=key;} - -return ret;}; - - -module.exports=keyMirror; -}); -__d('performanceNow',function(global, require, module, exports) { var - - - - - - - - - - - -performance=require('performance'); -var curPerformance=performance; - - - - - - -if(!curPerformance||!curPerformance.now){ -curPerformance=Date;} - - -var performanceNow=curPerformance.now.bind(curPerformance); - -module.exports=performanceNow; -}); -__d('performance',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ExecutionEnvironment=require('ExecutionEnvironment'); - -var performance; - -if(ExecutionEnvironment.canUseDOM){ -performance= -window.performance|| -window.msPerformance|| -window.webkitPerformance;} - - -module.exports=performance||{}; -}); -__d('ExecutionEnvironment',function(global, require, module, exports) { "use strict"; - - - - - - - - - - - - - - - - - - - - - - - -var canUseDOM=false; - - - - - - - -var ExecutionEnvironment={ - -canUseDOM:canUseDOM, - -canUseWorkers:typeof Worker!=='undefined', - -canUseEventListeners: -canUseDOM&&!!(window.addEventListener||window.attachEvent), - -canUseViewport:canUseDOM&&!!window.screen, - -isInWorker:!canUseDOM}; - - - -module.exports=ExecutionEnvironment; -}); -__d('warning',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var emptyFunction=require('emptyFunction'); - - - - - - - - -var warning=emptyFunction; - -if(__DEV__){ -warning=function(condition,format){for(var _len=arguments.length,args=Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){args[_key-2]=arguments[_key];} -if(format===undefined){ -throw new Error( -'`warning(condition, format, ...args)` requires a warning '+ -'message argument');} - - - -if(format.indexOf('Failed Composite propType: ')===0){ -return;} - - -if(!condition){ -var argIndex=0; -var message='Warning: '+format.replace(/%s/g,function(){return args[argIndex++];}); -if(typeof console!=='undefined'){ -console.error(message);} - -try{ - - - -throw new Error(message);} -catch(x) {}}};} - - - - -module.exports=warning; -}); -__d('emptyFunction',function(global, require, module, exports) { function - - - - - - - - - - -makeEmptyFunction(arg){ -return function(){ -return arg;};} - - - - - - - - -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; -}); -__d('JSTimers',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var RCTTiming=require('NativeModules').Timing; -var JSTimersExecution=require('JSTimersExecution'); - - - - - - -var JSTimers={ -Types:JSTimersExecution.Types, - - - - - -_getFreeIndex:function(){ -var freeIndex=JSTimersExecution.timerIDs.indexOf(null); -if(freeIndex===-1){ -freeIndex=JSTimersExecution.timerIDs.length;} - -return freeIndex;}, - - - - - - -setTimeout:function(func,duration){for(var _len=arguments.length,args=Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){args[_key-2]=arguments[_key];} -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=function(){ -return func.apply(undefined,args);}; - -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.setTimeout; -RCTTiming.createTimer(newID,duration||0,Date.now(),false); -return newID;}, - - - - - - -setInterval:function(func,duration){for(var _len2=arguments.length,args=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){args[_key2-2]=arguments[_key2];} -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=function(){ -return func.apply(undefined,args);}; - -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.setInterval; -RCTTiming.createTimer(newID,duration||0,Date.now(),true); -return newID;}, - - - - - - -setImmediate:function(func){for(var _len3=arguments.length,args=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];} -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=function(){ -return func.apply(undefined,args);}; - -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.setImmediate; -JSTimersExecution.immediates.push(newID); -return newID;}, - - - - - -requestAnimationFrame:function(func){ -var newID=JSTimersExecution.GUID++; -var freeIndex=JSTimers._getFreeIndex(); -JSTimersExecution.timerIDs[freeIndex]=newID; -JSTimersExecution.callbacks[freeIndex]=func; -JSTimersExecution.types[freeIndex]=JSTimersExecution.Type.requestAnimationFrame; -RCTTiming.createTimer(newID,1,Date.now(),false); -return newID;}, - - -clearTimeout:function(timerID){ -JSTimers._clearTimerID(timerID);}, - - -clearInterval:function(timerID){ -JSTimers._clearTimerID(timerID);}, - - -clearImmediate:function(timerID){ -JSTimers._clearTimerID(timerID); -JSTimersExecution.immediates.splice( -JSTimersExecution.immediates.indexOf(timerID), -1);}, - - - -cancelAnimationFrame:function(timerID){ -JSTimers._clearTimerID(timerID);}, - - -_clearTimerID:function(timerID){ - - -if(timerID==null){ -return;} - - -var index=JSTimersExecution.timerIDs.indexOf(timerID); - -if(index!==-1){ -JSTimersExecution._clearIndex(index); -if(JSTimersExecution.types[index]!==JSTimersExecution.Type.setImmediate){ -RCTTiming.deleteTimer(timerID);}}}}; - - - - - -module.exports=JSTimers; -}); -__d('stringifySafe',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - -function stringifySafe(arg){ -var ret; -var type=typeof arg; -if(arg===undefined){ -ret='undefined';}else -if(arg===null){ -ret='null';}else -if(type==='string'){ -ret='"'+arg+'"';}else -if(type==='function'){ -try{ -ret=arg.toString();} -catch(e) { -ret='[function unknown]';}}else - -{ - - -try{ -ret=JSON.stringify(arg);} -catch(e) { -if(typeof arg.toString==='function'){ -try{ -ret=arg.toString();} -catch(E) {}}}} - - - -return ret||'["'+type+'" failed to stringify]';} - - -module.exports=stringifySafe; -}); -__d('findNodeHandle',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ReactCurrentOwner=require('ReactCurrentOwner'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function findNodeHandle(componentOrHandle){ -if(__DEV__){ -var owner=ReactCurrentOwner.current; -if(owner!==null){ -warning( -owner._warnedAboutRefsInRender, -'%s is accessing findNodeHandle inside its render(). '+ -'render() should be a pure function of props and state. It should '+ -'never access something that requires stale data from the previous '+ -'render, such as refs. Move this logic to componentDidMount and '+ -'componentDidUpdate instead.', -owner.getName()||'A component'); - -owner._warnedAboutRefsInRender=true;}} - - -if(componentOrHandle==null){ -return null;} - -if(typeof componentOrHandle==='number'){ - -return componentOrHandle;} - - -var component=componentOrHandle; - - - -var internalInstance=ReactInstanceMap.get(component); -if(internalInstance){ -return ReactNativeTagHandles.rootNodeIDToTag[internalInstance._rootNodeID];}else -{ -var rootNodeID=component._rootNodeID; -if(rootNodeID){ -return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];}else -{ -invariant( - - -typeof component==='object'&& -'_rootNodeID' in component|| - - -component.render!=null&& -typeof component.render==='function', - -'findNodeHandle(...): Argument is not a component '+ -'(type: %s, keys: %s)', -typeof component, -Object.keys(component)); - -invariant( -false, -'findNodeHandle(...): Unable to find node handle for unmounted '+ -'component.');}}} - - - - - -module.exports=findNodeHandle; -}); -__d('ReactCurrentOwner',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - -var ReactCurrentOwner={ - - - - - -current:null}; - - - -module.exports=ReactCurrentOwner; -}); -__d('ReactInstanceMap',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - -var ReactInstanceMap={ - - - - - - -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; -}); -__d('ReactNativeTagHandles',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - - - - - - -var INITIAL_TAG_COUNT=1; -var NATIVE_TOP_ROOT_ID_SEPARATOR='{TOP_LEVEL}'; -var ReactNativeTagHandles={ -tagsStartAt:INITIAL_TAG_COUNT, -tagCount:INITIAL_TAG_COUNT, - -allocateTag:function(){ - -while(this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount)){ -ReactNativeTagHandles.tagCount++;} - -var tag=ReactNativeTagHandles.tagCount; -ReactNativeTagHandles.tagCount++; -return tag;}, - - - - - - - - - - - -associateRootNodeIDWithMountedNodeHandle:function( -rootNodeID, -tag) -{ -warning(rootNodeID&&tag,'Root node or tag is null when associating'); -if(rootNodeID&&tag){ -ReactNativeTagHandles.tagToRootNodeID[tag]=rootNodeID; -ReactNativeTagHandles.rootNodeIDToTag[rootNodeID]=tag;}}, - - - -allocateRootNodeIDForTag:function(tag){ -invariant( -this.reactTagIsNativeTopRootID(tag), -'Expect a native root tag, instead got ',tag); - -return '.r['+tag+']'+NATIVE_TOP_ROOT_ID_SEPARATOR;}, - - -reactTagIsNativeTopRootID:function(reactTag){ - -return reactTag%10===1;}, - - -getNativeTopRootIDFromNodeID:function(nodeID){ -if(!nodeID){ -return null;} - -var index=nodeID.indexOf(NATIVE_TOP_ROOT_ID_SEPARATOR); -if(index===-1){ -return null;} - -return nodeID.substr(0,index+NATIVE_TOP_ROOT_ID_SEPARATOR.length);}, - - - - - - - - - - - - - - -mostRecentMountedNodeHandleForRootNodeID:function( -rootNodeID) -{ -return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];}, - - -tagToRootNodeID:[], - -rootNodeIDToTag:{}}; - - -module.exports=ReactNativeTagHandles; -}); -__d('ReactPropTypes',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactElement=require('ReactElement'); -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); - -var emptyFunction=require('emptyFunction'); -var getIteratorFn=require('getIteratorFn'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ANONYMOUS='<>'; - -var ReactPropTypes={ -array:createPrimitiveTypeChecker('array'), -bool:createPrimitiveTypeChecker('boolean'), -func:createPrimitiveTypeChecker('function'), -number:createPrimitiveTypeChecker('number'), -object:createPrimitiveTypeChecker('object'), -string:createPrimitiveTypeChecker('string'), - -any:createAnyTypeChecker(), -arrayOf:createArrayOfTypeChecker, -element:createElementTypeChecker(), -instanceOf:createInstanceTypeChecker, -node:createNodeChecker(), -objectOf:createObjectOfTypeChecker, -oneOf:createEnumTypeChecker, -oneOfType:createUnionTypeChecker, -shape:createShapeTypeChecker}; - - -function createChainableTypeChecker(validate){ -function checkType( -isRequired, -props, -propName, -componentName, -location, -propFullName) -{ -componentName=componentName||ANONYMOUS; -propFullName=propFullName||propName; -if(props[propName]==null){ -var locationName=ReactPropTypeLocationNames[location]; -if(isRequired){ -return new Error( -'Required '+locationName+' `'+propFullName+'` was not specified in '+('`'+ -componentName+'`.'));} - - -return null;}else -{ -return validate(props,propName,componentName,location,propFullName);}} - - - -var chainedCheckType=checkType.bind(null,false); -chainedCheckType.isRequired=checkType.bind(null,true); - -return chainedCheckType;} - - -function createPrimitiveTypeChecker(expectedType){ -function validate(props,propName,componentName,location,propFullName){ -var propValue=props[propName]; -var propType=getPropType(propValue); -if(propType!==expectedType){ -var locationName=ReactPropTypeLocationNames[location]; - - - -var preciseType=getPreciseType(propValue); - -return new Error( -'Invalid '+locationName+' `'+propFullName+'` of type '+('`'+ -preciseType+'` supplied to `'+componentName+'`, expected ')+('`'+ -expectedType+'`.'));} - - -return null;} - -return createChainableTypeChecker(validate);} - - -function createAnyTypeChecker(){ -return createChainableTypeChecker(emptyFunction.thatReturns(null));} - - -function createArrayOfTypeChecker(typeChecker){ -function validate(props,propName,componentName,location,propFullName){ -var propValue=props[propName]; -if(!Array.isArray(propValue)){ -var locationName=ReactPropTypeLocationNames[location]; -var propType=getPropType(propValue); -return new Error( -'Invalid '+locationName+' `'+propFullName+'` of type '+('`'+ -propType+'` supplied to `'+componentName+'`, expected an array.'));} - - -for(var i=0;i>';} - -return propValue.constructor.name;} - - -module.exports=ReactPropTypes; -}); -__d('ReactElement',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactCurrentOwner=require('ReactCurrentOwner'); - -var assign=require('Object.assign'); -var canDefineProperty=require('canDefineProperty'); - - - -var REACT_ELEMENT_TYPE= -typeof Symbol==='function'&&Symbol.for&&Symbol.for('react.element')|| -0xeac7; - -var RESERVED_PROPS={ -key:true, -ref:true, -__self:true, -__source:true}; - - - - - - - - - - - - - - - - - - - - -var ReactElement=function(type,key,ref,self,source,owner,props){ -var element={ - -$$typeof:REACT_ELEMENT_TYPE, - - -type:type, -key:key, -ref:ref, -props:props, - - -_owner:owner}; - - -if(__DEV__){ - - - - -element._store={}; - - - - - -if(canDefineProperty){ -Object.defineProperty(element._store,'validated',{ -configurable:false, -enumerable:false, -writable:true, -value:false}); - - -Object.defineProperty(element,'_self',{ -configurable:false, -enumerable:false, -writable:false, -value:self}); - - - -Object.defineProperty(element,'_source',{ -configurable:false, -enumerable:false, -writable:false, -value:source});}else - -{ -element._store.validated=false; -element._self=self; -element._source=source;} - -Object.freeze(element.props); -Object.freeze(element);} - - -return element;}; - - -ReactElement.createElement=function(type,config,children){ -var propName; - - -var props={}; - -var key=null; -var ref=null; -var self=null; -var source=null; - -if(config!=null){ -ref=config.ref===undefined?null:config.ref; -key=config.key===undefined?null:''+config.key; -self=config.__self===undefined?null:config.__self; -source=config.__source===undefined?null:config.__source; - -for(propName in config){ -if(config.hasOwnProperty(propName)&& -!RESERVED_PROPS.hasOwnProperty(propName)){ -props[propName]=config[propName];}}} - - - - - - -var childrenLength=arguments.length-2; -if(childrenLength===1){ -props.children=children;}else -if(childrenLength>1){ -var childArray=Array(childrenLength); -for(var i=0;i1){ -var childArray=Array(childrenLength); -for(var i=0;i=0;--i){ -var entry=this.tryEntries[i]; -var record=entry.completion; - -if(entry.tryLoc==="root"){ - - - -return handle("end");} - - -if(entry.tryLoc<=this.prev){ -var hasCatch=hasOwn.call(entry,"catchLoc"); -var hasFinally=hasOwn.call(entry,"finallyLoc"); - -if(hasCatch&&hasFinally){ -if(this.prev=0;--i){ -var entry=this.tryEntries[i]; -if(entry.tryLoc<=this.prev&& -hasOwn.call(entry,"finallyLoc")&& -this.prev=0;--i){ -var entry=this.tryEntries[i]; -if(entry.finallyLoc===finallyLoc){ -this.complete(entry.completion,entry.afterLoc); -resetTryEntry(entry); -return ContinueSentinel;}}}, - - - - -"catch":function(tryLoc){ -for(var i=this.tryEntries.length-1;i>=0;--i){ -var entry=this.tryEntries[i]; -if(entry.tryLoc===tryLoc){ -var record=entry.completion; -if(record.type==="throw"){ -var thrown=record.arg; -resetTryEntry(entry);} - -return thrown;}} - - - - - -throw new Error("illegal catch attempt");}, - - -delegateYield:function(iterable,resultName,nextLoc){ -this.delegate={ -iterator:values(iterable), -resultName:resultName, -nextLoc:nextLoc}; - - -return ContinueSentinel;}};})( - - - - - - -typeof global==="object"?global: -typeof window==="object"?window: -typeof self==="object"?self:this); -}); -__d('ExceptionsManager',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTExceptionsManager=require('NativeModules').ExceptionsManager; - -var loadSourceMap=require('loadSourceMap'); -var parseErrorStack=require('parseErrorStack'); -var stringifySafe=require('stringifySafe'); - -var sourceMapPromise; - -var exceptionID=0; - - - - -function reportException(e,isFatal){ -var currentExceptionID=++exceptionID; -if(RCTExceptionsManager){ -var stack=parseErrorStack(e); -if(isFatal){ -RCTExceptionsManager.reportFatalException(e.message,stack,currentExceptionID);}else -{ -RCTExceptionsManager.reportSoftException(e.message,stack,currentExceptionID);} - -if(__DEV__){ -(sourceMapPromise=sourceMapPromise||loadSourceMap()). -then(function(map){ -var prettyStack=parseErrorStack(e,map); -RCTExceptionsManager.updateExceptionMessage(e.message,prettyStack,currentExceptionID);}). - -catch(function(error){ - - -console.warn('Unable to load source map: '+error.message);});}}} - - - - - - - - -function handleException(e,isFatal){ - - - - -if(!e.message){ -e=new Error(e);} - - -(console._errorOriginal||console.error)(e.message); -reportException(e,isFatal);} - - - - - - -function installConsoleErrorReporter(){ - -if(console._errorOriginal){ -return;} - -console._errorOriginal=console.error.bind(console); -console.error=function reactConsoleError(){ -console._errorOriginal.apply(null,arguments); -if(!console.reportErrorsAsExceptions){ -return;} - - -if(arguments[0]&&arguments[0].stack){ -reportException(arguments[0],false);}else -{ -var str=Array.prototype.map.call(arguments,stringifySafe).join(', '); -if(str.slice(0,10)==='"Warning: '){ - - - -return;} - -var error=new Error('console.error: '+str); -error.framesToPop=1; -reportException(error,false);}}; - - -if(console.reportErrorsAsExceptions===undefined){ -console.reportErrorsAsExceptions=true;}} - - - -module.exports={handleException:handleException,installConsoleErrorReporter:installConsoleErrorReporter}; -}); -__d('loadSourceMap',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var Promise=require('Promise'); -var NativeModules=require('NativeModules'); -var SourceMapConsumer=require('SourceMap').SourceMapConsumer; -var SourceMapURL=require('react-native/Libraries/JavaScriptAppEngine/Initialization/source-map-url.js'); - -var RCTSourceCode=NativeModules.SourceCode; -var RCTNetworking=NativeModules.Networking; - -function loadSourceMap(){ -return fetchSourceMap(). -then(function(map){return new SourceMapConsumer(map);});} - - -function fetchSourceMap(){ -if(global.RAW_SOURCE_MAP){ -return Promise.resolve(global.RAW_SOURCE_MAP);} - - -if(!RCTSourceCode){ -return Promise.reject(new Error('RCTSourceCode module is not available'));} - - -if(!RCTNetworking){ - -return Promise.reject(new Error('RCTNetworking module is not available'));} - - -return new Promise(RCTSourceCode.getScriptText). -then(extractSourceMapURL). -then(function(url){ -if(url===null){ -return Promise.reject(new Error('No source map URL found. May be running from bundled file.'));} - -return Promise.resolve(url);}). - -then(fetch). -then(function(response){return response.text();});} - - -function extractSourceMapURL(_ref){var url=_ref.url;var text=_ref.text;var fullSourceMappingURL=_ref.fullSourceMappingURL; -if(fullSourceMappingURL){ -return fullSourceMappingURL;} - -var mapURL=SourceMapURL.getFrom(text); -if(!mapURL){ -return null;} - -var baseURL=url.match(/(.+:\/\/.*?)\//)[1]; -return baseURL+mapURL;} - - -module.exports=loadSourceMap; -}); -__d('Promise',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - -global.setImmediate=require('setImmediate'); -var Promise=require('promise/setimmediate/es6-extensions.js'); -require('promise/setimmediate/done.js'); - - - - -Promise.prototype.finally=function(onSettled){ -return this.then(onSettled,onSettled);}; - - - -module.exports=Promise; -}); -__d('setImmediate',function(global, require, module, exports) { module. - - - - - - - - - - - - - - - - -exports=global.setImmediate|| -require('ImmediateImplementation').setImmediate; -}); -__d('ImmediateImplementation',function(global, require, module, exports) { /** - * @generated SignedSource<<57d0446bbd1186485d372efe6b323dca>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic - * Denicola - * - * 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. - * - * @preserve-header - * @providesModule ImmediateImplementation - */ - -(function(global,undefined){ -"use strict"; - -var nextHandle=1; -var tasksByHandle={}; -var queueHead={}; -var queueTail=queueHead; -var currentlyRunningATask=false; -var doc=global.document; -var setImmediate; - -function addFromSetImmediateArguments(args){ -var handler=args[0]; -args=Array.prototype.slice.call(args,1); -tasksByHandle[nextHandle]=function(){ -handler.apply(undefined,args);}; - -queueTail=queueTail.next={handle:nextHandle++}; -return queueTail.handle;} - - -function flushQueue(){ -var next,task; -while(!currentlyRunningATask&&(next=queueHead.next)){ -queueHead=next; -if(task=tasksByHandle[next.handle]){ -currentlyRunningATask=true; -try{ -task(); -currentlyRunningATask=false;}finally -{ -clearImmediate(next.handle); -if(currentlyRunningATask){ -currentlyRunningATask=false; - - - - - - -if(queueHead.next){ -setImmediate(flushQueue);}}}}}} - - - - - - - -function clearImmediate(handle){ -delete tasksByHandle[handle];} - - -function canUsePostMessage(){ - - -if(global.postMessage&&!global.importScripts){ -var postMessageIsAsynchronous=true; - -var onMessage=function(){ -postMessageIsAsynchronous=false; -if(global.removeEventListener){ -global.removeEventListener("message",onMessage,false);}else -{ -global.detachEvent("onmessage",onMessage);}}; - - - -if(global.addEventListener){ -global.addEventListener("message",onMessage,false);}else -if(global.attachEvent){ -global.attachEvent("onmessage",onMessage);}else -{ -return false;} - - -global.postMessage("","*"); -return postMessageIsAsynchronous;}} - - - -function installPostMessageImplementation(){ - - -var messagePrefix="setImmediate$"+Math.random()+"$"; -var onGlobalMessage=function(event){ -if(event.source===global&& -typeof event.data==="string"&& -event.data.indexOf(messagePrefix)===0){ -flushQueue();}}; - - - -if(global.addEventListener){ -global.addEventListener("message",onGlobalMessage,false);}else -{ -global.attachEvent("onmessage",onGlobalMessage);} - - -setImmediate=function(){ -var handle=addFromSetImmediateArguments(arguments); -global.postMessage(messagePrefix+handle,"*"); -return handle;};} - - - -function installMessageChannelImplementation(){ -var channel=new MessageChannel(); -channel.port1.onmessage=flushQueue; -setImmediate=function(){ -var handle=addFromSetImmediateArguments(arguments); -channel.port2.postMessage(handle); -return handle;};} - - - -function installReadyStateChangeImplementation(){ -var html=doc.documentElement; -setImmediate=function(){ -var handle=addFromSetImmediateArguments(arguments); - - -var script=doc.createElement("script"); -script.onreadystatechange=function(){ -script.onreadystatechange=null; -html.removeChild(script); -script=null; -flushQueue();}; - -html.appendChild(script); -return handle;};} - - - -function installSetTimeoutImplementation(){ -setImmediate=function(){ -setTimeout(flushQueue,0); -return addFromSetImmediateArguments(arguments);};} - - - -if(canUsePostMessage()){ - -installPostMessageImplementation();}else - -if(global.MessageChannel){ - -installMessageChannelImplementation();}else - -if(doc&&"onreadystatechange" in doc.createElement("script")){ - -installReadyStateChangeImplementation();}else - -{ - -installSetTimeoutImplementation();} - - -exports.setImmediate=setImmediate; -exports.clearImmediate=clearImmediate;})( -Function("return this")()); -}); -__d('promise/setimmediate/es6-extensions.js',function(global, require, module, exports) { 'use strict'; - - - -var Promise=require('promise/setimmediate/core.js'); - -module.exports=Promise; - - - -var TRUE=valuePromise(true); -var FALSE=valuePromise(false); -var NULL=valuePromise(null); -var UNDEFINED=valuePromise(undefined); -var ZERO=valuePromise(0); -var EMPTYSTRING=valuePromise(''); - -function valuePromise(value){ -var p=new Promise(Promise._61); -p._81=1; -p._65=value; -return p;} - -Promise.resolve=function(value){ -if(value instanceof Promise)return value; - -if(value===null)return NULL; -if(value===undefined)return UNDEFINED; -if(value===true)return TRUE; -if(value===false)return FALSE; -if(value===0)return ZERO; -if(value==='')return EMPTYSTRING; - -if(typeof value==='object'||typeof value==='function'){ -try{ -var then=value.then; -if(typeof then==='function'){ -return new Promise(then.bind(value));}} - -catch(ex) { -return new Promise(function(resolve,reject){ -reject(ex);});}} - - - -return valuePromise(value);}; - - -Promise.all=function(arr){ -var args=Array.prototype.slice.call(arr); - -return new Promise(function(resolve,reject){ -if(args.length===0)return resolve([]); -var remaining=args.length; -function res(i,val){ -if(val&&(typeof val==='object'||typeof val==='function')){ -if(val instanceof Promise&&val.then===Promise.prototype.then){ -while(val._81===3){ -val=val._65;} - -if(val._81===1)return res(i,val._65); -if(val._81===2)reject(val._65); -val.then(function(val){ -res(i,val);}, -reject); -return;}else -{ -var then=val.then; -if(typeof then==='function'){ -var p=new Promise(then.bind(val)); -p.then(function(val){ -res(i,val);}, -reject); -return;}}} - - - -args[i]=val; -if(--remaining===0){ -resolve(args);}} - - -for(var i=0;i0&&aGenerated.column>=0&& -!aOriginal&&!aSource&&!aName){ - -return;}else - -if(aGenerated&&'line' in aGenerated&&'column' in aGenerated&& -aOriginal&&'line' in aOriginal&&'column' in aOriginal&& -aGenerated.line>0&&aGenerated.column>=0&& -aOriginal.line>0&&aOriginal.column>=0&& -aSource){ - -return;}else - -{ -throw new Error('Invalid mapping: '+JSON.stringify({ -generated:aGenerated, -source:aSource, -orginal:aOriginal, -name:aName}));}}; - - - - - - - - -SourceMapGenerator.prototype._serializeMappings= -function SourceMapGenerator_serializeMappings(){ -var previousGeneratedColumn=0; -var previousGeneratedLine=1; -var previousOriginalColumn=0; -var previousOriginalLine=0; -var previousName=0; -var previousSource=0; -var result=''; -var mapping; - - - - - - -this._mappings.sort(util.compareByGeneratedPositions); - -for(var i=0,len=this._mappings.length;i0){ -if(!util.compareByGeneratedPositions(mapping,this._mappings[i-1])){ -continue;} - -result+=',';}} - - - -result+=base64VLQ.encode(mapping.generatedColumn- -previousGeneratedColumn); -previousGeneratedColumn=mapping.generatedColumn; - -if(mapping.source){ -result+=base64VLQ.encode(this._sources.indexOf(mapping.source)- -previousSource); -previousSource=this._sources.indexOf(mapping.source); - - -result+=base64VLQ.encode(mapping.originalLine-1- -previousOriginalLine); -previousOriginalLine=mapping.originalLine-1; - -result+=base64VLQ.encode(mapping.originalColumn- -previousOriginalColumn); -previousOriginalColumn=mapping.originalColumn; - -if(mapping.name){ -result+=base64VLQ.encode(this._names.indexOf(mapping.name)- -previousName); -previousName=this._names.indexOf(mapping.name);}}} - - - - -return result;}; - - -SourceMapGenerator.prototype._generateSourcesContent= -function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){ -return aSources.map(function(source){ -if(!this._sourcesContents){ -return null;} - -if(aSourceRoot){ -source=util.relative(aSourceRoot,source);} - -var key=util.toSetString(source); -return Object.prototype.hasOwnProperty.call(this._sourcesContents, -key)? -this._sourcesContents[key]: -null;}, -this);}; - - - - - -SourceMapGenerator.prototype.toJSON= -function SourceMapGenerator_toJSON(){ -var map={ -version:this._version, -file:this._file, -sources:this._sources.toArray(), -names:this._names.toArray(), -mappings:this._serializeMappings()}; - -if(this._sourceRoot){ -map.sourceRoot=this._sourceRoot;} - -if(this._sourcesContents){ -map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot);} - - -return map;}; - - - - - -SourceMapGenerator.prototype.toString= -function SourceMapGenerator_toString(){ -return JSON.stringify(this);}; - - -exports.SourceMapGenerator=SourceMapGenerator;}); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -define('source-map/base64-vlq',['require','exports','module','source-map/base64'],function(require,exports,module){ - -var base64=require('./base64'); - - - - - - - - - - - - - -var VLQ_BASE_SHIFT=5; - - -var VLQ_BASE=1<>1; -return isNegative? --shifted: -shifted;} - - - - - -exports.encode=function base64VLQ_encode(aValue){ -var encoded=""; -var digit; - -var vlq=toVLQSigned(aValue); - -do { -digit=vlq&VLQ_BASE_MASK; -vlq>>>=VLQ_BASE_SHIFT; -if(vlq>0){ - - -digit|=VLQ_CONTINUATION_BIT;} - -encoded+=base64.encode(digit);}while( -vlq>0); - -return encoded;}; - - - - - - -exports.decode=function base64VLQ_decode(aStr){ -var i=0; -var strLen=aStr.length; -var result=0; -var shift=0; -var continuation,digit; - -do { -if(i>=strLen){ -throw new Error("Expected more digits in base 64 VLQ value.");} - -digit=base64.decode(aStr.charAt(i++)); -continuation=!!(digit&VLQ_CONTINUATION_BIT); -digit&=VLQ_BASE_MASK; -result=result+(digit<s2)-(s1=0&&aIdx0){ -if(str.charAt(0)===';'){ -generatedLine++; -str=str.slice(1); -previousGeneratedColumn=0;}else - -if(str.charAt(0)===','){ -str=str.slice(1);}else - -{ -mapping={}; -mapping.generatedLine=generatedLine; - - -temp=base64VLQ.decode(str); -mapping.generatedColumn=previousGeneratedColumn+temp.value; -previousGeneratedColumn=mapping.generatedColumn; -str=temp.rest; - -if(str.length>0&&!mappingSeparator.test(str.charAt(0))){ - -temp=base64VLQ.decode(str); -mapping.source=this._sources.at(previousSource+temp.value); -previousSource+=temp.value; -str=temp.rest; -if(str.length===0||mappingSeparator.test(str.charAt(0))){ -throw new Error('Found a source, but no line and column');} - - - -temp=base64VLQ.decode(str); -mapping.originalLine=previousOriginalLine+temp.value; -previousOriginalLine=mapping.originalLine; - -mapping.originalLine+=1; -str=temp.rest; -if(str.length===0||mappingSeparator.test(str.charAt(0))){ -throw new Error('Found a source and line, but no column');} - - - -temp=base64VLQ.decode(str); -mapping.originalColumn=previousOriginalColumn+temp.value; -previousOriginalColumn=mapping.originalColumn; -str=temp.rest; - -if(str.length>0&&!mappingSeparator.test(str.charAt(0))){ - -temp=base64VLQ.decode(str); -mapping.name=this._names.at(previousName+temp.value); -previousName+=temp.value; -str=temp.rest;}} - - - -this.__generatedMappings.push(mapping); -if(typeof mapping.originalLine==='number'){ -this.__originalMappings.push(mapping);}}} - - - - -this.__originalMappings.sort(util.compareByOriginalPositions);}; - - - - - - -SourceMapConsumer.prototype._findMapping= -function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName, -aColumnName,aComparator){ - - - - - -if(aNeedle[aLineName]<=0){ -throw new TypeError('Line must be greater than or equal to 1, got '+ -aNeedle[aLineName]);} - -if(aNeedle[aColumnName]<0){ -throw new TypeError('Column must be greater than or equal to 0, got '+ -aNeedle[aColumnName]);} - - -return binarySearch.search(aNeedle,aMappings,aComparator);}; - - - - - - - - - - - - - - - - - -SourceMapConsumer.prototype.originalPositionFor= -function SourceMapConsumer_originalPositionFor(aArgs){ -var needle={ -generatedLine:util.getArg(aArgs,'line'), -generatedColumn:util.getArg(aArgs,'column')}; - - -var mapping=this._findMapping(needle, -this._generatedMappings, -"generatedLine", -"generatedColumn", -util.compareByGeneratedPositions); - -if(mapping){ -var source=util.getArg(mapping,'source',null); -if(source&&this.sourceRoot){ -source=util.join(this.sourceRoot,source);} - -return { -source:source, -line:util.getArg(mapping,'originalLine',null), -column:util.getArg(mapping,'originalColumn',null), -name:util.getArg(mapping,'name',null)};} - - - -return { -source:null, -line:null, -column:null, -name:null};}; - - - - - - - - -SourceMapConsumer.prototype.sourceContentFor= -function SourceMapConsumer_sourceContentFor(aSource){ -if(!this.sourcesContent){ -return null;} - - -if(this.sourceRoot){ -aSource=util.relative(this.sourceRoot,aSource);} - - -if(this._sources.has(aSource)){ -return this.sourcesContent[this._sources.indexOf(aSource)];} - - -var url; -if(this.sourceRoot&&( -url=util.urlParse(this.sourceRoot))){ - - - - -var fileUriAbsPath=aSource.replace(/^file:\/\//,""); -if(url.scheme=="file"&& -this._sources.has(fileUriAbsPath)){ -return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];} - - -if((!url.path||url.path=="/")&& -this._sources.has("/"+aSource)){ -return this.sourcesContent[this._sources.indexOf("/"+aSource)];}} - - - -throw new Error('"'+aSource+'" is not in the SourceMap.');}; - - - - - - - - - - - - - - - - -SourceMapConsumer.prototype.generatedPositionFor= -function SourceMapConsumer_generatedPositionFor(aArgs){ -var needle={ -source:util.getArg(aArgs,'source'), -originalLine:util.getArg(aArgs,'line'), -originalColumn:util.getArg(aArgs,'column')}; - - -if(this.sourceRoot){ -needle.source=util.relative(this.sourceRoot,needle.source);} - - -var mapping=this._findMapping(needle, -this._originalMappings, -"originalLine", -"originalColumn", -util.compareByOriginalPositions); - -if(mapping){ -return { -line:util.getArg(mapping,'generatedLine',null), -column:util.getArg(mapping,'generatedColumn',null)};} - - - -return { -line:null, -column:null};}; - - - -SourceMapConsumer.GENERATED_ORDER=1; -SourceMapConsumer.ORIGINAL_ORDER=2; - - - - - - - - - - - - - - - - - -SourceMapConsumer.prototype.eachMapping= -function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){ -var context=aContext||null; -var order=aOrder||SourceMapConsumer.GENERATED_ORDER; - -var mappings; -switch(order){ -case SourceMapConsumer.GENERATED_ORDER: -mappings=this._generatedMappings; -break; -case SourceMapConsumer.ORIGINAL_ORDER: -mappings=this._originalMappings; -break; -default: -throw new Error("Unknown order of iteration.");} - - -var sourceRoot=this.sourceRoot; -mappings.map(function(mapping){ -var source=mapping.source; -if(source&&sourceRoot){ -source=util.join(sourceRoot,source);} - -return { -source:source, -generatedLine:mapping.generatedLine, -generatedColumn:mapping.generatedColumn, -originalLine:mapping.originalLine, -originalColumn:mapping.originalColumn, -name:mapping.name};}). - -forEach(aCallback,context);}; - - -exports.SourceMapConsumer=SourceMapConsumer;}); - - - - - - - - -define('source-map/binary-search',['require','exports','module'],function(require,exports,module){ - - - - - - - - - - -function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){ - - - - - - - - - - -var mid=Math.floor((aHigh-aLow)/2)+aLow; -var cmp=aCompare(aNeedle,aHaystack[mid],true); -if(cmp===0){ - -return aHaystack[mid];}else - -if(cmp>0){ - -if(aHigh-mid>1){ - -return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare);} - - - -return aHaystack[mid];}else - -{ - -if(mid-aLow>1){ - -return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare);} - - - -return aLow<0? -null: -aHaystack[aLow];}} - - - - - - - - - - - - - - - - -exports.search=function search(aNeedle,aHaystack,aCompare){ -return aHaystack.length>0? -recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare): -null;};}); - - - - - - - - - -define('source-map/source-node',['require','exports','module','source-map/source-map-generator','source-map/util'],function(require,exports,module){ - -var SourceMapGenerator=require('./source-map-generator').SourceMapGenerator; -var util=require('./util'); - - - - - - - - - - - - - -function SourceNode(aLine,aColumn,aSource,aChunks,aName){ -this.children=[]; -this.sourceContents={}; -this.line=aLine===undefined?null:aLine; -this.column=aColumn===undefined?null:aColumn; -this.source=aSource===undefined?null:aSource; -this.name=aName===undefined?null:aName; -if(aChunks!=null)this.add(aChunks);} - - - - - - - - -SourceNode.fromStringWithSourceMap= -function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer){ - - -var node=new SourceNode(); - - - -var remainingLines=aGeneratedCode.split('\n'); - - -var lastGeneratedLine=1,lastGeneratedColumn=0; - - - - -var lastMapping=null; - -aSourceMapConsumer.eachMapping(function(mapping){ -if(lastMapping===null){ - - - -while(lastGeneratedLine=0;i--){ -this.prepend(aChunk[i]);}}else - - -if(aChunk instanceof SourceNode||typeof aChunk==="string"){ -this.children.unshift(aChunk);}else - -{ -throw new TypeError( -"Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk);} - - -return this;}; - - - - - - - - - -SourceNode.prototype.walk=function SourceNode_walk(aFn){ -var chunk; -for(var i=0,len=this.children.length;i0){ -newChildren=[]; -for(i=0;i-1?upcased:method;} - - -function Request(input,options){ -options=options||{}; -var body=options.body; -if(Request.prototype.isPrototypeOf(input)){ -if(input.bodyUsed){ -throw new TypeError('Already read');} - -this.url=input.url; -this.credentials=input.credentials; -if(!options.headers){ -this.headers=new Headers(input.headers);} - -this.method=input.method; -this.mode=input.mode; -if(!body){ -body=input._bodyInit; -input.bodyUsed=true;}}else - -{ -this.url=input;} - - -this.credentials=options.credentials||this.credentials||'omit'; -if(options.headers||!this.headers){ -this.headers=new Headers(options.headers);} - -this.method=normalizeMethod(options.method||this.method||'GET'); -this.mode=options.mode||this.mode||null; -this.referrer=null; - -if((this.method==='GET'||this.method==='HEAD')&&body){ -throw new TypeError('Body not allowed for GET or HEAD requests');} - -this._initBody(body);} - - -Request.prototype.clone=function(){ -return new Request(this);}; - - -function decode(body){ -var form=new FormData(); -body.trim().split('&').forEach(function(bytes){ -if(bytes){ -var split=bytes.split('='); -var name=split.shift().replace(/\+/g,' '); -var value=split.join('=').replace(/\+/g,' '); -form.append(decodeURIComponent(name),decodeURIComponent(value));}}); - - -return form;} - - -function headers(xhr){ -var head=new Headers(); -var pairs=xhr.getAllResponseHeaders().trim().split('\n'); -pairs.forEach(function(header){ -var split=header.trim().split(':'); -var key=split.shift().trim(); -var value=split.join(':').trim(); -head.append(key,value);}); - -return head;} - - -Body.call(Request.prototype); - -function Response(bodyInit,options){ -if(!options){ -options={};} - - -this._initBody(bodyInit); -this.type='default'; -this.url=null; -this.status=options.status; -this.ok=this.status>=200&&this.status<300; -this.statusText=options.statusText; -this.headers=options.headers instanceof Headers?options.headers:new Headers(options.headers); -this.url=options.url||'';} - - -Response.prototype.clone=function(){ -return new Response(this._bodyInit,{ -status:this.status, -statusText:this.statusText, -headers:new Headers(this.headers), -url:this.url});}; - - - -Body.call(Response.prototype); - -self.Headers=Headers; -self.Request=Request; -self.Response=Response; - -self.fetch=function(input,init){ -var request; -if(Request.prototype.isPrototypeOf(input)&&!init){ -request=input;}else -{ -request=new Request(input,init);} - - -return new Promise(function(resolve,reject){ -var xhr=new XMLHttpRequest(); - -function responseURL(){ -if('responseURL' in xhr){ -return xhr.responseURL;} - - - -if(/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())){ -return xhr.getResponseHeader('X-Request-URL');} - - -return;} - - -xhr.onload=function(){ -var status=xhr.status===1223?204:xhr.status; -if(status<100||status>599){ -reject(new TypeError('Network request failed')); -return;} - -var options={ -status:status, -statusText:xhr.statusText, -headers:headers(xhr), -url:responseURL()}; - -var body='response' in xhr?xhr.response:xhr.responseText; -resolve(new Response(body,options));}; - - -xhr.onerror=function(){ -reject(new TypeError('Network request failed'));}; - - -xhr.open(request.method,request.url,true); - -if(request.credentials==='include'){ -xhr.withCredentials=true;} - - -if('responseType' in xhr&&support.blob){ -xhr.responseType='blob';} - - -request.headers.forEach(function(value,name){ -xhr.setRequestHeader(name,value);}); - - -xhr.send(typeof request._bodyInit==='undefined'?null:request._bodyInit);});}; - - -self.fetch.polyfill=true;})(); - - - - -module.exports=self; -}); -__d('Geolocation',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTDeviceEventEmitter=require('RCTDeviceEventEmitter'); -var RCTLocationObserver=require('NativeModules').LocationObserver; - -var invariant=require('invariant'); -var logError=require('logError'); -var warning=require('warning'); - -var subscriptions=[]; - -var updatesEnabled=false; - - - - - - - - - - - - - - - - - - - - - - - - - - -var Geolocation={ - - - - - -getCurrentPosition:function( -geo_success, -geo_error, -geo_options) -{ -invariant( -typeof geo_success==='function', -'Must provide a valid geo_success callback.'); - -RCTLocationObserver.getCurrentPosition( -geo_options||{}, -geo_success, -geo_error||logError);}, - - - - - - - -watchPosition:function(success,error,options){ -if(!updatesEnabled){ -RCTLocationObserver.startObserving(options||{}); -updatesEnabled=true;} - -var watchID=subscriptions.length; -subscriptions.push([ -RCTDeviceEventEmitter.addListener( -'geolocationDidChange', -success), - -error?RCTDeviceEventEmitter.addListener( -'geolocationError', -error): -null]); - -return watchID;}, - - -clearWatch:function(watchID){ -var sub=subscriptions[watchID]; -if(!sub){ - - -return;} - - -sub[0].remove(); - -var sub1=sub[1];sub1&&sub1.remove(); -subscriptions[watchID]=undefined; -var noWatchers=true; -for(var ii=0;ii0){ -var types=Array(arguments.length); -for(var i=0;i1){ -var index=id.indexOf(SEPARATOR,1); -return index>-1?id.substr(0,index):id;} - -return null;}, - - - - - - - - - - - - - - - - -traverseEnterLeave:function(leaveID,enterID,cb,upArg,downArg){ -var ancestorID=getFirstCommonAncestorID(leaveID,enterID); -if(ancestorID!==leaveID){ -traverseParentPath(leaveID,ancestorID,cb,upArg,false,true);} - -if(ancestorID!==enterID){ -traverseParentPath(ancestorID,enterID,cb,downArg,true,false);}}, - - - - - - - - - - - - - -traverseTwoPhase:function(targetID,cb,arg){ -if(targetID){ -traverseParentPath('',targetID,cb,arg,true,false); -traverseParentPath(targetID,'',cb,arg,false,true);}}, - - - - - - -traverseTwoPhaseSkipTarget:function(targetID,cb,arg){ -if(targetID){ -traverseParentPath('',targetID,cb,arg,true,true); -traverseParentPath(targetID,'',cb,arg,true,true);}}, - - - - - - - - - - - - - - - -traverseAncestors:function(targetID,cb,arg){ -traverseParentPath('',targetID,cb,arg,true,false);}, - - -getFirstCommonAncestorID:getFirstCommonAncestorID, - - - - - -_getNextDescendantID:getNextDescendantID, - -isAncestorIDOf:isAncestorIDOf, - -SEPARATOR:SEPARATOR}; - - - -module.exports=ReactInstanceHandles; -}); -__d('ReactRootIndex',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ReactRootIndexInjection={ - - - -injectCreateReactRootIndex:function(_createReactRootIndex){ -ReactRootIndex.createReactRootIndex=_createReactRootIndex;}}; - - - -var ReactRootIndex={ -createReactRootIndex:null, -injection:ReactRootIndexInjection}; - - -module.exports=ReactRootIndex; -}); -__d('ReactNativeMount',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactElement=require('ReactElement'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var ReactPerf=require('ReactPerf'); -var ReactReconciler=require('ReactReconciler'); -var ReactUpdateQueue=require('ReactUpdateQueue'); -var ReactUpdates=require('ReactUpdates'); -var UIManager=require('UIManager'); - -var emptyObject=require('emptyObject'); -var instantiateReactComponent=require('instantiateReactComponent'); -var shouldUpdateReactComponent=require('shouldUpdateReactComponent'); - -function instanceNumberToChildRootID(rootNodeID,instanceNumber){ -return rootNodeID+'['+instanceNumber+']';} - - - - - - - -var TopLevelWrapper=function(){}; -TopLevelWrapper.prototype.isReactComponent={}; -if(__DEV__){ -TopLevelWrapper.displayName='TopLevelWrapper';} - -TopLevelWrapper.prototype.render=function(){ - -return this.props;}; - - - - - - - - - - -function mountComponentIntoNode( -componentInstance, -rootID, -container, -transaction){ -var markup=ReactReconciler.mountComponent( -componentInstance,rootID,transaction,emptyObject); - -componentInstance._renderedComponent._topLevelWrapper=componentInstance; -ReactNativeMount._mountImageIntoNode(markup,container);} - - - - - - - - - -function batchedMountComponentIntoNode( -componentInstance, -rootID, -container){ -var transaction=ReactUpdates.ReactReconcileTransaction.getPooled(); -transaction.perform( -mountComponentIntoNode, -null, -componentInstance, -rootID, -container, -transaction); - -ReactUpdates.ReactReconcileTransaction.release(transaction);} - - - - - - -var ReactNativeMount={ -instanceCount:0, - -_instancesByContainerID:{}, - - -findNodeHandle:require('findNodeHandle'), -nativeTagToRootNodeID:function(nativeTag){ -return ReactNativeTagHandles.tagToRootNodeID[nativeTag];}, - - - - - - -renderComponent:function( -nextElement, -containerTag, -callback) -{ -var nextWrappedElement=new ReactElement( -TopLevelWrapper, -null, -null, -null, -null, -null, -nextElement); - - -var topRootNodeID=ReactNativeTagHandles.tagToRootNodeID[containerTag]; -if(topRootNodeID){ -var prevComponent=ReactNativeMount._instancesByContainerID[topRootNodeID]; -if(prevComponent){ -var prevWrappedElement=prevComponent._currentElement; -var prevElement=prevWrappedElement.props; -if(shouldUpdateReactComponent(prevElement,nextElement)){ -ReactUpdateQueue.enqueueElementInternal(prevComponent,nextWrappedElement); -if(callback){ -ReactUpdateQueue.enqueueCallbackInternal(prevComponent,callback);} - -return prevComponent;}else -{ -ReactNativeMount.unmountComponentAtNode(containerTag);}}} - - - - -if(!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)){ -console.error('You cannot render into anything but a top root'); -return;} - - -var topRootNodeID=ReactNativeTagHandles.allocateRootNodeIDForTag(containerTag); -ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle( -topRootNodeID, -containerTag); - - -var instance=instantiateReactComponent(nextWrappedElement); -ReactNativeMount._instancesByContainerID[topRootNodeID]=instance; - -var childRootNodeID=instanceNumberToChildRootID( -topRootNodeID, -ReactNativeMount.instanceCount++); - - - - - - -ReactUpdates.batchedUpdates( -batchedMountComponentIntoNode, -instance, -childRootNodeID, -topRootNodeID); - -var component=instance.getPublicInstance(); -if(callback){ -callback.call(component);} - -return component;}, - - - - - - -_mountImageIntoNode:ReactPerf.measure( - -'ReactComponentBrowserEnvironment', -'mountImageIntoNode', -function(mountImage,containerID){ - - -ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle( -mountImage.rootNodeID, -mountImage.tag); - -var addChildTags=[mountImage.tag]; -var addAtIndices=[0]; -UIManager.manageChildren( -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID), -null, -null, -addChildTags, -addAtIndices, -null);}), - - - - - - - - - - - - -unmountComponentAtNodeAndRemoveContainer:function( -containerTag) -{ -ReactNativeMount.unmountComponentAtNode(containerTag); - -UIManager.removeRootView(containerTag);}, - - - - - - - -unmountComponentAtNode:function(containerTag){ -if(!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)){ -console.error('You cannot render into anything but a top root'); -return false;} - - -var containerID=ReactNativeTagHandles.tagToRootNodeID[containerTag]; -var instance=ReactNativeMount._instancesByContainerID[containerID]; -if(!instance){ -return false;} - -ReactNativeMount.unmountComponentFromNode(instance,containerID); -delete ReactNativeMount._instancesByContainerID[containerID]; -return true;}, - - - - - - - - - - - -unmountComponentFromNode:function( -instance, -containerID) -{ - -ReactReconciler.unmountComponent(instance); -var containerTag= -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID); -UIManager.removeSubviewsFromContainerWithID(containerTag);}, - - -getNode:function(rootNodeID){ -return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];}, - - -getID:function(nativeTag){ -return ReactNativeTagHandles.tagToRootNodeID[nativeTag];}}; - - - -ReactNativeMount.renderComponent=ReactPerf.measure( -'ReactMount', -'_renderNewRootComponent', -ReactNativeMount.renderComponent); - - -module.exports=ReactNativeMount; -}); -__d('ReactReconciler',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactRef=require('ReactRef'); - - - - - -function attachRefs(){ -ReactRef.attachRefs(this,this._currentElement);} - - -var ReactReconciler={ - - - - - - - - - - - -mountComponent:function(internalInstance,rootID,transaction,context){ -var markup=internalInstance.mountComponent(rootID,transaction,context); -if(internalInstance._currentElement&& -internalInstance._currentElement.ref!=null){ -transaction.getReactMountReady().enqueue(attachRefs,internalInstance);} - -return markup;}, - - - - - - - - -unmountComponent:function(internalInstance){ -ReactRef.detachRefs(internalInstance,internalInstance._currentElement); -internalInstance.unmountComponent();}, - - - - - - - - - - - -receiveComponent:function( -internalInstance,nextElement,transaction,context) -{ -var prevElement=internalInstance._currentElement; - -if(nextElement===prevElement&& -context===internalInstance._context) -{ - - - - - - - - - - -return;} - - -var refsChanged=ReactRef.shouldUpdateRefs( -prevElement, -nextElement); - - -if(refsChanged){ -ReactRef.detachRefs(internalInstance,prevElement);} - - -internalInstance.receiveComponent(nextElement,transaction,context); - -if(refsChanged&& -internalInstance._currentElement&& -internalInstance._currentElement.ref!=null){ -transaction.getReactMountReady().enqueue(attachRefs,internalInstance);}}, - - - - - - - - - - -performUpdateIfNecessary:function( -internalInstance, -transaction) -{ -internalInstance.performUpdateIfNecessary(transaction);}}; - - - - -module.exports=ReactReconciler; -}); -__d('ReactRef',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactOwner=require('ReactOwner'); - -var ReactRef={}; - -function attachRef(ref,component,owner){ -if(typeof ref==='function'){ -ref(component.getPublicInstance());}else -{ - -ReactOwner.addComponentAsRefTo(component,ref,owner);}} - - - -function detachRef(ref,component,owner){ -if(typeof ref==='function'){ -ref(null);}else -{ - -ReactOwner.removeComponentAsRefFrom(component,ref,owner);}} - - - -ReactRef.attachRefs=function(instance,element){ -if(element===null||element===false){ -return;} - -var ref=element.ref; -if(ref!=null){ -attachRef(ref,instance,element._owner);}}; - - - -ReactRef.shouldUpdateRefs=function(prevElement,nextElement){ - - - - - - - - - - - - -var prevEmpty=prevElement===null||prevElement===false; -var nextEmpty=nextElement===null||nextElement===false; - -return ( - -prevEmpty||nextEmpty|| -nextElement._owner!==prevElement._owner|| -nextElement.ref!==prevElement.ref);}; - - - -ReactRef.detachRefs=function(instance,element){ -if(element===null||element===false){ -return;} - -var ref=element.ref; -if(ref!=null){ -detachRef(ref,instance,element._owner);}}; - - - -module.exports=ReactRef; -}); -__d('ReactOwner',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ReactOwner={ - - - - - - -isValidOwner:function(object){ -return !!( -object&& -typeof object.attachRef==='function'&& -typeof object.detachRef==='function');}, - - - - - - - - - - - - -addComponentAsRefTo:function(component,ref,owner){ -invariant( -ReactOwner.isValidOwner(owner), -'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might '+ -'be adding a ref to a component that was not created inside a component\'s '+ -'`render` method, or you have multiple copies of React loaded '+ -'(details: https://fb.me/react-refs-must-have-owner).'); - -owner.attachRef(ref,component);}, - - - - - - - - - - - -removeComponentAsRefFrom:function(component,ref,owner){ -invariant( -ReactOwner.isValidOwner(owner), -'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might '+ -'be removing a ref to a component that was not created inside a component\'s '+ -'`render` method, or you have multiple copies of React loaded '+ -'(details: https://fb.me/react-refs-must-have-owner).'); - - - -if(owner.getPublicInstance().refs[ref]===component.getPublicInstance()){ -owner.detachRef(ref);}}}; - - - - - -module.exports=ReactOwner; -}); -__d('ReactUpdateQueue',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactCurrentOwner=require('ReactCurrentOwner'); -var ReactElement=require('ReactElement'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactUpdates=require('ReactUpdates'); - -var assign=require('Object.assign'); -var invariant=require('invariant'); -var warning=require('warning'); - -function enqueueUpdate(internalInstance){ -ReactUpdates.enqueueUpdate(internalInstance);} - - -function getInternalInstanceReadyForUpdate(publicInstance,callerName){ -var internalInstance=ReactInstanceMap.get(publicInstance); -if(!internalInstance){ -if(__DEV__){ - - - -warning( -!callerName, -'%s(...): Can only update a mounted or mounting component. '+ -'This usually means you called %s() on an unmounted component. '+ -'This is a no-op. Please check the code for the %s component.', -callerName, -callerName, -publicInstance.constructor.displayName);} - - -return null;} - - -if(__DEV__){ -warning( -ReactCurrentOwner.current==null, -'%s(...): Cannot update during an existing state transition '+ -'(such as within `render`). Render methods should be a pure function '+ -'of props and state.', -callerName);} - - - -return internalInstance;} - - - - - - -var ReactUpdateQueue={ - - - - - - - - -isMounted:function(publicInstance){ -if(__DEV__){ -var owner=ReactCurrentOwner.current; -if(owner!==null){ -warning( -owner._warnedAboutRefsInRender, -'%s is accessing isMounted inside its render() function. '+ -'render() should be a pure function of props and state. It should '+ -'never access something that requires stale data from the previous '+ -'render, such as refs. Move this logic to componentDidMount and '+ -'componentDidUpdate instead.', -owner.getName()||'A component'); - -owner._warnedAboutRefsInRender=true;}} - - -var internalInstance=ReactInstanceMap.get(publicInstance); -if(internalInstance){ - - - -return !!internalInstance._renderedComponent;}else -{ -return false;}}, - - - - - - - - - - - -enqueueCallback:function(publicInstance,callback){ -invariant( -typeof callback==='function', -'enqueueCallback(...): You called `setProps`, `replaceProps`, '+ -'`setState`, `replaceState`, or `forceUpdate` with a callback that '+ -'isn\'t callable.'); - -var internalInstance=getInternalInstanceReadyForUpdate(publicInstance); - - - - - - -if(!internalInstance){ -return null;} - - -if(internalInstance._pendingCallbacks){ -internalInstance._pendingCallbacks.push(callback);}else -{ -internalInstance._pendingCallbacks=[callback];} - - - - - -enqueueUpdate(internalInstance);}, - - -enqueueCallbackInternal:function(internalInstance,callback){ -invariant( -typeof callback==='function', -'enqueueCallback(...): You called `setProps`, `replaceProps`, '+ -'`setState`, `replaceState`, or `forceUpdate` with a callback that '+ -'isn\'t callable.'); - -if(internalInstance._pendingCallbacks){ -internalInstance._pendingCallbacks.push(callback);}else -{ -internalInstance._pendingCallbacks=[callback];} - -enqueueUpdate(internalInstance);}, - - - - - - - - - - - - - - - -enqueueForceUpdate:function(publicInstance){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'forceUpdate'); - - -if(!internalInstance){ -return;} - - -internalInstance._pendingForceUpdate=true; - -enqueueUpdate(internalInstance);}, - - - - - - - - - - - - - -enqueueReplaceState:function(publicInstance,completeState){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'replaceState'); - - -if(!internalInstance){ -return;} - - -internalInstance._pendingStateQueue=[completeState]; -internalInstance._pendingReplaceState=true; - -enqueueUpdate(internalInstance);}, - - - - - - - - - - - - -enqueueSetState:function(publicInstance,partialState){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'setState'); - - -if(!internalInstance){ -return;} - - -var queue= -internalInstance._pendingStateQueue||( -internalInstance._pendingStateQueue=[]); -queue.push(partialState); - -enqueueUpdate(internalInstance);}, - - - - - - - - - -enqueueSetProps:function(publicInstance,partialProps){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'setProps'); - -if(!internalInstance){ -return;} - -ReactUpdateQueue.enqueueSetPropsInternal(internalInstance,partialProps);}, - - -enqueueSetPropsInternal:function(internalInstance,partialProps){ -var topLevelWrapper=internalInstance._topLevelWrapper; -invariant( -topLevelWrapper, -'setProps(...): You called `setProps` on a '+ -'component with a parent. This is an anti-pattern since props will '+ -'get reactively updated when rendered. Instead, change the owner\'s '+ -'`render` method to pass the correct value as props to the component '+ -'where it is created.'); - - - - -var wrapElement=topLevelWrapper._pendingElement|| -topLevelWrapper._currentElement; -var element=wrapElement.props; -var props=assign({},element.props,partialProps); -topLevelWrapper._pendingElement=ReactElement.cloneAndReplaceProps( -wrapElement, -ReactElement.cloneAndReplaceProps(element,props)); - - -enqueueUpdate(topLevelWrapper);}, - - - - - - - - - -enqueueReplaceProps:function(publicInstance,props){ -var internalInstance=getInternalInstanceReadyForUpdate( -publicInstance, -'replaceProps'); - -if(!internalInstance){ -return;} - -ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance,props);}, - - -enqueueReplacePropsInternal:function(internalInstance,props){ -var topLevelWrapper=internalInstance._topLevelWrapper; -invariant( -topLevelWrapper, -'replaceProps(...): You called `replaceProps` on a '+ -'component with a parent. This is an anti-pattern since props will '+ -'get reactively updated when rendered. Instead, change the owner\'s '+ -'`render` method to pass the correct value as props to the component '+ -'where it is created.'); - - - - -var wrapElement=topLevelWrapper._pendingElement|| -topLevelWrapper._currentElement; -var element=wrapElement.props; -topLevelWrapper._pendingElement=ReactElement.cloneAndReplaceProps( -wrapElement, -ReactElement.cloneAndReplaceProps(element,props)); - - -enqueueUpdate(topLevelWrapper);}, - - -enqueueElementInternal:function(internalInstance,newElement){ -internalInstance._pendingElement=newElement; -enqueueUpdate(internalInstance);}}; - - - - -module.exports=ReactUpdateQueue; -}); -__d('ReactUpdates',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var CallbackQueue=require('CallbackQueue'); -var PooledClass=require('PooledClass'); -var ReactPerf=require('ReactPerf'); -var ReactReconciler=require('ReactReconciler'); -var Transaction=require('Transaction'); - -var assign=require('Object.assign'); -var invariant=require('invariant'); - -var dirtyComponents=[]; -var asapCallbackQueue=CallbackQueue.getPooled(); -var asapEnqueued=false; - -var batchingStrategy=null; - -function ensureInjected(){ -invariant( -ReactUpdates.ReactReconcileTransaction&&batchingStrategy, -'ReactUpdates: must inject a reconcile transaction class and batching '+ -'strategy');} - - - -var NESTED_UPDATES={ -initialize:function(){ -this.dirtyComponentsLength=dirtyComponents.length;}, - -close:function(){ -if(this.dirtyComponentsLength!==dirtyComponents.length){ - - - - - -dirtyComponents.splice(0,this.dirtyComponentsLength); -flushBatchedUpdates();}else -{ -dirtyComponents.length=0;}}}; - - - - -var UPDATE_QUEUEING={ -initialize:function(){ -this.callbackQueue.reset();}, - -close:function(){ -this.callbackQueue.notifyAll();}}; - - - -var TRANSACTION_WRAPPERS=[NESTED_UPDATES,UPDATE_QUEUEING]; - -function ReactUpdatesFlushTransaction(){ -this.reinitializeTransaction(); -this.dirtyComponentsLength=null; -this.callbackQueue=CallbackQueue.getPooled(); -this.reconcileTransaction= -ReactUpdates.ReactReconcileTransaction.getPooled(false);} - - -assign( -ReactUpdatesFlushTransaction.prototype, -Transaction.Mixin, -{ -getTransactionWrappers:function(){ -return TRANSACTION_WRAPPERS;}, - - -destructor:function(){ -this.dirtyComponentsLength=null; -CallbackQueue.release(this.callbackQueue); -this.callbackQueue=null; -ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); -this.reconcileTransaction=null;}, - - -perform:function(method,scope,a){ - - -return Transaction.Mixin.perform.call( -this, -this.reconcileTransaction.perform, -this.reconcileTransaction, -method, -scope, -a);}}); - - - - - -PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); - -function batchedUpdates(callback,a,b,c,d,e){ -ensureInjected(); -batchingStrategy.batchedUpdates(callback,a,b,c,d,e);} - - - - - - - - - -function mountOrderComparator(c1,c2){ -return c1._mountOrder-c2._mountOrder;} - - -function runBatchedUpdates(transaction){ -var len=transaction.dirtyComponentsLength; -invariant( -len===dirtyComponents.length, -'Expected flush transaction\'s stored dirty-components length (%s) to '+ -'match dirty-components array length (%s).', -len, -dirtyComponents.length); - - - - - -dirtyComponents.sort(mountOrderComparator); - -for(var i=0;i component.'); - -this._rootNodeID=rootID; -var tag=ReactNativeTagHandles.allocateTag(); -var nativeTopRootID=ReactNativeTagHandles.getNativeTopRootIDFromNodeID(rootID); -UIManager.createView( -tag, -'RCTRawText', -nativeTopRootID?ReactNativeTagHandles.rootNodeIDToTag[nativeTopRootID]:null, -{text:this._stringText}); - -return { -rootNodeID:rootID, -tag:tag};}, - - - -receiveComponent:function(nextText,transaction,context){ -if(nextText!==this._currentElement){ -this._currentElement=nextText; -var nextStringText=''+nextText; -if(nextStringText!==this._stringText){ -this._stringText=nextStringText; -UIManager.updateView( -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID( -this._rootNodeID), - -'RCTRawText', -{text:this._stringText});}}}, - - - - - -unmountComponent:function(){ -this._currentElement=null; -this._stringText=null; -this._rootNodeID=null;}}); - - - - -module.exports=ReactNativeTextComponent; -}); -__d('RCTDebugComponentOwnership',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - -var BatchedBridge=require('BatchedBridge'); -var DebugComponentOwnershipModule=require('NativeModules').DebugComponentOwnershipModule; -var InspectorUtils=require('InspectorUtils'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); - -function componentToString(component){ -return component.getName?component.getName():'Unknown';} - - -function getRootTagForTag(tag){ -var rootNodeID=ReactNativeTagHandles.tagToRootNodeID[tag]; -if(!rootNodeID){ -return null;} - -var rootID=ReactNativeTagHandles.getNativeTopRootIDFromNodeID(rootNodeID); -if(!rootID){ -return null;} - -return ReactNativeTagHandles.rootNodeIDToTag[rootID];} - - -var RCTDebugComponentOwnership={ - - - - - - - - -getOwnerHierarchy:function(requestID,tag){ -var rootTag=getRootTagForTag(tag); -var instance=InspectorUtils.findInstanceByNativeTag(rootTag,tag); -var ownerHierarchy=instance? -InspectorUtils.getOwnerHierarchy(instance).map(componentToString): -null; -DebugComponentOwnershipModule.receiveOwnershipHierarchy(requestID,tag,ownerHierarchy);}}; - - - -BatchedBridge.registerCallableModule( -'RCTDebugComponentOwnership', -RCTDebugComponentOwnership); - - -module.exports=RCTDebugComponentOwnership; -}); -__d('InspectorUtils',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -var ReactInstanceHandles=require('ReactInstanceHandles'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactNativeMount=require('ReactNativeMount'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); - -function traverseOwnerTreeUp(hierarchy,instance){ -if(instance){ -hierarchy.unshift(instance); -traverseOwnerTreeUp(hierarchy,instance._currentElement._owner);}} - - - -function findInstance(component,targetID){ -if(targetID===findRootNodeID(component)){ -return component;} - -if(component._renderedComponent){ -return findInstance(component._renderedComponent,targetID);}else -{ -for(var key in component._renderedChildren){ -var child=component._renderedChildren[key]; -if(ReactInstanceHandles.isAncestorIDOf(findRootNodeID(child),targetID)){ -var instance=findInstance(child,targetID); -if(instance){ -return instance;}}}}} - - - - - - -function findRootNodeID(component){ -var internalInstance=ReactInstanceMap.get(component); -return internalInstance?internalInstance._rootNodeID:component._rootNodeID;} - - -function findInstanceByNativeTag(rootTag,nativeTag){ -var containerID=ReactNativeTagHandles.tagToRootNodeID[rootTag]; -var rootInstance=ReactNativeMount._instancesByContainerID[containerID]; -var targetID=ReactNativeTagHandles.tagToRootNodeID[nativeTag]; -if(!targetID){ -return undefined;} - -return findInstance(rootInstance,targetID);} - - -function getOwnerHierarchy(instance){ -var hierarchy=[]; -traverseOwnerTreeUp(hierarchy,instance); -return hierarchy;} - - -module.exports={findInstanceByNativeTag:findInstanceByNativeTag,getOwnerHierarchy:getOwnerHierarchy}; -}); -__d('PerformanceLogger',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -var BatchedBridge=require('BatchedBridge'); - -var performanceNow=require('performanceNow'); - -var timespans={}; -var extras={}; - - - - - -var PerformanceLogger={ -addTimespan:function(key,lengthInMs,description){ -if(timespans[key]){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to add a timespan that already exists ', -key);} - - -return;} - - -timespans[key]={ -description:description, -totalTime:lengthInMs};}, - - - -startTimespan:function(key,description){ -if(timespans[key]){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to start a timespan that already exists ', -key);} - - -return;} - - -timespans[key]={ -description:description, -startTime:performanceNow()};}, - - - -stopTimespan:function(key){ -if(!timespans[key]||!timespans[key].startTime){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to end a timespan that has not started ', -key);} - - -return;} - -if(timespans[key].endTime){ -if(__DEV__){ -console.log( -'PerformanceLogger: Attempting to end a timespan that has already ended ', -key);} - - -return;} - - -timespans[key].endTime=performanceNow(); -timespans[key].totalTime= -timespans[key].endTime-timespans[key].startTime;}, - - -clear:function(){ -timespans={}; -extras={};}, - - -clearExceptTimespans:function(keys){ -timespans=Object.keys(timespans).reduce(function(previous,key){ -if(keys.indexOf(key)!==-1){ -previous[key]=timespans[key];} - -return previous;}, -{}); -extras={};}, - - -getTimespans:function(){ -return timespans;}, - - -hasTimespan:function(key){ -return !!timespans[key];}, - - -logTimespans:function(){ -for(var key in timespans){ -if(timespans[key].totalTime){ -console.log(key+': '+timespans[key].totalTime+'ms');}}}, - - - - -addTimespans:function(newTimespans,labels){ -for(var i=0,l=newTimespans.length;i-1, -'EventPluginRegistry: Cannot inject event plugins that do not exist in '+ -'the plugin ordering, `%s`.', -pluginName); - -if(EventPluginRegistry.plugins[pluginIndex]){ -continue;} - -invariant( -PluginModule.extractEvents, -'EventPluginRegistry: Event plugins must implement an `extractEvents` '+ -'method, but `%s` does not.', -pluginName); - -EventPluginRegistry.plugins[pluginIndex]=PluginModule; -var publishedEvents=PluginModule.eventTypes; -for(var eventName in publishedEvents){ -invariant( -publishEventForPlugin( -publishedEvents[eventName], -PluginModule, -eventName), - -'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', -eventName, -pluginName);}}} - - - - - - - - - - - - - -function publishEventForPlugin(dispatchConfig,PluginModule,eventName){ -invariant( -!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), -'EventPluginHub: More than one plugin attempted to publish the same '+ -'event name, `%s`.', -eventName); - -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;} - - - - - - - - - - -function publishRegistrationName(registrationName,PluginModule,eventName){ -invariant( -!EventPluginRegistry.registrationNameModules[registrationName], -'EventPluginHub: More than one plugin attempted to publish the same '+ -'registration name, `%s`.', -registrationName); - -EventPluginRegistry.registrationNameModules[registrationName]=PluginModule; -EventPluginRegistry.registrationNameDependencies[registrationName]= -PluginModule.eventTypes[eventName].dependencies;} - - - - - - - -var EventPluginRegistry={ - - - - -plugins:[], - - - - -eventNameDispatchConfigs:{}, - - - - -registrationNameModules:{}, - - - - -registrationNameDependencies:{}, - - - - - - - - - - -injectEventPluginOrder:function(InjectedEventPluginOrder){ -invariant( -!EventPluginOrder, -'EventPluginRegistry: Cannot inject event plugin ordering more than '+ -'once. You are likely trying to load more than one copy of React.'); - - -EventPluginOrder=Array.prototype.slice.call(InjectedEventPluginOrder); -recomputePluginOrdering();}, - - - - - - - - - - - - -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){ -invariant( -!namesToPlugins[pluginName], -'EventPluginRegistry: Cannot inject two different event plugins '+ -'using the same name, `%s`.', -pluginName); - -namesToPlugins[pluginName]=PluginModule; -isOrderingDirty=true;}} - - -if(isOrderingDirty){ -recomputePluginOrdering();}}, - - - - - - - - - - -getPluginModuleForEvent:function(event){ -var dispatchConfig=event.dispatchConfig; -if(dispatchConfig.registrationName){ -return EventPluginRegistry.registrationNameModules[ -dispatchConfig.registrationName]|| -null;} - -for(var phase in dispatchConfig.phasedRegistrationNames){ -if(!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)){ -continue;} - -var PluginModule=EventPluginRegistry.registrationNameModules[ -dispatchConfig.phasedRegistrationNames[phase]]; - -if(PluginModule){ -return PluginModule;}} - - -return null;}, - - - - - - -_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];}}}}; - - - - - - -module.exports=EventPluginRegistry; -}); -__d('EventPluginUtils',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventConstants=require('EventConstants'); -var ReactErrorUtils=require('ReactErrorUtils'); - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - -var injection={ -Mount:null, -injectMount:function(InjectedMount){ -injection.Mount=InjectedMount; -if(__DEV__){ -warning( -InjectedMount&&InjectedMount.getNode&&InjectedMount.getID, -'EventPluginUtils.injection.injectMount(...): Injected Mount '+ -'module is missing getNode or getID.');}}}; - - - - - -var topLevelTypes=EventConstants.topLevelTypes; - -function isEndish(topLevelType){ -return topLevelType===topLevelTypes.topMouseUp|| -topLevelType===topLevelTypes.topTouchEnd|| -topLevelType===topLevelTypes.topTouchCancel;} - - -function isMoveish(topLevelType){ -return topLevelType===topLevelTypes.topMouseMove|| -topLevelType===topLevelTypes.topTouchMove;} - -function isStartish(topLevelType){ -return topLevelType===topLevelTypes.topMouseDown|| -topLevelType===topLevelTypes.topTouchStart;} - - - -var validateEventDispatches; -if(__DEV__){ -validateEventDispatches=function(event){ -var dispatchListeners=event._dispatchListeners; -var dispatchIDs=event._dispatchIDs; - -var listenersIsArr=Array.isArray(dispatchListeners); -var idsIsArr=Array.isArray(dispatchIDs); -var IDsLen=idsIsArr?dispatchIDs.length:dispatchIDs?1:0; -var listenersLen=listenersIsArr? -dispatchListeners.length: -dispatchListeners?1:0; - -warning( -idsIsArr===listenersIsArr&&IDsLen===listenersLen, -'EventPluginUtils: Invalid `event`.');};} - - - - - - - - - - - -function executeDispatch(event,simulated,listener,domID){ -var type=event.type||'unknown-event'; -event.currentTarget=injection.Mount.getNode(domID); -if(simulated){ -ReactErrorUtils.invokeGuardedCallbackWithCatch( -type, -listener, -event, -domID);}else - -{ -ReactErrorUtils.invokeGuardedCallback(type,listener,event,domID);} - -event.currentTarget=null;} - - - - - -function executeDispatchesInOrder(event,simulated){ -var dispatchListeners=event._dispatchListeners; -var dispatchIDs=event._dispatchIDs; -if(__DEV__){ -validateEventDispatches(event);} - -if(Array.isArray(dispatchListeners)){ -for(var i=0;i=len){ -this._iteratedObject=undefined; -return createIterResultObject(undefined,true);} - - -this._nextIndex=index+1; - -if(kind===KIND_KEY){ -return createIterResultObject(index,false);}else -if(kind===KIND_VALUE){ -return createIterResultObject(array[index],false);}else -if(kind===KIND_KEY_VAL){ -return createIterResultObject([index,array[index]],false);}}},{key: - - - - -'@@iterator',value:function iterator(){ -return this;}}]);return ArrayIterator;})();var - - - -StringIterator=(function(){ - -function StringIterator(string){babelHelpers.classCallCheck(this,StringIterator); -if(typeof string!=='string'){ -throw new TypeError('Object is not a string');} - -this._iteratedString=string; -this._nextIndex=0;}babelHelpers.createClass(StringIterator,[{key:'next',value:function next() - - - -{ -if(!this instanceof StringIterator){ -throw new TypeError('Object is not a StringIterator');} - - -if(this._iteratedString==null){ -return createIterResultObject(undefined,true);} - - -var index=this._nextIndex; -var s=this._iteratedString; -var len=s.length; - -if(index>=len){ -this._iteratedString=undefined; -return createIterResultObject(undefined,true);} - - -var ret; -var first=s.charCodeAt(index); - -if(first<0xD800||first>0xDBFF||index+1===len){ -ret=s[index];}else -{ -var second=s.charCodeAt(index+1); -if(second<0xDC00||second>0xDFFF){ -ret=s[index];}else -{ -ret=s[index]+s[index+1];}} - - - -this._nextIndex=index+ret.length; - -return createIterResultObject(ret,false);}},{key: - - - -'@@iterator',value:function iterator(){ -return this;}}]);return StringIterator;})(); - - - - -function createIterResultObject(value,done){ -return {value:value,done:done};} - - -return function(object,kind){ -if(typeof object==='string'){ -return new StringIterator(object);}else -if(Array.isArray(object)){ -return new ArrayIterator(object,kind||KIND_VALUE);}else -{ -return object[ITERATOR_SYMBOL]();}};})();}else - - - -{ -return function(object){ -return object[ITERATOR_SYMBOL]();};}})(); - - - - - - - - -babelHelpers.extends(toIterator,{ -KIND_KEY:KIND_KEY, -KIND_VALUE:KIND_VALUE, -KIND_KEY_VAL:KIND_KEY_VAL, -ITERATOR_SYMBOL:ITERATOR_SYMBOL}); - - -module.exports=toIterator; -}); -__d('_shouldPolyfillES6Collection',function(global, require, module, exports) { function - - - - - - - - - - - - - - - - - - - - - - - - -shouldPolyfillES6Collection(collectionName){ -var Collection=global[collectionName]; -if(Collection==null){ -return true;} - - - - - - -if(typeof global.Symbol!=='function'){ -return true;} - - -var proto=Collection.prototype; - - - - -return Collection==null|| -typeof Collection!=='function'|| -typeof proto.clear!=='function'|| -new Collection().size!==0|| -typeof proto.keys!=='function'|| -typeof proto.forEach!=='function';} - - -module.exports=shouldPolyfillES6Collection; -}); -__d('ReactNativeGlobalResponderHandler',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var UIManager=require('UIManager'); - -var ReactNativeGlobalResponderHandler={ -onChange:function(from,to,blockNativeResponder){ -if(to!==null){ -UIManager.setJSResponder( -ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(to), -blockNativeResponder);}else - -{ -UIManager.clearJSResponder();}}}; - - - - -module.exports=ReactNativeGlobalResponderHandler; -}); -__d('ResponderEventPlugin',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventConstants=require('EventConstants'); -var EventPluginUtils=require('EventPluginUtils'); -var EventPropagators=require('EventPropagators'); -var ReactInstanceHandles=require('ReactInstanceHandles'); -var ResponderSyntheticEvent=require('ResponderSyntheticEvent'); -var ResponderTouchHistoryStore=require('ResponderTouchHistoryStore'); - -var accumulate=require('accumulate'); -var invariant=require('invariant'); -var keyOf=require('keyOf'); - -var isStartish=EventPluginUtils.isStartish; -var isMoveish=EventPluginUtils.isMoveish; -var isEndish=EventPluginUtils.isEndish; -var executeDirectDispatch=EventPluginUtils.executeDirectDispatch; -var hasDispatches=EventPluginUtils.hasDispatches; -var executeDispatchesInOrderStopAtTrue= -EventPluginUtils.executeDispatchesInOrderStopAtTrue; - - - - - -var responderID=null; - - - - - -var trackedTouchCount=0; - - - - -var previousActiveTouches=0; - -var changeResponder=function(nextResponderID,blockNativeResponder){ -var oldResponderID=responderID; -responderID=nextResponderID; -if(ResponderEventPlugin.GlobalResponderHandler!==null){ -ResponderEventPlugin.GlobalResponderHandler.onChange( -oldResponderID, -nextResponderID, -blockNativeResponder);}}; - - - - -var eventTypes={ - - - - -startShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onStartShouldSetResponder:null}), -captured:keyOf({onStartShouldSetResponderCapture:null})}}, - - - - - - - - - - - - -scrollShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onScrollShouldSetResponder:null}), -captured:keyOf({onScrollShouldSetResponderCapture:null})}}, - - - - - - - - - - -selectionChangeShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onSelectionChangeShouldSetResponder:null}), -captured:keyOf({onSelectionChangeShouldSetResponderCapture:null})}}, - - - - - - - -moveShouldSetResponder:{ -phasedRegistrationNames:{ -bubbled:keyOf({onMoveShouldSetResponder:null}), -captured:keyOf({onMoveShouldSetResponderCapture:null})}}, - - - - - - -responderStart:{registrationName:keyOf({onResponderStart:null})}, -responderMove:{registrationName:keyOf({onResponderMove:null})}, -responderEnd:{registrationName:keyOf({onResponderEnd:null})}, -responderRelease:{registrationName:keyOf({onResponderRelease:null})}, -responderTerminationRequest:{ -registrationName:keyOf({onResponderTerminationRequest:null})}, - -responderGrant:{registrationName:keyOf({onResponderGrant:null})}, -responderReject:{registrationName:keyOf({onResponderReject:null})}, -responderTerminate:{registrationName:keyOf({onResponderTerminate:null})}}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function setResponderAndExtractTransfer( -topLevelType, -topLevelTargetID, -nativeEvent, -nativeEventTarget){ -var shouldSetEventType= -isStartish(topLevelType)?eventTypes.startShouldSetResponder: -isMoveish(topLevelType)?eventTypes.moveShouldSetResponder: -topLevelType===EventConstants.topLevelTypes.topSelectionChange? -eventTypes.selectionChangeShouldSetResponder: -eventTypes.scrollShouldSetResponder; - - -var bubbleShouldSetFrom=!responderID? -topLevelTargetID: -ReactInstanceHandles.getFirstCommonAncestorID(responderID,topLevelTargetID); - - - - - -var skipOverBubbleShouldSetFrom=bubbleShouldSetFrom===responderID; -var shouldSetEvent=ResponderSyntheticEvent.getPooled( -shouldSetEventType, -bubbleShouldSetFrom, -nativeEvent, -nativeEventTarget); - -shouldSetEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -if(skipOverBubbleShouldSetFrom){ -EventPropagators.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent);}else -{ -EventPropagators.accumulateTwoPhaseDispatches(shouldSetEvent);} - -var wantsResponderID=executeDispatchesInOrderStopAtTrue(shouldSetEvent); -if(!shouldSetEvent.isPersistent()){ -shouldSetEvent.constructor.release(shouldSetEvent);} - - -if(!wantsResponderID||wantsResponderID===responderID){ -return null;} - -var extracted; -var grantEvent=ResponderSyntheticEvent.getPooled( -eventTypes.responderGrant, -wantsResponderID, -nativeEvent, -nativeEventTarget); - -grantEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; - -EventPropagators.accumulateDirectDispatches(grantEvent); -var blockNativeResponder=executeDirectDispatch(grantEvent)===true; -if(responderID){ - -var terminationRequestEvent=ResponderSyntheticEvent.getPooled( -eventTypes.responderTerminationRequest, -responderID, -nativeEvent, -nativeEventTarget); - -terminationRequestEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(terminationRequestEvent); -var shouldSwitch=!hasDispatches(terminationRequestEvent)|| -executeDirectDispatch(terminationRequestEvent); -if(!terminationRequestEvent.isPersistent()){ -terminationRequestEvent.constructor.release(terminationRequestEvent);} - - -if(shouldSwitch){ -var terminateType=eventTypes.responderTerminate; -var terminateEvent=ResponderSyntheticEvent.getPooled( -terminateType, -responderID, -nativeEvent, -nativeEventTarget); - -terminateEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(terminateEvent); -extracted=accumulate(extracted,[grantEvent,terminateEvent]); -changeResponder(wantsResponderID,blockNativeResponder);}else -{ -var rejectEvent=ResponderSyntheticEvent.getPooled( -eventTypes.responderReject, -wantsResponderID, -nativeEvent, -nativeEventTarget); - -rejectEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(rejectEvent); -extracted=accumulate(extracted,rejectEvent);}}else - -{ -extracted=accumulate(extracted,grantEvent); -changeResponder(wantsResponderID,blockNativeResponder);} - -return extracted;} - - - - - - - - - - -function canTriggerTransfer(topLevelType,topLevelTargetID,nativeEvent){ -return topLevelTargetID&&( - - - -topLevelType===EventConstants.topLevelTypes.topScroll&& -!nativeEvent.responderIgnoreScroll|| -trackedTouchCount>0&& -topLevelType===EventConstants.topLevelTypes.topSelectionChange|| -isStartish(topLevelType)|| -isMoveish(topLevelType));} - - - - - - - - - - -function noResponderTouches(nativeEvent){ -var touches=nativeEvent.touches; -if(!touches||touches.length===0){ -return true;} - -for(var i=0;i=0, -'Ended a touch event which was not counted in trackedTouchCount.');} - - - -ResponderTouchHistoryStore.recordTouchTrack(topLevelType,nativeEvent,nativeEventTarget); - -var extracted=canTriggerTransfer(topLevelType,topLevelTargetID,nativeEvent)? -setResponderAndExtractTransfer( -topLevelType, -topLevelTargetID, -nativeEvent, -nativeEventTarget): -null; - - - - - - - - - - -var isResponderTouchStart=responderID&&isStartish(topLevelType); -var isResponderTouchMove=responderID&&isMoveish(topLevelType); -var isResponderTouchEnd=responderID&&isEndish(topLevelType); -var incrementalTouch= -isResponderTouchStart?eventTypes.responderStart: -isResponderTouchMove?eventTypes.responderMove: -isResponderTouchEnd?eventTypes.responderEnd: -null; - -if(incrementalTouch){ -var gesture= -ResponderSyntheticEvent.getPooled( -incrementalTouch, -responderID, -nativeEvent, -nativeEventTarget); - -gesture.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(gesture); -extracted=accumulate(extracted,gesture);} - - -var isResponderTerminate= -responderID&& -topLevelType===EventConstants.topLevelTypes.topTouchCancel; -var isResponderRelease= -responderID&& -!isResponderTerminate&& -isEndish(topLevelType)&& -noResponderTouches(nativeEvent); -var finalTouch= -isResponderTerminate?eventTypes.responderTerminate: -isResponderRelease?eventTypes.responderRelease: -null; -if(finalTouch){ -var finalEvent= -ResponderSyntheticEvent.getPooled(finalTouch,responderID,nativeEvent,nativeEventTarget); -finalEvent.touchHistory=ResponderTouchHistoryStore.touchHistory; -EventPropagators.accumulateDirectDispatches(finalEvent); -extracted=accumulate(extracted,finalEvent); -changeResponder(null);} - - -var numberActiveTouches= -ResponderTouchHistoryStore.touchHistory.numberActiveTouches; -if(ResponderEventPlugin.GlobalInteractionHandler&& -numberActiveTouches!==previousActiveTouches){ -ResponderEventPlugin.GlobalInteractionHandler.onChange( -numberActiveTouches);} - - -previousActiveTouches=numberActiveTouches; - -return extracted;}, - - -GlobalResponderHandler:null, -GlobalInteractionHandler:null, - -injection:{ - - - - - -injectGlobalResponderHandler:function(GlobalResponderHandler){ -ResponderEventPlugin.GlobalResponderHandler=GlobalResponderHandler;}, - - - - - - -injectGlobalInteractionHandler:function(GlobalInteractionHandler){ -ResponderEventPlugin.GlobalInteractionHandler=GlobalInteractionHandler;}}}; - - - - -module.exports=ResponderEventPlugin; -}); -__d('ResponderSyntheticEvent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var SyntheticEvent=require('SyntheticEvent'); - - - - - - -var ResponderEventInterface={ -touchHistory:function(nativeEvent){ -return null;}}; - - - - - - - - - -function ResponderSyntheticEvent(dispatchConfig,dispatchMarker,nativeEvent,nativeEventTarget){ -SyntheticEvent.call(this,dispatchConfig,dispatchMarker,nativeEvent,nativeEventTarget);} - - -SyntheticEvent.augmentClass(ResponderSyntheticEvent,ResponderEventInterface); - -module.exports=ResponderSyntheticEvent; -}); -__d('ResponderTouchHistoryStore',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventPluginUtils=require('EventPluginUtils'); - -var invariant=require('invariant'); - -var isMoveish=EventPluginUtils.isMoveish; -var isStartish=EventPluginUtils.isStartish; -var isEndish=EventPluginUtils.isEndish; - -var MAX_TOUCH_BANK=20; - - - - - - - - - - - - - - - - -var touchHistory={ -touchBank:[], -numberActiveTouches:0, - - - -indexOfSingleActiveTouch:-1, -mostRecentTimeStamp:0}; - - -var timestampForTouch=function(touch){ - - - -return touch.timeStamp||touch.timestamp;}; - - - - - - - -var initializeTouchData=function(touch){ -return { -touchActive:true, -startTimeStamp:timestampForTouch(touch), -startPageX:touch.pageX, -startPageY:touch.pageY, -currentPageX:touch.pageX, -currentPageY:touch.pageY, -currentTimeStamp:timestampForTouch(touch), -previousPageX:touch.pageX, -previousPageY:touch.pageY, -previousTimeStamp:timestampForTouch(touch)};}; - - - -var reinitializeTouchTrack=function(touchTrack,touch){ -touchTrack.touchActive=true; -touchTrack.startTimeStamp=timestampForTouch(touch); -touchTrack.startPageX=touch.pageX; -touchTrack.startPageY=touch.pageY; -touchTrack.currentPageX=touch.pageX; -touchTrack.currentPageY=touch.pageY; -touchTrack.currentTimeStamp=timestampForTouch(touch); -touchTrack.previousPageX=touch.pageX; -touchTrack.previousPageY=touch.pageY; -touchTrack.previousTimeStamp=timestampForTouch(touch);}; - - -var validateTouch=function(touch){ -var identifier=touch.identifier; -invariant(identifier!=null,'Touch object is missing identifier'); -if(identifier>MAX_TOUCH_BANK){ -console.warn( -'Touch identifier '+identifier+' is greater than maximum '+ -'supported '+MAX_TOUCH_BANK+' which causes performance issues '+ -'backfilling array locations for all of the indices.');}}; - - - - -var recordStartTouchData=function(touch){ -var touchBank=touchHistory.touchBank; -var identifier=touch.identifier; -var touchTrack=touchBank[identifier]; -if(__DEV__){ -validateTouch(touch);} - -if(touchTrack){ -reinitializeTouchTrack(touchTrack,touch);}else -{ -touchBank[touch.identifier]=initializeTouchData(touch);} - -touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}; - - -var recordMoveTouchData=function(touch){ -var touchBank=touchHistory.touchBank; -var touchTrack=touchBank[touch.identifier]; -if(__DEV__){ -validateTouch(touch); -invariant(touchTrack,'Touch data should have been recorded on start');} - -touchTrack.touchActive=true; -touchTrack.previousPageX=touchTrack.currentPageX; -touchTrack.previousPageY=touchTrack.currentPageY; -touchTrack.previousTimeStamp=touchTrack.currentTimeStamp; -touchTrack.currentPageX=touch.pageX; -touchTrack.currentPageY=touch.pageY; -touchTrack.currentTimeStamp=timestampForTouch(touch); -touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}; - - -var recordEndTouchData=function(touch){ -var touchBank=touchHistory.touchBank; -var touchTrack=touchBank[touch.identifier]; -if(__DEV__){ -validateTouch(touch); -invariant(touchTrack,'Touch data should have been recorded on start');} - -touchTrack.previousPageX=touchTrack.currentPageX; -touchTrack.previousPageY=touchTrack.currentPageY; -touchTrack.previousTimeStamp=touchTrack.currentTimeStamp; -touchTrack.currentPageX=touch.pageX; -touchTrack.currentPageY=touch.pageY; -touchTrack.currentTimeStamp=timestampForTouch(touch); -touchTrack.touchActive=false; -touchHistory.mostRecentTimeStamp=timestampForTouch(touch);}; - - -var ResponderTouchHistoryStore={ -recordTouchTrack:function(topLevelType,nativeEvent){ -var touchBank=touchHistory.touchBank; -if(isMoveish(topLevelType)){ -nativeEvent.changedTouches.forEach(recordMoveTouchData);}else -if(isStartish(topLevelType)){ -nativeEvent.changedTouches.forEach(recordStartTouchData); -touchHistory.numberActiveTouches=nativeEvent.touches.length; -if(touchHistory.numberActiveTouches===1){ -touchHistory.indexOfSingleActiveTouch=nativeEvent.touches[0].identifier;}}else - -if(isEndish(topLevelType)){ -nativeEvent.changedTouches.forEach(recordEndTouchData); -touchHistory.numberActiveTouches=nativeEvent.touches.length; -if(touchHistory.numberActiveTouches===1){ -for(var i=0;i1)t-=1; -if(t<1/6)return p+(q-p)*6*t; -if(t<1/2)return q; -if(t<2/3)return p+(q-p)*(2/3-t)*6; -return p;} - - -if(s===0){ -r=g=b=l;}else - -{ -var q=l<0.5?l*(1+s):l+s-l*s; -var p=2*l-q; -r=hue2rgb(p,q,h+1/3); -g=hue2rgb(p,q,h); -b=hue2rgb(p,q,h-1/3);} - - -return {r:r*255,g:g*255,b:b*255};} - - - - - - -function hsvToRgb(h,s,v){ -h=bound01(h,360)*6; -s=bound01(s,100); -v=bound01(v,100); - -var i=math.floor(h), -f=h-i, -p=v*(1-s), -q=v*(1-f*s), -t=v*(1-(1-f)*s), -mod=i%6, -r=[v,q,p,p,t,v][mod], -g=[t,v,v,q,p,p][mod], -b=[p,p,t,v,v,q][mod]; - -return {r:r*255,g:g*255,b:b*255};} - - - - - -var names=tinycolor.names={ -aliceblue:"f0f8ff", -antiquewhite:"faebd7", -aqua:"0ff", -aquamarine:"7fffd4", -azure:"f0ffff", -beige:"f5f5dc", -bisque:"ffe4c4", -black:"000", -blanchedalmond:"ffebcd", -blue:"00f", -blueviolet:"8a2be2", -brown:"a52a2a", -burlywood:"deb887", -burntsienna:"ea7e5d", -cadetblue:"5f9ea0", -chartreuse:"7fff00", -chocolate:"d2691e", -coral:"ff7f50", -cornflowerblue:"6495ed", -cornsilk:"fff8dc", -crimson:"dc143c", -cyan:"0ff", -darkblue:"00008b", -darkcyan:"008b8b", -darkgoldenrod:"b8860b", -darkgray:"a9a9a9", -darkgreen:"006400", -darkgrey:"a9a9a9", -darkkhaki:"bdb76b", -darkmagenta:"8b008b", -darkolivegreen:"556b2f", -darkorange:"ff8c00", -darkorchid:"9932cc", -darkred:"8b0000", -darksalmon:"e9967a", -darkseagreen:"8fbc8f", -darkslateblue:"483d8b", -darkslategray:"2f4f4f", -darkslategrey:"2f4f4f", -darkturquoise:"00ced1", -darkviolet:"9400d3", -deeppink:"ff1493", -deepskyblue:"00bfff", -dimgray:"696969", -dimgrey:"696969", -dodgerblue:"1e90ff", -firebrick:"b22222", -floralwhite:"fffaf0", -forestgreen:"228b22", -fuchsia:"f0f", -gainsboro:"dcdcdc", -ghostwhite:"f8f8ff", -gold:"ffd700", -goldenrod:"daa520", -gray:"808080", -green:"008000", -greenyellow:"adff2f", -grey:"808080", -honeydew:"f0fff0", -hotpink:"ff69b4", -indianred:"cd5c5c", -indigo:"4b0082", -ivory:"fffff0", -khaki:"f0e68c", -lavender:"e6e6fa", -lavenderblush:"fff0f5", -lawngreen:"7cfc00", -lemonchiffon:"fffacd", -lightblue:"add8e6", -lightcoral:"f08080", -lightcyan:"e0ffff", -lightgoldenrodyellow:"fafad2", -lightgray:"d3d3d3", -lightgreen:"90ee90", -lightgrey:"d3d3d3", -lightpink:"ffb6c1", -lightsalmon:"ffa07a", -lightseagreen:"20b2aa", -lightskyblue:"87cefa", -lightslategray:"789", -lightslategrey:"789", -lightsteelblue:"b0c4de", -lightyellow:"ffffe0", -lime:"0f0", -limegreen:"32cd32", -linen:"faf0e6", -magenta:"f0f", -maroon:"800000", -mediumaquamarine:"66cdaa", -mediumblue:"0000cd", -mediumorchid:"ba55d3", -mediumpurple:"9370db", -mediumseagreen:"3cb371", -mediumslateblue:"7b68ee", -mediumspringgreen:"00fa9a", -mediumturquoise:"48d1cc", -mediumvioletred:"c71585", -midnightblue:"191970", -mintcream:"f5fffa", -mistyrose:"ffe4e1", -moccasin:"ffe4b5", -navajowhite:"ffdead", -navy:"000080", -oldlace:"fdf5e6", -olive:"808000", -olivedrab:"6b8e23", -orange:"ffa500", -orangered:"ff4500", -orchid:"da70d6", -palegoldenrod:"eee8aa", -palegreen:"98fb98", -paleturquoise:"afeeee", -palevioletred:"db7093", -papayawhip:"ffefd5", -peachpuff:"ffdab9", -peru:"cd853f", -pink:"ffc0cb", -plum:"dda0dd", -powderblue:"b0e0e6", -purple:"800080", -rebeccapurple:"663399", -red:"f00", -rosybrown:"bc8f8f", -royalblue:"4169e1", -saddlebrown:"8b4513", -salmon:"fa8072", -sandybrown:"f4a460", -seagreen:"2e8b57", -seashell:"fff5ee", -sienna:"a0522d", -silver:"c0c0c0", -skyblue:"87ceeb", -slateblue:"6a5acd", -slategray:"708090", -slategrey:"708090", -snow:"fffafa", -springgreen:"00ff7f", -steelblue:"4682b4", -tan:"d2b48c", -teal:"008080", -thistle:"d8bfd8", -tomato:"ff6347", -turquoise:"40e0d0", -violet:"ee82ee", -wheat:"f5deb3", -white:"fff", -whitesmoke:"f5f5f5", -yellow:"ff0", -yellowgreen:"9acd32"}; - - - -function boundAlpha(a){ -a=parseFloat(a); - -if(isNaN(a)||a<0||a>1){ -a=1;} - - -return a;} - - - -function bound01(n,max){ -if(isOnePointZero(n)){n="100%";} - -var processPercent=isPercentage(n); -n=mathMin(max,mathMax(0,parseFloat(n))); - - -if(processPercent){ -n=parseInt(n*max,10)/100;} - - - -if(Math.abs(n-max)<0.000001){ -return 1;} - - - -return n%max/parseFloat(max);} - - - -function parseIntFromHex(val){ -return parseInt(val,16);} - - - - -function isOnePointZero(n){ -return typeof n=="string"&&n.indexOf('.')!=-1&&parseFloat(n)===1;} - - - -function isPercentage(n){ -return typeof n==="string"&&n.indexOf('%')!=-1;} - - - -function convertToPercentage(n){ -if(n<=1){ -n=n*100+"%";} - - -return n;} - - - -function convertHexToDecimal(h){ -return parseIntFromHex(h)/255;} - - -var matchers=(function(){ - -var CSS_INTEGER="[-\\+]?\\d+%?"; - - -var CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?"; - - -var CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")"; - - - - -var PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?"; -var PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?"; - -return { -rgb:new RegExp("rgb"+PERMISSIVE_MATCH3), -rgba:new RegExp("rgba"+PERMISSIVE_MATCH4), -hsl:new RegExp("hsl"+PERMISSIVE_MATCH3), -hsla:new RegExp("hsla"+PERMISSIVE_MATCH4), -hsv:new RegExp("hsv"+PERMISSIVE_MATCH3), -hsva:new RegExp("hsva"+PERMISSIVE_MATCH4), -hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, -hex4:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, -hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, -hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};})(); - - - - - - -function stringInputToObject(color){ -color=color.replace(trimLeft,'').replace(trimRight,'').toLowerCase(); -var named=false; -if(names[color]){ -color=names[color]; -named=true;}else - -if(color=='transparent'){ -return {r:0,g:0,b:0,a:0,format:"name"};} - - - - - - -var match; -if(match=matchers.rgb.exec(color)){ -return {r:match[1],g:match[2],b:match[3]};} - -if(match=matchers.rgba.exec(color)){ -return {r:match[1],g:match[2],b:match[3],a:match[4]};} - -if(match=matchers.hsl.exec(color)){ -return {h:match[1],s:match[2],l:match[3]};} - -if(match=matchers.hsla.exec(color)){ -return {h:match[1],s:match[2],l:match[3],a:match[4]};} - -if(match=matchers.hsv.exec(color)){ -return {h:match[1],s:match[2],v:match[3]};} - -if(match=matchers.hsva.exec(color)){ -return {h:match[1],s:match[2],v:match[3],a:match[4]};} - -if(match=matchers.hex8.exec(color)){ -return { -r:parseIntFromHex(match[1]), -g:parseIntFromHex(match[2]), -b:parseIntFromHex(match[3]), -a:convertHexToDecimal(match[4]), -format:named?"name":"hex"};} - - -if(match=matchers.hex6.exec(color)){ -return { -r:parseIntFromHex(match[1]), -g:parseIntFromHex(match[2]), -b:parseIntFromHex(match[3]), -format:named?"name":"hex"};} - - -if(match=matchers.hex4.exec(color)){ -return { -r:parseIntFromHex(match[1]+''+match[1]), -g:parseIntFromHex(match[2]+''+match[2]), -b:parseIntFromHex(match[3]+''+match[3]), -a:convertHexToDecimal(match[4]+''+match[4]), -format:named?"name":"hex"};} - - -if(match=matchers.hex3.exec(color)){ -return { -r:parseIntFromHex(match[1]+''+match[1]), -g:parseIntFromHex(match[2]+''+match[2]), -b:parseIntFromHex(match[3]+''+match[3]), -format:named?"name":"hex"};} - - - -return false;} - - -module.exports=tinycolor; -}); -__d('processTransform',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var MatrixMath=require('MatrixMath'); -var Platform=require('Platform'); - -var invariant=require('invariant'); -var stringifySafe=require('stringifySafe'); - - - - - - - - - -function processTransform(transform){ -var result=MatrixMath.createIdentityMatrix(); - -transform.forEach(function(transformation){ -var key=Object.keys(transformation)[0]; -var value=transformation[key]; -if(__DEV__){ -_validateTransform(key,value,transformation);} - - -switch(key){ -case 'matrix': -MatrixMath.multiplyInto(result,result,value); -break; -case 'perspective': -_multiplyTransform(result,MatrixMath.reusePerspectiveCommand,[value]); -break; -case 'rotateX': -_multiplyTransform(result,MatrixMath.reuseRotateXCommand,[_convertToRadians(value)]); -break; -case 'rotateY': -_multiplyTransform(result,MatrixMath.reuseRotateYCommand,[_convertToRadians(value)]); -break; -case 'rotate': -case 'rotateZ': -_multiplyTransform(result,MatrixMath.reuseRotateZCommand,[_convertToRadians(value)]); -break; -case 'scale': -_multiplyTransform(result,MatrixMath.reuseScaleCommand,[value]); -break; -case 'scaleX': -_multiplyTransform(result,MatrixMath.reuseScaleXCommand,[value]); -break; -case 'scaleY': -_multiplyTransform(result,MatrixMath.reuseScaleYCommand,[value]); -break; -case 'translate': -_multiplyTransform(result,MatrixMath.reuseTranslate3dCommand,[value[0],value[1],value[2]||0]); -break; -case 'translateX': -_multiplyTransform(result,MatrixMath.reuseTranslate2dCommand,[value,0]); -break; -case 'translateY': -_multiplyTransform(result,MatrixMath.reuseTranslate2dCommand,[0,value]); -break; -case 'skewX': -_multiplyTransform(result,MatrixMath.reuseSkewXCommand,[_convertToRadians(value)]); -break; -case 'skewY': -_multiplyTransform(result,MatrixMath.reuseSkewYCommand,[_convertToRadians(value)]); -break; -default: -throw new Error('Invalid transform name: '+key);}}); - - - - - - - -if(Platform.OS==='android'){ -return MatrixMath.decomposeMatrix(result);} - -return result;} - - - - - -function _multiplyTransform( -result, -matrixMathFunction, -args) -{ -var matrixToApply=MatrixMath.createIdentityMatrix(); -var argsWithIdentity=[matrixToApply].concat(args); -matrixMathFunction.apply(this,argsWithIdentity); -MatrixMath.multiplyInto(result,result,matrixToApply);} - - - - - - -function _convertToRadians(value){ -var floatValue=parseFloat(value,10); -return value.indexOf('rad')>-1?floatValue:floatValue*Math.PI/180;} - - -function _validateTransform(key,value,transformation){ -invariant( -!value.getValue, -'You passed an Animated.Value to a normal component. '+ -'You need to wrap that component in an Animated. For example, '+ -'replace by .'); - - -var multivalueTransforms=[ -'matrix', -'translate']; - -if(multivalueTransforms.indexOf(key)!==-1){ -invariant( -Array.isArray(value), -'Transform with key of %s must have an array as the value: %s', -key, -stringifySafe(transformation));} - - -switch(key){ -case 'matrix': -invariant( -value.length===9||value.length===16, -'Matrix transform must have a length of 9 (2d) or 16 (3d). '+ -'Provided matrix has a length of %s: %s', -value.length, -stringifySafe(transformation)); - -break; -case 'translate': -break; -case 'rotateX': -case 'rotateY': -case 'rotateZ': -case 'rotate': -case 'skewX': -case 'skewY': -invariant( -typeof value==='string', -'Transform with key of "%s" must be a string: %s', -key, -stringifySafe(transformation)); - -invariant( -value.indexOf('deg')>-1||value.indexOf('rad')>-1, -'Rotate transform must be expressed in degrees (deg) or radians '+ -'(rad): %s', -stringifySafe(transformation)); - -break; -default: -invariant( -typeof value==='number', -'Transform with key of "%s" must be a number: %s', -key, -stringifySafe(transformation));}} - - - - -module.exports=processTransform; -}); -__d('MatrixMath',function(global, require, module, exports) { 'use strict'; - - - - - - - - -var invariant=require('invariant'); - - - - - -var MatrixMath={ -createIdentityMatrix:function(){ -return [ -1,0,0,0, -0,1,0,0, -0,0,1,0, -0,0,0,1];}, - - - -createCopy:function(m){ -return [ -m[0],m[1],m[2],m[3], -m[4],m[5],m[6],m[7], -m[8],m[9],m[10],m[11], -m[12],m[13],m[14],m[15]];}, - - - -createOrthographic:function(left,right,bottom,top,near,far){ -var a=2/(right-left); -var b=2/(top-bottom); -var c=-2/(far-near); - -var tx=-(right+left)/(right-left); -var ty=-(top+bottom)/(top-bottom); -var tz=-(far+near)/(far-near); - -return [ -a,0,0,0, -0,b,0,0, -0,0,c,0, -tx,ty,tz,1];}, - - - -createFrustum:function(left,right,bottom,top,near,far){ -var r_width=1/(right-left); -var r_height=1/(top-bottom); -var r_depth=1/(near-far); -var x=2*(near*r_width); -var y=2*(near*r_height); -var A=(right+left)*r_width; -var B=(top+bottom)*r_height; -var C=(far+near)*r_depth; -var D=2*(far*near*r_depth); -return [ -x,0,0,0, -0,y,0,0, -A,B,C,-1, -0,0,D,0];}, - - - -createPerspective:function(fovInRadians,aspect,near,far){ -var h=1/Math.tan(fovInRadians); -var r_depth=1/(near-far); -var C=(far+near)*r_depth; -var D=2*(far*near*r_depth); -return [ -h/aspect,0,0,0, -0,h,0,0, -0,0,C,-1, -0,0,D,0];}, - - - -createTranslate2d:function(x,y){ -var mat=MatrixMath.createIdentityMatrix(); -MatrixMath.reuseTranslate2dCommand(mat,x,y); -return mat;}, - - -reuseTranslate2dCommand:function(matrixCommand,x,y){ -matrixCommand[12]=x; -matrixCommand[13]=y;}, - - -reuseTranslate3dCommand:function(matrixCommand,x,y,z){ -matrixCommand[12]=x; -matrixCommand[13]=y; -matrixCommand[14]=z;}, - - -createScale:function(factor){ -var mat=MatrixMath.createIdentityMatrix(); -MatrixMath.reuseScaleCommand(mat,factor); -return mat;}, - - -reuseScaleCommand:function(matrixCommand,factor){ -matrixCommand[0]=factor; -matrixCommand[5]=factor;}, - - -reuseScale3dCommand:function(matrixCommand,x,y,z){ -matrixCommand[0]=x; -matrixCommand[5]=y; -matrixCommand[10]=z;}, - - -reusePerspectiveCommand:function(matrixCommand,p){ -matrixCommand[11]=-1/p;}, - - -reuseScaleXCommand:function(matrixCommand,factor){ -matrixCommand[0]=factor;}, - - -reuseScaleYCommand:function(matrixCommand,factor){ -matrixCommand[5]=factor;}, - - -reuseScaleZCommand:function(matrixCommand,factor){ -matrixCommand[10]=factor;}, - - -reuseRotateXCommand:function(matrixCommand,radians){ -matrixCommand[5]=Math.cos(radians); -matrixCommand[6]=Math.sin(radians); -matrixCommand[9]=-Math.sin(radians); -matrixCommand[10]=Math.cos(radians);}, - - -reuseRotateYCommand:function(matrixCommand,amount){ -matrixCommand[0]=Math.cos(amount); -matrixCommand[2]=-Math.sin(amount); -matrixCommand[8]=Math.sin(amount); -matrixCommand[10]=Math.cos(amount);}, - - - -reuseRotateZCommand:function(matrixCommand,radians){ -matrixCommand[0]=Math.cos(radians); -matrixCommand[1]=Math.sin(radians); -matrixCommand[4]=-Math.sin(radians); -matrixCommand[5]=Math.cos(radians);}, - - -createRotateZ:function(radians){ -var mat=MatrixMath.createIdentityMatrix(); -MatrixMath.reuseRotateZCommand(mat,radians); -return mat;}, - - -reuseSkewXCommand:function(matrixCommand,radians){ -matrixCommand[4]=Math.sin(radians); -matrixCommand[5]=Math.cos(radians);}, - - -reuseSkewYCommand:function(matrixCommand,radians){ -matrixCommand[0]=Math.cos(radians); -matrixCommand[1]=Math.sin(radians);}, - - -multiplyInto:function(out,a,b){ -var a00=a[0],a01=a[1],a02=a[2],a03=a[3], -a10=a[4],a11=a[5],a12=a[6],a13=a[7], -a20=a[8],a21=a[9],a22=a[10],a23=a[11], -a30=a[12],a31=a[13],a32=a[14],a33=a[15]; - -var b0=b[0],b1=b[1],b2=b[2],b3=b[3]; -out[0]=b0*a00+b1*a10+b2*a20+b3*a30; -out[1]=b0*a01+b1*a11+b2*a21+b3*a31; -out[2]=b0*a02+b1*a12+b2*a22+b3*a32; -out[3]=b0*a03+b1*a13+b2*a23+b3*a33; - -b0=b[4];b1=b[5];b2=b[6];b3=b[7]; -out[4]=b0*a00+b1*a10+b2*a20+b3*a30; -out[5]=b0*a01+b1*a11+b2*a21+b3*a31; -out[6]=b0*a02+b1*a12+b2*a22+b3*a32; -out[7]=b0*a03+b1*a13+b2*a23+b3*a33; - -b0=b[8];b1=b[9];b2=b[10];b3=b[11]; -out[8]=b0*a00+b1*a10+b2*a20+b3*a30; -out[9]=b0*a01+b1*a11+b2*a21+b3*a31; -out[10]=b0*a02+b1*a12+b2*a22+b3*a32; -out[11]=b0*a03+b1*a13+b2*a23+b3*a33; - -b0=b[12];b1=b[13];b2=b[14];b3=b[15]; -out[12]=b0*a00+b1*a10+b2*a20+b3*a30; -out[13]=b0*a01+b1*a11+b2*a21+b3*a31; -out[14]=b0*a02+b1*a12+b2*a22+b3*a32; -out[15]=b0*a03+b1*a13+b2*a23+b3*a33;}, - - -determinant:function(matrix){var _matrix=babelHelpers.slicedToArray( - - - - - -matrix,16);var m00=_matrix[0];var m01=_matrix[1];var m02=_matrix[2];var m03=_matrix[3];var m10=_matrix[4];var m11=_matrix[5];var m12=_matrix[6];var m13=_matrix[7];var m20=_matrix[8];var m21=_matrix[9];var m22=_matrix[10];var m23=_matrix[11];var m30=_matrix[12];var m31=_matrix[13];var m32=_matrix[14];var m33=_matrix[15]; -return ( -m03*m12*m21*m30-m02*m13*m21*m30- -m03*m11*m22*m30+m01*m13*m22*m30+ -m02*m11*m23*m30-m01*m12*m23*m30- -m03*m12*m20*m31+m02*m13*m20*m31+ -m03*m10*m22*m31-m00*m13*m22*m31- -m02*m10*m23*m31+m00*m12*m23*m31+ -m03*m11*m20*m32-m01*m13*m20*m32- -m03*m10*m21*m32+m00*m13*m21*m32+ -m01*m10*m23*m32-m00*m11*m23*m32- -m02*m11*m20*m33+m01*m12*m20*m33+ -m02*m10*m21*m33-m00*m12*m21*m33- -m01*m10*m22*m33+m00*m11*m22*m33);}, - - - - - - - - - - -inverse:function(matrix){ -var det=MatrixMath.determinant(matrix); -if(!det){ -return matrix;}var _matrix2=babelHelpers.slicedToArray( - - - - - - -matrix,16);var m00=_matrix2[0];var m01=_matrix2[1];var m02=_matrix2[2];var m03=_matrix2[3];var m10=_matrix2[4];var m11=_matrix2[5];var m12=_matrix2[6];var m13=_matrix2[7];var m20=_matrix2[8];var m21=_matrix2[9];var m22=_matrix2[10];var m23=_matrix2[11];var m30=_matrix2[12];var m31=_matrix2[13];var m32=_matrix2[14];var m33=_matrix2[15]; -return [ -(m12*m23*m31-m13*m22*m31+m13*m21*m32-m11*m23*m32-m12*m21*m33+m11*m22*m33)/det, -(m03*m22*m31-m02*m23*m31-m03*m21*m32+m01*m23*m32+m02*m21*m33-m01*m22*m33)/det, -(m02*m13*m31-m03*m12*m31+m03*m11*m32-m01*m13*m32-m02*m11*m33+m01*m12*m33)/det, -(m03*m12*m21-m02*m13*m21-m03*m11*m22+m01*m13*m22+m02*m11*m23-m01*m12*m23)/det, -(m13*m22*m30-m12*m23*m30-m13*m20*m32+m10*m23*m32+m12*m20*m33-m10*m22*m33)/det, -(m02*m23*m30-m03*m22*m30+m03*m20*m32-m00*m23*m32-m02*m20*m33+m00*m22*m33)/det, -(m03*m12*m30-m02*m13*m30-m03*m10*m32+m00*m13*m32+m02*m10*m33-m00*m12*m33)/det, -(m02*m13*m20-m03*m12*m20+m03*m10*m22-m00*m13*m22-m02*m10*m23+m00*m12*m23)/det, -(m11*m23*m30-m13*m21*m30+m13*m20*m31-m10*m23*m31-m11*m20*m33+m10*m21*m33)/det, -(m03*m21*m30-m01*m23*m30-m03*m20*m31+m00*m23*m31+m01*m20*m33-m00*m21*m33)/det, -(m01*m13*m30-m03*m11*m30+m03*m10*m31-m00*m13*m31-m01*m10*m33+m00*m11*m33)/det, -(m03*m11*m20-m01*m13*m20-m03*m10*m21+m00*m13*m21+m01*m10*m23-m00*m11*m23)/det, -(m12*m21*m30-m11*m22*m30-m12*m20*m31+m10*m22*m31+m11*m20*m32-m10*m21*m32)/det, -(m01*m22*m30-m02*m21*m30+m02*m20*m31-m00*m22*m31-m01*m20*m32+m00*m21*m32)/det, -(m02*m11*m30-m01*m12*m30-m02*m10*m31+m00*m12*m31+m01*m10*m32-m00*m11*m32)/det, -(m01*m12*m20-m02*m11*m20+m02*m10*m21-m00*m12*m21-m01*m10*m22+m00*m11*m22)/det];}, - - - - - - -transpose:function(m){ -return [ -m[0],m[4],m[8],m[12], -m[1],m[5],m[9],m[13], -m[2],m[6],m[10],m[14], -m[3],m[7],m[11],m[15]];}, - - - - - - -multiplyVectorByMatrix:function( -v, -m) -{var _v=babelHelpers.slicedToArray( -v,4);var vx=_v[0];var vy=_v[1];var vz=_v[2];var vw=_v[3]; -return [ -vx*m[0]+vy*m[4]+vz*m[8]+vw*m[12], -vx*m[1]+vy*m[5]+vz*m[9]+vw*m[13], -vx*m[2]+vy*m[6]+vz*m[10]+vw*m[14], -vx*m[3]+vy*m[7]+vz*m[11]+vw*m[15]];}, - - - - - - -v3Length:function(a){ -return Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);}, - - - - - -v3Normalize:function( -vector, -v3Length) -{ -var im=1/(v3Length||MatrixMath.v3Length(vector)); -return [ -vector[0]*im, -vector[1]*im, -vector[2]*im];}, - - - - - - - -v3Dot:function(a,b){ -return a[0]*b[0]+ -a[1]*b[1]+ -a[2]*b[2];}, - - - - - - -v3Combine:function( -a, -b, -aScale, -bScale) -{ -return [ -aScale*a[0]+bScale*b[0], -aScale*a[1]+bScale*b[1], -aScale*a[2]+bScale*b[2]];}, - - - - - - - -v3Cross:function(a,b){ -return [ -a[1]*b[2]-a[2]*b[1], -a[2]*b[0]-a[0]*b[2], -a[0]*b[1]-a[1]*b[0]];}, - - - - - - - - - - - - - - - - - - - -quaternionToDegreesXYZ:function(q,matrix,row){var _q=babelHelpers.slicedToArray( -q,4);var qx=_q[0];var qy=_q[1];var qz=_q[2];var qw=_q[3]; -var qw2=qw*qw; -var qx2=qx*qx; -var qy2=qy*qy; -var qz2=qz*qz; -var test=qx*qy+qz*qw; -var unit=qw2+qx2+qy2+qz2; -var conv=180/Math.PI; - -if(test>0.49999*unit){ -return [0,2*Math.atan2(qx,qw)*conv,90];} - -if(test<-0.49999*unit){ -return [0,-2*Math.atan2(qx,qw)*conv,-90];} - - -return [ -MatrixMath.roundTo3Places( -Math.atan2(2*qx*qw-2*qy*qz,1-2*qx2-2*qz2)*conv), - -MatrixMath.roundTo3Places( -Math.atan2(2*qy*qw-2*qx*qz,1-2*qy2-2*qz2)*conv), - -MatrixMath.roundTo3Places( -Math.asin(2*qx*qy+2*qz*qw)*conv)];}, - - - - - - - - -roundTo3Places:function(n){ -var arr=n.toString().split('e'); -return Math.round(arr[0]+'e'+(arr[1]?+arr[1]-3:3))*0.001;}, - - - - - - - - - - - - - -decomposeMatrix:function(transformMatrix){ - -invariant( -transformMatrix.length===16, -'Matrix decomposition needs a list of 3d matrix values, received %s', -transformMatrix); - - - -var perspective=[]; -var quaternion=[]; -var scale=[]; -var skew=[]; -var translation=[]; - - - -if(!transformMatrix[15]){ -return;} - -var matrix=[]; -var perspectiveMatrix=[]; -for(var i=0;i<4;i++){ -matrix.push([]); -for(var j=0;j<4;j++){ -var value=transformMatrix[i*4+j]/transformMatrix[15]; -matrix[i].push(value); -perspectiveMatrix.push(j===3?0:value);}} - - -perspectiveMatrix[15]=1; - - -if(!MatrixMath.determinant(perspectiveMatrix)){ -return;} - - - -if(matrix[0][3]!==0||matrix[1][3]!==0||matrix[2][3]!==0){ - - -var rightHandSide=[ -matrix[0][3], -matrix[1][3], -matrix[2][3], -matrix[3][3]]; - - - - -var inversePerspectiveMatrix=MatrixMath.inverse( -perspectiveMatrix); - -var transposedInversePerspectiveMatrix=MatrixMath.transpose( -inversePerspectiveMatrix); - -var perspective=MatrixMath.multiplyVectorByMatrix( -rightHandSide, -transposedInversePerspectiveMatrix);}else - -{ - -perspective[0]=perspective[1]=perspective[2]=0; -perspective[3]=1;} - - - -for(var i=0;i<3;i++){ -translation[i]=matrix[3][i];} - - - - -var row=[]; -for(i=0;i<3;i++){ -row[i]=[ -matrix[i][0], -matrix[i][1], -matrix[i][2]];} - - - - -scale[0]=MatrixMath.v3Length(row[0]); -row[0]=MatrixMath.v3Normalize(row[0],scale[0]); - - -skew[0]=MatrixMath.v3Dot(row[0],row[1]); -row[1]=MatrixMath.v3Combine(row[1],row[0],1.0,-skew[0]); - - -skew[0]=MatrixMath.v3Dot(row[0],row[1]); -row[1]=MatrixMath.v3Combine(row[1],row[0],1.0,-skew[0]); - - -scale[1]=MatrixMath.v3Length(row[1]); -row[1]=MatrixMath.v3Normalize(row[1],scale[1]); -skew[0]/=scale[1]; - - -skew[1]=MatrixMath.v3Dot(row[0],row[2]); -row[2]=MatrixMath.v3Combine(row[2],row[0],1.0,-skew[1]); -skew[2]=MatrixMath.v3Dot(row[1],row[2]); -row[2]=MatrixMath.v3Combine(row[2],row[1],1.0,-skew[2]); - - -scale[2]=MatrixMath.v3Length(row[2]); -row[2]=MatrixMath.v3Normalize(row[2],scale[2]); -skew[1]/=scale[2]; -skew[2]/=scale[2]; - - - - -var pdum3=MatrixMath.v3Cross(row[1],row[2]); -if(MatrixMath.v3Dot(row[0],pdum3)<0){ -for(i=0;i<3;i++){ -scale[i]*=-1; -row[i][0]*=-1; -row[i][1]*=-1; -row[i][2]*=-1;}} - - - - -quaternion[0]= -0.5*Math.sqrt(Math.max(1+row[0][0]-row[1][1]-row[2][2],0)); -quaternion[1]= -0.5*Math.sqrt(Math.max(1-row[0][0]+row[1][1]-row[2][2],0)); -quaternion[2]= -0.5*Math.sqrt(Math.max(1-row[0][0]-row[1][1]+row[2][2],0)); -quaternion[3]= -0.5*Math.sqrt(Math.max(1+row[0][0]+row[1][1]+row[2][2],0)); - -if(row[2][1]>row[1][2]){ -quaternion[0]=-quaternion[0];} - -if(row[0][2]>row[2][0]){ -quaternion[1]=-quaternion[1];} - -if(row[1][0]>row[0][1]){ -quaternion[2]=-quaternion[2];} - - - -var rotationDegrees; -if( -quaternion[0]<0.001&&quaternion[0]>=0&& -quaternion[1]<0.001&&quaternion[1]>=0) -{ - -rotationDegrees=[0,0,MatrixMath.roundTo3Places( -Math.atan2(row[0][1],row[0][0])*180/Math.PI)];}else - -{ -rotationDegrees=MatrixMath.quaternionToDegreesXYZ(quaternion,matrix,row);} - - - -return { -rotationDegrees:rotationDegrees, -perspective:perspective, -quaternion:quaternion, -scale:scale, -skew:skew, -translation:translation, - -rotate:rotationDegrees[2], -rotateX:rotationDegrees[0], -rotateY:rotationDegrees[1], -scaleX:scale[0], -scaleY:scale[1], -translateX:translation[0], -translateY:translation[1]};}}; - - - - - -module.exports=MatrixMath; -}); -__d('sizesDiffer',function(global, require, module, exports) { 'use strict'; - - - - - - -var dummySize={width:undefined,height:undefined}; - -var sizesDiffer=function(one,two){ -one=one||dummySize; -two=two||dummySize; -return one!==two&&( -one.width!==two.width|| -one.height!==two.height);}; - - - -module.exports=sizesDiffer; -}); -__d('ReactNativeViewAttributes',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeStyleAttributes=require('ReactNativeStyleAttributes'); - -var ReactNativeViewAttributes={}; - -ReactNativeViewAttributes.UIView={ -pointerEvents:true, -accessible:true, -accessibilityLabel:true, -accessibilityComponentType:true, -accessibilityLiveRegion:true, -accessibilityTraits:true, -importantForAccessibility:true, -testID:true, -renderToHardwareTextureAndroid:true, -shouldRasterizeIOS:true, -onLayout:true, -onAccessibilityTap:true, -onMagicTap:true, -collapsable:true, -needsOffscreenAlphaCompositing:true, -style:ReactNativeStyleAttributes}; - - -ReactNativeViewAttributes.RCTView=babelHelpers.extends({}, -ReactNativeViewAttributes.UIView,{ - - - - - - -removeClippedSubviews:true}); - - -module.exports=ReactNativeViewAttributes; -}); -__d('StyleSheetPropType',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var createStrictShapeTypeChecker=require('createStrictShapeTypeChecker'); -var flattenStyle=require('flattenStyle'); - -function StyleSheetPropType( -shape) -{ -var shapePropType=createStrictShapeTypeChecker(shape); -return function(props,propName,componentName,location){ -var newProps=props; -if(props[propName]){ - -newProps={}; -newProps[propName]=flattenStyle(props[propName]);} - -return shapePropType(newProps,propName,componentName,location);};} - - - -module.exports=StyleSheetPropType; -}); -__d('createStrictShapeTypeChecker',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); - -var invariant=require('invariant'); -var merge=require('merge'); - -function createStrictShapeTypeChecker( -shapeTypes) -{ -function checkType(isRequired,props,propName,componentName,location){ -if(!props[propName]){ -if(isRequired){ -invariant( -false, -'Required object `'+propName+'` was not specified in '+('`'+ -componentName+'`.'));} - - -return;} - -var propValue=props[propName]; -var propType=typeof propValue; -var locationName= -location&&ReactPropTypeLocationNames[location]||'(unknown)'; -if(propType!=='object'){ -invariant( -false, -'Invalid '+locationName+' `'+propName+'` of type `'+propType+'` '+('supplied to `'+ -componentName+'`, expected `object`.'));} - - - - -var allKeys=merge(props[propName],shapeTypes); -for(var key in allKeys){ -var checker=shapeTypes[key]; -if(!checker){ -invariant( -false, -'Invalid props.'+propName+' key `'+key+'` supplied to `'+componentName+'`.'+'\nBad object: '+ -JSON.stringify(props[propName],null,' ')+'\nValid keys: '+ -JSON.stringify(Object.keys(shapeTypes),null,' '));} - - -var error=checker(propValue,key,componentName,location); -if(error){ -invariant( -false, -error.message+'\nBad object: '+ -JSON.stringify(props[propName],null,' '));}}} - - - - -function chainedCheckType( -props, -propName, -componentName, -location) -{ -return checkType(false,props,propName,componentName,location);} - -chainedCheckType.isRequired=checkType.bind(null,true); -return chainedCheckType;} - - -module.exports=createStrictShapeTypeChecker; -}); -__d('requireNativeComponent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeStyleAttributes=require('ReactNativeStyleAttributes'); -var UIManager=require('UIManager'); -var UnimplementedView=require('UnimplementedView'); - -var createReactNativeComponentClass=require('createReactNativeComponentClass'); - -var insetsDiffer=require('insetsDiffer'); -var pointsDiffer=require('pointsDiffer'); -var matricesDiffer=require('matricesDiffer'); -var processColor=require('processColor'); -var resolveAssetSource=require('resolveAssetSource'); -var sizesDiffer=require('sizesDiffer'); -var verifyPropTypes=require('verifyPropTypes'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - -function requireNativeComponent( -viewName, -componentInterface, -extraConfig) -{ -var viewConfig=UIManager[viewName]; -if(!viewConfig||!viewConfig.NativeProps){ -warning(false,'Native component for "%s" does not exist',viewName); -return UnimplementedView;} - -var nativeProps=babelHelpers.extends({}, -UIManager.RCTView.NativeProps, -viewConfig.NativeProps); - -viewConfig.uiViewClassName=viewName; -viewConfig.validAttributes={}; -viewConfig.propTypes=componentInterface&&componentInterface.propTypes; -for(var key in nativeProps){ -var useAttribute=false; -var attribute={}; - -var differ=TypeToDifferMap[nativeProps[key]]; -if(differ){ -attribute.diff=differ; -useAttribute=true;} - - -var processor=TypeToProcessorMap[nativeProps[key]]; -if(processor){ -attribute.process=processor; -useAttribute=true;} - - -viewConfig.validAttributes[key]=useAttribute?attribute:true;} - - - - - - - -viewConfig.validAttributes.style=ReactNativeStyleAttributes; - -if(__DEV__){ -componentInterface&&verifyPropTypes( -componentInterface, -viewConfig, -extraConfig&&extraConfig.nativeOnly);} - - -return createReactNativeComponentClass(viewConfig);} - - -var TypeToDifferMap={ - -CATransform3D:matricesDiffer, -CGPoint:pointsDiffer, -CGSize:sizesDiffer, -UIEdgeInsets:insetsDiffer}; - - - - -var TypeToProcessorMap={ - -CGColor:processColor, -CGColorArray:processColor, -UIColor:processColor, -UIColorArray:processColor, -CGImage:resolveAssetSource, -UIImage:resolveAssetSource, -RCTImageSource:resolveAssetSource, - -Color:processColor}; - - -module.exports=requireNativeComponent; -}); -__d('verifyPropTypes',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeStyleAttributes=require('ReactNativeStyleAttributes'); - - - - - - - -function verifyPropTypes( -componentInterface, -viewConfig, -nativePropsToIgnore) -{ -if(!viewConfig){ -return;} - -var componentName=componentInterface.name|| -componentInterface.displayName|| -'unknown'; -if(!componentInterface.propTypes){ -throw new Error( -'`'+componentName+'` has no propTypes defined`');} - - - -var nativeProps=viewConfig.NativeProps; -for(var prop in nativeProps){ -if(!componentInterface.propTypes[prop]&& -!ReactNativeStyleAttributes[prop]&&( -!nativePropsToIgnore||!nativePropsToIgnore[prop])){ -var message; -if(componentInterface.propTypes.hasOwnProperty(prop)){ -message='`'+componentName+'` has incorrectly defined propType for native prop `'+ -viewConfig.uiViewClassName+'.'+prop+'` of native type `'+nativeProps[prop];}else -{ -message='`'+componentName+'` has no propType for native prop `'+ -viewConfig.uiViewClassName+'.'+prop+'` of native type `'+ -nativeProps[prop]+'`';} -; -throw new Error(message);}}} - - - - -module.exports=verifyPropTypes; -}); -__d('UnimplementedView',function(global, require, module, exports) { 'use strict'; - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); - -var UnimplementedView=React.createClass({displayName:'UnimplementedView', -setNativeProps:function(){}, - - - - -render:function(){ - -var View=require('View'); -return ( -React.createElement(View,{style:[styles.unimplementedView,this.props.style]}, -this.props.children));}}); - - - - - -var styles=StyleSheet.create({ -unimplementedView:{ -borderWidth:1, -borderColor:'red', -alignSelf:'flex-start'}}); - - - -module.exports=UnimplementedView; -}); -__d('StyleSheet',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var StyleSheetRegistry=require('StyleSheetRegistry'); -var StyleSheetValidation=require('StyleSheetValidation'); -var flattenStyle=require('flattenStyle');var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -StyleSheet=(function(){function StyleSheet(){babelHelpers.classCallCheck(this,StyleSheet);}babelHelpers.createClass(StyleSheet,null,[{key:'create',value:function create( - - -obj){ -var result={}; -for(var key in obj){ -StyleSheetValidation.validateStyle(key,obj); -result[key]=StyleSheetRegistry.registerStyle(obj[key]);} - -return result;}}]);return StyleSheet;})(); - - - - -StyleSheet.flatten=flattenStyle; - -module.exports=StyleSheet; -}); -__d('StyleSheetValidation',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ImageStylePropTypes=require('ImageStylePropTypes'); -var ReactPropTypeLocations=require('ReactPropTypeLocations'); -var TextStylePropTypes=require('TextStylePropTypes'); -var ViewStylePropTypes=require('ViewStylePropTypes'); - -var invariant=require('invariant');var - -StyleSheetValidation=(function(){function StyleSheetValidation(){babelHelpers.classCallCheck(this,StyleSheetValidation);}babelHelpers.createClass(StyleSheetValidation,null,[{key:'validateStyleProp',value:function validateStyleProp( -prop,style,caller){ -if(!__DEV__){ -return;} - -if(allStylePropTypes[prop]===undefined){ -var message1='"'+prop+'" is not a valid style property.'; -var message2='\nValid style props: '+ -JSON.stringify(Object.keys(allStylePropTypes).sort(),null,' '); -styleError(message1,style,caller,message2);} - -var error=allStylePropTypes[prop]( -style, -prop, -caller, -ReactPropTypeLocations.prop); - -if(error){ -styleError(error.message,style,caller);}}},{key:'validateStyle',value:function validateStyle( - - - -name,styles){ -if(!__DEV__){ -return;} - -for(var prop in styles[name]){ -StyleSheetValidation.validateStyleProp(prop,styles[name],'StyleSheet '+name);}}},{key:'addValidStylePropTypes',value:function addValidStylePropTypes( - - - -stylePropTypes){ -for(var key in stylePropTypes){ -allStylePropTypes[key]=stylePropTypes[key];}}}]);return StyleSheetValidation;})(); - - - - -var styleError=function(message1,style,caller,message2){ -invariant( -false, -message1+'\n'+(caller||'<>')+': '+ -JSON.stringify(style,null,' ')+(message2||''));}; - - - -var allStylePropTypes={}; - -StyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes); -StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes); -StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes); - -module.exports=StyleSheetValidation; -}); -__d('createReactNativeComponentClass',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var ReactNativeBaseComponent=require('ReactNativeBaseComponent'); - - - - - - - - - - - - -var createReactNativeComponentClass=function( -viewConfig) -{ -var Constructor=function(element){ -this._currentElement=element; - -this._rootNodeID=null; -this._renderedChildren=null;}; - -Constructor.displayName=viewConfig.uiViewClassName; -Constructor.viewConfig=viewConfig; -Constructor.propTypes=viewConfig.propTypes; -Constructor.prototype=new ReactNativeBaseComponent(viewConfig); -Constructor.prototype.constructor=Constructor; - -return Constructor;}; - - -module.exports=createReactNativeComponentClass; -}); -__d('ReactNativeBaseComponent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var ReactNativeAttributePayload=require('ReactNativeAttributePayload'); -var ReactNativeEventEmitter=require('ReactNativeEventEmitter'); -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var ReactMultiChild=require('ReactMultiChild'); -var UIManager=require('UIManager'); - -var deepFreezeAndThrowOnMutationInDev=require('deepFreezeAndThrowOnMutationInDev'); -var warning=require('warning'); - -var registrationNames=ReactNativeEventEmitter.registrationNames; -var putListener=ReactNativeEventEmitter.putListener; -var deleteListener=ReactNativeEventEmitter.deleteListener; -var deleteAllListeners=ReactNativeEventEmitter.deleteAllListeners; - - - - - - - - - - - - - - -var ReactNativeBaseComponent=function( -viewConfig) -{ -this.viewConfig=viewConfig;}; - - - - - - - - - - - - -var cachedIndexArray=function(size){ -var cachedResult=cachedIndexArray._cache[size]; -if(!cachedResult){ -var arr=[]; -for(var i=0;i=deviceScale){ -return scales[i];}} - - - - - - -return scales[scales.length-1]||1;} - - -function resolveAssetSource(source){ -if(typeof source==='object'){ -return source;} - - -var asset=AssetRegistry.getAssetByID(source); -if(asset){ -return assetToImageSource(asset);} - - -return null;} - - -function assetToImageSource(asset){ -var devServerURL=getDevServerURL(); -return { -__packager_asset:true, -width:asset.width, -height:asset.height, -uri:devServerURL?getPathOnDevserver(devServerURL,asset):getPathInArchive(asset), -scale:pickScale(asset.scales,PixelRatio.get())};} - - - -module.exports=resolveAssetSource; -module.exports.pickScale=pickScale; -}); -__d('AssetRegistry',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - -var assets=[]; - -function registerAsset(asset){ - - -return assets.push(asset);} - - -function getAssetByID(assetId){ -return assets[assetId-1];} - - -module.exports={registerAsset:registerAsset,getAssetByID:getAssetByID}; -}); -__d('PixelRatio',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Dimensions=require('Dimensions');var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -PixelRatio=(function(){function PixelRatio(){babelHelpers.classCallCheck(this,PixelRatio);}babelHelpers.createClass(PixelRatio,null,[{key:'get',value:function get() - - - - - - - - - - - - - - - - - - -{ -return Dimensions.get('window').scale;}},{key:'getFontScale',value:function getFontScale() - - - - - - - - - - - - - -{ -return Dimensions.get('window').fontScale||PixelRatio.get();}},{key:'getPixelSizeForLayoutSize',value:function getPixelSizeForLayoutSize( - - - - - - - -layoutSize){ -return Math.round(layoutSize*PixelRatio.get());}},{key:'startDetecting',value:function startDetecting() - - - -{}}]);return PixelRatio;})(); - - -module.exports=PixelRatio; -}); -__d('Dimensions',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var UIManager=require('UIManager'); - -var invariant=require('invariant'); - -var dimensions=UIManager.Dimensions; - - - - -if(dimensions&&dimensions.windowPhysicalPixels){ - -dimensions=JSON.parse(JSON.stringify(dimensions)); - -var windowPhysicalPixels=dimensions.windowPhysicalPixels; -dimensions.window={ -width:windowPhysicalPixels.width/windowPhysicalPixels.scale, -height:windowPhysicalPixels.height/windowPhysicalPixels.scale, -scale:windowPhysicalPixels.scale, -fontScale:windowPhysicalPixels.fontScale}; - - - -delete dimensions.windowPhysicalPixels;}var - - -Dimensions=(function(){function Dimensions(){babelHelpers.classCallCheck(this,Dimensions);}babelHelpers.createClass(Dimensions,null,[{key:'set',value:function set( - - - - - -dims){ -babelHelpers.extends(dimensions,dims); -return true;}},{key:'get',value:function get( - - - - - - - - - - - - - - - -dim){ -invariant(dimensions[dim],'No dimension set for key '+dim); -return dimensions[dim];}}]);return Dimensions;})(); - - - -module.exports=Dimensions; -}); -__d('ReactChildren',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var PooledClass=require('PooledClass'); -var ReactElement=require('ReactElement'); - -var emptyFunction=require('emptyFunction'); -var traverseAllChildren=require('traverseAllChildren'); - -var twoArgumentPooler=PooledClass.twoArgumentPooler; -var fourArgumentPooler=PooledClass.fourArgumentPooler; - - -var userProvidedKeyEscapeRegex=/\/(?!\/)/g; -function escapeUserProvidedKey(text){ -return (''+text).replace(userProvidedKeyEscapeRegex,'//');} - - - - - - - - - - - -function ForEachBookKeeping(forEachFunction,forEachContext){ -this.func=forEachFunction; -this.context=forEachContext; -this.count=0;} - -ForEachBookKeeping.prototype.destructor=function(){ -this.func=null; -this.context=null; -this.count=0;}; - -PooledClass.addPoolingTo(ForEachBookKeeping,twoArgumentPooler); - -function forEachSingleChild(bookKeeping,child,name){var -func=bookKeeping.func;var context=bookKeeping.context; -func.call(context,child,bookKeeping.count++);} - - - - - - - - - - - - -function forEachChildren(children,forEachFunc,forEachContext){ -if(children==null){ -return children;} - -var traverseContext= -ForEachBookKeeping.getPooled(forEachFunc,forEachContext); -traverseAllChildren(children,forEachSingleChild,traverseContext); -ForEachBookKeeping.release(traverseContext);} - - - - - - - - - - - - -function MapBookKeeping(mapResult,keyPrefix,mapFunction,mapContext){ -this.result=mapResult; -this.keyPrefix=keyPrefix; -this.func=mapFunction; -this.context=mapContext; -this.count=0;} - -MapBookKeeping.prototype.destructor=function(){ -this.result=null; -this.keyPrefix=null; -this.func=null; -this.context=null; -this.count=0;}; - -PooledClass.addPoolingTo(MapBookKeeping,fourArgumentPooler); - -function mapSingleChildIntoContext(bookKeeping,child,childKey){var -result=bookKeeping.result;var keyPrefix=bookKeeping.keyPrefix;var func=bookKeeping.func;var context=bookKeeping.context; - -var mappedChild=func.call(context,child,bookKeeping.count++); -if(Array.isArray(mappedChild)){ -mapIntoWithKeyPrefixInternal( -mappedChild, -result, -childKey, -emptyFunction.thatReturnsArgument);}else - -if(mappedChild!=null){ -if(ReactElement.isValidElement(mappedChild)){ -mappedChild=ReactElement.cloneAndReplaceKey( -mappedChild, - - -keyPrefix+( - -mappedChild!==child? -escapeUserProvidedKey(mappedChild.key||'')+'/': -'')+ - -childKey);} - - -result.push(mappedChild);}} - - - -function mapIntoWithKeyPrefixInternal(children,array,prefix,func,context){ -var escapedPrefix=''; -if(prefix!=null){ -escapedPrefix=escapeUserProvidedKey(prefix)+'/';} - -var traverseContext=MapBookKeeping.getPooled( -array, -escapedPrefix, -func, -context); - -traverseAllChildren(children,mapSingleChildIntoContext,traverseContext); -MapBookKeeping.release(traverseContext);} - - - - - - - - - - - - - -function mapChildren(children,func,context){ -if(children==null){ -return children;} - -var result=[]; -mapIntoWithKeyPrefixInternal(children,result,null,func,context); -return result;} - - - - -function forEachSingleChildDummy(traverseContext,child,name){ -return null;} - - - - - - - - - -function countChildren(children,context){ -return traverseAllChildren(children,forEachSingleChildDummy,null);} - - - - - - - -function toArray(children){ -var result=[]; -mapIntoWithKeyPrefixInternal( -children, -result, -null, -emptyFunction.thatReturnsArgument); - -return result;} - - - -var ReactChildren={ -forEach:forEachChildren, -map:mapChildren, -mapIntoWithKeyPrefixInternal:mapIntoWithKeyPrefixInternal, -count:countChildren, -toArray:toArray}; - - -module.exports=ReactChildren; -}); -__d('ReactClass',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactComponent=require('ReactComponent'); -var ReactElement=require('ReactElement'); -var ReactPropTypeLocations=require('ReactPropTypeLocations'); -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); -var ReactNoopUpdateQueue=require('ReactNoopUpdateQueue'); - -var assign=require('Object.assign'); -var emptyObject=require('emptyObject'); -var invariant=require('invariant'); -var keyMirror=require('keyMirror'); -var keyOf=require('keyOf'); -var warning=require('warning'); - -var MIXINS_KEY=keyOf({mixins:null}); - - - - -var SpecPolicy=keyMirror({ - - - -DEFINE_ONCE:null, - - - - -DEFINE_MANY:null, - - - -OVERRIDE_BASE:null, - - - - - -DEFINE_MANY_MERGED:null}); - - - -var injectedMixins=[]; - -var warnedSetProps=false; -function warnSetProps(){ -if(!warnedSetProps){ -warnedSetProps=true; -warning( -false, -'setProps(...) and replaceProps(...) are deprecated. '+ -'Instead, call render again at the top level.');}} - - - - - - - - - - - - - - - - - - - - - - - - - - -var ReactClassInterface={ - - - - - - - -mixins:SpecPolicy.DEFINE_MANY, - - - - - - - - -statics:SpecPolicy.DEFINE_MANY, - - - - - - - -propTypes:SpecPolicy.DEFINE_MANY, - - - - - - - -contextTypes:SpecPolicy.DEFINE_MANY, - - - - - - - -childContextTypes:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - -getDefaultProps:SpecPolicy.DEFINE_MANY_MERGED, - - - - - - - - - - - - - - - -getInitialState:SpecPolicy.DEFINE_MANY_MERGED, - - - - - -getChildContext:SpecPolicy.DEFINE_MANY_MERGED, - - - - - - - - - - - - - - - - - -render:SpecPolicy.DEFINE_ONCE, - - - - - - - - - - - - -componentWillMount:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - -componentDidMount:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - - - - - - - - -componentWillReceiveProps:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - - - - - - - - - -shouldComponentUpdate:SpecPolicy.DEFINE_ONCE, - - - - - - - - - - - - - - - - -componentWillUpdate:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - -componentDidUpdate:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - -componentWillUnmount:SpecPolicy.DEFINE_MANY, - - - - - - - - - - - - - - - -updateComponent:SpecPolicy.OVERRIDE_BASE}; - - - - - - - - - - - - -var RESERVED_SPEC_KEYS={ -displayName:function(Constructor,displayName){ -Constructor.displayName=displayName;}, - -mixins:function(Constructor,mixins){ -if(mixins){ -for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];} - - - -if(newThis!==component&&newThis!==null){ -warning( -false, -'bind(): React component methods may only be bound to the '+ -'component instance. See %s', -componentName);}else - -if(!args.length){ -warning( -false, -'bind(): You are binding a component method to the component. '+ -'React does this for you automatically in a high-performance '+ -'way, so you can safely remove this call. See %s', -componentName); - -return boundMethod;} - -var reboundMethod=_bind.apply(boundMethod,arguments); -reboundMethod.__reactBoundContext=component; -reboundMethod.__reactBoundMethod=method; -reboundMethod.__reactBoundArguments=args; -return reboundMethod;};} - - - -return boundMethod;} - - - - - - - -function bindAutoBindMethods(component){ -for(var autoBindKey in component.__reactAutoBindMap){ -if(component.__reactAutoBindMap.hasOwnProperty(autoBindKey)){ -var method=component.__reactAutoBindMap[autoBindKey]; -component[autoBindKey]=bindAutoBindMethod( -component, -method);}}} - - - - - - - - - -var ReactClassMixin={ - - - - - -replaceState:function(newState,callback){ -this.updater.enqueueReplaceState(this,newState); -if(callback){ -this.updater.enqueueCallback(this,callback);}}, - - - - - - - - - -isMounted:function(){ -return this.updater.isMounted(this);}, - - - - - - - - - - - -setProps:function(partialProps,callback){ -if(__DEV__){ -warnSetProps();} - -this.updater.enqueueSetProps(this,partialProps); -if(callback){ -this.updater.enqueueCallback(this,callback);}}, - - - - - - - - - - - - -replaceProps:function(newProps,callback){ -if(__DEV__){ -warnSetProps();} - -this.updater.enqueueReplaceProps(this,newProps); -if(callback){ -this.updater.enqueueCallback(this,callback);}}}; - - - - -var ReactClassComponent=function(){}; -assign( -ReactClassComponent.prototype, -ReactComponent.prototype, -ReactClassMixin); - - - - - - - -var ReactClass={ - - - - - - - - -createClass:function(spec){ -var Constructor=function(props,context,updater){ - - - -if(__DEV__){ -warning( -this instanceof Constructor, -'Something is calling a React component directly. Use a factory or '+ -'JSX instead. See: https://fb.me/react-legacyfactory');} - - - - -if(this.__reactAutoBindMap){ -bindAutoBindMethods(this);} - - -this.props=props; -this.context=context; -this.refs=emptyObject; -this.updater=updater||ReactNoopUpdateQueue; - -this.state=null; - - - - -var initialState=this.getInitialState?this.getInitialState():null; -if(__DEV__){ - -if(typeof initialState==='undefined'&& -this.getInitialState._isMockFunction){ - - -initialState=null;}} - - -invariant( -typeof initialState==='object'&&!Array.isArray(initialState), -'%s.getInitialState(): must return an object or null', -Constructor.displayName||'ReactCompositeComponent'); - - -this.state=initialState;}; - -Constructor.prototype=new ReactClassComponent(); -Constructor.prototype.constructor=Constructor; - -injectedMixins.forEach( -mixSpecIntoComponent.bind(null,Constructor)); - - -mixSpecIntoComponent(Constructor,spec); - - -if(Constructor.getDefaultProps){ -Constructor.defaultProps=Constructor.getDefaultProps();} - - -if(__DEV__){ - - - - -if(Constructor.getDefaultProps){ -Constructor.getDefaultProps.isReactClassApproved={};} - -if(Constructor.prototype.getInitialState){ -Constructor.prototype.getInitialState.isReactClassApproved={};}} - - - -invariant( -Constructor.prototype.render, -'createClass(...): Class specification must implement a `render` method.'); - - -if(__DEV__){ -warning( -!Constructor.prototype.componentShouldUpdate, -'%s has a method called '+ -'componentShouldUpdate(). Did you mean shouldComponentUpdate()? '+ -'The name is phrased as a question because the function is '+ -'expected to return a value.', -spec.displayName||'A component'); - -warning( -!Constructor.prototype.componentWillRecieveProps, -'%s has a method called '+ -'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', -spec.displayName||'A component');} - - - - -for(var methodName in ReactClassInterface){ -if(!Constructor.prototype[methodName]){ -Constructor.prototype[methodName]=null;}} - - - -return Constructor;}, - - -injection:{ -injectMixin:function(mixin){ -injectedMixins.push(mixin);}}}; - - - - - -module.exports=ReactClass; -}); -__d('ReactComponent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNoopUpdateQueue=require('ReactNoopUpdateQueue'); - -var canDefineProperty=require('canDefineProperty'); -var emptyObject=require('emptyObject'); -var invariant=require('invariant'); -var warning=require('warning'); - - - - -function ReactComponent(props,context,updater){ -this.props=props; -this.context=context; -this.refs=emptyObject; - - -this.updater=updater||ReactNoopUpdateQueue;} - - -ReactComponent.prototype.isReactComponent={}; - - - - - - - - - - - - - - - - - - - - - - - - - - -ReactComponent.prototype.setState=function(partialState,callback){ -invariant( -typeof partialState==='object'|| -typeof partialState==='function'|| -partialState==null, -'setState(...): takes an object of state variables to update or a '+ -'function which returns an object of state variables.'); - -if(__DEV__){ -warning( -partialState!=null, -'setState(...): You passed an undefined or null state object; '+ -'instead, use forceUpdate().');} - - -this.updater.enqueueSetState(this,partialState); -if(callback){ -this.updater.enqueueCallback(this,callback);}}; - - - - - - - - - - - - - - - - - -ReactComponent.prototype.forceUpdate=function(callback){ -this.updater.enqueueForceUpdate(this); -if(callback){ -this.updater.enqueueCallback(this,callback);}}; - - - - - - - - -if(__DEV__){ -var deprecatedAPIs={ -getDOMNode:[ -'getDOMNode', -'Use ReactDOM.findDOMNode(component) instead.'], - -isMounted:[ -'isMounted', -'Instead, make sure to clean up subscriptions and pending requests in '+ -'componentWillUnmount to prevent memory leaks.'], - -replaceProps:[ -'replaceProps', -'Instead, call render again at the top level.'], - -replaceState:[ -'replaceState', -'Refactor your code to use setState instead (see '+ -'https://github.com/facebook/react/issues/3236).'], - -setProps:[ -'setProps', -'Instead, call render again at the top level.']}; - - -var defineDeprecationWarning=function(methodName,info){ -if(canDefineProperty){ -Object.defineProperty(ReactComponent.prototype,methodName,{ -get:function(){ -warning( -false, -'%s(...) is deprecated in plain JavaScript React classes. %s', -info[0], -info[1]); - -return undefined;}});}}; - - - - -for(var fnName in deprecatedAPIs){ -if(deprecatedAPIs.hasOwnProperty(fnName)){ -defineDeprecationWarning(fnName,deprecatedAPIs[fnName]);}}} - - - - -module.exports=ReactComponent; -}); -__d('ReactNoopUpdateQueue',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var warning=require('warning'); - -function warnTDZ(publicInstance,callerName){ -if(__DEV__){ -warning( -false, -'%s(...): Can only update a mounted or mounting component. '+ -'This usually means you called %s() on an unmounted component. '+ -'This is a no-op. Please check the code for the %s component.', -callerName, -callerName, -publicInstance.constructor&&publicInstance.constructor.displayName||'');}} - - - - - - - -var ReactNoopUpdateQueue={ - - - - - - - - -isMounted:function(publicInstance){ -return false;}, - - - - - - - - - - -enqueueCallback:function(publicInstance,callback){}, - - - - - - - - - - - - - - -enqueueForceUpdate:function(publicInstance){ -warnTDZ(publicInstance,'forceUpdate');}, - - - - - - - - - - - - - -enqueueReplaceState:function(publicInstance,completeState){ -warnTDZ(publicInstance,'replaceState');}, - - - - - - - - - - - - -enqueueSetState:function(publicInstance,partialState){ -warnTDZ(publicInstance,'setState');}, - - - - - - - - - -enqueueSetProps:function(publicInstance,partialProps){ -warnTDZ(publicInstance,'setProps');}, - - - - - - - - - -enqueueReplaceProps:function(publicInstance,props){ -warnTDZ(publicInstance,'replaceProps');}}; - - - - -module.exports=ReactNoopUpdateQueue; -}); -__d('ReactElementValidator',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - -var ReactElement=require('ReactElement'); -var ReactPropTypeLocations=require('ReactPropTypeLocations'); -var ReactPropTypeLocationNames=require('ReactPropTypeLocationNames'); -var ReactCurrentOwner=require('ReactCurrentOwner'); - -var canDefineProperty=require('canDefineProperty'); -var getIteratorFn=require('getIteratorFn'); -var invariant=require('invariant'); -var warning=require('warning'); - -function getDeclarationErrorAddendum(){ -if(ReactCurrentOwner.current){ -var name=ReactCurrentOwner.current.getName(); -if(name){ -return ' Check the render method of `'+name+'`.';}} - - -return '';} - - - - - - - -var ownerHasKeyUseWarning={}; - -var loggedTypeFailures={}; - - - - - - - - - - - -function validateExplicitKey(element,parentType){ -if(!element._store||element._store.validated||element.key!=null){ -return;} - -element._store.validated=true; - -var addenda=getAddendaForKeyUse('uniqueKey',element,parentType); -if(addenda===null){ - -return;} - -warning( -false, -'Each child in an array or iterator should have a unique "key" prop.'+ -'%s%s%s', -addenda.parentOrOwner||'', -addenda.childOwner||'', -addenda.url||'');} - - - - - - - - - - - - - -function getAddendaForKeyUse(messageType,element,parentType){ -var addendum=getDeclarationErrorAddendum(); -if(!addendum){ -var parentName=typeof parentType==='string'? -parentType:parentType.displayName||parentType.name; -if(parentName){ -addendum=' Check the top-level render call using <'+parentName+'>.';}} - - - -var memoizer=ownerHasKeyUseWarning[messageType]||( -ownerHasKeyUseWarning[messageType]={}); - -if(memoizer[addendum]){ -return null;} - -memoizer[addendum]=true; - -var addenda={ -parentOrOwner:addendum, -url:' See https://fb.me/react-warning-keys for more information.', -childOwner:null}; - - - - - -if(element&& -element._owner&& -element._owner!==ReactCurrentOwner.current){ - -addenda.childOwner=' It was passed a child from '+ -element._owner.getName()+'.';} - - -return addenda;} - - - - - - - - - - - -function validateChildKeys(node,parentType){ -if(typeof node!=='object'){ -return;} - -if(Array.isArray(node)){ -for(var i=0;ig){ -cx-=gx; -cy-=gy;}else -if(u>0&&g!=0){ -cx-=u/g*gx; -cy-=u/g*gy;} - - -v1=cx*cx+cy*cy; - -cx=c2x-sx;cy=c2y-sy; -u=cx*gx+cy*gy; - -if(u>g){ -cx-=gx; -cy-=gy;}else -if(u>0&&g!=0){ -cx-=u/g*gx; -cy-=u/g*gy;} - - -v2=cx*cx+cy*cy; - -if(v1<0.01&&v2<0.01){ -this.onLine(sx,sy,ex,ey); -return;} - - - -if(isNaN(v1)||isNaN(v2)){ -throw new Error('Bad input');} - - - -var s1x=(c1x+c2x)*0.5,s1y=(c1y+c2y)*0.5, -l1x=(c1x+sx)*0.5,l1y=(c1y+sy)*0.5, -l2x=(l1x+s1x)*0.5,l2y=(l1y+s1y)*0.5, -r2x=(ex+c2x)*0.5,r2y=(ey+c2y)*0.5, -r1x=(r2x+s1x)*0.5,r1y=(r2y+s1y)*0.5, -l2r1x=(l2x+r1x)*0.5,l2r1y=(l2y+r1y)*0.5; - - -this.onBezierCurve(sx,sy,l1x,l1y,l2x,l2y,l2r1x,l2r1y); -this.onBezierCurve(l2r1x,l2r1y,r1x,r1y,r2x,r2y,ex,ey);}, - - -onArc:function(sx,sy,ex,ey,cx,cy,rx,ry,sa,ea,ccw,rotation){ - -var rad=rotation?rotation*Math.PI/180:0,cos=Math.cos(rad),sin=Math.sin(rad), -xx=cos*rx,yx=-sin*ry, -xy=sin*rx,yy=cos*ry; - - -var arc=ea-sa; -if(arc<0&&!ccw)arc+=Math.PI*2;else -if(arc>0&&ccw)arc-=Math.PI*2; - -var n=Math.ceil(Math.abs(arc/(Math.PI/2))), -step=arc/n, -k=4/3*Math.tan(step/4); - -var x=Math.cos(sa),y=Math.sin(sa); - -for(var i=0;im.yy/m.xy?-1:1; -if(m.xx<0?m.xy>=0:m.xy<0)flip=-flip; -return this.rotate(deg-Math.atan2(flip*m.yx,flip*m.xx)*180/Math.PI,x,y);}, - - -scaleTo:function(x,y){ - -var m=this; - -var h=Math.sqrt(m.xx*m.xx+m.yx*m.yx); -m.xx/=h;m.yx/=h; - -h=Math.sqrt(m.yy*m.yy+m.xy*m.xy); -m.yy/=h;m.xy/=h; - -return this.scale(x,y);}, - - -resizeTo:function(width,height){ -var w=this.width,h=this.height; -if(!w||!h)return this; -return this.scaleTo(width/w,height/h);}, - - - - - - - - - - - - - - - - -inversePoint:function(x,y){ -var a=this.xx,b=this.yx, -c=this.xy,d=this.yy, -e=this.x,f=this.y; -var det=b*c-a*d; -if(det==0)return null; -return { -x:(d*(e-x)+c*(y-f))/det, -y:(a*(f-y)+b*(x-e))/det};}, - - - -point:function(x,y){ -var m=this; -return { -x:m.xx*x+m.xy*y+m.x, -y:m.yx*x+m.yy*y+m.y};}}); -}); -__d('DatePickerIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var RCTDatePickerIOSConsts=require('NativeModules').UIManager.RCTDatePicker.Constants; -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - - - - - - - - - - - -var DatePickerIOS=React.createClass({displayName:'DatePickerIOS', - -_picker:undefined, - -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -date:PropTypes.instanceOf(Date).isRequired, - - - - - - - - -onDateChange:PropTypes.func.isRequired, - - - - - - -maximumDate:PropTypes.instanceOf(Date), - - - - - - -minimumDate:PropTypes.instanceOf(Date), - - - - -mode:PropTypes.oneOf(['date','time','datetime']), - - - - -minuteInterval:PropTypes.oneOf([1,2,3,4,5,6,10,12,15,20,30]), - - - - - - - - -timeZoneOffsetInMinutes:PropTypes.number}), - - -getDefaultProps:function(){ -return { -mode:'datetime'};}, - - - -_onChange:function(event){ -var nativeTimeStamp=event.nativeEvent.timestamp; -this.props.onDateChange&&this.props.onDateChange( -new Date(nativeTimeStamp)); - -this.props.onChange&&this.props.onChange(event); - - - - - -var propsTimeStamp=this.props.date.getTime(); -if(this._picker&&nativeTimeStamp!==propsTimeStamp){ -this._picker.setNativeProps({ -date:propsTimeStamp});}}, - - - - -render:function(){var _this=this; -var props=this.props; -return ( -React.createElement(View,{style:props.style}, -React.createElement(RCTDatePickerIOS,{ -ref:function(picker){return _this._picker=picker;}, -style:styles.datePickerIOS, -date:props.date.getTime(), -maximumDate: -props.maximumDate?props.maximumDate.getTime():undefined, - -minimumDate: -props.minimumDate?props.minimumDate.getTime():undefined, - -mode:props.mode, -minuteInterval:props.minuteInterval, -timeZoneOffsetInMinutes:props.timeZoneOffsetInMinutes, -onChange:this._onChange})));}}); - - - - - - -var styles=StyleSheet.create({ -datePickerIOS:{ -height:RCTDatePickerIOSConsts.ComponentHeight, -width:RCTDatePickerIOSConsts.ComponentWidth}}); - - - -var RCTDatePickerIOS=requireNativeComponent('RCTDatePicker',DatePickerIOS,{ -nativeOnly:{onChange:true}}); - - -module.exports=DatePickerIOS; -}); -__d('DrawerLayoutAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('Image',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EdgeInsetsPropType=require('EdgeInsetsPropType'); -var ImageResizeMode=require('ImageResizeMode'); -var ImageStylePropTypes=require('ImageStylePropTypes'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var NativeModules=require('NativeModules'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var ReactNativeViewAttributes=require('ReactNativeViewAttributes'); -var View=require('View'); -var StyleSheet=require('StyleSheet'); -var StyleSheetPropType=require('StyleSheetPropType'); - -var flattenStyle=require('flattenStyle'); -var invariant=require('invariant'); -var requireNativeComponent=require('requireNativeComponent'); -var resolveAssetSource=require('resolveAssetSource'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - - - - - - - - -var Image=React.createClass({displayName:'Image', -propTypes:{ -style:StyleSheetPropType(ImageStylePropTypes), - - - - - -source:PropTypes.oneOfType([ -PropTypes.shape({ -uri:PropTypes.string}), - - -PropTypes.number]), - - - - - -defaultSource:PropTypes.oneOfType([ -PropTypes.shape({ -uri:PropTypes.string}), - - -PropTypes.number]), - - - - - -accessible:PropTypes.bool, - - - - - -accessibilityLabel:PropTypes.string, - - - - - - - - -capInsets:EdgeInsetsPropType, - - - - -resizeMode:PropTypes.oneOf(['cover','contain','stretch']), - - - - -testID:PropTypes.string, - - - - -onLayout:PropTypes.func, - - - -onLoadStart:PropTypes.func, - - - - -onProgress:PropTypes.func, - - - - -onError:PropTypes.func, - - - -onLoad:PropTypes.func, - - - -onLoadEnd:PropTypes.func}, - - -statics:{ -resizeMode:ImageResizeMode}, - - -mixins:[NativeMethodsMixin], - - - - - -viewConfig:{ -uiViewClassName:'UIView', -validAttributes:ReactNativeViewAttributes.UIView}, - - -contextTypes:{ -isInAParentText:React.PropTypes.bool}, - - -render:function(){ -var source=resolveAssetSource(this.props.source)||{};var -width=source.width;var height=source.height; -var style=flattenStyle([{width:width,height:height},styles.base,this.props.style])||{}; - -var isNetwork=source.uri&&source.uri.match(/^https?:/); -var RawImage=isNetwork?RCTNetworkImageView:RCTImageView; -var resizeMode=this.props.resizeMode||(style||{}).resizeMode||'cover'; -var tintColor=(style||{}).tintColor; - - - -if(isNetwork&&tintColor){ -RawImage=RCTImageView;} - - -if(this.context.isInAParentText){ -return React.createElement(RCTVirtualImage,{source:source});}else -{ -return ( -React.createElement(RawImage,babelHelpers.extends({}, -this.props,{ -style:style, -resizeMode:resizeMode, -tintColor:tintColor, -source:source})));}}}); - - - - - - -var styles=StyleSheet.create({ -base:{ -overflow:'hidden'}}); - - - -var RCTImageView=requireNativeComponent('RCTImageView',Image); -var RCTNetworkImageView=NativeModules.NetworkImageViewManager?requireNativeComponent('RCTNetworkImageView',Image):RCTImageView; -var RCTVirtualImage=requireNativeComponent('RCTVirtualImage',Image); - -module.exports=Image; -}); -__d('EdgeInsetsPropType',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var PropTypes=require('ReactPropTypes'); - -var createStrictShapeTypeChecker=require('createStrictShapeTypeChecker'); - -var EdgeInsetsPropType=createStrictShapeTypeChecker({ -top:PropTypes.number, -left:PropTypes.number, -bottom:PropTypes.number, -right:PropTypes.number}); - - -module.exports=EdgeInsetsPropType; -}); -__d('ListView',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ListViewDataSource=require('ListViewDataSource'); -var React=require('React'); -var RCTScrollViewManager=require('NativeModules').ScrollViewManager; -var ScrollView=require('ScrollView'); -var ScrollResponder=require('ScrollResponder'); -var StaticRenderer=require('StaticRenderer'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); - -var isEmpty=require('isEmpty'); -var logError=require('logError'); -var merge=require('merge'); - -var PropTypes=React.PropTypes; - -var DEFAULT_PAGE_SIZE=1; -var DEFAULT_INITIAL_ROWS=10; -var DEFAULT_SCROLL_RENDER_AHEAD=1000; -var DEFAULT_END_REACHED_THRESHOLD=1000; -var DEFAULT_SCROLL_CALLBACK_THROTTLE=50; -var SCROLLVIEW_REF='listviewscroll'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var ListView=React.createClass({displayName:'ListView', -mixins:[ScrollResponder.Mixin,TimerMixin], - -statics:{ -DataSource:ListViewDataSource}, - - - - - - - - - -propTypes:babelHelpers.extends({}, -ScrollView.propTypes,{ - -dataSource:PropTypes.instanceOf(ListViewDataSource).isRequired, - - - - - - - - -renderSeparator:PropTypes.func, - - - - - - - - - - - -renderRow:PropTypes.func.isRequired, - - - - - -initialListSize:PropTypes.number, - - - - - -onEndReached:PropTypes.func, - - - -onEndReachedThreshold:PropTypes.number, - - - -pageSize:PropTypes.number, - - - - - - - - -renderFooter:PropTypes.func, -renderHeader:PropTypes.func, - - - - - - - - - -renderSectionHeader:PropTypes.func, - - - - - - -renderScrollComponent:React.PropTypes.func.isRequired, - - - - -scrollRenderAheadDistance:React.PropTypes.number, - - - - - - - - - -onChangeVisibleRows:React.PropTypes.func, - - - - - -removeClippedSubviews:React.PropTypes.bool}), - - - - - -getMetrics:function(){ -return { -contentLength:this.scrollProperties.contentLength, -totalRows:this.props.dataSource.getRowCount(), -renderedRows:this.state.curRenderedRowsCount, -visibleRows:Object.keys(this._visibleRows).length};}, - - - - - - - -getScrollResponder:function(){ -return this.refs[SCROLLVIEW_REF]&& -this.refs[SCROLLVIEW_REF].getScrollResponder&& -this.refs[SCROLLVIEW_REF].getScrollResponder();}, - - -setNativeProps:function(props){ -this.refs[SCROLLVIEW_REF].setNativeProps(props);}, - - - - - - -getDefaultProps:function(){ -return { -initialListSize:DEFAULT_INITIAL_ROWS, -pageSize:DEFAULT_PAGE_SIZE, -renderScrollComponent:function(props){return React.createElement(ScrollView,props);}, -scrollRenderAheadDistance:DEFAULT_SCROLL_RENDER_AHEAD, -onEndReachedThreshold:DEFAULT_END_REACHED_THRESHOLD};}, - - - -getInitialState:function(){ -return { -curRenderedRowsCount:this.props.initialListSize, -prevRenderedRowsCount:0, -highlightedRow:{}};}, - - - -getInnerViewNode:function(){ -return this.refs[SCROLLVIEW_REF].getInnerViewNode();}, - - -componentWillMount:function(){ - -this.scrollProperties={ -visibleLength:null, -contentLength:null, -offset:0}; - -this._childFrames=[]; -this._visibleRows={};}, - - -componentDidMount:function(){var _this=this; - - -this.requestAnimationFrame(function(){ -_this._measureAndUpdateScrollProps();});}, - - - -componentWillReceiveProps:function(nextProps){ -if(this.props.dataSource!==nextProps.dataSource){ -this.setState(function(state,props){ -var rowsToRender=Math.min( -state.curRenderedRowsCount+props.pageSize, -props.dataSource.getRowCount()); - -return { -prevRenderedRowsCount:0, -curRenderedRowsCount:rowsToRender};});}}, - - - - - -componentDidUpdate:function(){var _this2=this; -this.requestAnimationFrame(function(){ -_this2._measureAndUpdateScrollProps();});}, - - - -onRowHighlighted:function(sectionID,rowID){ -this.setState({highlightedRow:{sectionID:sectionID,rowID:rowID}});}, - - -render:function(){ -var bodyComponents=[]; - -var dataSource=this.props.dataSource; -var allRowIDs=dataSource.rowIdentities; -var rowCount=0; -var sectionHeaderIndices=[]; - -var header=this.props.renderHeader&&this.props.renderHeader(); -var footer=this.props.renderFooter&&this.props.renderFooter(); -var totalIndex=header?1:0; - -for(var sectionIdx=0;sectionIdx=this.state.prevRenderedRowsCount&& -dataSource.sectionHeaderShouldUpdate(sectionIdx); -bodyComponents.push( -React.createElement(StaticRenderer,{ -key:'s_'+sectionID, -shouldUpdate:!!shouldUpdateHeader, -render:this.props.renderSectionHeader.bind( -null, -dataSource.getSectionHeaderData(sectionIdx), -sectionID)})); - - - -sectionHeaderIndices.push(totalIndex++);} - - -for(var rowIdx=0;rowIdx=this.state.prevRenderedRowsCount&& -dataSource.rowShouldUpdate(sectionIdx,rowIdx); -var row= -React.createElement(StaticRenderer,{ -key:'r_'+comboID, -shouldUpdate:!!shouldUpdateRow, -render:this.props.renderRow.bind( -null, -dataSource.getRowData(sectionIdx,rowIdx), -sectionID, -rowID, -this.onRowHighlighted)}); - - -bodyComponents.push(row); -totalIndex++; - -if(this.props.renderSeparator&&( -rowIdx!==rowIDs.length-1||sectionIdx===allRowIDs.length-1)){ -var adjacentRowHighlighted= -this.state.highlightedRow.sectionID===sectionID&&( -this.state.highlightedRow.rowID===rowID|| -this.state.highlightedRow.rowID===rowIDs[rowIdx+1]); - -var separator=this.props.renderSeparator( -sectionID, -rowID, -adjacentRowHighlighted); - -bodyComponents.push(separator); -totalIndex++;} - -if(++rowCount===this.state.curRenderedRowsCount){ -break;}} - - -if(rowCount>=this.state.curRenderedRowsCount){ -break;}}var _props= - - - - - - -this.props;var renderScrollComponent=_props.renderScrollComponent;var props=babelHelpers.objectWithoutProperties(_props,['renderScrollComponent']); -if(!props.scrollEventThrottle){ -props.scrollEventThrottle=DEFAULT_SCROLL_CALLBACK_THROTTLE;} - -if(props.removeClippedSubviews===undefined){ -props.removeClippedSubviews=true;} - -babelHelpers.extends(props,{ -onScroll:this._onScroll, -stickyHeaderIndices:sectionHeaderIndices, - - - -onKeyboardWillShow:undefined, -onKeyboardWillHide:undefined, -onKeyboardDidShow:undefined, -onKeyboardDidHide:undefined}); - - - - -return React.cloneElement(renderScrollComponent(props),{ -ref:SCROLLVIEW_REF, -onContentSizeChange:this._onContentSizeChange, -onLayout:this._onLayout}, -header,bodyComponents,footer);}, - - - - - - -_measureAndUpdateScrollProps:function(){ -var scrollComponent=this.getScrollResponder(); -if(!scrollComponent||!scrollComponent.getInnerViewNode){ -return;} - - - - -RCTScrollViewManager&&RCTScrollViewManager.calculateChildFrames&& -RCTScrollViewManager.calculateChildFrames( -React.findNodeHandle(scrollComponent), -this._updateChildFrames);}, - - - -_onContentSizeChange:function(width,height){ -this.scrollProperties.contentLength=!this.props.horizontal? -height:width; -this._updateVisibleRows(); -this._renderMoreRowsIfNeeded();}, - - -_onLayout:function(event){var _event$nativeEvent$la= -event.nativeEvent.layout;var width=_event$nativeEvent$la.width;var height=_event$nativeEvent$la.height; -this.scrollProperties.visibleLength=!this.props.horizontal? -height:width; -this._updateVisibleRows(); -this._renderMoreRowsIfNeeded();}, - - -_setScrollVisibleLength:function(left,top,width,height){ -this.scrollProperties.visibleLength=!this.props.horizontal? -height:width; -this._updateVisibleRows(); -this._renderMoreRowsIfNeeded();}, - - -_updateChildFrames:function(childFrames){ -this._updateVisibleRows(childFrames);}, - - -_maybeCallOnEndReached:function(event){ -if(this.props.onEndReached&& -this.scrollProperties.contentLength!==this._sentEndForContentLength&& -this._getDistanceFromEnd(this.scrollProperties)visibleMax||maxthis.props.onEndReachedThreshold){ - -this._sentEndForContentLength=null;} - - -this.props.onScroll&&this.props.onScroll(e);}}); - - - -module.exports=ListView; -}); -__d('ListViewDataSource',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var invariant=require('invariant'); -var isEmpty=require('isEmpty'); -var warning=require('warning'); - -function defaultGetRowData( -dataBlob, -sectionID, -rowID) -{ -return dataBlob[sectionID][rowID];} - - -function defaultGetSectionHeaderData( -dataBlob, -sectionID) -{ -return dataBlob[sectionID];}var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ListViewDataSource=(function(){ - - - - - - - - - - - - - - - - - - - - - - - - - - -function ListViewDataSource(params){babelHelpers.classCallCheck(this,ListViewDataSource); -invariant( -params&&typeof params.rowHasChanged==='function', -'Must provide a rowHasChanged function.'); - -this._rowHasChanged=params.rowHasChanged; -this._getRowData=params.getRowData||defaultGetRowData; -this._sectionHeaderHasChanged=params.sectionHeaderHasChanged; -this._getSectionHeaderData= -params.getSectionHeaderData||defaultGetSectionHeaderData; - -this._dataBlob=null; -this._dirtyRows=[]; -this._dirtySections=[]; -this._cachedRowCount=0; - - - -this.rowIdentities=[]; -this.sectionIdentities=[];}babelHelpers.createClass(ListViewDataSource,[{key:'cloneWithRows',value:function cloneWithRows( - - - - - - - - - - - - - - - - - - - -dataBlob, -rowIdentities) -{ -var rowIds=rowIdentities?[rowIdentities]:null; -if(!this._sectionHeaderHasChanged){ -this._sectionHeaderHasChanged=function(){return false;};} - -return this.cloneWithRowsAndSections({s1:dataBlob},['s1'],rowIds);}},{key:'cloneWithRowsAndSections',value:function cloneWithRowsAndSections( - - - - - - - - - - - - - - -dataBlob, -sectionIdentities, -rowIdentities) -{ -invariant( -typeof this._sectionHeaderHasChanged==='function', -'Must provide a sectionHeaderHasChanged function with section data.'); - -var newSource=new ListViewDataSource({ -getRowData:this._getRowData, -getSectionHeaderData:this._getSectionHeaderData, -rowHasChanged:this._rowHasChanged, -sectionHeaderHasChanged:this._sectionHeaderHasChanged}); - -newSource._dataBlob=dataBlob; -if(sectionIdentities){ -newSource.sectionIdentities=sectionIdentities;}else -{ -newSource.sectionIdentities=Object.keys(dataBlob);} - -if(rowIdentities){ -newSource.rowIdentities=rowIdentities;}else -{ -newSource.rowIdentities=[]; -newSource.sectionIdentities.forEach(function(sectionID){ -newSource.rowIdentities.push(Object.keys(dataBlob[sectionID]));});} - - -newSource._cachedRowCount=countRows(newSource.rowIdentities); - -newSource._calculateDirtyArrays( -this._dataBlob, -this.sectionIdentities, -this.rowIdentities); - - -return newSource;}},{key:'getRowCount',value:function getRowCount() - - -{ -return this._cachedRowCount;}},{key:'rowShouldUpdate',value:function rowShouldUpdate( - - - - - -sectionIndex,rowIndex){ -var needsUpdate=this._dirtyRows[sectionIndex][rowIndex]; -warning(needsUpdate!==undefined, -'missing dirtyBit for section, row: '+sectionIndex+', '+rowIndex); -return needsUpdate;}},{key:'getRowData',value:function getRowData( - - - - - -sectionIndex,rowIndex){ -var sectionID=this.sectionIdentities[sectionIndex]; -var rowID=this.rowIdentities[sectionIndex][rowIndex]; -warning( -sectionID!==undefined&&rowID!==undefined, -'rendering invalid section, row: '+sectionIndex+', '+rowIndex); - -return this._getRowData(this._dataBlob,sectionID,rowID);}},{key:'getRowIDForFlatIndex',value:function getRowIDForFlatIndex( - - - - - - -index){ -var accessIndex=index; -for(var ii=0;ii=this.rowIdentities[ii].length){ -accessIndex-=this.rowIdentities[ii].length;}else -{ -return this.rowIdentities[ii][accessIndex];}} - - -return null;}},{key:'getSectionIDForFlatIndex',value:function getSectionIDForFlatIndex( - - - - - - -index){ -var accessIndex=index; -for(var ii=0;ii=this.rowIdentities[ii].length){ -accessIndex-=this.rowIdentities[ii].length;}else -{ -return this.sectionIdentities[ii];}} - - -return null;}},{key:'getSectionLengths',value:function getSectionLengths() - - - - - -{ -var results=[]; -for(var ii=0;ii but not '+ -'`scrollEventThrottle`. You will only receive one event. '+ -'Using `16` you get all the events but be aware that it may '+ -'cause frame drops, use a bigger number if you don\'t need as '+ -'much precision.');}} - - - -if(Platform.OS==='android'){ -if(this.props.keyboardDismissMode==='on-drag'){ -dismissKeyboard();}} - - -this.scrollResponderHandleScroll(e);}, - - -_handleContentOnLayout:function(e){var _e$nativeEvent$layout= -e.nativeEvent.layout;var width=_e$nativeEvent$layout.width;var height=_e$nativeEvent$layout.height; -this.props.onContentSizeChange&&this.props.onContentSizeChange(width,height);}, - - -render:function(){ -var contentContainerStyle=[ -this.props.horizontal&&styles.contentContainerHorizontal, -this.props.contentContainerStyle]; - -if(__DEV__&&this.props.style){ -var style=flattenStyle(this.props.style); -var childLayoutProps=['alignItems','justifyContent']. -filter(function(prop){return style&&style[prop]!==undefined;}); -invariant( -childLayoutProps.length===0, -'ScrollView child layout ('+JSON.stringify(childLayoutProps)+ -') must by applied through the contentContainerStyle prop.');} - - - -var contentSizeChangeProps={}; -if(this.props.onContentSizeChange){ -contentSizeChangeProps={ -onLayout:this._handleContentOnLayout};} - - - -var contentContainer= -React.createElement(View,babelHelpers.extends({}, -contentSizeChangeProps,{ -ref:INNERVIEW, -style:contentContainerStyle, -removeClippedSubviews:this.props.removeClippedSubviews, -collapsable:false}), -this.props.children); - - -var alwaysBounceHorizontal= -this.props.alwaysBounceHorizontal!==undefined? -this.props.alwaysBounceHorizontal: -this.props.horizontal; - -var alwaysBounceVertical= -this.props.alwaysBounceVertical!==undefined? -this.props.alwaysBounceVertical: -!this.props.horizontal; - -var props=babelHelpers.extends({}, -this.props,{ -alwaysBounceHorizontal:alwaysBounceHorizontal, -alwaysBounceVertical:alwaysBounceVertical, -style:[styles.base,this.props.style], -onTouchStart:this.scrollResponderHandleTouchStart, -onTouchMove:this.scrollResponderHandleTouchMove, -onTouchEnd:this.scrollResponderHandleTouchEnd, -onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag, -onScrollEndDrag:this.scrollResponderHandleScrollEndDrag, -onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin, -onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd, -onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder, -onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture, -onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder, -onScroll:this.handleScroll, -onResponderGrant:this.scrollResponderHandleResponderGrant, -onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest, -onResponderTerminate:this.scrollResponderHandleTerminate, -onResponderRelease:this.scrollResponderHandleResponderRelease, -onResponderReject:this.scrollResponderHandleResponderReject}); - - -var onRefreshStart=this.props.onRefreshStart; - - -props.onRefreshStart=onRefreshStart? -(function(){onRefreshStart&&onRefreshStart(this.endRefreshing);}).bind(this): -null; - -var ScrollViewClass; -if(Platform.OS==='ios'){ -ScrollViewClass=RCTScrollView;}else -if(Platform.OS==='android'){ -if(this.props.horizontal){ -ScrollViewClass=AndroidHorizontalScrollView;}else -{ -ScrollViewClass=AndroidScrollView;}} - - -invariant( -ScrollViewClass!==undefined, -'ScrollViewClass must not be undefined'); - - -return ( -React.createElement(ScrollViewClass,babelHelpers.extends({},props,{ref:SCROLLVIEW}), -contentContainer));}}); - - - - - -var styles=StyleSheet.create({ -base:{ -flex:1}, - -contentContainerHorizontal:{ -alignSelf:'flex-start', -flexDirection:'row'}}); - - - -var validAttributes=babelHelpers.extends({}, -ReactNativeViewAttributes.UIView,{ -alwaysBounceHorizontal:true, -alwaysBounceVertical:true, -automaticallyAdjustContentInsets:true, -bounces:true, -centerContent:true, -contentInset:{diff:insetsDiffer}, -contentOffset:{diff:pointsDiffer}, -decelerationRate:true, -horizontal:true, -keyboardDismissMode:true, -keyboardShouldPersistTaps:true, -maximumZoomScale:true, -minimumZoomScale:true, -pagingEnabled:true, -removeClippedSubviews:true, -scrollEnabled:true, -scrollIndicatorInsets:{diff:insetsDiffer}, -scrollsToTop:true, -showsHorizontalScrollIndicator:true, -showsVerticalScrollIndicator:true, -snapToInterval:true, -snapToAlignment:true, -stickyHeaderIndices:{diff:deepDiffer}, -scrollEventThrottle:true, -zoomScale:true}); - - -if(Platform.OS==='android'){ -var AndroidScrollView=requireNativeComponent('RCTScrollView',ScrollView); -var AndroidHorizontalScrollView=requireNativeComponent( -'AndroidHorizontalScrollView', -ScrollView);}else - -if(Platform.OS==='ios'){ -var RCTScrollView=requireNativeComponent('RCTScrollView',ScrollView);} - - -module.exports=ScrollView; -}); -__d('PointPropType',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var PropTypes=require('ReactPropTypes'); - -var createStrictShapeTypeChecker=require('createStrictShapeTypeChecker'); - -var PointPropType=createStrictShapeTypeChecker({ -x:PropTypes.number, -y:PropTypes.number}); - - -module.exports=PointPropType; -}); -__d('ScrollResponder',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var Platform=require('Platform'); -var RCTDeviceEventEmitter=require('RCTDeviceEventEmitter'); -var React=require('React'); -var Subscribable=require('Subscribable'); -var TextInputState=require('TextInputState');var _require= - -require('NativeModules');var UIManager=_require.UIManager;var ScrollViewManager=_require.ScrollViewManager; - -var invariant=require('invariant'); -var warning=require('warning'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var IS_ANIMATING_TOUCH_START_THRESHOLD_MS=16; - - - - - - - - - - -var ScrollResponderMixin={ -mixins:[Subscribable.Mixin], -scrollResponderMixinGetInitialState:function(){ -return { -isTouching:false, -lastMomentumScrollBeginTime:0, -lastMomentumScrollEndTime:0, - - - - - - -observedScrollSinceBecomingResponder:false, -becameResponderWhileAnimating:false};}, - - - - - - -scrollResponderHandleScrollShouldSetResponder:function(){ -return this.state.isTouching;}, - - - - - - - - - - - - - - - - - - - - - - - - - - - -scrollResponderHandleStartShouldSetResponder:function(){ -return false;}, - - - - - - - - - - - - - -scrollResponderHandleStartShouldSetResponderCapture:function(e){ - -var currentlyFocusedTextInput=TextInputState.currentlyFocusedField(); -if(!this.props.keyboardShouldPersistTaps&& -currentlyFocusedTextInput!=null&& -e.target!==currentlyFocusedTextInput){ -return true;} - -return this.scrollResponderIsAnimating();}, - - - - - - - - - - - - -scrollResponderHandleResponderReject:function(){ -warning(false,"ScrollView doesn't take rejection well - scrolls anyway");}, - - - - - - - - - - - - - - - - - -scrollResponderHandleTerminationRequest:function(){ -return !this.state.observedScrollSinceBecomingResponder;}, - - - - - - - -scrollResponderHandleTouchEnd:function(e){ -var nativeEvent=e.nativeEvent; -this.state.isTouching=nativeEvent.touches.length!==0; -this.props.onTouchEnd&&this.props.onTouchEnd(e);}, - - - - - -scrollResponderHandleResponderRelease:function(e){ -this.props.onResponderRelease&&this.props.onResponderRelease(e); - - - -var currentlyFocusedTextInput=TextInputState.currentlyFocusedField(); -if(!this.props.keyboardShouldPersistTaps&& -currentlyFocusedTextInput!=null&& -e.target!==currentlyFocusedTextInput&& -!this.state.observedScrollSinceBecomingResponder&& -!this.state.becameResponderWhileAnimating){ -this.props.onScrollResponderKeyboardDismissed&& -this.props.onScrollResponderKeyboardDismissed(e); -TextInputState.blurTextInput(currentlyFocusedTextInput);}}, - - - -scrollResponderHandleScroll:function(e){ -this.state.observedScrollSinceBecomingResponder=true; -this.props.onScroll&&this.props.onScroll(e);}, - - - - - -scrollResponderHandleResponderGrant:function(e){ -this.state.observedScrollSinceBecomingResponder=false; -this.props.onResponderGrant&&this.props.onResponderGrant(e); -this.state.becameResponderWhileAnimating=this.scrollResponderIsAnimating();}, - - - - - - - - - -scrollResponderHandleScrollBeginDrag:function(e){ -this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e);}, - - - - - -scrollResponderHandleScrollEndDrag:function(e){ -this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e);}, - - - - - -scrollResponderHandleMomentumScrollBegin:function(e){ -this.state.lastMomentumScrollBeginTime=Date.now(); -this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e);}, - - - - - -scrollResponderHandleMomentumScrollEnd:function(e){ -this.state.lastMomentumScrollEndTime=Date.now(); -this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e);}, - - - - - - - - - - - - - -scrollResponderHandleTouchStart:function(e){ -this.state.isTouching=true; -this.props.onTouchStart&&this.props.onTouchStart(e);}, - - - - - - - - - - - - - -scrollResponderHandleTouchMove:function(e){ -this.props.onTouchMove&&this.props.onTouchMove(e);}, - - - - - - - -scrollResponderIsAnimating:function(){ -var now=Date.now(); -var timeSinceLastMomentumScrollEnd=now-this.state.lastMomentumScrollEndTime; -var isAnimating=timeSinceLastMomentumScrollEnd=1, -'Navigator requires props.initialRoute or props.initialRouteStack.'); - -var initialRouteIndex=routeStack.length-1; -if(this.props.initialRoute){ -initialRouteIndex=routeStack.indexOf(this.props.initialRoute); -invariant( -initialRouteIndex!==-1, -'initialRoute is not in initialRouteStack.');} - - -return { -sceneConfigStack:routeStack.map( -function(route){return _this.props.configureScene(route);}), - -routeStack:routeStack, -presentedIndex:initialRouteIndex, -transitionFromIndex:null, -activeGesture:null, -pendingGestureProgress:null, -transitionQueue:[]};}, - - - -componentWillMount:function(){var _this2=this; - -this.__defineGetter__('navigationContext',this._getNavigationContext); - -this._subRouteFocus=[]; -this.parentNavigator=this.props.navigator; -this._handlers={}; -this.springSystem=new rebound.SpringSystem(); -this.spring=this.springSystem.createSpring(); -this.spring.setRestSpeedThreshold(0.05); -this.spring.setCurrentValue(0).setAtRest(); -this.spring.addListener({ -onSpringEndStateChange:function(){ -if(!_this2._interactionHandle){ -_this2._interactionHandle=_this2.createInteractionHandle();}}, - - -onSpringUpdate:function(){ -_this2._handleSpringUpdate();}, - -onSpringAtRest:function(){ -_this2._completeTransition();}}); - - -this.panGesture=PanResponder.create({ -onMoveShouldSetPanResponder:this._handleMoveShouldSetPanResponder, -onPanResponderRelease:this._handlePanResponderRelease, -onPanResponderMove:this._handlePanResponderMove, -onPanResponderTerminate:this._handlePanResponderTerminate}); - -this._interactionHandle=null; -this._emitWillFocus(this.state.routeStack[this.state.presentedIndex]);}, - - -componentDidMount:function(){ -this._handleSpringUpdate(); -this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]);}, - - -componentWillUnmount:function(){ -if(this._navigationContext){ -this._navigationContext.dispose(); -this._navigationContext=null;} - - -this.spring.destroy(); - -if(this._interactionHandle){ -this.clearInteractionHandle(this._interactionHandle);}}, - - - - - - - - - - -immediatelyResetRouteStack:function(nextRouteStack){var _this3=this; -var destIndex=nextRouteStack.length-1; -this.setState({ -routeStack:nextRouteStack, -sceneConfigStack:nextRouteStack.map( -this.props.configureScene), - -presentedIndex:destIndex, -activeGesture:null, -transitionFromIndex:null, -transitionQueue:[]}, -function(){ -_this3._handleSpringUpdate();});}, - - - -_transitionTo:function(destIndex,velocity,jumpSpringTo,cb){ -if(destIndex===this.state.presentedIndex){ -return;} - -if(this.state.transitionFromIndex!==null){ -this.state.transitionQueue.push({ -destIndex:destIndex, -velocity:velocity, -cb:cb}); - -return;} - -this.state.transitionFromIndex=this.state.presentedIndex; -this.state.presentedIndex=destIndex; -this.state.transitionCb=cb; -this._onAnimationStart(); -if(AnimationsDebugModule){ -AnimationsDebugModule.startRecordingFps();} - -var sceneConfig=this.state.sceneConfigStack[this.state.transitionFromIndex]|| -this.state.sceneConfigStack[this.state.presentedIndex]; -invariant( -sceneConfig, -'Cannot configure scene at index '+this.state.transitionFromIndex); - -if(jumpSpringTo!=null){ -this.spring.setCurrentValue(jumpSpringTo);} - -this.spring.setOvershootClampingEnabled(true); -this.spring.getSpringConfig().friction=sceneConfig.springFriction; -this.spring.getSpringConfig().tension=sceneConfig.springTension; -this.spring.setVelocity(velocity||sceneConfig.defaultTransitionVelocity); -this.spring.setEndValue(1);}, - - - - - - -_handleSpringUpdate:function(){ -if(!this.isMounted()){ -return;} - - -if(this.state.transitionFromIndex!=null){ -this._transitionBetween( -this.state.transitionFromIndex, -this.state.presentedIndex, -this.spring.getCurrentValue());}else - -if(this.state.activeGesture!=null){ -var presentedToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._transitionBetween( -this.state.presentedIndex, -presentedToIndex, -this.spring.getCurrentValue());}}, - - - - - - - -_completeTransition:function(){ -if(!this.isMounted()){ -return;} - - -if(this.spring.getCurrentValue()!==1&&this.spring.getCurrentValue()!==0){ - - -if(this.state.pendingGestureProgress){ -this.state.pendingGestureProgress=null;} - -return;} - -this._onAnimationEnd(); -var presentedIndex=this.state.presentedIndex; -var didFocusRoute=this._subRouteFocus[presentedIndex]||this.state.routeStack[presentedIndex]; -this._emitDidFocus(didFocusRoute); -if(AnimationsDebugModule){ -AnimationsDebugModule.stopRecordingFps(Date.now());} - -this.state.transitionFromIndex=null; -this.spring.setCurrentValue(0).setAtRest(); -this._hideScenes(); -if(this.state.transitionCb){ -this.state.transitionCb(); -this.state.transitionCb=null;} - -if(this._interactionHandle){ -this.clearInteractionHandle(this._interactionHandle); -this._interactionHandle=null;} - -if(this.state.pendingGestureProgress){ - - -var gestureToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._enableScene(gestureToIndex); -this.spring.setEndValue(this.state.pendingGestureProgress); -return;} - -if(this.state.transitionQueue.length){ -var queuedTransition=this.state.transitionQueue.shift(); -this._enableScene(queuedTransition.destIndex); -this._emitWillFocus(this.state.routeStack[queuedTransition.destIndex]); -this._transitionTo( -queuedTransition.destIndex, -queuedTransition.velocity, -null, -queuedTransition.cb);}}, - - - - -_emitDidFocus:function(route){ -this.navigationContext.emit('didfocus',{route:route}); - -if(this.props.onDidFocus){ -this.props.onDidFocus(route);}}, - - - -_emitWillFocus:function(route){ -this.navigationContext.emit('willfocus',{route:route}); - -var navBar=this._navBar; -if(navBar&&navBar.handleWillFocus){ -navBar.handleWillFocus(route);} - -if(this.props.onWillFocus){ -this.props.onWillFocus(route);}}, - - - - - - -_hideScenes:function(){ -var gesturingToIndex=null; -if(this.state.activeGesture){ -gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture);} - -for(var i=0;i=this.state.routeStack.length-1&& -gestureName==='jumpForward'; -return wouldOverswipeForward||wouldOverswipeBack;}, - - -_deltaForGestureAction:function(gestureAction){ -switch(gestureAction){ -case 'pop': -case 'jumpBack': -return -1; -case 'jumpForward': -return 1; -default: -invariant(false,'Unsupported gesture action '+gestureAction); -return;}}, - - - -_handlePanResponderRelease:function(e,gestureState){var _this4=this; -var sceneConfig=this.state.sceneConfigStack[this.state.presentedIndex]; -var releaseGestureAction=this.state.activeGesture; -if(!releaseGestureAction){ - -return;} - -var releaseGesture=sceneConfig.gestures[releaseGestureAction]; -var destIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -if(this.spring.getCurrentValue()===0){ - -this.spring.setCurrentValue(0).setAtRest(); -this._completeTransition(); -return;} - -var isTravelVertical=releaseGesture.direction==='top-to-bottom'||releaseGesture.direction==='bottom-to-top'; -var isTravelInverted=releaseGesture.direction==='right-to-left'||releaseGesture.direction==='bottom-to-top'; -var velocity,gestureDistance; -if(isTravelVertical){ -velocity=isTravelInverted?-gestureState.vy:gestureState.vy; -gestureDistance=isTravelInverted?-gestureState.dy:gestureState.dy;}else -{ -velocity=isTravelInverted?-gestureState.vx:gestureState.vx; -gestureDistance=isTravelInverted?-gestureState.dx:gestureState.dx;} - -var transitionVelocity=clamp(-10,velocity,10); -if(Math.abs(velocity)releaseGesture.fullDistance*releaseGesture.stillCompletionRatio; -transitionVelocity=hasGesturedEnoughToComplete?releaseGesture.snapVelocity:-releaseGesture.snapVelocity;} - -if(transitionVelocity<0||this._doesGestureOverswipe(releaseGestureAction)){ - - -if(this.state.transitionFromIndex==null){ - -var transitionBackToPresentedIndex=this.state.presentedIndex; - -this.state.presentedIndex=destIndex; -this._transitionTo( -transitionBackToPresentedIndex, --transitionVelocity, -1-this.spring.getCurrentValue());}}else - - -{ - -this._emitWillFocus(this.state.routeStack[destIndex]); -this._transitionTo( -destIndex, -transitionVelocity, -null, -function(){ -if(releaseGestureAction==='pop'){ -_this4._cleanScenesPastIndex(destIndex);}});} - - - - -this._detachGesture();}, - - -_handlePanResponderTerminate:function(e,gestureState){ -if(this.state.activeGesture==null){ -return;} - -var destIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._detachGesture(); -var transitionBackToPresentedIndex=this.state.presentedIndex; - -this.state.presentedIndex=destIndex; -this._transitionTo( -transitionBackToPresentedIndex, -null, -1-this.spring.getCurrentValue());}, - - - -_attachGesture:function(gestureId){ -this.state.activeGesture=gestureId; -var gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._enableScene(gesturingToIndex);}, - - -_detachGesture:function(){ -this.state.activeGesture=null; -this.state.pendingGestureProgress=null; -this._hideScenes();}, - - -_handlePanResponderMove:function(e,gestureState){ -if(this._isMoveGestureAttached!==undefined){ -invariant( -this._expectingGestureGrant, -'Responder granted unexpectedly.'); - -this._attachGesture(this._expectingGestureGrant); -this._onAnimationStart(); -this._expectingGestureGrant=undefined;} - - -var sceneConfig=this.state.sceneConfigStack[this.state.presentedIndex]; -if(this.state.activeGesture){ -var gesture=sceneConfig.gestures[this.state.activeGesture]; -return this._moveAttachedGesture(gesture,gestureState);} - -var matchedGesture=this._matchGestureAction(GESTURE_ACTIONS,sceneConfig.gestures,gestureState); -if(matchedGesture){ -this._attachGesture(matchedGesture);}}, - - - -_moveAttachedGesture:function(gesture,gestureState){ -var isTravelVertical=gesture.direction==='top-to-bottom'||gesture.direction==='bottom-to-top'; -var isTravelInverted=gesture.direction==='right-to-left'||gesture.direction==='bottom-to-top'; -var distance=isTravelVertical?gestureState.dy:gestureState.dx; -distance=isTravelInverted?-distance:distance; -var gestureDetectMovement=gesture.gestureDetectMovement; -var nextProgress=(distance-gestureDetectMovement)/( -gesture.fullDistance-gestureDetectMovement); -if(nextProgress<0&&gesture.isDetachable){ -var gesturingToIndex=this.state.presentedIndex+this._deltaForGestureAction(this.state.activeGesture); -this._transitionBetween(this.state.presentedIndex,gesturingToIndex,0); -this._detachGesture(); -if(this.state.pendingGestureProgress!=null){ -this.spring.setCurrentValue(0);} - -return;} - -if(this._doesGestureOverswipe(this.state.activeGesture)){ -var frictionConstant=gesture.overswipe.frictionConstant; -var frictionByDistance=gesture.overswipe.frictionByDistance; -var frictionRatio=1/(frictionConstant+Math.abs(nextProgress)*frictionByDistance); -nextProgress*=frictionRatio;} - -nextProgress=clamp(0,nextProgress,1); -if(this.state.transitionFromIndex!=null){ -this.state.pendingGestureProgress=nextProgress;}else -if(this.state.pendingGestureProgress){ -this.spring.setEndValue(nextProgress);}else -{ -this.spring.setCurrentValue(nextProgress);}}, - - - -_matchGestureAction:function(eligibleGestures,gestures,gestureState){var _this5=this; -if(!gestures){ -return null;} - -var matchedGesture=null; -eligibleGestures.some(function(gestureName,gestureIndex){ -var gesture=gestures[gestureName]; -if(!gesture){ -return;} - -if(gesture.overswipe==null&&_this5._doesGestureOverswipe(gestureName)){ - -return false;} - -var isTravelVertical=gesture.direction==='top-to-bottom'||gesture.direction==='bottom-to-top'; -var isTravelInverted=gesture.direction==='right-to-left'||gesture.direction==='bottom-to-top'; -var currentLoc=isTravelVertical?gestureState.moveY:gestureState.moveX; -var travelDist=isTravelVertical?gestureState.dy:gestureState.dx; -var oppositeAxisTravelDist= -isTravelVertical?gestureState.dx:gestureState.dy; -var edgeHitWidth=gesture.edgeHitWidth; -if(isTravelInverted){ -currentLoc=-currentLoc; -travelDist=-travelDist; -oppositeAxisTravelDist=-oppositeAxisTravelDist; -edgeHitWidth=isTravelVertical? --(SCREEN_HEIGHT-edgeHitWidth): --(SCREEN_WIDTH-edgeHitWidth);} - -var moveStartedInRegion=gesture.edgeHitWidth==null|| -currentLoc=gesture.gestureDetectMovement; -if(!moveTravelledFarEnough){ -return false;} - -var directionIsCorrect=Math.abs(travelDist)>Math.abs(oppositeAxisTravelDist)*gesture.directionRatio; -if(directionIsCorrect){ -matchedGesture=gestureName; -return true;}else -{ -_this5._eligibleGestures=_this5._eligibleGestures.slice().splice(gestureIndex,1);}}); - - -return matchedGesture||null;}, - - -_transitionSceneStyle:function(fromIndex,toIndex,progress,index){ -var viewAtIndex=this.refs['scene_'+index]; -if(viewAtIndex===null||viewAtIndex===undefined){ -return;} - - -var sceneConfigIndex=fromIndex=0&&fromIndex>=0){ -navBar.updateProgress(progress,fromIndex,toIndex);}}, - - - -_handleResponderTerminationRequest:function(){ -return false;}, - - -_getDestIndexWithinBounds:function(n){ -var currentIndex=this.state.presentedIndex; -var destIndex=currentIndex+n; -invariant( -destIndex>=0, -'Cannot jump before the first route.'); - -var maxIndex=this.state.routeStack.length-1; -invariant( -maxIndex>=destIndex, -'Cannot jump past the last route.'); - -return destIndex;}, - - -_jumpN:function(n){ -var destIndex=this._getDestIndexWithinBounds(n); -this._enableScene(destIndex); -this._emitWillFocus(this.state.routeStack[destIndex]); -this._transitionTo(destIndex);}, - - -jumpTo:function(route){ -var destIndex=this.state.routeStack.indexOf(route); -invariant( -destIndex!==-1, -'Cannot jump to route that is not in the route stack'); - -this._jumpN(destIndex-this.state.presentedIndex);}, - - -jumpForward:function(){ -this._jumpN(1);}, - - -jumpBack:function(){ -this._jumpN(-1);}, - - -push:function(route){var _this6=this; -invariant(!!route,'Must supply route to push'); -var activeLength=this.state.presentedIndex+1; -var activeStack=this.state.routeStack.slice(0,activeLength); -var activeAnimationConfigStack=this.state.sceneConfigStack.slice(0,activeLength); -var nextStack=activeStack.concat([route]); -var destIndex=nextStack.length-1; -var nextAnimationConfigStack=activeAnimationConfigStack.concat([ -this.props.configureScene(route)]); - -this._emitWillFocus(nextStack[destIndex]); -this.setState({ -routeStack:nextStack, -sceneConfigStack:nextAnimationConfigStack}, -function(){ -_this6._enableScene(destIndex); -_this6._transitionTo(destIndex);});}, - - - -_popN:function(n){var _this7=this; -if(n===0){ -return;} - -invariant( -this.state.presentedIndex-n>=0, -'Cannot pop below zero'); - -var popIndex=this.state.presentedIndex-n; -this._enableScene(popIndex); -this._emitWillFocus(this.state.routeStack[popIndex]); -this._transitionTo( -popIndex, -null, -null, -function(){ -_this7._cleanScenesPastIndex(popIndex);});}, - - - - -pop:function(){ -if(this.state.transitionQueue.length){ - - - - - - -return;} - - -if(this.state.presentedIndex>0){ -this._popN(1);}}, - - - - - - - - - -replaceAtIndex:function(route,index,cb){var _this8=this; -invariant(!!route,'Must supply route to replace'); -if(index<0){ -index+=this.state.routeStack.length;} - - -if(this.state.routeStack.length<=index){ -return;} - - -var nextRouteStack=this.state.routeStack.slice(); -var nextAnimationModeStack=this.state.sceneConfigStack.slice(); -nextRouteStack[index]=route; -nextAnimationModeStack[index]=this.props.configureScene(route); - -if(index===this.state.presentedIndex){ -this._emitWillFocus(route);} - -this.setState({ -routeStack:nextRouteStack, -sceneConfigStack:nextAnimationModeStack}, -function(){ -if(index===_this8.state.presentedIndex){ -_this8._emitDidFocus(route);} - -cb&&cb();});}, - - - - - - -replace:function(route){ -this.replaceAtIndex(route,this.state.presentedIndex);}, - - - - - -replacePrevious:function(route){ -this.replaceAtIndex(route,this.state.presentedIndex-1);}, - - -popToTop:function(){ -this.popToRoute(this.state.routeStack[0]);}, - - -popToRoute:function(route){ -var indexOfRoute=this.state.routeStack.indexOf(route); -invariant( -indexOfRoute!==-1, -'Calling popToRoute for a route that doesn\'t exist!'); - -var numToPop=this.state.presentedIndex-indexOfRoute; -this._popN(numToPop);}, - - -replacePreviousAndPop:function(route){ -if(this.state.routeStack.length<2){ -return;} - -this.replacePrevious(route); -this.pop();}, - - -resetTo:function(route){var _this9=this; -invariant(!!route,'Must supply route to push'); -this.replaceAtIndex(route,0,function(){ - - -if(_this9.state.presentedIndex>0){ -_this9._popN(_this9.state.presentedIndex);}});}, - - - - -getCurrentRoutes:function(){ - -return this.state.routeStack.slice();}, - - -_cleanScenesPastIndex:function(index){ -var newStackLength=index+1; - -if(newStackLength0){ - - -var args=Array.prototype.slice.call(arguments); -this._emitQueue.push(args); -return;} - - -this._emitCounter++; - -if(LegacyEventTypes.has(eventType)){ - -this.__emit( -eventType, -data, -null, -{ -defaultPrevented:false, -eventPhase:AT_TARGET, -propagationStopped:true, -target:this});}else - - -{ -var targets=[this]; -var parentTarget=this.parent; -while(parentTarget){ -targets.unshift(parentTarget); -parentTarget=parentTarget.parent;} - - -var propagationStopped=false; -var defaultPrevented=false; -var callback=function(event){ -propagationStopped=propagationStopped||event.isPropagationStopped(); -defaultPrevented=defaultPrevented||event.defaultPrevented;}; - - - -targets.some(function(currentTarget){ -if(propagationStopped){ -return true;} - - -var extraInfo={ -defaultPrevented:defaultPrevented, -eventPhase:CAPTURING_PHASE, -propagationStopped:propagationStopped, -target:_this}; - - -currentTarget.__emit(eventType,data,callback,extraInfo);}, -this); - - -targets.reverse().some(function(currentTarget){ -if(propagationStopped){ -return true;} - -var extraInfo={ -defaultPrevented:defaultPrevented, -eventPhase:BUBBLING_PHASE, -propagationStopped:propagationStopped, -target:_this}; - -currentTarget.__emit(eventType,data,callback,extraInfo);}, -this);} - - -if(didEmitCallback){ -var event=NavigationEvent.pool(eventType,this,data); -propagationStopped&&event.stopPropagation(); -defaultPrevented&&event.preventDefault(); -didEmitCallback.call(this,event); -event.dispose();} - - -this._emitCounter--; -while(this._emitQueue.length){ -var args=this._emitQueue.shift(); -this.emit.apply(this,args);}}},{key:'dispose',value:function dispose() - - - -{ - -this._bubbleEventEmitter&&this._bubbleEventEmitter.removeAllListeners(); -this._captureEventEmitter&&this._captureEventEmitter.removeAllListeners(); -this._bubbleEventEmitter=null; -this._captureEventEmitter=null; -this._currentRoute=null;}},{key:'__emit',value:function __emit( - - - - -eventType, -data, -didEmitCallback, -extraInfo) -{ -var emitter; -switch(extraInfo.eventPhase){ -case CAPTURING_PHASE: -emitter=this._captureEventEmitter; -break; - -case AT_TARGET: -emitter=this._bubbleEventEmitter; -break; - -case BUBBLING_PHASE: -emitter=this._bubbleEventEmitter; -break; - -default: -invariant(false,'invalid event phase %s',extraInfo.eventPhase);} - - -if(extraInfo.target===this){ - -extraInfo.eventPhase=AT_TARGET;} - - -if(emitter){ -emitter.emit( -eventType, -data, -didEmitCallback, -extraInfo);}}},{key:'_onFocus',value:function _onFocus( - - - - -event){ -invariant( -event.data&&event.data.hasOwnProperty('route'), -'event type "%s" should provide route', -event.type); - - -this._currentRoute=event.data.route;}},{key:'parent',get:function(){var parent=this.__node.getParent();return parent?parent.getValue():null;}},{key:'top',get:function(){var result=null;var parentNode=this.__node.getParent();while(parentNode){result=parentNode.getValue();parentNode=parentNode.getParent();}return result;}},{key:'currentRoute',get:function(){return this._currentRoute;}}]);return NavigationContext;})(); - - - -module.exports=NavigationContext; -}); -__d('NavigationEvent',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var invariant=require('invariant');var - -NavigationEventPool=(function(){ - - -function NavigationEventPool(){babelHelpers.classCallCheck(this,NavigationEventPool); -this._list=[];}babelHelpers.createClass(NavigationEventPool,[{key:'get',value:function get( - - -type,currentTarget,data){ -var event; -if(this._list.length>0){ -event=this._list.pop(); -event.constructor.call(event,type,currentTarget,data);}else -{ -event=new NavigationEvent(type,currentTarget,data);} - -return event;}},{key:'put',value:function put( - - -event){ -this._list.push(event);}}]);return NavigationEventPool;})(); - - - -var _navigationEventPool=new NavigationEventPool();var - - - - - - - - - - - - - - - - - - - - - - - -NavigationEvent=(function(){babelHelpers.createClass(NavigationEvent,null,[{key:'pool',value:function pool( - - - - - - - - - - - - - - - - - - -type,currentTarget,data){ -return _navigationEventPool.get(type,currentTarget,data);}}]); - - -function NavigationEvent(type,currentTarget,data){babelHelpers.classCallCheck(this,NavigationEvent); -this.target=currentTarget; -this.eventPhase=NavigationEvent.NONE; - -this._type=type; -this._currentTarget=currentTarget; -this._data=data; -this._defaultPrevented=false; -this._disposed=false; -this._propagationStopped=false;}babelHelpers.createClass(NavigationEvent,[{key:'preventDefault',value:function preventDefault() - - - - - - - - - - - - - - - - - - - - - - -{ -this._defaultPrevented=true;}},{key:'stopPropagation',value:function stopPropagation() - - -{ -this._propagationStopped=true;}},{key:'stop',value:function stop() - - -{ -this.preventDefault(); -this.stopPropagation();}},{key:'isPropagationStopped',value:function isPropagationStopped() - - -{ -return this._propagationStopped;}},{key:'dispose',value:function dispose() - - - - - - - -{ -invariant(!this._disposed,'NavigationEvent is already disposed'); -this._disposed=true; - - -this.target=null; -this.eventPhase=NavigationEvent.NONE; -this._type=null; -this._currentTarget=null; -this._data=null; -this._defaultPrevented=false; - - -_navigationEventPool.put(this);}},{key:'type',get:function(){return this._type;}},{key:'currentTarget',get:function(){return this._currentTarget;}},{key:'data',get:function(){return this._data;}},{key:'defaultPrevented',get:function(){return this._defaultPrevented;}}]);return NavigationEvent;})(); - - - - - - - - - - -NavigationEvent.NONE=0; - - -NavigationEvent.CAPTURING_PHASE=1; - - - -NavigationEvent.AT_TARGET=2; - - - - - -NavigationEvent.BUBBLING_PHASE=3; - -module.exports=NavigationEvent; -}); -__d('NavigationEventEmitter',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var EventEmitter=require('EventEmitter'); -var NavigationEvent=require('NavigationEvent');var - - - - - - - - -NavigationEventEmitter=(function(_EventEmitter){babelHelpers.inherits(NavigationEventEmitter,_EventEmitter); - - - - -function NavigationEventEmitter(target){babelHelpers.classCallCheck(this,NavigationEventEmitter);var _this=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(NavigationEventEmitter).call(this)); - -_this._emitting=false; -_this._emitQueue=[]; -_this._target=target;return _this;}babelHelpers.createClass(NavigationEventEmitter,[{key:'emit',value:function emit( - - - -eventType, -data, -didEmitCallback, -extraInfo) -{ -if(this._emitting){ - - -var args=Array.prototype.slice.call(arguments); -this._emitQueue.unshift(args); -return;} - - -this._emitting=true; - -var event=NavigationEvent.pool(eventType,this._target,data); - -if(extraInfo){ -if(extraInfo.target){ -event.target=extraInfo.target;} - - -if(extraInfo.eventPhase){ -event.eventPhase=extraInfo.eventPhase;} - - -if(extraInfo.defaultPrevented){ -event.preventDefault();} - - -if(extraInfo.propagationStopped){ -event.stopPropagation();}} - - - - - -babelHelpers.get(Object.getPrototypeOf(NavigationEventEmitter.prototype),'emit',this).call(this,String(eventType),event); - -if(typeof didEmitCallback==='function'){ -didEmitCallback.call(this._target,event);} - -event.dispose(); - -this._emitting=false; - -while(this._emitQueue.length){ -var args=this._emitQueue.shift(); -this.emit.apply(this,args);}}}]);return NavigationEventEmitter;})(EventEmitter); - - - - -module.exports=NavigationEventEmitter; -}); -__d('NavigationTreeNode',function(global, require, module, exports) { 'use strict'; - - - - - - - - - -var invariant=require('invariant'); -var immutable=require('immutable/dist/immutable.js');var - -List=immutable.List;var - - - - - - -NavigationTreeNode=(function(){ - - - - - - -function NavigationTreeNode(value){babelHelpers.classCallCheck(this,NavigationTreeNode); -this.__parent=null; -this._children=new List(); -this._value=value;}babelHelpers.createClass(NavigationTreeNode,[{key:'getValue',value:function getValue() - - -{ -return this._value;}},{key:'getParent',value:function getParent() - - -{ -return this.__parent;}},{key:'getChildrenCount',value:function getChildrenCount() - - -{ -return this._children.size;}},{key:'getChildAt',value:function getChildAt( - - -index){ -return index>-1&&index-1, -'The node to be removed is not a child of this node.'); - - -child.__parent=null; - -this._children=this._children.splice(index,1);}},{key:'indexOf',value:function indexOf( - - -child){ -return this._children.indexOf(child);}},{key:'forEach',value:function forEach( - - -callback,context){ -this._children.forEach(callback,context);}},{key:'map',value:function map( - - -callback,context){ -return this._children.map(callback,context).toJS();}},{key:'some',value:function some( - - -callback,context){ -return this._children.some(callback,context);}}]);return NavigationTreeNode;})(); - - - - -module.exports=NavigationTreeNode; -}); -__d('immutable/dist/immutable.js',function(global, require, module, exports) { ( - - - - - - - - -function(global,factory){ -typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(): -typeof define==='function'&&define.amd?define(factory): -global.Immutable=factory();})( -this,function(){'use strict';var SLICE$0=Array.prototype.slice; - -function createClass(ctor,superClass){ -if(superClass){ -ctor.prototype=Object.create(superClass.prototype);} - -ctor.prototype.constructor=ctor;} - - -function Iterable(value){ -return isIterable(value)?value:Seq(value);} - - - -createClass(KeyedIterable,Iterable); -function KeyedIterable(value){ -return isKeyed(value)?value:KeyedSeq(value);} - - - -createClass(IndexedIterable,Iterable); -function IndexedIterable(value){ -return isIndexed(value)?value:IndexedSeq(value);} - - - -createClass(SetIterable,Iterable); -function SetIterable(value){ -return isIterable(value)&&!isAssociative(value)?value:SetSeq(value);} - - - - -function isIterable(maybeIterable){ -return !!(maybeIterable&&maybeIterable[IS_ITERABLE_SENTINEL]);} - - -function isKeyed(maybeKeyed){ -return !!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]);} - - -function isIndexed(maybeIndexed){ -return !!(maybeIndexed&&maybeIndexed[IS_INDEXED_SENTINEL]);} - - -function isAssociative(maybeAssociative){ -return isKeyed(maybeAssociative)||isIndexed(maybeAssociative);} - - -function isOrdered(maybeOrdered){ -return !!(maybeOrdered&&maybeOrdered[IS_ORDERED_SENTINEL]);} - - -Iterable.isIterable=isIterable; -Iterable.isKeyed=isKeyed; -Iterable.isIndexed=isIndexed; -Iterable.isAssociative=isAssociative; -Iterable.isOrdered=isOrdered; - -Iterable.Keyed=KeyedIterable; -Iterable.Indexed=IndexedIterable; -Iterable.Set=SetIterable; - - -var IS_ITERABLE_SENTINEL='@@__IMMUTABLE_ITERABLE__@@'; -var IS_KEYED_SENTINEL='@@__IMMUTABLE_KEYED__@@'; -var IS_INDEXED_SENTINEL='@@__IMMUTABLE_INDEXED__@@'; -var IS_ORDERED_SENTINEL='@@__IMMUTABLE_ORDERED__@@'; - - -var DELETE='delete'; - - -var SHIFT=5; -var SIZE=1<>>0; -if(''+uint32Index!==index||uint32Index===4294967295){ -return NaN;} - -index=uint32Index;} - -return index<0?ensureSize(iter)+index:index;} - - -function returnTrue(){ -return true;} - - -function wholeSlice(begin,end,size){ -return (begin===0||size!==undefined&&begin<=-size)&&( -end===undefined||size!==undefined&&end>=size);} - - -function resolveBegin(begin,size){ -return resolveIndex(begin,size,0);} - - -function resolveEnd(end,size){ -return resolveIndex(end,size,size);} - - -function resolveIndex(index,size,defaultIndex){ -return index===undefined? -defaultIndex: -index<0? -Math.max(0,size+index): -size===undefined? -index: -Math.min(size,index);} - - - - -var ITERATE_KEYS=0; -var ITERATE_VALUES=1; -var ITERATE_ENTRIES=2; - -var REAL_ITERATOR_SYMBOL=typeof Symbol==='function'&&Symbol.iterator; -var FAUX_ITERATOR_SYMBOL='@@iterator'; - -var ITERATOR_SYMBOL=REAL_ITERATOR_SYMBOL||FAUX_ITERATOR_SYMBOL; - - -function Iterator(next){ -this.next=next;} - - -Iterator.prototype.toString=function(){ -return '[Iterator]';}; - - - -Iterator.KEYS=ITERATE_KEYS; -Iterator.VALUES=ITERATE_VALUES; -Iterator.ENTRIES=ITERATE_ENTRIES; - -Iterator.prototype.inspect= -Iterator.prototype.toSource=function(){return this.toString();}; -Iterator.prototype[ITERATOR_SYMBOL]=function(){ -return this;}; - - - -function iteratorValue(type,k,v,iteratorResult){ -var value=type===0?k:type===1?v:[k,v]; -iteratorResult?iteratorResult.value=value:iteratorResult={ -value:value,done:false}; - -return iteratorResult;} - - -function iteratorDone(){ -return {value:undefined,done:true};} - - -function hasIterator(maybeIterable){ -return !!getIteratorFn(maybeIterable);} - - -function isIterator(maybeIterator){ -return maybeIterator&&typeof maybeIterator.next==='function';} - - -function getIterator(iterable){ -var iteratorFn=getIteratorFn(iterable); -return iteratorFn&&iteratorFn.call(iterable);} - - -function getIteratorFn(iterable){ -var iteratorFn=iterable&&( -REAL_ITERATOR_SYMBOL&&iterable[REAL_ITERATOR_SYMBOL]|| -iterable[FAUX_ITERATOR_SYMBOL]); - -if(typeof iteratorFn==='function'){ -return iteratorFn;}} - - - -function isArrayLike(value){ -return value&&typeof value.length==='number';} - - -createClass(Seq,Iterable); -function Seq(value){ -return value===null||value===undefined?emptySequence(): -isIterable(value)?value.toSeq():seqFromValue(value);} - - -Seq.of=function(){ -return Seq(arguments);}; - - -Seq.prototype.toSeq=function(){ -return this;}; - - -Seq.prototype.toString=function(){ -return this.__toString('Seq {','}');}; - - -Seq.prototype.cacheResult=function(){ -if(!this._cache&&this.__iterateUncached){ -this._cache=this.entrySeq().toArray(); -this.size=this._cache.length;} - -return this;}; - - - - -Seq.prototype.__iterate=function(fn,reverse){ -return seqIterate(this,fn,reverse,true);}; - - - - -Seq.prototype.__iterator=function(type,reverse){ -return seqIterator(this,type,reverse,true);}; - - - - -createClass(KeyedSeq,Seq); -function KeyedSeq(value){ -return value===null||value===undefined? -emptySequence().toKeyedSeq(): -isIterable(value)? -isKeyed(value)?value.toSeq():value.fromEntrySeq(): -keyedSeqFromValue(value);} - - -KeyedSeq.prototype.toKeyedSeq=function(){ -return this;}; - - - - -createClass(IndexedSeq,Seq); -function IndexedSeq(value){ -return value===null||value===undefined?emptySequence(): -!isIterable(value)?indexedSeqFromValue(value): -isKeyed(value)?value.entrySeq():value.toIndexedSeq();} - - -IndexedSeq.of=function(){ -return IndexedSeq(arguments);}; - - -IndexedSeq.prototype.toIndexedSeq=function(){ -return this;}; - - -IndexedSeq.prototype.toString=function(){ -return this.__toString('Seq [',']');}; - - -IndexedSeq.prototype.__iterate=function(fn,reverse){ -return seqIterate(this,fn,reverse,false);}; - - -IndexedSeq.prototype.__iterator=function(type,reverse){ -return seqIterator(this,type,reverse,false);}; - - - - -createClass(SetSeq,Seq); -function SetSeq(value){ -return ( -value===null||value===undefined?emptySequence(): -!isIterable(value)?indexedSeqFromValue(value): -isKeyed(value)?value.entrySeq():value). -toSetSeq();} - - -SetSeq.of=function(){ -return SetSeq(arguments);}; - - -SetSeq.prototype.toSetSeq=function(){ -return this;}; - - - - -Seq.isSeq=isSeq; -Seq.Keyed=KeyedSeq; -Seq.Set=SetSeq; -Seq.Indexed=IndexedSeq; - -var IS_SEQ_SENTINEL='@@__IMMUTABLE_SEQ__@@'; - -Seq.prototype[IS_SEQ_SENTINEL]=true; - - - -createClass(ArraySeq,IndexedSeq); -function ArraySeq(array){ -this._array=array; -this.size=array.length;} - - -ArraySeq.prototype.get=function(index,notSetValue){ -return this.has(index)?this._array[wrapIndex(this,index)]:notSetValue;}; - - -ArraySeq.prototype.__iterate=function(fn,reverse){ -var array=this._array; -var maxIndex=array.length-1; -for(var ii=0;ii<=maxIndex;ii++){ -if(fn(array[reverse?maxIndex-ii:ii],ii,this)===false){ -return ii+1;}} - - -return ii;}; - - -ArraySeq.prototype.__iterator=function(type,reverse){ -var array=this._array; -var maxIndex=array.length-1; -var ii=0; -return new Iterator(function() -{return ii>maxIndex? -iteratorDone(): -iteratorValue(type,ii,array[reverse?maxIndex-ii++:ii++]);});}; - - - - - -createClass(ObjectSeq,KeyedSeq); -function ObjectSeq(object){ -var keys=Object.keys(object); -this._object=object; -this._keys=keys; -this.size=keys.length;} - - -ObjectSeq.prototype.get=function(key,notSetValue){ -if(notSetValue!==undefined&&!this.has(key)){ -return notSetValue;} - -return this._object[key];}; - - -ObjectSeq.prototype.has=function(key){ -return this._object.hasOwnProperty(key);}; - - -ObjectSeq.prototype.__iterate=function(fn,reverse){ -var object=this._object; -var keys=this._keys; -var maxIndex=keys.length-1; -for(var ii=0;ii<=maxIndex;ii++){ -var key=keys[reverse?maxIndex-ii:ii]; -if(fn(object[key],key,this)===false){ -return ii+1;}} - - -return ii;}; - - -ObjectSeq.prototype.__iterator=function(type,reverse){ -var object=this._object; -var keys=this._keys; -var maxIndex=keys.length-1; -var ii=0; -return new Iterator(function(){ -var key=keys[reverse?maxIndex-ii:ii]; -return ii++>maxIndex? -iteratorDone(): -iteratorValue(type,key,object[key]);});}; - - - -ObjectSeq.prototype[IS_ORDERED_SENTINEL]=true; - - -createClass(IterableSeq,IndexedSeq); -function IterableSeq(iterable){ -this._iterable=iterable; -this.size=iterable.length||iterable.size;} - - -IterableSeq.prototype.__iterateUncached=function(fn,reverse){ -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var iterable=this._iterable; -var iterator=getIterator(iterable); -var iterations=0; -if(isIterator(iterator)){ -var step; -while(!(step=iterator.next()).done){ -if(fn(step.value,iterations++,this)===false){ -break;}}} - - - -return iterations;}; - - -IterableSeq.prototype.__iteratorUncached=function(type,reverse){ -if(reverse){ -return this.cacheResult().__iterator(type,reverse);} - -var iterable=this._iterable; -var iterator=getIterator(iterable); -if(!isIterator(iterator)){ -return new Iterator(iteratorDone);} - -var iterations=0; -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step:iteratorValue(type,iterations++,step.value);});}; - - - - - -createClass(IteratorSeq,IndexedSeq); -function IteratorSeq(iterator){ -this._iterator=iterator; -this._iteratorCache=[];} - - -IteratorSeq.prototype.__iterateUncached=function(fn,reverse){ -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var iterator=this._iterator; -var cache=this._iteratorCache; -var iterations=0; -while(iterations=cache.length){ -var step=iterator.next(); -if(step.done){ -return step;} - -cache[iterations]=step.value;} - -return iteratorValue(type,iterations,cache[iterations++]);});}; - - - - - - - - -function isSeq(maybeSeq){ -return !!(maybeSeq&&maybeSeq[IS_SEQ_SENTINEL]);} - - -var EMPTY_SEQ; - -function emptySequence(){ -return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]));} - - -function keyedSeqFromValue(value){ -var seq= -Array.isArray(value)?new ArraySeq(value).fromEntrySeq(): -isIterator(value)?new IteratorSeq(value).fromEntrySeq(): -hasIterator(value)?new IterableSeq(value).fromEntrySeq(): -typeof value==='object'?new ObjectSeq(value): -undefined; -if(!seq){ -throw new TypeError( -'Expected Array or iterable object of [k, v] entries, '+ -'or keyed object: '+value);} - - -return seq;} - - -function indexedSeqFromValue(value){ -var seq=maybeIndexedSeqFromValue(value); -if(!seq){ -throw new TypeError( -'Expected Array or iterable object of values: '+value);} - - -return seq;} - - -function seqFromValue(value){ -var seq=maybeIndexedSeqFromValue(value)|| -typeof value==='object'&&new ObjectSeq(value); -if(!seq){ -throw new TypeError( -'Expected Array or iterable object of values, or keyed object: '+value);} - - -return seq;} - - -function maybeIndexedSeqFromValue(value){ -return ( -isArrayLike(value)?new ArraySeq(value): -isIterator(value)?new IteratorSeq(value): -hasIterator(value)?new IterableSeq(value): -undefined);} - - - -function seqIterate(seq,fn,reverse,useKeys){ -var cache=seq._cache; -if(cache){ -var maxIndex=cache.length-1; -for(var ii=0;ii<=maxIndex;ii++){ -var entry=cache[reverse?maxIndex-ii:ii]; -if(fn(entry[1],useKeys?entry[0]:ii,seq)===false){ -return ii+1;}} - - -return ii;} - -return seq.__iterateUncached(fn,reverse);} - - -function seqIterator(seq,type,reverse,useKeys){ -var cache=seq._cache; -if(cache){ -var maxIndex=cache.length-1; -var ii=0; -return new Iterator(function(){ -var entry=cache[reverse?maxIndex-ii:ii]; -return ii++>maxIndex? -iteratorDone(): -iteratorValue(type,useKeys?entry[0]:ii-1,entry[1]);});} - - -return seq.__iteratorUncached(type,reverse);} - - -function fromJS(json,converter){ -return converter? -fromJSWith(converter,json,'',{'':json}): -fromJSDefault(json);} - - -function fromJSWith(converter,json,key,parentJSON){ -if(Array.isArray(json)){ -return converter.call(parentJSON,key,IndexedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json);}));} - -if(isPlainObj(json)){ -return converter.call(parentJSON,key,KeyedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json);}));} - -return json;} - - -function fromJSDefault(json){ -if(Array.isArray(json)){ -return IndexedSeq(json).map(fromJSDefault).toList();} - -if(isPlainObj(json)){ -return KeyedSeq(json).map(fromJSDefault).toMap();} - -return json;} - - -function isPlainObj(value){ -return value&&(value.constructor===Object||value.constructor===undefined);} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function is(valueA,valueB){ -if(valueA===valueB||valueA!==valueA&&valueB!==valueB){ -return true;} - -if(!valueA||!valueB){ -return false;} - -if(typeof valueA.valueOf==='function'&& -typeof valueB.valueOf==='function'){ -valueA=valueA.valueOf(); -valueB=valueB.valueOf(); -if(valueA===valueB||valueA!==valueA&&valueB!==valueB){ -return true;} - -if(!valueA||!valueB){ -return false;}} - - -if(typeof valueA.equals==='function'&& -typeof valueB.equals==='function'&& -valueA.equals(valueB)){ -return true;} - -return false;} - - -function deepEqual(a,b){ -if(a===b){ -return true;} - - -if( -!isIterable(b)|| -a.size!==undefined&&b.size!==undefined&&a.size!==b.size|| -a.__hash!==undefined&&b.__hash!==undefined&&a.__hash!==b.__hash|| -isKeyed(a)!==isKeyed(b)|| -isIndexed(a)!==isIndexed(b)|| -isOrdered(a)!==isOrdered(b)) -{ -return false;} - - -if(a.size===0&&b.size===0){ -return true;} - - -var notAssociative=!isAssociative(a); - -if(isOrdered(a)){ -var entries=a.entries(); -return b.every(function(v,k){ -var entry=entries.next().value; -return entry&&is(entry[1],v)&&(notAssociative||is(entry[0],k));})&& -entries.next().done;} - - -var flipped=false; - -if(a.size===undefined){ -if(b.size===undefined){ -if(typeof a.cacheResult==='function'){ -a.cacheResult();}}else - -{ -flipped=true; -var _=a; -a=b; -b=_;}} - - - -var allEqual=true; -var bSize=b.__iterate(function(v,k){ -if(notAssociative?!a.has(v): -flipped?!is(v,a.get(k,NOT_SET)):!is(a.get(k,NOT_SET),v)){ -allEqual=false; -return false;}}); - - - -return allEqual&&a.size===bSize;} - - -createClass(Repeat,IndexedSeq); - -function Repeat(value,times){ -if(!(this instanceof Repeat)){ -return new Repeat(value,times);} - -this._value=value; -this.size=times===undefined?Infinity:Math.max(0,times); -if(this.size===0){ -if(EMPTY_REPEAT){ -return EMPTY_REPEAT;} - -EMPTY_REPEAT=this;}} - - - -Repeat.prototype.toString=function(){ -if(this.size===0){ -return 'Repeat []';} - -return 'Repeat [ '+this._value+' '+this.size+' times ]';}; - - -Repeat.prototype.get=function(index,notSetValue){ -return this.has(index)?this._value:notSetValue;}; - - -Repeat.prototype.includes=function(searchValue){ -return is(this._value,searchValue);}; - - -Repeat.prototype.slice=function(begin,end){ -var size=this.size; -return wholeSlice(begin,end,size)?this: -new Repeat(this._value,resolveEnd(end,size)-resolveBegin(begin,size));}; - - -Repeat.prototype.reverse=function(){ -return this;}; - - -Repeat.prototype.indexOf=function(searchValue){ -if(is(this._value,searchValue)){ -return 0;} - -return -1;}; - - -Repeat.prototype.lastIndexOf=function(searchValue){ -if(is(this._value,searchValue)){ -return this.size;} - -return -1;}; - - -Repeat.prototype.__iterate=function(fn,reverse){ -for(var ii=0;ii1?' by '+this._step:'')+ -' ]';}; - - -Range.prototype.get=function(index,notSetValue){ -return this.has(index)? -this._start+wrapIndex(this,index)*this._step: -notSetValue;}; - - -Range.prototype.includes=function(searchValue){ -var possibleIndex=(searchValue-this._start)/this._step; -return possibleIndex>=0&& -possibleIndex=0&&indexmaxIndex?iteratorDone():iteratorValue(type,ii++,v);});}; - - - -Range.prototype.equals=function(other){ -return other instanceof Range? -this._start===other._start&& -this._end===other._end&& -this._step===other._step: -deepEqual(this,other);}; - - - -var EMPTY_RANGE; - -createClass(Collection,Iterable); -function Collection(){ -throw TypeError('Abstract');} - - - -createClass(KeyedCollection,Collection);function KeyedCollection(){} - -createClass(IndexedCollection,Collection);function IndexedCollection(){} - -createClass(SetCollection,Collection);function SetCollection(){} - - -Collection.Keyed=KeyedCollection; -Collection.Indexed=IndexedCollection; -Collection.Set=SetCollection; - -var imul= -typeof Math.imul==='function'&&Math.imul(0xffffffff,2)===-2? -Math.imul: -function imul(a,b){ -a=a|0; -b=b|0; -var c=a&0xffff; -var d=b&0xffff; - -return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0;}; - - - - - - -function smi(i32){ -return i32>>>1&0x40000000|i32&0xBFFFFFFF;} - - -function hash(o){ -if(o===false||o===null||o===undefined){ -return 0;} - -if(typeof o.valueOf==='function'){ -o=o.valueOf(); -if(o===false||o===null||o===undefined){ -return 0;}} - - -if(o===true){ -return 1;} - -var type=typeof o; -if(type==='number'){ -var h=o|0; -if(h!==o){ -h^=o*0xFFFFFFFF;} - -while(o>0xFFFFFFFF){ -o/=0xFFFFFFFF; -h^=o;} - -return smi(h);} - -if(type==='string'){ -return o.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(o):hashString(o);} - -if(typeof o.hashCode==='function'){ -return o.hashCode();} - -if(type==='object'){ -return hashJSObj(o);} - -if(typeof o.toString==='function'){ -return hashString(o.toString());} - -throw new Error('Value type '+type+' cannot be hashed.');} - - -function cachedHashString(string){ -var hash=stringHashCache[string]; -if(hash===undefined){ -hash=hashString(string); -if(STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE){ -STRING_HASH_CACHE_SIZE=0; -stringHashCache={};} - -STRING_HASH_CACHE_SIZE++; -stringHashCache[string]=hash;} - -return hash;} - - - -function hashString(string){ - - - - - - -var hash=0; -for(var ii=0;ii0){ -switch(node.nodeType){ -case 1: -return node.uniqueID; -case 9: -return node.documentElement&&node.documentElement.uniqueID;}}} - - - - - -var usingWeakMap=typeof WeakMap==='function'; -var weakMap; -if(usingWeakMap){ -weakMap=new WeakMap();} - - -var objHashUID=0; - -var UID_HASH_KEY='__immutablehash__'; -if(typeof Symbol==='function'){ -UID_HASH_KEY=Symbol(UID_HASH_KEY);} - - -var STRING_HASH_CACHE_MIN_STRLEN=16; -var STRING_HASH_CACHE_MAX_SIZE=255; -var STRING_HASH_CACHE_SIZE=0; -var stringHashCache={}; - -function assertNotInfinite(size){ -invariant( -size!==Infinity, -'Cannot perform this action with an infinite size.');} - - - -createClass(Map,KeyedCollection); - - - -function Map(value){ -return value===null||value===undefined?emptyMap(): -isMap(value)&&!isOrdered(value)?value: -emptyMap().withMutations(function(map){ -var iter=KeyedIterable(value); -assertNotInfinite(iter.size); -iter.forEach(function(v,k){return map.set(k,v);});});} - - - -Map.prototype.toString=function(){ -return this.__toString('Map {','}');}; - - - - -Map.prototype.get=function(k,notSetValue){ -return this._root? -this._root.get(0,undefined,k,notSetValue): -notSetValue;}; - - - - -Map.prototype.set=function(k,v){ -return updateMap(this,k,v);}; - - -Map.prototype.setIn=function(keyPath,v){ -return this.updateIn(keyPath,NOT_SET,function(){return v;});}; - - -Map.prototype.remove=function(k){ -return updateMap(this,k,NOT_SET);}; - - -Map.prototype.deleteIn=function(keyPath){ -return this.updateIn(keyPath,function(){return NOT_SET;});}; - - -Map.prototype.update=function(k,notSetValue,updater){ -return arguments.length===1? -k(this): -this.updateIn([k],notSetValue,updater);}; - - -Map.prototype.updateIn=function(keyPath,notSetValue,updater){ -if(!updater){ -updater=notSetValue; -notSetValue=undefined;} - -var updatedValue=updateInDeepMap( -this, -forceIterator(keyPath), -notSetValue, -updater); - -return updatedValue===NOT_SET?undefined:updatedValue;}; - - -Map.prototype.clear=function(){ -if(this.size===0){ -return this;} - -if(this.__ownerID){ -this.size=0; -this._root=null; -this.__hash=undefined; -this.__altered=true; -return this;} - -return emptyMap();}; - - - - -Map.prototype.merge=function(){ -return mergeIntoMapWith(this,undefined,arguments);}; - - -Map.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1); -return mergeIntoMapWith(this,merger,iters);}; - - -Map.prototype.mergeIn=function(keyPath){var iters=SLICE$0.call(arguments,1); -return this.updateIn( -keyPath, -emptyMap(), -function(m){return typeof m.merge==='function'? -m.merge.apply(m,iters): -iters[iters.length-1];});}; - - - -Map.prototype.mergeDeep=function(){ -return mergeIntoMapWith(this,deepMerger,arguments);}; - - -Map.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1); -return mergeIntoMapWith(this,deepMergerWith(merger),iters);}; - - -Map.prototype.mergeDeepIn=function(keyPath){var iters=SLICE$0.call(arguments,1); -return this.updateIn( -keyPath, -emptyMap(), -function(m){return typeof m.mergeDeep==='function'? -m.mergeDeep.apply(m,iters): -iters[iters.length-1];});}; - - - -Map.prototype.sort=function(comparator){ - -return OrderedMap(sortFactory(this,comparator));}; - - -Map.prototype.sortBy=function(mapper,comparator){ - -return OrderedMap(sortFactory(this,comparator,mapper));}; - - - - -Map.prototype.withMutations=function(fn){ -var mutable=this.asMutable(); -fn(mutable); -return mutable.wasAltered()?mutable.__ensureOwner(this.__ownerID):this;}; - - -Map.prototype.asMutable=function(){ -return this.__ownerID?this:this.__ensureOwner(new OwnerID());}; - - -Map.prototype.asImmutable=function(){ -return this.__ensureOwner();}; - - -Map.prototype.wasAltered=function(){ -return this.__altered;}; - - -Map.prototype.__iterator=function(type,reverse){ -return new MapIterator(this,type,reverse);}; - - -Map.prototype.__iterate=function(fn,reverse){var this$0=this; -var iterations=0; -this._root&&this._root.iterate(function(entry){ -iterations++; -return fn(entry[1],entry[0],this$0);}, -reverse); -return iterations;}; - - -Map.prototype.__ensureOwner=function(ownerID){ -if(ownerID===this.__ownerID){ -return this;} - -if(!ownerID){ -this.__ownerID=ownerID; -this.__altered=false; -return this;} - -return makeMap(this.size,this._root,ownerID,this.__hash);}; - - - -function isMap(maybeMap){ -return !!(maybeMap&&maybeMap[IS_MAP_SENTINEL]);} - - -Map.isMap=isMap; - -var IS_MAP_SENTINEL='@@__IMMUTABLE_MAP__@@'; - -var MapPrototype=Map.prototype; -MapPrototype[IS_MAP_SENTINEL]=true; -MapPrototype[DELETE]=MapPrototype.remove; -MapPrototype.removeIn=MapPrototype.deleteIn; - - - - - - -function ArrayMapNode(ownerID,entries){ -this.ownerID=ownerID; -this.entries=entries;} - - -ArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){ -var entries=this.entries; -for(var ii=0,len=entries.length;ii=MAX_ARRAY_MAP_SIZE){ -return createNodes(ownerID,entries,key,value);} - - -var isEditable=ownerID&&ownerID===this.ownerID; -var newEntries=isEditable?entries:arrCopy(entries); - -if(exists){ -if(removed){ -idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop();}else -{ -newEntries[idx]=[key,value];}}else - -{ -newEntries.push([key,value]);} - - -if(isEditable){ -this.entries=newEntries; -return this;} - - -return new ArrayMapNode(ownerID,newEntries);}; - - - - - -function BitmapIndexedNode(ownerID,bitmap,nodes){ -this.ownerID=ownerID; -this.bitmap=bitmap; -this.nodes=nodes;} - - -BitmapIndexedNode.prototype.get=function(shift,keyHash,key,notSetValue){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var bit=1<<((shift===0?keyHash:keyHash>>>shift)&MASK); -var bitmap=this.bitmap; -return (bitmap&bit)===0?notSetValue: -this.nodes[popCount(bitmap&bit-1)].get(shift+SHIFT,keyHash,key,notSetValue);}; - - -BitmapIndexedNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var keyHashFrag=(shift===0?keyHash:keyHash>>>shift)&MASK; -var bit=1<=MAX_BITMAP_INDEXED_SIZE){ -return expandNodes(ownerID,nodes,bitmap,keyHashFrag,newNode);} - - -if(exists&&!newNode&&nodes.length===2&&isLeafNode(nodes[idx^1])){ -return nodes[idx^1];} - - -if(exists&&newNode&&nodes.length===1&&isLeafNode(newNode)){ -return newNode;} - - -var isEditable=ownerID&&ownerID===this.ownerID; -var newBitmap=exists?newNode?bitmap:bitmap^bit:bitmap|bit; -var newNodes=exists?newNode? -setIn(nodes,idx,newNode,isEditable): -spliceOut(nodes,idx,isEditable): -spliceIn(nodes,idx,newNode,isEditable); - -if(isEditable){ -this.bitmap=newBitmap; -this.nodes=newNodes; -return this;} - - -return new BitmapIndexedNode(ownerID,newBitmap,newNodes);}; - - - - - -function HashArrayMapNode(ownerID,count,nodes){ -this.ownerID=ownerID; -this.count=count; -this.nodes=nodes;} - - -HashArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var idx=(shift===0?keyHash:keyHash>>>shift)&MASK; -var node=this.nodes[idx]; -return node?node.get(shift+SHIFT,keyHash,key,notSetValue):notSetValue;}; - - -HashArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){ -if(keyHash===undefined){ -keyHash=hash(key);} - -var idx=(shift===0?keyHash:keyHash>>>shift)&MASK; -var removed=value===NOT_SET; -var nodes=this.nodes; -var node=nodes[idx]; - -if(removed&&!node){ -return this;} - - -var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter); -if(newNode===node){ -return this;} - - -var newCount=this.count; -if(!node){ -newCount++;}else -if(!newNode){ -newCount--; -if(newCount>>shift)&MASK; -var idx2=(shift===0?keyHash:keyHash>>>shift)&MASK; - -var newNode; -var nodes=idx1===idx2? -[mergeIntoNode(node,ownerID,shift+SHIFT,keyHash,entry)]:( -newNode=new ValueNode(ownerID,keyHash,entry),idx1>>=1){ -expandedNodes[ii]=bitmap&1?nodes[count++]:undefined;} - -expandedNodes[including]=node; -return new HashArrayMapNode(ownerID,count+1,expandedNodes);} - - -function mergeIntoMapWith(map,merger,iterables){ -var iters=[]; -for(var ii=0;ii>1&0x55555555); -x=(x&0x33333333)+(x>>2&0x33333333); -x=x+(x>>4)&0x0f0f0f0f; -x=x+(x>>8); -x=x+(x>>16); -return x&0x7f;} - - -function setIn(array,idx,val,canEdit){ -var newArray=canEdit?array:arrCopy(array); -newArray[idx]=val; -return newArray;} - - -function spliceIn(array,idx,val,canEdit){ -var newLen=array.length+1; -if(canEdit&&idx+1===newLen){ -array[idx]=val; -return array;} - -var newArray=new Array(newLen); -var after=0; -for(var ii=0;ii0&&size=0&&index>>level&MASK; -if(originIndex>=this.array.length){ -return new VNode([],ownerID);} - -var removingFirst=originIndex===0; -var newChild; -if(level>0){ -var oldChild=this.array[originIndex]; -newChild=oldChild&&oldChild.removeBefore(ownerID,level-SHIFT,index); -if(newChild===oldChild&&removingFirst){ -return this;}} - - -if(removingFirst&&!newChild){ -return this;} - -var editable=editableVNode(this,ownerID); -if(!removingFirst){ -for(var ii=0;ii>>level&MASK; -if(sizeIndex>=this.array.length){ -return this;} - - -var newChild; -if(level>0){ -var oldChild=this.array[sizeIndex]; -newChild=oldChild&&oldChild.removeAfter(ownerID,level-SHIFT,index); -if(newChild===oldChild&&sizeIndex===this.array.length-1){ -return this;}} - - - -var editable=editableVNode(this,ownerID); -editable.array.splice(sizeIndex+1); -if(newChild){ -editable.array[sizeIndex]=newChild;} - -return editable;}; - - - - -var DONE={}; - -function iterateList(list,reverse){ -var left=list._origin; -var right=list._capacity; -var tailPos=getTailOffset(right); -var tail=list._tail; - -return iterateNodeOrLeaf(list._root,list._level,0); - -function iterateNodeOrLeaf(node,level,offset){ -return level===0? -iterateLeaf(node,offset): -iterateNode(node,level,offset);} - - -function iterateLeaf(node,offset){ -var array=offset===tailPos?tail&&tail.array:node&&node.array; -var from=offset>left?0:left-offset; -var to=right-offset; -if(to>SIZE){ -to=SIZE;} - -return function(){ -if(from===to){ -return DONE;} - -var idx=reverse?--to:from++; -return array&&array[idx];};} - - - -function iterateNode(node,level,offset){ -var values; -var array=node&&node.array; -var from=offset>left?0:left-offset>>level; -var to=(right-offset>>level)+1; -if(to>SIZE){ -to=SIZE;} - -return function(){ -do { -if(values){ -var value=values(); -if(value!==DONE){ -return value;} - -values=null;} - -if(from===to){ -return DONE;} - -var idx=reverse?--to:from++; -values=iterateNodeOrLeaf( -array&&array[idx],level-SHIFT,offset+(idx<=list.size||index<0){ -return list.withMutations(function(list){ -index<0? -setListBounds(list,index).set(0,value): -setListBounds(list,0,index+1).set(index,value);});} - - - -index+=list._origin; - -var newTail=list._tail; -var newRoot=list._root; -var didAlter=MakeRef(DID_ALTER); -if(index>=getTailOffset(list._capacity)){ -newTail=updateVNode(newTail,list.__ownerID,0,index,value,didAlter);}else -{ -newRoot=updateVNode(newRoot,list.__ownerID,list._level,index,value,didAlter);} - - -if(!didAlter.value){ -return list;} - - -if(list.__ownerID){ -list._root=newRoot; -list._tail=newTail; -list.__hash=undefined; -list.__altered=true; -return list;} - -return makeList(list._origin,list._capacity,list._level,newRoot,newTail);} - - -function updateVNode(node,ownerID,level,index,value,didAlter){ -var idx=index>>>level&MASK; -var nodeHas=node&&idx0){ -var lowerNode=node&&node.array[idx]; -var newLowerNode=updateVNode(lowerNode,ownerID,level-SHIFT,index,value,didAlter); -if(newLowerNode===lowerNode){ -return node;} - -newNode=editableVNode(node,ownerID); -newNode.array[idx]=newLowerNode; -return newNode;} - - -if(nodeHas&&node.array[idx]===value){ -return node;} - - -SetRef(didAlter); - -newNode=editableVNode(node,ownerID); -if(value===undefined&&idx===newNode.array.length-1){ -newNode.array.pop();}else -{ -newNode.array[idx]=value;} - -return newNode;} - - -function editableVNode(node,ownerID){ -if(ownerID&&node&&ownerID===node.ownerID){ -return node;} - -return new VNode(node?node.array.slice():[],ownerID);} - - -function listNodeFor(list,rawIndex){ -if(rawIndex>=getTailOffset(list._capacity)){ -return list._tail;} - -if(rawIndex<1<0){ -node=node.array[rawIndex>>>level&MASK]; -level-=SHIFT;} - -return node;}} - - - -function setListBounds(list,begin,end){ - - -if(begin!==undefined){ -begin=begin|0;} - -if(end!==undefined){ -end=end|0;} - -var owner=list.__ownerID||new OwnerID(); -var oldOrigin=list._origin; -var oldCapacity=list._capacity; -var newOrigin=oldOrigin+begin; -var newCapacity=end===undefined?oldCapacity:end<0?oldCapacity+end:oldOrigin+end; -if(newOrigin===oldOrigin&&newCapacity===oldCapacity){ -return list;} - - - -if(newOrigin>=newCapacity){ -return list.clear();} - - -var newLevel=list._level; -var newRoot=list._root; - - -var offsetShift=0; -while(newOrigin+offsetShift<0){ -newRoot=new VNode(newRoot&&newRoot.array.length?[undefined,newRoot]:[],owner); -newLevel+=SHIFT; -offsetShift+=1<=1<oldTailOffset?new VNode([],owner):oldTail; - - -if(oldTail&&newTailOffset>oldTailOffset&&newOriginSHIFT;level-=SHIFT){ -var idx=oldTailOffset>>>level&MASK; -node=node.array[idx]=editableVNode(node.array[idx],owner);} - -node.array[oldTailOffset>>>SHIFT&MASK]=oldTail;} - - - -if(newCapacity=newTailOffset){ -newOrigin-=newTailOffset; -newCapacity-=newTailOffset; -newLevel=SHIFT; -newRoot=null; -newTail=newTail&&newTail.removeBefore(owner,0,newOrigin);}else - - -if(newOrigin>oldOrigin||newTailOffset>>newLevel&MASK; -if(beginIndex!==newTailOffset>>>newLevel&MASK){ -break;} - -if(beginIndex){ -offsetShift+=(1<oldOrigin){ -newRoot=newRoot.removeBefore(owner,newLevel,newOrigin-offsetShift);} - -if(newRoot&&newTailOffsetmaxSize){ -maxSize=iter.size;} - -if(!isIterable(value)){ -iter=iter.map(function(v){return fromJS(v);});} - -iters.push(iter);} - -if(maxSize>list.size){ -list=list.setSize(maxSize);} - -return mergeIntoCollectionWith(list,merger,iters);} - - -function getTailOffset(size){ -return size>>SHIFT<=SIZE&&list.size>=map.size*2){ -newList=list.filter(function(entry,idx){return entry!==undefined&&i!==idx;}); -newMap=newList.toKeyedSeq().map(function(entry){return entry[0];}).flip().toMap(); -if(omap.__ownerID){ -newMap.__ownerID=newList.__ownerID=omap.__ownerID;}}else - -{ -newMap=map.remove(k); -newList=i===list.size-1?list.pop():list.set(i,undefined);}}else - -{ -if(has){ -if(v===list.get(i)[1]){ -return omap;} - -newMap=map; -newList=list.set(i,[k,v]);}else -{ -newMap=map.set(k,list.size); -newList=list.set(list.size,[k,v]);}} - - -if(omap.__ownerID){ -omap.size=newMap.size; -omap._map=newMap; -omap._list=newList; -omap.__hash=undefined; -return omap;} - -return makeOrderedMap(newMap,newList);} - - -createClass(ToKeyedSequence,KeyedSeq); -function ToKeyedSequence(indexed,useKeys){ -this._iter=indexed; -this._useKeys=useKeys; -this.size=indexed.size;} - - -ToKeyedSequence.prototype.get=function(key,notSetValue){ -return this._iter.get(key,notSetValue);}; - - -ToKeyedSequence.prototype.has=function(key){ -return this._iter.has(key);}; - - -ToKeyedSequence.prototype.valueSeq=function(){ -return this._iter.valueSeq();}; - - -ToKeyedSequence.prototype.reverse=function(){var this$0=this; -var reversedSequence=reverseFactory(this,true); -if(!this._useKeys){ -reversedSequence.valueSeq=function(){return this$0._iter.toSeq().reverse();};} - -return reversedSequence;}; - - -ToKeyedSequence.prototype.map=function(mapper,context){var this$0=this; -var mappedSequence=mapFactory(this,mapper,context); -if(!this._useKeys){ -mappedSequence.valueSeq=function(){return this$0._iter.toSeq().map(mapper,context);};} - -return mappedSequence;}; - - -ToKeyedSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -var ii; -return this._iter.__iterate( -this._useKeys? -function(v,k){return fn(v,k,this$0);}:( -ii=reverse?resolveSize(this):0, -function(v){return fn(v,reverse?--ii:ii++,this$0);}), -reverse);}; - - - -ToKeyedSequence.prototype.__iterator=function(type,reverse){ -if(this._useKeys){ -return this._iter.__iterator(type,reverse);} - -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -var ii=reverse?resolveSize(this):0; -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step: -iteratorValue(type,reverse?--ii:ii++,step.value,step);});}; - - - -ToKeyedSequence.prototype[IS_ORDERED_SENTINEL]=true; - - -createClass(ToIndexedSequence,IndexedSeq); -function ToIndexedSequence(iter){ -this._iter=iter; -this.size=iter.size;} - - -ToIndexedSequence.prototype.includes=function(value){ -return this._iter.includes(value);}; - - -ToIndexedSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -var iterations=0; -return this._iter.__iterate(function(v){return fn(v,iterations++,this$0);},reverse);}; - - -ToIndexedSequence.prototype.__iterator=function(type,reverse){ -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -var iterations=0; -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step: -iteratorValue(type,iterations++,step.value,step);});}; - - - - - -createClass(ToSetSequence,SetSeq); -function ToSetSequence(iter){ -this._iter=iter; -this.size=iter.size;} - - -ToSetSequence.prototype.has=function(key){ -return this._iter.includes(key);}; - - -ToSetSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -return this._iter.__iterate(function(v){return fn(v,v,this$0);},reverse);}; - - -ToSetSequence.prototype.__iterator=function(type,reverse){ -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -return new Iterator(function(){ -var step=iterator.next(); -return step.done?step: -iteratorValue(type,step.value,step.value,step);});}; - - - - - -createClass(FromEntriesSequence,KeyedSeq); -function FromEntriesSequence(entries){ -this._iter=entries; -this.size=entries.size;} - - -FromEntriesSequence.prototype.entrySeq=function(){ -return this._iter.toSeq();}; - - -FromEntriesSequence.prototype.__iterate=function(fn,reverse){var this$0=this; -return this._iter.__iterate(function(entry){ - - -if(entry){ -validateEntry(entry); -var indexedIterable=isIterable(entry); -return fn( -indexedIterable?entry.get(1):entry[1], -indexedIterable?entry.get(0):entry[0], -this$0);}}, - - -reverse);}; - - -FromEntriesSequence.prototype.__iterator=function(type,reverse){ -var iterator=this._iter.__iterator(ITERATE_VALUES,reverse); -return new Iterator(function(){ -while(true){ -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; - - -if(entry){ -validateEntry(entry); -var indexedIterable=isIterable(entry); -return iteratorValue( -type, -indexedIterable?entry.get(0):entry[0], -indexedIterable?entry.get(1):entry[1], -step);}}});}; - - - - - - - -ToIndexedSequence.prototype.cacheResult= -ToKeyedSequence.prototype.cacheResult= -ToSetSequence.prototype.cacheResult= -FromEntriesSequence.prototype.cacheResult= -cacheResultThrough; - - -function flipFactory(iterable){ -var flipSequence=makeSequence(iterable); -flipSequence._iter=iterable; -flipSequence.size=iterable.size; -flipSequence.flip=function(){return iterable;}; -flipSequence.reverse=function(){ -var reversedSequence=iterable.reverse.apply(this); -reversedSequence.flip=function(){return iterable.reverse();}; -return reversedSequence;}; - -flipSequence.has=function(key){return iterable.includes(key);}; -flipSequence.includes=function(key){return iterable.has(key);}; -flipSequence.cacheResult=cacheResultThrough; -flipSequence.__iterateUncached=function(fn,reverse){var this$0=this; -return iterable.__iterate(function(v,k){return fn(k,v,this$0)!==false;},reverse);}; - -flipSequence.__iteratorUncached=function(type,reverse){ -if(type===ITERATE_ENTRIES){ -var iterator=iterable.__iterator(type,reverse); -return new Iterator(function(){ -var step=iterator.next(); -if(!step.done){ -var k=step.value[0]; -step.value[0]=step.value[1]; -step.value[1]=k;} - -return step;});} - - -return iterable.__iterator( -type===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES, -reverse);}; - - -return flipSequence;} - - - -function mapFactory(iterable,mapper,context){ -var mappedSequence=makeSequence(iterable); -mappedSequence.size=iterable.size; -mappedSequence.has=function(key){return iterable.has(key);}; -mappedSequence.get=function(key,notSetValue){ -var v=iterable.get(key,NOT_SET); -return v===NOT_SET? -notSetValue: -mapper.call(context,v,key,iterable);}; - -mappedSequence.__iterateUncached=function(fn,reverse){var this$0=this; -return iterable.__iterate( -function(v,k,c){return fn(mapper.call(context,v,k,c),k,this$0)!==false;}, -reverse);}; - - -mappedSequence.__iteratorUncached=function(type,reverse){ -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -return new Iterator(function(){ -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; -var key=entry[0]; -return iteratorValue( -type, -key, -mapper.call(context,entry[1],key,iterable), -step);});}; - - - -return mappedSequence;} - - - -function reverseFactory(iterable,useKeys){ -var reversedSequence=makeSequence(iterable); -reversedSequence._iter=iterable; -reversedSequence.size=iterable.size; -reversedSequence.reverse=function(){return iterable;}; -if(iterable.flip){ -reversedSequence.flip=function(){ -var flipSequence=flipFactory(iterable); -flipSequence.reverse=function(){return iterable.flip();}; -return flipSequence;};} - - -reversedSequence.get=function(key,notSetValue) -{return iterable.get(useKeys?key:-1-key,notSetValue);}; -reversedSequence.has=function(key) -{return iterable.has(useKeys?key:-1-key);}; -reversedSequence.includes=function(value){return iterable.includes(value);}; -reversedSequence.cacheResult=cacheResultThrough; -reversedSequence.__iterate=function(fn,reverse){var this$0=this; -return iterable.__iterate(function(v,k){return fn(v,k,this$0);},!reverse);}; - -reversedSequence.__iterator= -function(type,reverse){return iterable.__iterator(type,!reverse);}; -return reversedSequence;} - - - -function filterFactory(iterable,predicate,context,useKeys){ -var filterSequence=makeSequence(iterable); -if(useKeys){ -filterSequence.has=function(key){ -var v=iterable.get(key,NOT_SET); -return v!==NOT_SET&&!!predicate.call(context,v,key,iterable);}; - -filterSequence.get=function(key,notSetValue){ -var v=iterable.get(key,NOT_SET); -return v!==NOT_SET&&predicate.call(context,v,key,iterable)? -v:notSetValue;};} - - -filterSequence.__iterateUncached=function(fn,reverse){var this$0=this; -var iterations=0; -iterable.__iterate(function(v,k,c){ -if(predicate.call(context,v,k,c)){ -iterations++; -return fn(v,useKeys?k:iterations-1,this$0);}}, - -reverse); -return iterations;}; - -filterSequence.__iteratorUncached=function(type,reverse){ -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -var iterations=0; -return new Iterator(function(){ -while(true){ -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; -var key=entry[0]; -var value=entry[1]; -if(predicate.call(context,value,key,iterable)){ -return iteratorValue(type,useKeys?key:iterations++,value,step);}}});}; - - - - -return filterSequence;} - - - -function countByFactory(iterable,grouper,context){ -var groups=Map().asMutable(); -iterable.__iterate(function(v,k){ -groups.update( -grouper.call(context,v,k,iterable), -0, -function(a){return a+1;});}); - - -return groups.asImmutable();} - - - -function groupByFactory(iterable,grouper,context){ -var isKeyedIter=isKeyed(iterable); -var groups=(isOrdered(iterable)?OrderedMap():Map()).asMutable(); -iterable.__iterate(function(v,k){ -groups.update( -grouper.call(context,v,k,iterable), -function(a){return a=a||[],a.push(isKeyedIter?[k,v]:v),a;});}); - - -var coerce=iterableClass(iterable); -return groups.map(function(arr){return reify(iterable,coerce(arr));});} - - - -function sliceFactory(iterable,begin,end,useKeys){ -var originalSize=iterable.size; - - - -if(begin!==undefined){ -begin=begin|0;} - -if(end!==undefined){ -end=end|0;} - - -if(wholeSlice(begin,end,originalSize)){ -return iterable;} - - -var resolvedBegin=resolveBegin(begin,originalSize); -var resolvedEnd=resolveEnd(end,originalSize); - - - - -if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd){ -return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys);} - - - - - - -var resolvedSize=resolvedEnd-resolvedBegin; -var sliceSize; -if(resolvedSize===resolvedSize){ -sliceSize=resolvedSize<0?0:resolvedSize;} - - -var sliceSeq=makeSequence(iterable); - - - -sliceSeq.size=sliceSize===0?sliceSize:iterable.size&&sliceSize||undefined; - -if(!useKeys&&isSeq(iterable)&&sliceSize>=0){ -sliceSeq.get=function(index,notSetValue){ -index=wrapIndex(this,index); -return index>=0&&indexsliceSize){ -return iteratorDone();} - -var step=iterator.next(); -if(useKeys||type===ITERATE_VALUES){ -return step;}else -if(type===ITERATE_KEYS){ -return iteratorValue(type,iterations-1,undefined,step);}else -{ -return iteratorValue(type,iterations-1,step.value[1],step);}});}; - - - - -return sliceSeq;} - - - -function takeWhileFactory(iterable,predicate,context){ -var takeSequence=makeSequence(iterable); -takeSequence.__iterateUncached=function(fn,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var iterations=0; -iterable.__iterate(function(v,k,c) -{return predicate.call(context,v,k,c)&&++iterations&&fn(v,k,this$0);}); - -return iterations;}; - -takeSequence.__iteratorUncached=function(type,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterator(type,reverse);} - -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -var iterating=true; -return new Iterator(function(){ -if(!iterating){ -return iteratorDone();} - -var step=iterator.next(); -if(step.done){ -return step;} - -var entry=step.value; -var k=entry[0]; -var v=entry[1]; -if(!predicate.call(context,v,k,this$0)){ -iterating=false; -return iteratorDone();} - -return type===ITERATE_ENTRIES?step: -iteratorValue(type,k,v,step);});}; - - -return takeSequence;} - - - -function skipWhileFactory(iterable,predicate,context,useKeys){ -var skipSequence=makeSequence(iterable); -skipSequence.__iterateUncached=function(fn,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterate(fn,reverse);} - -var isSkipping=true; -var iterations=0; -iterable.__iterate(function(v,k,c){ -if(!(isSkipping&&(isSkipping=predicate.call(context,v,k,c)))){ -iterations++; -return fn(v,useKeys?k:iterations-1,this$0);}}); - - -return iterations;}; - -skipSequence.__iteratorUncached=function(type,reverse){var this$0=this; -if(reverse){ -return this.cacheResult().__iterator(type,reverse);} - -var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse); -var skipping=true; -var iterations=0; -return new Iterator(function(){ -var step,k,v; -do { -step=iterator.next(); -if(step.done){ -if(useKeys||type===ITERATE_VALUES){ -return step;}else -if(type===ITERATE_KEYS){ -return iteratorValue(type,iterations++,undefined,step);}else -{ -return iteratorValue(type,iterations++,step.value[1],step);}} - - -var entry=step.value; -k=entry[0]; -v=entry[1]; -skipping&&(skipping=predicate.call(context,v,k,this$0));}while( -skipping); -return type===ITERATE_ENTRIES?step: -iteratorValue(type,k,v,step);});}; - - -return skipSequence;} - - - -function concatFactory(iterable,values){ -var isKeyedIterable=isKeyed(iterable); -var iters=[iterable].concat(values).map(function(v){ -if(!isIterable(v)){ -v=isKeyedIterable? -keyedSeqFromValue(v): -indexedSeqFromValue(Array.isArray(v)?v:[v]);}else -if(isKeyedIterable){ -v=KeyedIterable(v);} - -return v;}). -filter(function(v){return v.size!==0;}); - -if(iters.length===0){ -return iterable;} - - -if(iters.length===1){ -var singleton=iters[0]; -if(singleton===iterable|| -isKeyedIterable&&isKeyed(singleton)|| -isIndexed(iterable)&&isIndexed(singleton)){ -return singleton;}} - - - -var concatSeq=new ArraySeq(iters); -if(isKeyedIterable){ -concatSeq=concatSeq.toKeyedSeq();}else -if(!isIndexed(iterable)){ -concatSeq=concatSeq.toSetSeq();} - -concatSeq=concatSeq.flatten(true); -concatSeq.size=iters.reduce( -function(sum,seq){ -if(sum!==undefined){ -var size=seq.size; -if(size!==undefined){ -return sum+size;}}}, - - - -0); - -return concatSeq;} - - - -function flattenFactory(iterable,depth,useKeys){ -var flatSequence=makeSequence(iterable); -flatSequence.__iterateUncached=function(fn,reverse){ -var iterations=0; -var stopped=false; -function flatDeep(iter,currentDepth){var this$0=this; -iter.__iterate(function(v,k){ -if((!depth||currentDepth0;} - - - -function zipWithFactory(keyIter,zipper,iters){ -var zipSequence=makeSequence(keyIter); -zipSequence.size=new ArraySeq(iters).map(function(i){return i.size;}).min(); - - -zipSequence.__iterate=function(fn,reverse){ - - - - - - - - - - - - - -var iterator=this.__iterator(ITERATE_VALUES,reverse); -var step; -var iterations=0; -while(!(step=iterator.next()).done){ -if(fn(step.value,iterations++,this)===false){ -break;}} - - -return iterations;}; - -zipSequence.__iteratorUncached=function(type,reverse){ -var iterators=iters.map(function(i) -{return i=Iterable(i),getIterator(reverse?i.reverse():i);}); - -var iterations=0; -var isDone=false; -return new Iterator(function(){ -var steps; -if(!isDone){ -steps=iterators.map(function(i){return i.next();}); -isDone=steps.some(function(s){return s.done;});} - -if(isDone){ -return iteratorDone();} - -return iteratorValue( -type, -iterations++, -zipper.apply(null,steps.map(function(s){return s.value;})));});}; - - - -return zipSequence;} - - - - - -function reify(iter,seq){ -return isSeq(iter)?seq:iter.constructor(seq);} - - -function validateEntry(entry){ -if(entry!==Object(entry)){ -throw new TypeError('Expected [K, V] tuple: '+entry);}} - - - -function resolveSize(iter){ -assertNotInfinite(iter.size); -return ensureSize(iter);} - - -function iterableClass(iterable){ -return isKeyed(iterable)?KeyedIterable: -isIndexed(iterable)?IndexedIterable: -SetIterable;} - - -function makeSequence(iterable){ -return Object.create( -( -isKeyed(iterable)?KeyedSeq: -isIndexed(iterable)?IndexedSeq: -SetSeq). -prototype);} - - - -function cacheResultThrough(){ -if(this._iter.cacheResult){ -this._iter.cacheResult(); -this.size=this._iter.size; -return this;}else -{ -return Seq.prototype.cacheResult.call(this);}} - - - -function defaultComparator(a,b){ -return a>b?1:a=0;ii--){ -head={ -value:arguments[ii], -next:head};} - - -if(this.__ownerID){ -this.size=newSize; -this._head=head; -this.__hash=undefined; -this.__altered=true; -return this;} - -return makeStack(newSize,head);}; - - -Stack.prototype.pushAll=function(iter){ -iter=IndexedIterable(iter); -if(iter.size===0){ -return this;} - -assertNotInfinite(iter.size); -var newSize=this.size; -var head=this._head; -iter.reverse().forEach(function(value){ -newSize++; -head={ -value:value, -next:head};}); - - -if(this.__ownerID){ -this.size=newSize; -this._head=head; -this.__hash=undefined; -this.__altered=true; -return this;} - -return makeStack(newSize,head);}; - - -Stack.prototype.pop=function(){ -return this.slice(1);}; - - -Stack.prototype.unshift=function(){ -return this.push.apply(this,arguments);}; - - -Stack.prototype.unshiftAll=function(iter){ -return this.pushAll(iter);}; - - -Stack.prototype.shift=function(){ -return this.pop.apply(this,arguments);}; - - -Stack.prototype.clear=function(){ -if(this.size===0){ -return this;} - -if(this.__ownerID){ -this.size=0; -this._head=undefined; -this.__hash=undefined; -this.__altered=true; -return this;} - -return emptyStack();}; - - -Stack.prototype.slice=function(begin,end){ -if(wholeSlice(begin,end,this.size)){ -return this;} - -var resolvedBegin=resolveBegin(begin,this.size); -var resolvedEnd=resolveEnd(end,this.size); -if(resolvedEnd!==this.size){ - -return IndexedCollection.prototype.slice.call(this,begin,end);} - -var newSize=this.size-resolvedBegin; -var head=this._head; -while(resolvedBegin--){ -head=head.next;} - -if(this.__ownerID){ -this.size=newSize; -this._head=head; -this.__hash=undefined; -this.__altered=true; -return this;} - -return makeStack(newSize,head);}; - - - - -Stack.prototype.__ensureOwner=function(ownerID){ -if(ownerID===this.__ownerID){ -return this;} - -if(!ownerID){ -this.__ownerID=ownerID; -this.__altered=false; -return this;} - -return makeStack(this.size,this._head,ownerID,this.__hash);}; - - - - -Stack.prototype.__iterate=function(fn,reverse){ -if(reverse){ -return this.reverse().__iterate(fn);} - -var iterations=0; -var node=this._head; -while(node){ -if(fn(node.value,iterations++,this)===false){ -break;} - -node=node.next;} - -return iterations;}; - - -Stack.prototype.__iterator=function(type,reverse){ -if(reverse){ -return this.reverse().__iterator(type);} - -var iterations=0; -var node=this._head; -return new Iterator(function(){ -if(node){ -var value=node.value; -node=node.next; -return iteratorValue(type,iterations++,value);} - -return iteratorDone();});}; - - - - -function isStack(maybeStack){ -return !!(maybeStack&&maybeStack[IS_STACK_SENTINEL]);} - - -Stack.isStack=isStack; - -var IS_STACK_SENTINEL='@@__IMMUTABLE_STACK__@@'; - -var StackPrototype=Stack.prototype; -StackPrototype[IS_STACK_SENTINEL]=true; -StackPrototype.withMutations=MapPrototype.withMutations; -StackPrototype.asMutable=MapPrototype.asMutable; -StackPrototype.asImmutable=MapPrototype.asImmutable; -StackPrototype.wasAltered=MapPrototype.wasAltered; - - -function makeStack(size,head,ownerID,hash){ -var map=Object.create(StackPrototype); -map.size=size; -map._head=head; -map.__ownerID=ownerID; -map.__hash=hash; -map.__altered=false; -return map;} - - -var EMPTY_STACK; -function emptyStack(){ -return EMPTY_STACK||(EMPTY_STACK=makeStack(0));} - - - - - -function mixin(ctor,methods){ -var keyCopier=function(key){ctor.prototype[key]=methods[key];}; -Object.keys(methods).forEach(keyCopier); -Object.getOwnPropertySymbols&& -Object.getOwnPropertySymbols(methods).forEach(keyCopier); -return ctor;} - - -Iterable.Iterator=Iterator; - -mixin(Iterable,{ - - - -toArray:function(){ -assertNotInfinite(this.size); -var array=new Array(this.size||0); -this.valueSeq().__iterate(function(v,i){array[i]=v;}); -return array;}, - - -toIndexedSeq:function(){ -return new ToIndexedSequence(this);}, - - -toJS:function(){ -return this.toSeq().map( -function(value){return value&&typeof value.toJS==='function'?value.toJS():value;}). -__toJS();}, - - -toJSON:function(){ -return this.toSeq().map( -function(value){return value&&typeof value.toJSON==='function'?value.toJSON():value;}). -__toJS();}, - - -toKeyedSeq:function(){ -return new ToKeyedSequence(this,true);}, - - -toMap:function(){ - -return Map(this.toKeyedSeq());}, - - -toObject:function(){ -assertNotInfinite(this.size); -var object={}; -this.__iterate(function(v,k){object[k]=v;}); -return object;}, - - -toOrderedMap:function(){ - -return OrderedMap(this.toKeyedSeq());}, - - -toOrderedSet:function(){ - -return OrderedSet(isKeyed(this)?this.valueSeq():this);}, - - -toSet:function(){ - -return Set(isKeyed(this)?this.valueSeq():this);}, - - -toSetSeq:function(){ -return new ToSetSequence(this);}, - - -toSeq:function(){ -return isIndexed(this)?this.toIndexedSeq(): -isKeyed(this)?this.toKeyedSeq(): -this.toSetSeq();}, - - -toStack:function(){ - -return Stack(isKeyed(this)?this.valueSeq():this);}, - - -toList:function(){ - -return List(isKeyed(this)?this.valueSeq():this);}, - - - - - -toString:function(){ -return '[Iterable]';}, - - -__toString:function(head,tail){ -if(this.size===0){ -return head+tail;} - -return head+' '+this.toSeq().map(this.__toStringMapper).join(', ')+' '+tail;}, - - - - - -concat:function(){var values=SLICE$0.call(arguments,0); -return reify(this,concatFactory(this,values));}, - - -includes:function(searchValue){ -return this.some(function(value){return is(value,searchValue);});}, - - -entries:function(){ -return this.__iterator(ITERATE_ENTRIES);}, - - -every:function(predicate,context){ -assertNotInfinite(this.size); -var returnValue=true; -this.__iterate(function(v,k,c){ -if(!predicate.call(context,v,k,c)){ -returnValue=false; -return false;}}); - - -return returnValue;}, - - -filter:function(predicate,context){ -return reify(this,filterFactory(this,predicate,context,true));}, - - -find:function(predicate,context,notSetValue){ -var entry=this.findEntry(predicate,context); -return entry?entry[1]:notSetValue;}, - - -findEntry:function(predicate,context){ -var found; -this.__iterate(function(v,k,c){ -if(predicate.call(context,v,k,c)){ -found=[k,v]; -return false;}}); - - -return found;}, - - -findLastEntry:function(predicate,context){ -return this.toSeq().reverse().findEntry(predicate,context);}, - - -forEach:function(sideEffect,context){ -assertNotInfinite(this.size); -return this.__iterate(context?sideEffect.bind(context):sideEffect);}, - - -join:function(separator){ -assertNotInfinite(this.size); -separator=separator!==undefined?''+separator:','; -var joined=''; -var isFirst=true; -this.__iterate(function(v){ -isFirst?isFirst=false:joined+=separator; -joined+=v!==null&&v!==undefined?v.toString():'';}); - -return joined;}, - - -keys:function(){ -return this.__iterator(ITERATE_KEYS);}, - - -map:function(mapper,context){ -return reify(this,mapFactory(this,mapper,context));}, - - -reduce:function(reducer,initialReduction,context){ -assertNotInfinite(this.size); -var reduction; -var useFirst; -if(arguments.length<2){ -useFirst=true;}else -{ -reduction=initialReduction;} - -this.__iterate(function(v,k,c){ -if(useFirst){ -useFirst=false; -reduction=v;}else -{ -reduction=reducer.call(context,reduction,v,k,c);}}); - - -return reduction;}, - - -reduceRight:function(reducer,initialReduction,context){ -var reversed=this.toKeyedSeq().reverse(); -return reversed.reduce.apply(reversed,arguments);}, - - -reverse:function(){ -return reify(this,reverseFactory(this,true));}, - - -slice:function(begin,end){ -return reify(this,sliceFactory(this,begin,end,true));}, - - -some:function(predicate,context){ -return !this.every(not(predicate),context);}, - - -sort:function(comparator){ -return reify(this,sortFactory(this,comparator));}, - - -values:function(){ -return this.__iterator(ITERATE_VALUES);}, - - - - - -butLast:function(){ -return this.slice(0,-1);}, - - -isEmpty:function(){ -return this.size!==undefined?this.size===0:!this.some(function(){return true;});}, - - -count:function(predicate,context){ -return ensureSize( -predicate?this.toSeq().filter(predicate,context):this);}, - - - -countBy:function(grouper,context){ -return countByFactory(this,grouper,context);}, - - -equals:function(other){ -return deepEqual(this,other);}, - - -entrySeq:function(){ -var iterable=this; -if(iterable._cache){ - -return new ArraySeq(iterable._cache);} - -var entriesSequence=iterable.toSeq().map(entryMapper).toIndexedSeq(); -entriesSequence.fromEntrySeq=function(){return iterable.toSeq();}; -return entriesSequence;}, - - -filterNot:function(predicate,context){ -return this.filter(not(predicate),context);}, - - -findLast:function(predicate,context,notSetValue){ -return this.toKeyedSeq().reverse().find(predicate,context,notSetValue);}, - - -first:function(){ -return this.find(returnTrue);}, - - -flatMap:function(mapper,context){ -return reify(this,flatMapFactory(this,mapper,context));}, - - -flatten:function(depth){ -return reify(this,flattenFactory(this,depth,true));}, - - -fromEntrySeq:function(){ -return new FromEntriesSequence(this);}, - - -get:function(searchKey,notSetValue){ -return this.find(function(_,key){return is(key,searchKey);},undefined,notSetValue);}, - - -getIn:function(searchKeyPath,notSetValue){ -var nested=this; - - -var iter=forceIterator(searchKeyPath); -var step; -while(!(step=iter.next()).done){ -var key=step.value; -nested=nested&&nested.get?nested.get(key,NOT_SET):NOT_SET; -if(nested===NOT_SET){ -return notSetValue;}} - - -return nested;}, - - -groupBy:function(grouper,context){ -return groupByFactory(this,grouper,context);}, - - -has:function(searchKey){ -return this.get(searchKey,NOT_SET)!==NOT_SET;}, - - -hasIn:function(searchKeyPath){ -return this.getIn(searchKeyPath,NOT_SET)!==NOT_SET;}, - - -isSubset:function(iter){ -iter=typeof iter.includes==='function'?iter:Iterable(iter); -return this.every(function(value){return iter.includes(value);});}, - - -isSuperset:function(iter){ -iter=typeof iter.isSubset==='function'?iter:Iterable(iter); -return iter.isSubset(this);}, - - -keySeq:function(){ -return this.toSeq().map(keyMapper).toIndexedSeq();}, - - -last:function(){ -return this.toSeq().reverse().first();}, - - -max:function(comparator){ -return maxFactory(this,comparator);}, - - -maxBy:function(mapper,comparator){ -return maxFactory(this,comparator,mapper);}, - - -min:function(comparator){ -return maxFactory(this,comparator?neg(comparator):defaultNegComparator);}, - - -minBy:function(mapper,comparator){ -return maxFactory(this,comparator?neg(comparator):defaultNegComparator,mapper);}, - - -rest:function(){ -return this.slice(1);}, - - -skip:function(amount){ -return this.slice(Math.max(0,amount));}, - - -skipLast:function(amount){ -return reify(this,this.toSeq().reverse().skip(amount).reverse());}, - - -skipWhile:function(predicate,context){ -return reify(this,skipWhileFactory(this,predicate,context,true));}, - - -skipUntil:function(predicate,context){ -return this.skipWhile(not(predicate),context);}, - - -sortBy:function(mapper,comparator){ -return reify(this,sortFactory(this,comparator,mapper));}, - - -take:function(amount){ -return this.slice(0,Math.max(0,amount));}, - - -takeLast:function(amount){ -return reify(this,this.toSeq().reverse().take(amount).reverse());}, - - -takeWhile:function(predicate,context){ -return reify(this,takeWhileFactory(this,predicate,context));}, - - -takeUntil:function(predicate,context){ -return this.takeWhile(not(predicate),context);}, - - -valueSeq:function(){ -return this.toIndexedSeq();}, - - - - - -hashCode:function(){ -return this.__hash||(this.__hash=hashIterable(this));}}); - - - - - - - - - - - - - - - -var IterablePrototype=Iterable.prototype; -IterablePrototype[IS_ITERABLE_SENTINEL]=true; -IterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.values; -IterablePrototype.__toJS=IterablePrototype.toArray; -IterablePrototype.__toStringMapper=quoteString; -IterablePrototype.inspect= -IterablePrototype.toSource=function(){return this.toString();}; -IterablePrototype.chain=IterablePrototype.flatMap; -IterablePrototype.contains=IterablePrototype.includes; - - -(function(){ -try{ -Object.defineProperty(IterablePrototype,'length',{ -get:function(){ -if(!Iterable.noLengthWarning){ -var stack; -try{ -throw new Error();} -catch(error) { -stack=error.stack;} - -if(stack.indexOf('_wrapObject')===-1){ -console&&console.warn&&console.warn( -'iterable.length has been deprecated, '+ -'use iterable.size or iterable.count(). '+ -'This warning will become a silent error in a future version. '+ -stack); - -return this.size;}}}});} - - - - -catch(e) {}})(); - - - - -mixin(KeyedIterable,{ - - - -flip:function(){ -return reify(this,flipFactory(this));}, - - -findKey:function(predicate,context){ -var entry=this.findEntry(predicate,context); -return entry&&entry[0];}, - - -findLastKey:function(predicate,context){ -return this.toSeq().reverse().findKey(predicate,context);}, - - -keyOf:function(searchValue){ -return this.findKey(function(value){return is(value,searchValue);});}, - - -lastKeyOf:function(searchValue){ -return this.findLastKey(function(value){return is(value,searchValue);});}, - - -mapEntries:function(mapper,context){var this$0=this; -var iterations=0; -return reify(this, -this.toSeq().map( -function(v,k){return mapper.call(context,[k,v],iterations++,this$0);}). -fromEntrySeq());}, - - - -mapKeys:function(mapper,context){var this$0=this; -return reify(this, -this.toSeq().flip().map( -function(k,v){return mapper.call(context,k,v,this$0);}). -flip());}}); - - - - - -var KeyedIterablePrototype=KeyedIterable.prototype; -KeyedIterablePrototype[IS_KEYED_SENTINEL]=true; -KeyedIterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.entries; -KeyedIterablePrototype.__toJS=IterablePrototype.toObject; -KeyedIterablePrototype.__toStringMapper=function(v,k){return JSON.stringify(k)+': '+quoteString(v);}; - - - -mixin(IndexedIterable,{ - - - -toKeyedSeq:function(){ -return new ToKeyedSequence(this,false);}, - - - - - -filter:function(predicate,context){ -return reify(this,filterFactory(this,predicate,context,false));}, - - -findIndex:function(predicate,context){ -var entry=this.findEntry(predicate,context); -return entry?entry[0]:-1;}, - - -indexOf:function(searchValue){ -var key=this.toKeyedSeq().keyOf(searchValue); -return key===undefined?-1:key;}, - - -lastIndexOf:function(searchValue){ -var key=this.toKeyedSeq().reverse().keyOf(searchValue); -return key===undefined?-1:key;}, - - - - - -reverse:function(){ -return reify(this,reverseFactory(this,false));}, - - -slice:function(begin,end){ -return reify(this,sliceFactory(this,begin,end,false));}, - - -splice:function(index,removeNum){ -var numArgs=arguments.length; -removeNum=Math.max(removeNum|0,0); -if(numArgs===0||numArgs===2&&!removeNum){ -return this;} - - - - -index=resolveBegin(index,index<0?this.count():this.size); -var spliced=this.slice(0,index); -return reify( -this, -numArgs===1? -spliced: -spliced.concat(arrCopy(arguments,2),this.slice(index+removeNum)));}, - - - - - - -findLastIndex:function(predicate,context){ -var key=this.toKeyedSeq().findLastKey(predicate,context); -return key===undefined?-1:key;}, - - -first:function(){ -return this.get(0);}, - - -flatten:function(depth){ -return reify(this,flattenFactory(this,depth,false));}, - - -get:function(index,notSetValue){ -index=wrapIndex(this,index); -return index<0||this.size===Infinity|| -this.size!==undefined&&index>this.size? -notSetValue: -this.find(function(_,key){return key===index;},undefined,notSetValue);}, - - -has:function(index){ -index=wrapIndex(this,index); -return index>=0&&(this.size!==undefined? -this.size===Infinity||indexb?-1:0;} - - -function hashIterable(iterable){ -if(iterable.size===Infinity){ -return 0;} - -var ordered=isOrdered(iterable); -var keyed=isKeyed(iterable); -var h=ordered?1:0; -var size=iterable.__iterate( -keyed? -ordered? -function(v,k){h=31*h+hashMerge(hash(v),hash(k))|0;}: -function(v,k){h=h+hashMerge(hash(v),hash(k))|0;}: -ordered? -function(v){h=31*h+hash(v)|0;}: -function(v){h=h+hash(v)|0;}); - -return murmurHashOfSize(size,h);} - - -function murmurHashOfSize(size,h){ -h=imul(h,0xCC9E2D51); -h=imul(h<<15|h>>>-15,0x1B873593); -h=imul(h<<13|h>>>-13,5); -h=(h+0xE6546B64|0)^size; -h=imul(h^h>>>16,0x85EBCA6B); -h=imul(h^h>>>13,0xC2B2AE35); -h=smi(h^h>>>16); -return h;} - - -function hashMerge(a,b){ -return a^b+0x9E3779B9+(a<<6)+(a>>2)|0;} - - -var Immutable={ - -Iterable:Iterable, - -Seq:Seq, -Collection:Collection, -Map:Map, -OrderedMap:OrderedMap, -List:List, -Stack:Stack, -Set:Set, -OrderedSet:OrderedSet, - -Record:Record, -Range:Range, -Repeat:Repeat, - -is:is, -fromJS:fromJS}; - - - -return Immutable;}); -}); -__d('NavigatorBreadcrumbNavigationBar',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var NavigatorBreadcrumbNavigationBarStyles=require('NavigatorBreadcrumbNavigationBarStyles'); -var NavigatorNavigationBarStylesAndroid=require('NavigatorNavigationBarStylesAndroid'); -var NavigatorNavigationBarStylesIOS=require('NavigatorNavigationBarStylesIOS'); -var Platform=require('Platform'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View');var _require= - -require('immutable/dist/immutable.js');var Map=_require.Map; - -var invariant=require('invariant'); - -var Interpolators=NavigatorBreadcrumbNavigationBarStyles.Interpolators; -var NavigatorNavigationBarStyles=Platform.OS==='android'? -NavigatorNavigationBarStylesAndroid:NavigatorNavigationBarStylesIOS; -var PropTypes=React.PropTypes; - - - - -var CRUMB_PROPS=Interpolators.map(function(){return {style:{}};}); -var ICON_PROPS=Interpolators.map(function(){return {style:{}};}); -var SEPARATOR_PROPS=Interpolators.map(function(){return {style:{}};}); -var TITLE_PROPS=Interpolators.map(function(){return {style:{}};}); -var RIGHT_BUTTON_PROPS=Interpolators.map(function(){return {style:{}};}); - - -var navStatePresentedIndex=function(navState){ -if(navState.presentedIndex!==undefined){ -return navState.presentedIndex;} - - -return navState.observedTopOfStack;}; - - - - - - - - - - -var initStyle=function(index,presentedIndex){ -return index===presentedIndex?NavigatorBreadcrumbNavigationBarStyles.Center[index]: -indexfromIndex?progress:1-progress; -var oldDistToCenter=index-fromIndex; -var newDistToCenter=index-toIndex; -var interpolate; -invariant( -Interpolators[index], -'Cannot find breadcrumb interpolators for '+index); - -if(oldDistToCenter>0&&newDistToCenter===0|| -newDistToCenter>0&&oldDistToCenter===0){ -interpolate=Interpolators[index].RightToCenter;}else -if(oldDistToCenter<0&&newDistToCenter===0|| -newDistToCenter<0&&oldDistToCenter===0){ -interpolate=Interpolators[index].CenterToLeft;}else -if(oldDistToCenter===newDistToCenter){ -interpolate=Interpolators[index].RightToCenter;}else -{ -interpolate=Interpolators[index].RightToLeft;} - - -if(interpolate.Crumb(CRUMB_PROPS[index].style,amount)){ -this._setPropsIfExists('crumb_'+index,CRUMB_PROPS[index]);} - -if(interpolate.Icon(ICON_PROPS[index].style,amount)){ -this._setPropsIfExists('icon_'+index,ICON_PROPS[index]);} - -if(interpolate.Separator(SEPARATOR_PROPS[index].style,amount)){ -this._setPropsIfExists('separator_'+index,SEPARATOR_PROPS[index]);} - -if(interpolate.Title(TITLE_PROPS[index].style,amount)){ -this._setPropsIfExists('title_'+index,TITLE_PROPS[index]);} - -var right=this.refs['right_'+index]; -if(right&& -interpolate.RightItem(RIGHT_BUTTON_PROPS[index].style,amount)){ -right.setNativeProps(RIGHT_BUTTON_PROPS[index]);}}, - - - -updateProgress:function(progress,fromIndex,toIndex){ -var max=Math.max(fromIndex,toIndex); -var min=Math.min(fromIndex,toIndex); -for(var index=min;index<=max;index++){ -this._updateIndexProgress(progress,index,fromIndex,toIndex);}}, - - - -onAnimationStart:function(fromIndex,toIndex){ -var max=Math.max(fromIndex,toIndex); -var min=Math.min(fromIndex,toIndex); -for(var index=min;index<=max;index++){ -this._setRenderViewsToHardwareTextureAndroid(index,true);}}, - - - -onAnimationEnd:function(){ -var max=this.props.navState.routeStack.length-1; -for(var index=0;index<=max;index++){ -this._setRenderViewsToHardwareTextureAndroid(index,false);}}, - - - -_setRenderViewsToHardwareTextureAndroid:function(index,renderToHardwareTexture){ -var props={ -renderToHardwareTextureAndroid:renderToHardwareTexture}; - - -this._setPropsIfExists('icon_'+index,props); -this._setPropsIfExists('separator_'+index,props); -this._setPropsIfExists('title_'+index,props); -this._setPropsIfExists('right_'+index,props);}, - - -componentWillMount:function(){ -this._descriptors={ -crumb:new Map(), -title:new Map(), -right:new Map()};}, - - - -render:function(){ -var navState=this.props.navState; -var icons=navState&&navState.routeStack.map(this._getBreadcrumb); -var titles=navState.routeStack.map(this._getTitle); -var buttons=navState.routeStack.map(this._getRightButton); -return ( -React.createElement(View,{style:[styles.breadCrumbContainer,this.props.style]}, -titles, -icons, -buttons));}, - - - - -_getBreadcrumb:function(route,index){ -if(this._descriptors.crumb.has(route)){ -return this._descriptors.crumb.get(route);} - - -var navBarRouteMapper=this.props.routeMapper; -var firstStyles=initStyle(index,navStatePresentedIndex(this.props.navState)); - -var breadcrumbDescriptor= -React.createElement(View,{ -key:'crumb_'+index, -ref:'crumb_'+index, -style:firstStyles.Crumb}, -React.createElement(View,{ref:'icon_'+index,style:firstStyles.Icon}, -navBarRouteMapper.iconForRoute(route,this.props.navigator)), - -React.createElement(View,{ref:'separator_'+index,style:firstStyles.Separator}, -navBarRouteMapper.separatorForRoute(route,this.props.navigator))); - - - - -this._descriptors.crumb=this._descriptors.crumb.set(route,breadcrumbDescriptor); -return breadcrumbDescriptor;}, - - -_getTitle:function(route,index){ -if(this._descriptors.title.has(route)){ -return this._descriptors.title.get(route);} - - -var titleContent=this.props.routeMapper.titleContentForRoute( -this.props.navState.routeStack[index], -this.props.navigator); - -var firstStyles=initStyle(index,navStatePresentedIndex(this.props.navState)); - -var titleDescriptor= -React.createElement(View,{ -key:'title_'+index, -ref:'title_'+index, -style:firstStyles.Title}, -titleContent); - - -this._descriptors.title=this._descriptors.title.set(route,titleDescriptor); -return titleDescriptor;}, - - -_getRightButton:function(route,index){ -if(this._descriptors.right.has(route)){ -return this._descriptors.right.get(route);} - -var rightContent=this.props.routeMapper.rightContentForRoute( -this.props.navState.routeStack[index], -this.props.navigator); - -if(!rightContent){ -this._descriptors.right=this._descriptors.right.set(route,null); -return null;} - -var firstStyles=initStyle(index,navStatePresentedIndex(this.props.navState)); -var rightButtonDescriptor= -React.createElement(View,{ -key:'right_'+index, -ref:'right_'+index, -style:firstStyles.RightItem}, -rightContent); - - -this._descriptors.right=this._descriptors.right.set(route,rightButtonDescriptor); -return rightButtonDescriptor;}, - - -_setPropsIfExists:function(ref,props){ -var ref=this.refs[ref]; -ref&&ref.setNativeProps(props);}}); - - - -var styles=StyleSheet.create({ -breadCrumbContainer:{ -overflow:'hidden', -position:'absolute', -height:NavigatorNavigationBarStyles.General.TotalNavHeight, -top:0, -left:0, -right:0}}); - - - -module.exports=NavigatorBreadcrumbNavigationBar; -}); -__d('NavigatorBreadcrumbNavigationBarStyles',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var NavigatorNavigationBarStylesIOS=require('NavigatorNavigationBarStylesIOS'); - -var buildStyleInterpolator=require('buildStyleInterpolator'); -var merge=require('merge'); - -var SCREEN_WIDTH=Dimensions.get('window').width; -var STATUS_BAR_HEIGHT=NavigatorNavigationBarStylesIOS.General.StatusBarHeight; -var NAV_BAR_HEIGHT=NavigatorNavigationBarStylesIOS.General.NavBarHeight; - -var SPACING=4; -var ICON_WIDTH=40; -var SEPARATOR_WIDTH=9; -var CRUMB_WIDTH=ICON_WIDTH+SEPARATOR_WIDTH; - -var OPACITY_RATIO=100; -var ICON_INACTIVE_OPACITY=0.6; -var MAX_BREADCRUMBS=10; - -var CRUMB_BASE={ -position:'absolute', -flexDirection:'row', -top:STATUS_BAR_HEIGHT, -width:CRUMB_WIDTH, -height:NAV_BAR_HEIGHT, -backgroundColor:'transparent'}; - - -var ICON_BASE={ -width:ICON_WIDTH, -height:NAV_BAR_HEIGHT}; - - -var SEPARATOR_BASE={ -width:SEPARATOR_WIDTH, -height:NAV_BAR_HEIGHT}; - - -var TITLE_BASE={ -position:'absolute', -top:STATUS_BAR_HEIGHT, -height:NAV_BAR_HEIGHT, -backgroundColor:'transparent'}; - - - -var FIRST_TITLE_BASE=merge(TITLE_BASE,{ -left:0, -right:0, -alignItems:'center', -height:NAV_BAR_HEIGHT}); - - -var RIGHT_BUTTON_BASE={ -position:'absolute', -top:STATUS_BAR_HEIGHT, -right:SPACING, -overflow:'hidden', -opacity:1, -height:NAV_BAR_HEIGHT, -backgroundColor:'transparent'}; - - - - - - -var LEFT=[]; -var CENTER=[]; -var RIGHT=[]; -for(var i=0;i= '+( -anim.threshold+' ? '+anim.to+' : '+anim.from)+';\n');}; - - - -var computeNextValIdentity=function(anim){ -return ' nextScalarVal = value;\n';}; - - -var operationVar=function(name){ -return name+'ReuseOp';}; - - -var createReusableOperationVars=function(anims){ -var ret=''; -for(var name in anims){ -if(ShouldAllocateReusableOperationVars[name]){ -ret+='var '+operationVar(name)+' = [];\n';}} - - -return ret;}; - - -var newlines=function(statements){ -return '\n'+statements.join('\n')+'\n';}; - - - - - - - - -var computeNextMatrixOperationField=function(anim,name,dimension,index){ -var fieldAccess=operationVar(name)+'['+index+']'; -if(anim.from[dimension]!==undefined&&anim.to[dimension]!==undefined){ -return ' '+anim.from[dimension]!==anim.to[dimension]? -computeNextValLinear(anim,anim.from[dimension],anim.to[dimension],fieldAccess): -fieldAccess+' = '+anim.from[dimension]+';';}else -{ -return ' '+fieldAccess+' = '+InitialOperationField[name][index]+';';}}; - - - -var unrolledVars=[]; -for(var varIndex=0;varIndex<16;varIndex++){ -unrolledVars.push('m'+varIndex);} - -var setNextMatrixAndDetectChange=function(orderedMatrixOperations){ -var fn=[ -' var transformMatrix = result.transformMatrix !== undefined ? '+ -'result.transformMatrix : (result.transformMatrix = []);']; - -fn.push.apply( -fn, -inline(MatrixOps.unroll,['transformMatrix'].concat(unrolledVars))); - -for(var i=0;ifromIndex?progress:1-progress; -var oldDistToCenter=index-fromIndex; -var newDistToCenter=index-toIndex; -var interpolate; -if(oldDistToCenter>0&&newDistToCenter===0|| -newDistToCenter>0&&oldDistToCenter===0){ -interpolate=this.props.navigationStyles.Interpolators.RightToCenter;}else -if(oldDistToCenter<0&&newDistToCenter===0|| -newDistToCenter<0&&oldDistToCenter===0){ -interpolate=this.props.navigationStyles.Interpolators.CenterToLeft;}else -if(oldDistToCenter===newDistToCenter){ -interpolate=this.props.navigationStyles.Interpolators.RightToCenter;}else -{ -interpolate=this.props.navigationStyles.Interpolators.RightToLeft;} - - -COMPONENT_NAMES.forEach(function(componentName){ -var component=this._components[componentName].get(this.props.navState.routeStack[index]); -var props=this._getReusableProps(componentName,index); -if(component&&interpolate[componentName](props.style,amount)){ -component.setNativeProps(props);}}, - -this);}, - - -updateProgress:function( -progress, -fromIndex, -toIndex) -{ -var max=Math.max(fromIndex,toIndex); -var min=Math.min(fromIndex,toIndex); -for(var index=min;index<=max;index++){ -this._updateIndexProgress(progress,index,fromIndex,toIndex);}}, - - - -render:function(){ -var navBarStyle={ -height:this.props.navigationStyles.General.TotalNavHeight}; - -var navState=this.props.navState; -var components=COMPONENT_NAMES.map(function(componentName){ -return navState.routeStack.map( -this._getComponent.bind(this,componentName));}, - -this); - -return ( -React.createElement(View,{style:[styles.navBarContainer,navBarStyle,this.props.style]}, -components));}, - - - - -_getComponent:function( -componentName, -route, -index) -{var _this2=this; -if(this._descriptors[componentName].includes(route)){ -return this._descriptors[componentName].get(route);} - - -var rendered=null; - -var content=this.props.routeMapper[componentName]( -this.props.navState.routeStack[index], -this.props.navigator, -index, -this.props.navState); - -if(!content){ -return null;} - - -var initialStage=index===navStatePresentedIndex(this.props.navState)? -this.props.navigationStyles.Stages.Center: -this.props.navigationStyles.Stages.Left; -rendered= -React.createElement(View,{ -ref:function(ref){ -_this2._components[componentName]=_this2._components[componentName].set(route,ref);}, - -style:initialStage[componentName]}, -content); - - - -this._descriptors[componentName]=this._descriptors[componentName].set(route,rendered); -return rendered;}}); - - - - - -var styles=StyleSheet.create({ -navBarContainer:{ -position:'absolute', -top:0, -left:0, -right:0, -backgroundColor:'transparent'}}); - - - -module.exports=NavigatorNavigationBar; -}); -__d('NavigatorSceneConfigs',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var PixelRatio=require('PixelRatio'); - -var buildStyleInterpolator=require('buildStyleInterpolator'); - -var SCREEN_WIDTH=Dimensions.get('window').width; -var SCREEN_HEIGHT=Dimensions.get('window').height; - -var FadeToTheLeft={ - - -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:-Math.round(Dimensions.get('window').width*0.3),y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - - - - - - - - - - - - -transformScale:{ -from:{x:1,y:1,z:1}, -to:{x:0.95,y:0.95,z:1}, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -opacity:{ -from:1, -to:0.3, -min:0, -max:1, -type:'linear', -extrapolate:false, -round:100}, - -translateX:{ -from:0, -to:-Math.round(Dimensions.get('window').width*0.3), -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -scaleX:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -scaleY:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}}; - - - -var FadeToTheRight=babelHelpers.extends({}, -FadeToTheLeft,{ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:Math.round(SCREEN_WIDTH*0.3),y:0,z:0}}, - -translateX:{ -from:0, -to:Math.round(SCREEN_WIDTH*0.3)}}); - - - -var FadeIn={ -opacity:{ -from:0, -to:1, -min:0.5, -max:1, -type:'linear', -extrapolate:false, -round:100}}; - - - -var FadeOut={ -opacity:{ -from:1, -to:0, -min:0, -max:0.5, -type:'linear', -extrapolate:false, -round:100}}; - - - -var ToTheLeft={ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:-Dimensions.get('window').width,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -opacity:{ -value:1.0, -type:'constant'}, - - -translateX:{ -from:0, -to:-Dimensions.get('window').width, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var ToTheUp={ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:0,y:-Dimensions.get('window').height,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -opacity:{ -value:1.0, -type:'constant'}, - -translateY:{ -from:0, -to:-Dimensions.get('window').height, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var ToTheDown={ -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:0,y:Dimensions.get('window').height,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -opacity:{ -value:1.0, -type:'constant'}, - -translateY:{ -from:0, -to:Dimensions.get('window').height, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var FromTheRight={ -opacity:{ -value:1.0, -type:'constant'}, - - -transformTranslate:{ -from:{x:Dimensions.get('window').width,y:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - - -translateX:{ -from:Dimensions.get('window').width, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - - -scaleX:{ -value:1, -type:'constant'}, - -scaleY:{ -value:1, -type:'constant'}}; - - - -var FromTheLeft=babelHelpers.extends({}, -FromTheRight,{ -transformTranslate:{ -from:{x:-SCREEN_WIDTH,y:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateX:{ -from:-SCREEN_WIDTH, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}); - - - -var FromTheDown=babelHelpers.extends({}, -FromTheRight,{ -transformTranslate:{ -from:{y:SCREEN_HEIGHT,x:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:SCREEN_HEIGHT, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}); - - - -var FromTheTop=babelHelpers.extends({}, -FromTheRight,{ -transformTranslate:{ -from:{y:-SCREEN_HEIGHT,x:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:-SCREEN_HEIGHT, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}); - - - -var ToTheBack={ - - -transformTranslate:{ -from:{x:0,y:0,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -transformScale:{ -from:{x:1,y:1,z:1}, -to:{x:0.95,y:0.95,z:1}, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -opacity:{ -from:1, -to:0.3, -min:0, -max:1, -type:'linear', -extrapolate:false, -round:100}, - -scaleX:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}, - -scaleY:{ -from:1, -to:0.95, -min:0, -max:1, -type:'linear', -extrapolate:true}}; - - - -var FromTheFront={ -opacity:{ -value:1.0, -type:'constant'}, - - -transformTranslate:{ -from:{x:0,y:Dimensions.get('window').height,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:Dimensions.get('window').height, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -scaleX:{ -value:1, -type:'constant'}, - -scaleY:{ -value:1, -type:'constant'}}; - - - -var ToTheBackAndroid={ -opacity:{ -value:1, -type:'constant'}}; - - - -var FromTheFrontAndroid={ -opacity:{ -from:0, -to:1, -min:0.5, -max:1, -type:'linear', -extrapolate:false, -round:100}, - -transformTranslate:{ -from:{x:0,y:100,z:0}, -to:{x:0,y:0,z:0}, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}, - -translateY:{ -from:100, -to:0, -min:0, -max:1, -type:'linear', -extrapolate:true, -round:PixelRatio.get()}}; - - - -var BaseOverswipeConfig={ -frictionConstant:1, -frictionByDistance:1.5}; - - -var BaseLeftToRightGesture={ - - -isDetachable:false, - - -gestureDetectMovement:2, - - -notMoving:0.3, - - -directionRatio:0.66, - - -snapVelocity:2, - - -edgeHitWidth:30, - - -stillCompletionRatio:3/5, - -fullDistance:SCREEN_WIDTH, - -direction:'left-to-right'}; - - - -var BaseRightToLeftGesture=babelHelpers.extends({}, -BaseLeftToRightGesture,{ -direction:'right-to-left'}); - - -var BaseDownUpGesture=babelHelpers.extends({}, -BaseLeftToRightGesture,{ -fullDistance:SCREEN_HEIGHT, -direction:'down-to-up'}); - - -var BaseUpDownGesture=babelHelpers.extends({}, -BaseLeftToRightGesture,{ -fullDistance:SCREEN_HEIGHT, -direction:'up-to-down'}); - - -var BaseConfig={ - -gestures:{ -pop:BaseLeftToRightGesture}, - - - -springFriction:26, -springTension:200, - - -defaultTransitionVelocity:1.5, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheRight), -out:buildStyleInterpolator(FadeToTheLeft)}}; - - - -var NavigatorSceneConfigs={ -PushFromRight:babelHelpers.extends({}, -BaseConfig), - - -FloatFromRight:babelHelpers.extends({}, -BaseConfig), - - -FloatFromLeft:babelHelpers.extends({}, -BaseConfig,{ -animationInterpolators:{ -into:buildStyleInterpolator(FromTheLeft), -out:buildStyleInterpolator(FadeToTheRight)}}), - - -FloatFromBottom:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -pop:babelHelpers.extends({}, -BaseLeftToRightGesture,{ -edgeHitWidth:150, -direction:'top-to-bottom', -fullDistance:SCREEN_HEIGHT})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheFront), -out:buildStyleInterpolator(ToTheBack)}}), - - -FloatFromBottomAndroid:babelHelpers.extends({}, -BaseConfig,{ -gestures:null, -defaultTransitionVelocity:3, -springFriction:20, -animationInterpolators:{ -into:buildStyleInterpolator(FromTheFrontAndroid), -out:buildStyleInterpolator(ToTheBackAndroid)}}), - - -FadeAndroid:babelHelpers.extends({}, -BaseConfig,{ -gestures:null, -animationInterpolators:{ -into:buildStyleInterpolator(FadeIn), -out:buildStyleInterpolator(FadeOut)}}), - - -HorizontalSwipeJump:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -jumpBack:babelHelpers.extends({}, -BaseLeftToRightGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true}), - -jumpForward:babelHelpers.extends({}, -BaseRightToLeftGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheRight), -out:buildStyleInterpolator(ToTheLeft)}}), - - -VerticalUpSwipeJump:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -jumpBack:babelHelpers.extends({}, -BaseDownUpGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true}), - -jumpForward:babelHelpers.extends({}, -BaseDownUpGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheDown), -out:buildStyleInterpolator(ToTheUp)}}), - - -VerticalDownSwipeJump:babelHelpers.extends({}, -BaseConfig,{ -gestures:{ -jumpBack:babelHelpers.extends({}, -BaseUpDownGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true}), - -jumpForward:babelHelpers.extends({}, -BaseUpDownGesture,{ -overswipe:BaseOverswipeConfig, -edgeHitWidth:null, -isDetachable:true})}, - - -animationInterpolators:{ -into:buildStyleInterpolator(FromTheTop), -out:buildStyleInterpolator(ToTheDown)}})}; - - - - -module.exports=NavigatorSceneConfigs; -}); -__d('PanResponder',function(global, require, module, exports) { "use strict"; - - - - - -var TouchHistoryMath=require('TouchHistoryMath'); - -var currentCentroidXOfTouchesChangedAfter= -TouchHistoryMath.currentCentroidXOfTouchesChangedAfter; -var currentCentroidYOfTouchesChangedAfter= -TouchHistoryMath.currentCentroidYOfTouchesChangedAfter; -var previousCentroidXOfTouchesChangedAfter= -TouchHistoryMath.previousCentroidXOfTouchesChangedAfter; -var previousCentroidYOfTouchesChangedAfter= -TouchHistoryMath.previousCentroidYOfTouchesChangedAfter; -var currentCentroidX=TouchHistoryMath.currentCentroidX; -var currentCentroidY=TouchHistoryMath.currentCentroidY; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var PanResponder={ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_initializeGestureState:function(gestureState){ -gestureState.moveX=0; -gestureState.moveY=0; -gestureState.x0=0; -gestureState.y0=0; -gestureState.dx=0; -gestureState.dy=0; -gestureState.vx=0; -gestureState.vy=0; -gestureState.numberActiveTouches=0; - -gestureState._accountsForMovesUpTo=0;}, - - - - - - - - - - - - - - - - - - - - - - - - - - -_updateGestureStateOnMove:function(gestureState,touchHistory){ -gestureState.numberActiveTouches=touchHistory.numberActiveTouches; -gestureState.moveX=currentCentroidXOfTouchesChangedAfter( -touchHistory, -gestureState._accountsForMovesUpTo); - -gestureState.moveY=currentCentroidYOfTouchesChangedAfter( -touchHistory, -gestureState._accountsForMovesUpTo); - -var movedAfter=gestureState._accountsForMovesUpTo; -var prevX=previousCentroidXOfTouchesChangedAfter(touchHistory,movedAfter); -var x=currentCentroidXOfTouchesChangedAfter(touchHistory,movedAfter); -var prevY=previousCentroidYOfTouchesChangedAfter(touchHistory,movedAfter); -var y=currentCentroidYOfTouchesChangedAfter(touchHistory,movedAfter); -var nextDX=gestureState.dx+(x-prevX); -var nextDY=gestureState.dy+(y-prevY); - - -var dt= -touchHistory.mostRecentTimeStamp-gestureState._accountsForMovesUpTo; -gestureState.vx=(nextDX-gestureState.dx)/dt; -gestureState.vy=(nextDY-gestureState.dy)/dt; - -gestureState.dx=nextDX; -gestureState.dy=nextDY; -gestureState._accountsForMovesUpTo=touchHistory.mostRecentTimeStamp;}, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -create:function(config){ -var gestureState={ - -stateID:Math.random()}; - -PanResponder._initializeGestureState(gestureState); -var panHandlers={ -onStartShouldSetResponder:function(e){ -return config.onStartShouldSetPanResponder===undefined?false: -config.onStartShouldSetPanResponder(e,gestureState);}, - -onMoveShouldSetResponder:function(e){ -return config.onMoveShouldSetPanResponder===undefined?false: -config.onMoveShouldSetPanResponder(e,gestureState);}, - -onStartShouldSetResponderCapture:function(e){ - - -if(e.nativeEvent.touches.length===1){ -PanResponder._initializeGestureState(gestureState);} - -gestureState.numberActiveTouches=e.touchHistory.numberActiveTouches; -return config.onStartShouldSetPanResponderCapture!==undefined? -config.onStartShouldSetPanResponderCapture(e,gestureState):false;}, - - -onMoveShouldSetResponderCapture:function(e){ -var touchHistory=e.touchHistory; - - - -if(gestureState._accountsForMovesUpTo===touchHistory.mostRecentTimeStamp){ -return false;} - -PanResponder._updateGestureStateOnMove(gestureState,touchHistory); -return config.onMoveShouldSetPanResponderCapture? -config.onMoveShouldSetPanResponderCapture(e,gestureState):false;}, - - -onResponderGrant:function(e){ -gestureState.x0=currentCentroidX(e.touchHistory); -gestureState.y0=currentCentroidY(e.touchHistory); -gestureState.dx=0; -gestureState.dy=0; -config.onPanResponderGrant&&config.onPanResponderGrant(e,gestureState); - -return config.onShouldBlockNativeResponder===undefined?true: -config.onShouldBlockNativeResponder();}, - - -onResponderReject:function(e){ -config.onPanResponderReject&&config.onPanResponderReject(e,gestureState);}, - - -onResponderRelease:function(e){ -config.onPanResponderRelease&&config.onPanResponderRelease(e,gestureState); -PanResponder._initializeGestureState(gestureState);}, - - -onResponderStart:function(e){ -var touchHistory=e.touchHistory; -gestureState.numberActiveTouches=touchHistory.numberActiveTouches; -config.onPanResponderStart&&config.onPanResponderStart(e,gestureState);}, - - -onResponderMove:function(e){ -var touchHistory=e.touchHistory; - - -if(gestureState._accountsForMovesUpTo===touchHistory.mostRecentTimeStamp){ -return;} - - - -PanResponder._updateGestureStateOnMove(gestureState,touchHistory); -config.onPanResponderMove&&config.onPanResponderMove(e,gestureState);}, - - -onResponderEnd:function(e){ -var touchHistory=e.touchHistory; -gestureState.numberActiveTouches=touchHistory.numberActiveTouches; -config.onPanResponderEnd&&config.onPanResponderEnd(e,gestureState);}, - - -onResponderTerminate:function(e){ -config.onPanResponderTerminate&& -config.onPanResponderTerminate(e,gestureState); -PanResponder._initializeGestureState(gestureState);}, - - -onResponderTerminationRequest:function(e){ -return config.onPanResponderTerminationRequest===undefined?true: -config.onPanResponderTerminationRequest(e,gestureState);}}; - - -return {panHandlers:panHandlers};}}; - - - -module.exports=PanResponder; -}); -__d('TouchHistoryMath',function(global, require, module, exports) { "use strict"; - - - - - -var TouchHistoryMath={ - - - - - - - - - - - - - - - - -centroidDimension:function(touchHistory,touchesChangedAfter,isXAxis,ofCurrent){ -var touchBank=touchHistory.touchBank; -var total=0; -var count=0; - -var oneTouchData=touchHistory.numberActiveTouches===1? -touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]:null; - -if(oneTouchData!==null){ -if(oneTouchData.touchActive&&oneTouchData.currentTimeStamp>touchesChangedAfter){ -total+=ofCurrent&&isXAxis?oneTouchData.currentPageX: -ofCurrent&&!isXAxis?oneTouchData.currentPageY: -!ofCurrent&&isXAxis?oneTouchData.previousPageX: -oneTouchData.previousPageY; -count=1;}}else - -{ -for(var i=0;i=touchesChangedAfter){ -var toAdd; -if(ofCurrent&&isXAxis){ -toAdd=touchTrack.currentPageX;}else -if(ofCurrent&&!isXAxis){ -toAdd=touchTrack.currentPageY;}else -if(!ofCurrent&&isXAxis){ -toAdd=touchTrack.previousPageX;}else -{ -toAdd=touchTrack.previousPageY;} - -total+=toAdd; -count++;}}} - - - -return count>0?total/count:TouchHistoryMath.noCentroid;}, - - -currentCentroidXOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -true, -true);}, - - - -currentCentroidYOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -false, -true);}, - - - -previousCentroidXOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -true, -false);}, - - - -previousCentroidYOfTouchesChangedAfter:function(touchHistory,touchesChangedAfter){ -return TouchHistoryMath.centroidDimension( -touchHistory, -touchesChangedAfter, -false, -false);}, - - - -currentCentroidX:function(touchHistory){ -return TouchHistoryMath.centroidDimension( -touchHistory, -0, -true, -true);}, - - - -currentCentroidY:function(touchHistory){ -return TouchHistoryMath.centroidDimension( -touchHistory, -0, -false, -true);}, - - - -noCentroid:-1}; - - -module.exports=TouchHistoryMath; -}); -__d('clamp',function(global, require, module, exports) { function - - - - - - - - - - - - - - - - - - - - - - - -clamp(min,value,max){ -if(valuemax){ -return max;} - -return value;} - - -module.exports=clamp; -}); -__d('rebound/rebound.js',function(global, require, module, exports) { ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function(){ -var rebound={}; -var util=rebound.util={}; -var concat=Array.prototype.concat; -var slice=Array.prototype.slice; - - -util.bind=function bind(func,context){ -var args=slice.call(arguments,2); -return function(){ -func.apply(context,concat.call(args,slice.call(arguments)));};}; - - - - -util.extend=function extend(target,source){ -for(var key in source){ -if(source.hasOwnProperty(key)){ -target[key]=source[key];}}}; - - - - - - - - - -var SpringSystem=rebound.SpringSystem=function SpringSystem(looper){ -this._springRegistry={}; -this._activeSprings=[]; -this.listeners=[]; -this._idleSpringIndices=[]; -this.looper=looper||new AnimationLooper(); -this.looper.springSystem=this;}; - - -util.extend(SpringSystem.prototype,{ - -_springRegistry:null, - -_isIdle:true, - -_lastTimeMillis:-1, - -_activeSprings:null, - -listeners:null, - -_idleSpringIndices:null, - - - - - - -setLooper:function(looper){ -this.looper=looper; -looper.springSystem=this;}, - - - - - - -createSpring:function(tension,friction){ -var springConfig; -if(tension===undefined||friction===undefined){ -springConfig=SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;}else -{ -springConfig= -SpringConfig.fromOrigamiTensionAndFriction(tension,friction);} - -return this.createSpringWithConfig(springConfig);}, - - - - - -createSpringWithBouncinessAndSpeed:function(bounciness,speed){ -var springConfig; -if(bounciness===undefined||speed===undefined){ -springConfig=SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;}else -{ -springConfig= -SpringConfig.fromBouncinessAndSpeed(bounciness,speed);} - -return this.createSpringWithConfig(springConfig);}, - - - -createSpringWithConfig:function(springConfig){ -var spring=new Spring(this); -this.registerSpring(spring); -spring.setSpringConfig(springConfig); -return spring;}, - - - - - - -getIsIdle:function(){ -return this._isIdle;}, - - - - - -getSpringById:function(id){ -return this._springRegistry[id];}, - - - - -getAllSprings:function(){ -var vals=[]; -for(var id in this._springRegistry){ -if(this._springRegistry.hasOwnProperty(id)){ -vals.push(this._springRegistry[id]);}} - - -return vals;}, - - - - - - -registerSpring:function(spring){ -this._springRegistry[spring.getId()]=spring;}, - - - - - - -deregisterSpring:function(spring){ -removeFirst(this._activeSprings,spring); -delete this._springRegistry[spring.getId()];}, - - -advance:function(time,deltaTime){ -while(this._idleSpringIndices.length>0){this._idleSpringIndices.pop();} -for(var i=0,len=this._activeSprings.length;i0){ -var idx=this._idleSpringIndices.pop(); -idx>=0&&this._activeSprings.splice(idx,1);}}, - - - - - - - - - - - - - - - - -loop:function(currentTimeMillis){ -var listener; -if(this._lastTimeMillis===-1){ -this._lastTimeMillis=currentTimeMillis-1;} - -var ellapsedMillis=currentTimeMillis-this._lastTimeMillis; -this._lastTimeMillis=currentTimeMillis; - -var i=0,len=this.listeners.length; -for(i=0;i0&&( -startend|| -start>end&&this.getCurrentValue()Spring.MAX_DELTA_TIME_SEC){ -adjustedDeltaTime=Spring.MAX_DELTA_TIME_SEC;} - - -this._timeAccumulator+=adjustedDeltaTime; - -var tension=this._springConfig.tension, -friction=this._springConfig.friction, - -position=this._currentState.position, -velocity=this._currentState.velocity, -tempPosition=this._tempState.position, -tempVelocity=this._tempState.velocity, - -aVelocity,aAcceleration, -bVelocity,bAcceleration, -cVelocity,cAcceleration, -dVelocity,dAcceleration, - -dxdt,dvdt; - -while(this._timeAccumulator>=Spring.SOLVER_TIMESTEP_SEC){ - -this._timeAccumulator-=Spring.SOLVER_TIMESTEP_SEC; - -if(this._timeAccumulator0){ -this._interpolate(this._timeAccumulator/Spring.SOLVER_TIMESTEP_SEC);} - - -if(this.isAtRest()|| -this._overshootClampingEnabled&&this.isOvershooting()){ - -if(this._springConfig.tension>0){ -this._startValue=this._endValue; -this._currentState.position=this._endValue;}else -{ -this._endValue=this._currentState.position; -this._startValue=this._endValue;} - -this.setVelocity(0); -isAtRest=true;} - - -var notifyActivate=false; -if(this._wasAtRest){ -this._wasAtRest=false; -notifyActivate=true;} - - -var notifyAtRest=false; -if(isAtRest){ -this._wasAtRest=true; -notifyAtRest=true;} - - -this.notifyPositionUpdated(notifyActivate,notifyAtRest);}, - - -notifyPositionUpdated:function(notifyActivate,notifyAtRest){ -for(var i=0,len=this.listeners.length;i18&&tension<=44){ -friction=this.b3Friction2(tension);}else -{ -friction=this.b3Friction3(tension);} - -return friction;}}); - - - -util.extend(SpringConfig,{ - - - - -fromOrigamiTensionAndFriction:function(tension,friction){ -return new SpringConfig( -OrigamiValueConverter.tensionFromOrigamiValue(tension), -OrigamiValueConverter.frictionFromOrigamiValue(friction));}, - - - - - -fromBouncinessAndSpeed:function(bounciness,speed){ -var bouncyConversion=new rebound.BouncyConversion(bounciness,speed); -return this.fromOrigamiTensionAndFriction( -bouncyConversion.bouncyTension, -bouncyConversion.bouncyFriction);}, - - - - -coastingConfigWithOrigamiFriction:function(friction){ -return new SpringConfig( -0, -OrigamiValueConverter.frictionFromOrigamiValue(friction));}}); - - - - -SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG= -SpringConfig.fromOrigamiTensionAndFriction(40,7); - -util.extend(SpringConfig.prototype,{friction:0,tension:0}); - - - - -var colorCache={}; -util.hexToRGB=function(color){ -if(colorCache[color]){ -return colorCache[color];} - -color=color.replace('#',''); -if(color.length===3){ -color=color[0]+color[0]+color[1]+color[1]+color[2]+color[2];} - -var parts=color.match(/.{2}/g); - -var ret={ -r:parseInt(parts[0],16), -g:parseInt(parts[1],16), -b:parseInt(parts[2],16)}; - - -colorCache[color]=ret; -return ret;}; - - -util.rgbToHex=function(r,g,b){ -r=r.toString(16); -g=g.toString(16); -b=b.toString(16); -r=r.length<2?'0'+r:r; -g=g.length<2?'0'+g:g; -b=b.length<2?'0'+b:b; -return '#'+r+g+b;}; - - -var MathUtil=rebound.MathUtil={ - - - - - - - - -mapValueInRange:function(value,fromLow,fromHigh,toLow,toHigh){ -var fromRangeSize=fromHigh-fromLow; -var toRangeSize=toHigh-toLow; -var valueScale=(value-fromLow)/fromRangeSize; -return toLow+valueScale*toRangeSize;}, - - - - - -interpolateColor: -function(val,startColor,endColor,fromLow,fromHigh,asRGB){ -fromLow=fromLow===undefined?0:fromLow; -fromHigh=fromHigh===undefined?1:fromHigh; -startColor=util.hexToRGB(startColor); -endColor=util.hexToRGB(endColor); -var r=Math.floor( -util.mapValueInRange(val,fromLow,fromHigh,startColor.r,endColor.r)); - -var g=Math.floor( -util.mapValueInRange(val,fromLow,fromHigh,startColor.g,endColor.g)); - -var b=Math.floor( -util.mapValueInRange(val,fromLow,fromHigh,startColor.b,endColor.b)); - -if(asRGB){ -return 'rgb('+r+','+g+','+b+')';}else -{ -return util.rgbToHex(r,g,b);}}, - - - -degreesToRadians:function(deg){ -return deg*Math.PI/180;}, - - -radiansToDegrees:function(rad){ -return rad*180/Math.PI;}}; - - - - -util.extend(util,MathUtil); - - - - - - - -function removeFirst(array,item){ -var idx=array.indexOf(item); -idx!=-1&&array.splice(idx,1);} - - -var _onFrame; -if(typeof window!=='undefined'){ -_onFrame=window.requestAnimationFrame|| -window.webkitRequestAnimationFrame|| -window.mozRequestAnimationFrame|| -window.msRequestAnimationFrame|| -window.oRequestAnimationFrame|| -function(callback){ -window.setTimeout(callback,1000/60);};} - - -if(!_onFrame&&typeof process!=='undefined'&&process.title==='node'){ -_onFrame=setImmediate;} - - - -util.onFrame=function onFrame(func){ -return _onFrame(func);}; - - - - -if(typeof exports!='undefined'){ -util.extend(exports,rebound);}else -if(typeof window!='undefined'){ -window.rebound=rebound;}})(); -}); -__d('NavigatorIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var EventEmitter=require('EventEmitter'); -var Image=require('Image'); -var NavigationContext=require('NavigationContext'); -var RCTNavigatorManager=require('NativeModules').NavigatorManager; -var React=require('React'); -var StaticContainer=require('StaticContainer.react'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var invariant=require('invariant'); -var logError=require('logError'); -var requireNativeComponent=require('requireNativeComponent'); -var resolveAssetSource=require('resolveAssetSource'); - -var TRANSITIONER_REF='transitionerRef'; - -var PropTypes=React.PropTypes; - -var __uid=0; -function getuid(){ -return __uid++;} - - -var NavigatorTransitionerIOS=React.createClass({displayName:'NavigatorTransitionerIOS', -requestSchedulingNavigation:function(cb){ -RCTNavigatorManager.requestSchedulingJavaScriptNavigation( -React.findNodeHandle(this), -logError, -cb);}, - - - -render:function(){ -return ( -React.createElement(RCTNavigator,this.props));}}); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var NavigatorIOS=React.createClass({displayName:'NavigatorIOS', - -propTypes:{ - - - - - - -initialRoute:PropTypes.shape({ - - - -component:PropTypes.func.isRequired, - - - - -title:PropTypes.string.isRequired, - - - - - -passProps:PropTypes.object, - - - - - - -backButtonIcon:Image.propTypes.source, - - - - - - -backButtonTitle:PropTypes.string, - - - - -leftButtonIcon:Image.propTypes.source, - - - - -leftButtonTitle:PropTypes.string, - - - - -onLeftButtonPress:PropTypes.func, - - - - -rightButtonIcon:Image.propTypes.source, - - - - -rightButtonTitle:PropTypes.string, - - - - -onRightButtonPress:PropTypes.func, - - - - -wrapperStyle:View.propTypes.style}). - -isRequired, - - - - -navigationBarHidden:PropTypes.bool, - - - - -shadowHidden:PropTypes.bool, - - - - - -itemWrapperStyle:View.propTypes.style, - - - - -tintColor:PropTypes.string, - - - - -barTintColor:PropTypes.string, - - - - -titleTextColor:PropTypes.string, - - - - -translucent:PropTypes.bool}, - - - -navigator:undefined, -navigationContext:new NavigationContext(), - -componentWillMount:function(){ - - -this.navigator={ -push:this.push, -pop:this.pop, -popN:this.popN, -replace:this.replace, -replacePrevious:this.replacePrevious, -replacePreviousAndPop:this.replacePreviousAndPop, -resetTo:this.resetTo, -popToRoute:this.popToRoute, -popToTop:this.popToTop, -navigationContext:this.navigationContext}; - -this._emitWillFocus(this.state.routeStack[this.state.observedTopOfStack]);}, - - -componentDidMount:function(){ -this._emitDidFocus(this.state.routeStack[this.state.observedTopOfStack]);}, - - -componentWillUnmount:function(){ -this.navigationContext.dispose(); -this.navigationContext=new NavigationContext();}, - - -getDefaultProps:function(){ -return { -translucent:true};}, - - - -getInitialState:function(){ -return { -idStack:[getuid()], -routeStack:[this.props.initialRoute], - -requestedTopOfStack:0, - - - - - - -observedTopOfStack:0, -progress:1, -fromIndex:0, -toIndex:0, - - -makingNavigatorRequest:false, - - - -updatingAllIndicesAtOrBeyond:0};}, - - - -_toFocusOnNavigationComplete:undefined, - -_handleFocusRequest:function(item){ -if(this.state.makingNavigatorRequest){ -this._toFocusOnNavigationComplete=item;}else -{ -this._getFocusEmitter().emit('focus',item);}}, - - - -_focusEmitter:undefined, - -_getFocusEmitter:function(){ - -var focusEmitter=this._focusEmitter; -if(!focusEmitter){ -focusEmitter=new EventEmitter(); -this._focusEmitter=focusEmitter;} - -return focusEmitter;}, - - -getChildContext:function() - - -{ -return { -onFocusRequested:this._handleFocusRequest, -focusEmitter:this._getFocusEmitter()};}, - - - -childContextTypes:{ -onFocusRequested:React.PropTypes.func, -focusEmitter:React.PropTypes.instanceOf(EventEmitter)}, - - -_tryLockNavigator:function(cb){ -this.refs[TRANSITIONER_REF].requestSchedulingNavigation( -function(acquiredLock){return acquiredLock&&cb();});}, - - - -_handleNavigatorStackChanged:function(e){ -var newObservedTopOfStack=e.nativeEvent.stackLength-1; -this._emitDidFocus(this.state.routeStack[newObservedTopOfStack]); - -invariant( -newObservedTopOfStack<=this.state.requestedTopOfStack, -'No navigator item should be pushed without JS knowing about it %s %s',newObservedTopOfStack,this.state.requestedTopOfStack); - -var wasWaitingForConfirmation= -this.state.requestedTopOfStack!==this.state.observedTopOfStack; -if(wasWaitingForConfirmation){ -invariant( -newObservedTopOfStack===this.state.requestedTopOfStack, -'If waiting for observedTopOfStack to reach requestedTopOfStack, '+ -'the only valid observedTopOfStack should be requestedTopOfStack.');} - - - - - - - - - - - -var nextState={ -observedTopOfStack:newObservedTopOfStack, -makingNavigatorRequest:false, -updatingAllIndicesAtOrBeyond:null, -progress:1, -toIndex:newObservedTopOfStack, -fromIndex:newObservedTopOfStack}; - -this.setState(nextState,this._eliminateUnneededChildren);}, - - -_eliminateUnneededChildren:function(){ - - - -var updatingAllIndicesAtOrBeyond= -this.state.routeStack.length>this.state.observedTopOfStack+1? -this.state.observedTopOfStack+1: -null; -this.setState({ -idStack:this.state.idStack.slice(0,this.state.observedTopOfStack+1), -routeStack:this.state.routeStack.slice(0,this.state.observedTopOfStack+1), - -requestedTopOfStack:this.state.observedTopOfStack, -makingNavigatorRequest:true, -updatingAllIndicesAtOrBeyond:updatingAllIndicesAtOrBeyond});}, - - - -_emitDidFocus:function(route){ -this.navigationContext.emit('didfocus',{route:route});}, - - -_emitWillFocus:function(route){ -this.navigationContext.emit('willfocus',{route:route});}, - - -push:function(route){var _this=this; -invariant(!!route,'Must supply route to push'); - -if(this.state.requestedTopOfStack===this.state.observedTopOfStack){ -this._tryLockNavigator(function(){ -_this._emitWillFocus(route); - -var nextStack=_this.state.routeStack.concat([route]); -var nextIDStack=_this.state.idStack.concat([getuid()]); -_this.setState({ - - -idStack:nextIDStack, -routeStack:nextStack, -requestedTopOfStack:nextStack.length-1, -makingNavigatorRequest:true, -updatingAllIndicesAtOrBeyond:nextStack.length-1});});}}, - - - - - -popN:function(n){var _this2=this; -if(n===0){ -return;} - - -if(this.state.requestedTopOfStack===this.state.observedTopOfStack){ -if(this.state.requestedTopOfStack>0){ -this._tryLockNavigator(function(){ -var newRequestedTopOfStack=_this2.state.requestedTopOfStack-n; -invariant(newRequestedTopOfStack>=0,'Cannot pop below 0'); -_this2._emitWillFocus(_this2.state.routeStack[newRequestedTopOfStack]); -_this2.setState({ -requestedTopOfStack:newRequestedTopOfStack, -makingNavigatorRequest:true, - - -updatingAllIndicesAtOrBeyond:null});});}}}, - - - - - - -pop:function(){ -this.popN(1);}, - - - - - - - - -replaceAtIndex:function(route,index){ -invariant(!!route,'Must supply route to replace'); -if(index<0){ -index+=this.state.routeStack.length;} - - -if(this.state.routeStack.length<=index){ -return;} - - - - -var nextIDStack=this.state.idStack.slice(); -var nextRouteStack=this.state.routeStack.slice(); -nextIDStack[index]=getuid(); -nextRouteStack[index]=route; - -this.setState({ -idStack:nextIDStack, -routeStack:nextRouteStack, -makingNavigatorRequest:false, -updatingAllIndicesAtOrBeyond:index}); - - -this._emitWillFocus(route); -this._emitDidFocus(route);}, - - - - - -replace:function(route){ -this.replaceAtIndex(route,-1);}, - - - - - -replacePrevious:function(route){ -this.replaceAtIndex(route,-2);}, - - -popToTop:function(){ -this.popToRoute(this.state.routeStack[0]);}, - - -popToRoute:function(route){ -var indexOfRoute=this.state.routeStack.indexOf(route); -invariant( -indexOfRoute!==-1, -'Calling pop to route for a route that doesn\'t exist!'); - -var numToPop=this.state.routeStack.length-indexOfRoute-1; -this.popN(numToPop);}, - - -replacePreviousAndPop:function(route){var _this3=this; - -if(this.state.requestedTopOfStack!==this.state.observedTopOfStack){ -return;} - -if(this.state.routeStack.length<2){ -return;} - -this._tryLockNavigator(function(){ -_this3.replacePrevious(route); -_this3.setState({ -requestedTopOfStack:_this3.state.requestedTopOfStack-1, -makingNavigatorRequest:true});});}, - - - - -resetTo:function(route){ -invariant(!!route,'Must supply route to push'); - -if(this.state.requestedTopOfStack!==this.state.observedTopOfStack){ -return;} - -this.replaceAtIndex(route,0); -this.popToRoute(route);}, - - -handleNavigationComplete:function(e){ -if(this._toFocusOnNavigationComplete){ -this._getFocusEmitter().emit('focus',this._toFocusOnNavigationComplete); -this._toFocusOnNavigationComplete=null;} - -this._handleNavigatorStackChanged(e);}, - - -_routeToStackItem:function(route,i){var -component=route.component;var wrapperStyle=route.wrapperStyle;var passProps=route.passProps;var route=babelHelpers.objectWithoutProperties(route,['component','wrapperStyle','passProps']);var _props= -this.props;var itemWrapperStyle=_props.itemWrapperStyle;var props=babelHelpers.objectWithoutProperties(_props,['itemWrapperStyle']); -var shouldUpdateChild= -this.state.updatingAllIndicesAtOrBeyond&& -this.state.updatingAllIndicesAtOrBeyond>=i; -var Component=component; -return ( -React.createElement(StaticContainer,{key:'nav'+i,shouldUpdate:shouldUpdateChild}, -React.createElement(RCTNavigatorItem,babelHelpers.extends({}, -route, -props,{ -style:[ -styles.stackItem, -itemWrapperStyle, -wrapperStyle]}), - -React.createElement(Component,babelHelpers.extends({ -navigator:this.navigator, -route:route}, -passProps)))));}, - - - - - - -renderNavigationStackItems:function(){ -var shouldRecurseToNavigator= -this.state.makingNavigatorRequest|| -this.state.updatingAllIndicesAtOrBeyond!==null; - - -var items=shouldRecurseToNavigator? -this.state.routeStack.map(this._routeToStackItem):null; -return ( -React.createElement(StaticContainer,{shouldUpdate:shouldRecurseToNavigator}, -React.createElement(NavigatorTransitionerIOS,{ -ref:TRANSITIONER_REF, -style:styles.transitioner, -vertical:this.props.vertical, -requestedTopOfStack:this.state.requestedTopOfStack, -onNavigationComplete:this.handleNavigationComplete}, -items)));}, - - - - - -render:function(){ -return ( -React.createElement(View,{style:this.props.style}, -this.renderNavigationStackItems()));}}); - - - - - -var styles=StyleSheet.create({ -stackItem:{ -backgroundColor:'white', -overflow:'hidden', -position:'absolute', -top:0, -left:0, -right:0, -bottom:0}, - -transitioner:{ -flex:1}}); - - - -var RCTNavigator=requireNativeComponent('RCTNavigator'); -var RCTNavigatorItem=requireNativeComponent('RCTNavItem'); - -module.exports=NavigatorIOS; -}); -__d('StaticContainer.react',function(global, require, module, exports) { var - - - - - - - - - - - - - - - - - - - - -React=require('React'); - -var onlyChild=require('onlyChild');var - - - - - - - - - - - - - - - - -StaticContainer=(function(_React$Component){babelHelpers.inherits(StaticContainer,_React$Component);function StaticContainer(){babelHelpers.classCallCheck(this,StaticContainer);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(StaticContainer).apply(this,arguments));}babelHelpers.createClass(StaticContainer,[{key:'shouldComponentUpdate',value:function shouldComponentUpdate( - -nextProps){ -return !!nextProps.shouldUpdate;}},{key:'render',value:function render() - - -{ -var child=this.props.children; -return child===null||child===false?null:onlyChild(child);}}]);return StaticContainer;})(React.Component); - - - - -module.exports=StaticContainer; -}); -__d('PickerIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var React=require('React'); -var ReactChildren=require('ReactChildren'); -var RCTPickerIOSConsts=require('NativeModules').UIManager.RCTPicker.Constants; -var StyleSheet=require('StyleSheet'); -var StyleSheetPropType=require('StyleSheetPropType'); -var TextStylePropTypes=require('TextStylePropTypes'); -var View=require('View'); - -var itemStylePropType=StyleSheetPropType(TextStylePropTypes); -var requireNativeComponent=require('requireNativeComponent'); - -var PickerIOS=React.createClass({displayName:'PickerIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ -itemStyle:itemStylePropType, -onValueChange:React.PropTypes.func, -selectedValue:React.PropTypes.any}), - - -getInitialState:function(){ -return this._stateFromProps(this.props);}, - - -componentWillReceiveProps:function(nextProps){ -this.setState(this._stateFromProps(nextProps));}, - - - -_stateFromProps:function(props){ -var selectedIndex=0; -var items=[]; -ReactChildren.forEach(props.children,function(child,index){ -if(child.props.value===props.selectedValue){ -selectedIndex=index;} - -items.push({value:child.props.value,label:child.props.label});}); - -return {selectedIndex:selectedIndex,items:items};}, - - -render:function(){var _this=this; -return ( -React.createElement(View,{style:this.props.style}, -React.createElement(RCTPickerIOS,{ -ref:function(picker){return _this._picker=picker;}, -style:[styles.pickerIOS,this.props.itemStyle], -items:this.state.items, -selectedIndex:this.state.selectedIndex, -onChange:this._onChange})));}, - - - - - -_onChange:function(event){ -if(this.props.onChange){ -this.props.onChange(event);} - -if(this.props.onValueChange){ -this.props.onValueChange(event.nativeEvent.newValue);} - - - - - - - - -if(this._picker&&this.state.selectedIndex!==event.nativeEvent.newIndex){ -this._picker.setNativeProps({ -selectedIndex:this.state.selectedIndex});}}}); - - - - - -PickerIOS.Item=React.createClass({displayName:'Item', -propTypes:{ -value:React.PropTypes.any, -label:React.PropTypes.string}, - - -render:function(){ - -return null;}}); - - - -var styles=StyleSheet.create({ -pickerIOS:{ - - - -height:RCTPickerIOSConsts.ComponentHeight}}); - - - -var RCTPickerIOS=requireNativeComponent('RCTPicker',{ -propTypes:{ -style:itemStylePropType}}, - -{ -nativeOnly:{ -items:true, -onChange:true, -selectedIndex:true}}); - - - -module.exports=PickerIOS; -}); -__d('ProgressBarAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('ProgressViewIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Image=require('Image'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var NativeModules=require('NativeModules'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - -var ProgressViewIOS=React.createClass({displayName:'ProgressViewIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -progressViewStyle:PropTypes.oneOf(['default','bar']), - - - - -progress:PropTypes.number, - - - - -progressTintColor:PropTypes.string, - - - - -trackTintColor:PropTypes.string, - - - - -progressImage:Image.propTypes.source, - - - - -trackImage:Image.propTypes.source}), - - -render:function(){ -return ( -React.createElement(RCTProgressView,babelHelpers.extends({}, -this.props,{ -style:[styles.progressView,this.props.style]})));}}); - - - - - -var styles=StyleSheet.create({ -progressView:{ -height:NativeModules.ProgressViewManager.ComponentHeight}}); - - - -var RCTProgressView=requireNativeComponent( -'RCTProgressView', -ProgressViewIOS); - - -module.exports=ProgressViewIOS; -}); -__d('SegmentedControlIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var NativeModules=require('NativeModules'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - - - -var SEGMENTED_CONTROL_REFERENCE='segmentedcontrol'; - - - - - - -var SegmentedControlIOS=React.createClass({displayName:'SegmentedControlIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -values:PropTypes.arrayOf(PropTypes.string), - - - - -selectedIndex:PropTypes.number, - - - - - -onValueChange:PropTypes.func, - - - - - -onChange:PropTypes.func, - - - - - -enabled:PropTypes.bool, - - - - -tintColor:PropTypes.string, - - - - - -momentary:PropTypes.bool}), - - -getDefaultProps:function(){ -return { -values:[], -enabled:true};}, - - - -_onChange:function(event){ -this.props.onChange&&this.props.onChange(event); -this.props.onValueChange&&this.props.onValueChange(event.nativeEvent.value);}, - - -render:function(){ -return ( -React.createElement(RCTSegmentedControl,babelHelpers.extends({}, -this.props,{ -ref:SEGMENTED_CONTROL_REFERENCE, -style:[styles.segmentedControl,this.props.style], -onChange:this._onChange})));}}); - - - - - -var styles=StyleSheet.create({ -segmentedControl:{ -height:NativeModules.SegmentedControlManager.ComponentHeight}}); - - - -var RCTSegmentedControl=requireNativeComponent( -'RCTSegmentedControl', -SegmentedControlIOS); - - -module.exports=SegmentedControlIOS; -}); -__d('SliderIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Image=require('Image'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - -var SliderIOS=React.createClass({displayName:'SliderIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - -style:View.propTypes.style, - - - - - - - - - -value:PropTypes.number, - - - - - - -step:PropTypes.number, - - - - -minimumValue:PropTypes.number, - - - - -maximumValue:PropTypes.number, - - - - - -minimumTrackTintColor:PropTypes.string, - - - - - -maximumTrackTintColor:PropTypes.string, - - - - - -disabled:PropTypes.bool, - - - - -trackImage:Image.propTypes.source, - - - - -thumbImage:Image.propTypes.source, - - - - -onValueChange:PropTypes.func, - - - - - -onSlidingComplete:PropTypes.func}), - - -getDefaultProps:function(){ -return { -disabled:false};}, - - - -render:function(){var _this=this; - -var onValueChange=this.props.onValueChange&&function(event){ -_this.props.onValueChange&& -_this.props.onValueChange(event.nativeEvent.value);}; - - -var onSlidingComplete=this.props.onSlidingComplete&&function(event){ -_this.props.onSlidingComplete&& -_this.props.onSlidingComplete(event.nativeEvent.value);};var _props= - - -this.props;var style=_props.style;var props=babelHelpers.objectWithoutProperties(_props,['style']); -style=[styles.slider,style]; - -return ( -React.createElement(RCTSlider,babelHelpers.extends({}, -props,{ -style:style, -onValueChange:onValueChange, -onSlidingComplete:onSlidingComplete})));}}); - - - - - -var styles=StyleSheet.create({ -slider:{ -height:40}}); - - - -var RCTSlider=requireNativeComponent('RCTSlider',SliderIOS); - -module.exports=SliderIOS; -}); -__d('SnapshotViewIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet');var _require= -require('NativeModules');var TestModule=_require.TestModule;var UIManager=_require.UIManager; -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var SnapshotViewIOS=React.createClass({displayName:'SnapshotViewIOS', -onDefaultAction:function(event){ -TestModule.verifySnapshot(TestModule.markTestPassed);}, - - -render:function(){ -var testIdentifier=this.props.testIdentifier||'test'; -var onSnapshotReady=this.props.onSnapshotReady||this.onDefaultAction; -return ( -React.createElement(RCTSnapshot,babelHelpers.extends({ -style:style.snapshot}, -this.props,{ -onSnapshotReady:onSnapshotReady, -testIdentifier:testIdentifier})));}, - - - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - -onSnapshotReady:React.PropTypes.func, - -testIdentifier:React.PropTypes.string})}); - - - -var style=StyleSheet.create({ -snapshot:{ -flex:1}}); - - - - - - -var RCTSnapshot=UIManager.RCTSnapshot? -requireNativeComponent('RCTSnapshot',SnapshotViewIOS): -View; - -module.exports=SnapshotViewIOS; -}); -__d('Switch',function(global, require, module, exports) { 'use strict'; - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var Platform=require('Platform'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - - - - - - - - - -var Switch=React.createClass({displayName:'Switch', -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - -value:React.PropTypes.bool, - - - - -disabled:React.PropTypes.bool, - - - -onValueChange:React.PropTypes.func, - - - -testID:React.PropTypes.string, - - - - - -tintColor:React.PropTypes.string, - - - - -onTintColor:React.PropTypes.string, - - - - -thumbTintColor:React.PropTypes.string}), - - -getDefaultProps:function(){ -return { -value:false, -disabled:false};}, - - - -mixins:[NativeMethodsMixin], - -_rctSwitch:{}, -_onChange:function(event){ -this.props.onChange&&this.props.onChange(event); -this.props.onValueChange&&this.props.onValueChange(event.nativeEvent.value); - - - -if(Platform.OS==='android'){ -this._rctSwitch.setNativeProps({on:this.props.value});}else -{ -this._rctSwitch.setNativeProps({value:this.props.value});}}, - - - -render:function(){var _this=this; -var props=babelHelpers.extends({},this.props); -props.onStartShouldSetResponder=function(){return true;}; -props.onResponderTerminationRequest=function(){return false;}; -if(Platform.OS==='android'){ -props.enabled=!this.props.disabled; -props.on=this.props.value; -props.style=[styles.rctSwitchAndroid,this.props.style];}else -if(Platform.OS==='ios'){ -props.style=[styles.rctSwitchIOS,this.props.style];} - -return ( -React.createElement(RCTSwitch,babelHelpers.extends({}, -props,{ -ref:function(ref){_this._rctSwitch=ref;}, -onChange:this._onChange})));}}); - - - - - -var styles=StyleSheet.create({ -rctSwitchIOS:{ -height:31, -width:51}, - -rctSwitchAndroid:{ -height:27, -width:40}}); - - - -if(Platform.OS==='android'){ -var RCTSwitch=requireNativeComponent('AndroidSwitch',Switch,{ -nativeOnly:{onChange:true,on:true,enabled:true}});}else - -{ -var RCTSwitch=requireNativeComponent('RCTSwitch',Switch,{ -nativeOnly:{onChange:true}});} - - - -module.exports=Switch; -}); -__d('PullToRefreshViewAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('SwitchAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('SwitchIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var SWITCH='switch'; - - - - - - - - - - - - - - - -var SwitchIOS=React.createClass({displayName:'SwitchIOS', -mixins:[NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - -value:PropTypes.bool, - - - - - -disabled:PropTypes.bool, - - - - -onValueChange:PropTypes.func, - - - - -onTintColor:PropTypes.string, - - - - -thumbTintColor:PropTypes.string, - - - - -tintColor:PropTypes.string}), - - -getDefaultProps:function(){ -return { -value:false, -disabled:false};}, - - - -_onChange:function(event){ - - -this.refs[SWITCH].setNativeProps({value:this.props.value}); - -if(this.props.value===event.nativeEvent.value||this.props.disabled){ -return;} - - -this.props.onChange&&this.props.onChange(event); -this.props.onValueChange&&this.props.onValueChange(event.nativeEvent.value);}, - - -render:function(){ -return ( -React.createElement(RCTSwitch,babelHelpers.extends({}, -this.props,{ -ref:SWITCH, -onChange:this._onChange, -style:[styles.rkSwitch,this.props.style]})));}}); - - - - - -var styles=StyleSheet.create({ -rkSwitch:{ -height:31, -width:51}}); - - - -var RCTSwitch=requireNativeComponent('RCTSwitch',SwitchIOS,{ -nativeOnly:{onChange:true}}); - - -module.exports=SwitchIOS; -}); -__d('TabBarIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var TabBarItemIOS=require('TabBarItemIOS'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var TabBarIOS=React.createClass({displayName:'TabBarIOS', -statics:{ -Item:TabBarItemIOS}, - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ -style:View.propTypes.style, - - - -tintColor:React.PropTypes.string, - - - -barTintColor:React.PropTypes.string, - - - -translucent:React.PropTypes.bool}), - - -render:function(){ -return ( -React.createElement(RCTTabBar,{ -style:[styles.tabGroup,this.props.style], -tintColor:this.props.tintColor, -barTintColor:this.props.barTintColor, -translucent:this.props.translucent!==false}, -this.props.children));}}); - - - - - -var styles=StyleSheet.create({ -tabGroup:{ -flex:1}}); - - - -var RCTTabBar=requireNativeComponent('RCTTabBar',TabBarIOS); - -module.exports=TabBarIOS; -}); -__d('TabBarItemIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Image=require('Image'); -var React=require('React'); -var StaticContainer=require('StaticContainer.react'); -var StyleSheet=require('StyleSheet'); -var View=require('View'); - -var requireNativeComponent=require('requireNativeComponent'); - -var TabBarItemIOS=React.createClass({displayName:'TabBarItemIOS', -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - -badge:React.PropTypes.oneOfType([ -React.PropTypes.string, -React.PropTypes.number]), - - - - - - -systemIcon:React.PropTypes.oneOf([ -'bookmarks', -'contacts', -'downloads', -'favorites', -'featured', -'history', -'more', -'most-recent', -'most-viewed', -'recents', -'search', -'top-rated']), - - - - -icon:Image.propTypes.source, - - - - -selectedIcon:Image.propTypes.source, - - - - -onPress:React.PropTypes.func, - - - - -selected:React.PropTypes.bool, - - - -style:View.propTypes.style, - - - - -title:React.PropTypes.string}), - - -getInitialState:function(){ -return { -hasBeenSelected:false};}, - - - -componentWillMount:function(){ -if(this.props.selected){ -this.setState({hasBeenSelected:true});}}, - - - -componentWillReceiveProps:function(nextProps){ -if(this.state.hasBeenSelected||nextProps.selected){ -this.setState({hasBeenSelected:true});}}, - - - -render:function(){var _props= -this.props;var style=_props.style;var children=_props.children;var props=babelHelpers.objectWithoutProperties(_props,['style','children']); - - - -if(this.state.hasBeenSelected){ -var tabContents= -React.createElement(StaticContainer,{shouldUpdate:this.props.selected}, -children);}else - -{ -var tabContents=React.createElement(View,null);} - - -return ( -React.createElement(RCTTabBarItem,babelHelpers.extends({}, -props,{ -style:[styles.tab,style]}), -tabContents));}}); - - - - - -var styles=StyleSheet.create({ -tab:{ -position:'absolute', -top:0, -right:0, -bottom:0, -left:0}}); - - - -var RCTTabBarItem=requireNativeComponent('RCTTabBarItem',TabBarItemIOS); - -module.exports=TabBarItemIOS; -}); -__d('Text',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var Platform=require('Platform'); -var React=require('React'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactNativeViewAttributes=require('ReactNativeViewAttributes'); -var StyleSheetPropType=require('StyleSheetPropType'); -var TextStylePropTypes=require('TextStylePropTypes'); -var Touchable=require('Touchable'); - -var createReactNativeComponentClass= -require('createReactNativeComponentClass'); -var merge=require('merge'); - -var stylePropType=StyleSheetPropType(TextStylePropTypes); - -var viewConfig={ -validAttributes:merge(ReactNativeViewAttributes.UIView,{ -isHighlighted:true, -numberOfLines:true, -allowFontScaling:true}), - -uiViewClassName:'RCTText'}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var Text=React.createClass({displayName:'Text', -propTypes:{ - - - - - -numberOfLines:React.PropTypes.number, - - - - - -onLayout:React.PropTypes.func, - - - -onPress:React.PropTypes.func, - - - - - -suppressHighlighting:React.PropTypes.bool, -style:stylePropType, - - - -testID:React.PropTypes.string, - - - -allowFontScaling:React.PropTypes.bool}, - -getDefaultProps:function(){ -return { -accessible:true, -allowFontScaling:true};}, - - -getInitialState:function(){ -return merge(Touchable.Mixin.touchableGetInitialState(),{ -isHighlighted:false});}, - - -mixins:[NativeMethodsMixin], -viewConfig:viewConfig, -getChildContext:function(){ -return {isInAParentText:true};}, - -childContextTypes:{ -isInAParentText:React.PropTypes.bool}, - -contextTypes:{ -isInAParentText:React.PropTypes.bool}, - - - - -_handlers:null, - - - - -touchableHandleActivePressIn:null, -touchableHandleActivePressOut:null, -touchableHandlePress:null, -touchableGetPressRectOffset:null, -render:function(){var _this=this; -var newProps=this.props; -if(this.props.onStartShouldSetResponder||this.props.onPress){ -if(!this._handlers){ -this._handlers={ -onStartShouldSetResponder:function(){ -var shouldSetFromProps=_this.props.onStartShouldSetResponder&& -_this.props.onStartShouldSetResponder(); -var setResponder=shouldSetFromProps||!!_this.props.onPress; -if(setResponder&&!_this.touchableHandleActivePressIn){ - - -for(var key in Touchable.Mixin){ -if(typeof Touchable.Mixin[key]==='function'){ -_this[key]=Touchable.Mixin[key].bind(_this);}} - - -_this.touchableHandleActivePressIn=function(){ -if(_this.props.suppressHighlighting||!_this.props.onPress){ -return;} - -_this.setState({ -isHighlighted:true});}; - - - -_this.touchableHandleActivePressOut=function(){ -if(_this.props.suppressHighlighting||!_this.props.onPress){ -return;} - -_this.setState({ -isHighlighted:false});}; - - - -_this.touchableHandlePress=function(){ -_this.props.onPress&&_this.props.onPress();}; - - -_this.touchableGetPressRectOffset=function(){ -return PRESS_RECT_OFFSET;};} - - -return setResponder;}, - -onResponderGrant:(function(e,dispatchID){ -this.touchableHandleResponderGrant(e,dispatchID); -this.props.onResponderGrant&& -this.props.onResponderGrant.apply(this,arguments);}). -bind(this), -onResponderMove:(function(e){ -this.touchableHandleResponderMove(e); -this.props.onResponderMove&& -this.props.onResponderMove.apply(this,arguments);}). -bind(this), -onResponderRelease:(function(e){ -this.touchableHandleResponderRelease(e); -this.props.onResponderRelease&& -this.props.onResponderRelease.apply(this,arguments);}). -bind(this), -onResponderTerminate:(function(e){ -this.touchableHandleResponderTerminate(e); -this.props.onResponderTerminate&& -this.props.onResponderTerminate.apply(this,arguments);}). -bind(this), -onResponderTerminationRequest:(function(){ - - -var allowTermination=this.touchableHandleResponderTerminationRequest(); -if(allowTermination&&this.props.onResponderTerminationRequest){ -allowTermination=this.props.onResponderTerminationRequest.apply(this,arguments);} - -return allowTermination;}). -bind(this)};} - - -newProps=babelHelpers.extends({}, -this.props, -this._handlers,{ -isHighlighted:this.state.isHighlighted});} - - -if(this.context.isInAParentText){ -return React.createElement(RCTVirtualText,newProps);}else -{ -return React.createElement(RCTText,newProps);}}}); - - - - - - - - - - - -var PRESS_RECT_OFFSET={top:20,left:20,right:20,bottom:30}; - -var RCTText=createReactNativeComponentClass(viewConfig); -var RCTVirtualText=RCTText; - -if(Platform.OS==='android'){ -RCTVirtualText=createReactNativeComponentClass({ -validAttributes:merge(ReactNativeViewAttributes.UIView,{ -isHighlighted:true}), - -uiViewClassName:'RCTVirtualText'});} - - - -module.exports=Text; -}); -__d('Touchable',function(global, require, module, exports) { 'use strict'; - - - - - -var BoundingDimensions=require('BoundingDimensions'); -var Position=require('Position'); -var TouchEventUtils=require('TouchEventUtils'); - -var keyMirror=require('keyMirror'); -var queryLayoutByID=require('queryLayoutByID'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var States=keyMirror({ -NOT_RESPONDER:null, -RESPONDER_INACTIVE_PRESS_IN:null, -RESPONDER_INACTIVE_PRESS_OUT:null, -RESPONDER_ACTIVE_PRESS_IN:null, -RESPONDER_ACTIVE_PRESS_OUT:null, -RESPONDER_ACTIVE_LONG_PRESS_IN:null, -RESPONDER_ACTIVE_LONG_PRESS_OUT:null, -ERROR:null}); - - - - - -var IsActive={ -RESPONDER_ACTIVE_PRESS_OUT:true, -RESPONDER_ACTIVE_PRESS_IN:true}; - - - - - - -var IsPressingIn={ -RESPONDER_INACTIVE_PRESS_IN:true, -RESPONDER_ACTIVE_PRESS_IN:true, -RESPONDER_ACTIVE_LONG_PRESS_IN:true}; - - -var IsLongPressingIn={ -RESPONDER_ACTIVE_LONG_PRESS_IN:true}; - - - - - -var Signals=keyMirror({ -DELAY:null, -RESPONDER_GRANT:null, -RESPONDER_RELEASE:null, -RESPONDER_TERMINATED:null, -ENTER_PRESS_RECT:null, -LEAVE_PRESS_RECT:null, -LONG_PRESS_DETECTED:null}); - - - - - -var Transitions={ -NOT_RESPONDER:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.RESPONDER_INACTIVE_PRESS_IN, -RESPONDER_RELEASE:States.ERROR, -RESPONDER_TERMINATED:States.ERROR, -ENTER_PRESS_RECT:States.ERROR, -LEAVE_PRESS_RECT:States.ERROR, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_INACTIVE_PRESS_IN:{ -DELAY:States.RESPONDER_ACTIVE_PRESS_IN, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_INACTIVE_PRESS_OUT:{ -DELAY:States.RESPONDER_ACTIVE_PRESS_OUT, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_ACTIVE_PRESS_IN:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.RESPONDER_ACTIVE_LONG_PRESS_IN}, - -RESPONDER_ACTIVE_PRESS_OUT:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -RESPONDER_ACTIVE_LONG_PRESS_IN:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_OUT, -LONG_PRESS_DETECTED:States.RESPONDER_ACTIVE_LONG_PRESS_IN}, - -RESPONDER_ACTIVE_LONG_PRESS_OUT:{ -DELAY:States.ERROR, -RESPONDER_GRANT:States.ERROR, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_IN, -LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_OUT, -LONG_PRESS_DETECTED:States.ERROR}, - -error:{ -DELAY:States.NOT_RESPONDER, -RESPONDER_GRANT:States.RESPONDER_INACTIVE_PRESS_IN, -RESPONDER_RELEASE:States.NOT_RESPONDER, -RESPONDER_TERMINATED:States.NOT_RESPONDER, -ENTER_PRESS_RECT:States.NOT_RESPONDER, -LEAVE_PRESS_RECT:States.NOT_RESPONDER, -LONG_PRESS_DETECTED:States.NOT_RESPONDER}}; - - - - - - -var HIGHLIGHT_DELAY_MS=130; - -var PRESS_EXPAND_PX=20; - -var LONG_PRESS_THRESHOLD=500; - -var LONG_PRESS_DELAY_MS=LONG_PRESS_THRESHOLD-HIGHLIGHT_DELAY_MS; - -var LONG_PRESS_ALLOWED_MOVEMENT=10; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var TouchableMixin={ - - - -componentWillUnmount:function(){ -this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout); -this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout); -this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout);}, - - - - - - - - - -touchableGetInitialState:function(){ -return { -touchable:{touchState:undefined,responderID:null}};}, - - - - - - - -touchableHandleResponderTerminationRequest:function(){ -return !this.props.rejectResponderTermination;}, - - - - - -touchableHandleStartShouldSetResponder:function(){ -return true;}, - - - - - -touchableLongPressCancelsPress:function(){ -return true;}, - - - - - - - - -touchableHandleResponderGrant:function(e,dispatchID){ - - - -e.persist(); - -this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout); -this.pressOutDelayTimeout=null; - -this.state.touchable.touchState=States.NOT_RESPONDER; -this.state.touchable.responderID=dispatchID; -this._receiveSignal(Signals.RESPONDER_GRANT,e); -var delayMS= -this.touchableGetHighlightDelayMS!==undefined? -Math.max(this.touchableGetHighlightDelayMS(),0):HIGHLIGHT_DELAY_MS; -delayMS=isNaN(delayMS)?HIGHLIGHT_DELAY_MS:delayMS; -if(delayMS!==0){ -this.touchableDelayTimeout=setTimeout( -this._handleDelay.bind(this,e), -delayMS);}else - -{ -this._handleDelay(e);} - - -var longDelayMS= -this.touchableGetLongPressDelayMS!==undefined? -Math.max(this.touchableGetLongPressDelayMS(),10):LONG_PRESS_DELAY_MS; -longDelayMS=isNaN(longDelayMS)?LONG_PRESS_DELAY_MS:longDelayMS; -this.longPressDelayTimeout=setTimeout( -this._handleLongDelay.bind(this,e), -longDelayMS+delayMS);}, - - - - - - -touchableHandleResponderRelease:function(e){ -this._receiveSignal(Signals.RESPONDER_RELEASE,e);}, - - - - - -touchableHandleResponderTerminate:function(e){ -this._receiveSignal(Signals.RESPONDER_TERMINATED,e);}, - - - - - -touchableHandleResponderMove:function(e){ - - -if(this.state.touchable.touchState===States.RESPONDER_INACTIVE_PRESS_IN){ -return;} - - - -if(!this.state.touchable.positionOnActivate){ -return;} - - -var positionOnActivate=this.state.touchable.positionOnActivate; -var dimensionsOnActivate=this.state.touchable.dimensionsOnActivate; -var pressRectOffset=this.touchableGetPressRectOffset? -this.touchableGetPressRectOffset():{ -left:PRESS_EXPAND_PX, -right:PRESS_EXPAND_PX, -top:PRESS_EXPAND_PX, -bottom:PRESS_EXPAND_PX}; - - -var pressExpandLeft=pressRectOffset.left; -var pressExpandTop=pressRectOffset.top; -var pressExpandRight=pressRectOffset.right; -var pressExpandBottom=pressRectOffset.bottom; - -var touch=TouchEventUtils.extractSingleTouch(e.nativeEvent); -var pageX=touch&&touch.pageX; -var pageY=touch&&touch.pageY; - -if(this.pressInLocation){ -var movedDistance=this._getDistanceBetweenPoints(pageX,pageY,this.pressInLocation.pageX,this.pressInLocation.pageY); -if(movedDistance>LONG_PRESS_ALLOWED_MOVEMENT){ -this._cancelLongPressDelayTimeout();}} - - - -var isTouchWithinActive= -pageX>positionOnActivate.left-pressExpandLeft&& -pageY>positionOnActivate.top-pressExpandTop&& -pageX< -positionOnActivate.left+ -dimensionsOnActivate.width+ -pressExpandRight&& -pageY< -positionOnActivate.top+ -dimensionsOnActivate.height+ -pressExpandBottom; -if(isTouchWithinActive){ -this._receiveSignal(Signals.ENTER_PRESS_RECT,e); -var curState=this.state.touchable.touchState; -if(curState===States.RESPONDER_INACTIVE_PRESS_IN){ - -this._cancelLongPressDelayTimeout();}}else - -{ -this._cancelLongPressDelayTimeout(); -this._receiveSignal(Signals.LEAVE_PRESS_RECT,e);}}, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_remeasureMetricsOnActivation:function(){ -queryLayoutByID( -this.state.touchable.responderID, -null, -this._handleQueryLayout);}, - - - -_handleQueryLayout:function(l,t,w,h,globalX,globalY){ -this.state.touchable.positionOnActivate&& -Position.release(this.state.touchable.positionOnActivate); -this.state.touchable.dimensionsOnActivate&& -BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); -this.state.touchable.positionOnActivate=Position.getPooled(globalX,globalY); -this.state.touchable.dimensionsOnActivate=BoundingDimensions.getPooled(w,h);}, - - -_handleDelay:function(e){ -this.touchableDelayTimeout=null; -this._receiveSignal(Signals.DELAY,e);}, - - -_handleLongDelay:function(e){ -this.longPressDelayTimeout=null; -var curState=this.state.touchable.touchState; -if(curState!==States.RESPONDER_ACTIVE_PRESS_IN&& -curState!==States.RESPONDER_ACTIVE_LONG_PRESS_IN){ -console.error('Attempted to transition from state `'+curState+'` to `'+ -States.RESPONDER_ACTIVE_LONG_PRESS_IN+'`, which is not supported. This is '+ -'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');}else -{ -this._receiveSignal(Signals.LONG_PRESS_DETECTED,e);}}, - - - - - - - - - - - -_receiveSignal:function(signal,e){ -var curState=this.state.touchable.touchState; -var nextState=Transitions[curState]&&Transitions[curState][signal]; -if(!nextState){ -throw new Error( -'Unrecognized signal `'+signal+'` or state `'+curState+ -'` for Touchable responder `'+this.state.touchable.responderID+'`');} - - -if(nextState===States.ERROR){ -throw new Error( -'Touchable cannot transition from `'+curState+'` to `'+signal+ -'` for responder `'+this.state.touchable.responderID+'`');} - - -if(curState!==nextState){ -this._performSideEffectsForTransition(curState,nextState,signal,e); -this.state.touchable.touchState=nextState;}}, - - - -_cancelLongPressDelayTimeout:function(){ -this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout); -this.longPressDelayTimeout=null;}, - - -_isHighlight:function(state){ -return state===States.RESPONDER_ACTIVE_PRESS_IN|| -state===States.RESPONDER_ACTIVE_LONG_PRESS_IN;}, - - -_savePressInLocation:function(e){ -var touch=TouchEventUtils.extractSingleTouch(e.nativeEvent); -var pageX=touch&&touch.pageX; -var pageY=touch&&touch.pageY; -this.pressInLocation={pageX:pageX,pageY:pageY};}, - - -_getDistanceBetweenPoints:function(aX,aY,bX,bY){ -var deltaX=aX-bX; -var deltaY=aY-bY; -return Math.sqrt(deltaX*deltaX+deltaY*deltaY);}, - - - - - - - - - - - - - -_performSideEffectsForTransition:function(curState,nextState,signal,e){ -var curIsHighlight=this._isHighlight(curState); -var newIsHighlight=this._isHighlight(nextState); - -var isFinalSignal= -signal===Signals.RESPONDER_TERMINATED|| -signal===Signals.RESPONDER_RELEASE; - -if(isFinalSignal){ -this._cancelLongPressDelayTimeout();} - - -if(!IsActive[curState]&&IsActive[nextState]){ -this._remeasureMetricsOnActivation();} - - -if(IsPressingIn[curState]&&signal===Signals.LONG_PRESS_DETECTED){ -this.touchableHandleLongPress&&this.touchableHandleLongPress(e);} - - -if(newIsHighlight&&!curIsHighlight){ -this._savePressInLocation(e); -this.touchableHandleActivePressIn&&this.touchableHandleActivePressIn(e);}else -if(!newIsHighlight&&curIsHighlight&&this.touchableHandleActivePressOut){ -if(this.touchableGetPressOutDelayMS&&this.touchableGetPressOutDelayMS()){ -this.pressOutDelayTimeout=this.setTimeout(function(){ -this.touchableHandleActivePressOut(e);}, -this.touchableGetPressOutDelayMS());}else -{ -this.touchableHandleActivePressOut(e);}} - - - -if(IsPressingIn[curState]&&signal===Signals.RESPONDER_RELEASE){ -var hasLongPressHandler=!!this.props.onLongPress; -var pressIsLongButStillCallOnPress= -IsLongPressingIn[curState]&&( -!hasLongPressHandler|| -!this.touchableLongPressCancelsPress()); - - -var shouldInvokePress=!IsLongPressingIn[curState]||pressIsLongButStillCallOnPress; -if(shouldInvokePress&&this.touchableHandlePress){ -this.touchableHandlePress(e);}} - - - -this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout); -this.touchableDelayTimeout=null;}}; - - - - -var Touchable={ -Mixin:TouchableMixin}; - - -module.exports=Touchable; -}); -__d('BoundingDimensions',function(global, require, module, exports) { 'use strict'; - - - - - -var PooledClass=require('PooledClass'); - -var twoArgumentPooler=PooledClass.twoArgumentPooler; - - - - - - - - -function BoundingDimensions(width,height){ -this.width=width; -this.height=height;} - - -BoundingDimensions.prototype.destructor=function(){ -this.width=null; -this.height=null;}; - - - - - - -BoundingDimensions.getPooledFromElement=function(element){ -return BoundingDimensions.getPooled( -element.offsetWidth, -element.offsetHeight);}; - - - -PooledClass.addPoolingTo(BoundingDimensions,twoArgumentPooler); - -module.exports=BoundingDimensions; -}); -__d('Position',function(global, require, module, exports) { 'use strict'; - - - - - -var PooledClass=require('PooledClass'); - -var twoArgumentPooler=PooledClass.twoArgumentPooler; - - - - - - - - - -function Position(left,top){ -this.left=left; -this.top=top;} - - -Position.prototype.destructor=function(){ -this.left=null; -this.top=null;}; - - -PooledClass.addPoolingTo(Position,twoArgumentPooler); - -module.exports=Position; -}); -__d('TouchEventUtils',function(global, require, module, exports) { var - - - - - - - - - - -TouchEventUtils={ - - - - - - - - - - -extractSingleTouch:function(nativeEvent){ -var touches=nativeEvent.touches; -var changedTouches=nativeEvent.changedTouches; -var hasTouches=touches&&touches.length>0; -var hasChangedTouches=changedTouches&&changedTouches.length>0; - -return !hasTouches&&hasChangedTouches?changedTouches[0]: -hasTouches?touches[0]: -nativeEvent;}}; - - - -module.exports=TouchEventUtils; -}); -__d('queryLayoutByID',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactNativeTagHandles=require('ReactNativeTagHandles'); -var UIManager=require('UIManager'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var queryLayoutByID=function( -rootNodeID, -onError, -onSuccess) -{ - -UIManager.measure( -ReactNativeTagHandles.rootNodeIDToTag[rootNodeID], -onSuccess);}; - - - -module.exports=queryLayoutByID; -}); -__d('TextInput',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var DocumentSelectionState=require('DocumentSelectionState'); -var EventEmitter=require('EventEmitter'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var Platform=require('Platform'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var ReactChildren=require('ReactChildren'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var TextInputState=require('TextInputState'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); -var UIManager=require('UIManager'); -var View=require('View'); - -var createReactNativeComponentClass=require('createReactNativeComponentClass'); -var emptyFunction=require('emptyFunction'); -var invariant=require('invariant'); -var requireNativeComponent=require('requireNativeComponent'); - -var onlyMultiline={ -onTextInput:true, -children:true}; - - -var notMultiline={}; - - - -if(Platform.OS==='android'){ -var AndroidTextInput=requireNativeComponent('AndroidTextInput',null);}else -if(Platform.OS==='ios'){ -var RCTTextView=requireNativeComponent('RCTTextView',null); -var RCTTextField=requireNativeComponent('RCTTextField',null);} - - - - - - - - - - - - - - - - - - - - - - - - - -var TextInput=React.createClass({displayName:'TextInput', -statics:{ - -State:TextInputState}, - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ - - - - - - - - -autoCapitalize:PropTypes.oneOf([ -'none', -'sentences', -'words', -'characters']), - - - - -autoCorrect:PropTypes.bool, - - - - -autoFocus:PropTypes.bool, - - - - -textAlign:PropTypes.oneOf([ -'start', -'center', -'end']), - - - - - -textAlignVertical:PropTypes.oneOf([ -'top', -'center', -'bottom']), - - - - -editable:PropTypes.bool, - - - - - - - - -keyboardType:PropTypes.oneOf([ - -'default', -'numeric', -'email-address', - -'ascii-capable', -'numbers-and-punctuation', -'url', -'number-pad', -'phone-pad', -'name-phone-pad', -'decimal-pad', -'twitter', -'web-search']), - - - - - -keyboardAppearance:PropTypes.oneOf([ -'default', -'light', -'dark']), - - - - - -returnKeyType:PropTypes.oneOf([ -'default', -'go', -'google', -'join', -'next', -'route', -'search', -'send', -'yahoo', -'done', -'emergency-call']), - - - - - -maxLength:PropTypes.number, - - - - - -numberOfLines:PropTypes.number, - - - - - -enablesReturnKeyAutomatically:PropTypes.bool, - - - - -multiline:PropTypes.bool, - - - -onBlur:PropTypes.func, - - - -onFocus:PropTypes.func, - - - -onChange:PropTypes.func, - - - - -onChangeText:PropTypes.func, - - - -onEndEditing:PropTypes.func, - - - - -onSubmitEditing:PropTypes.func, - - - - - - -onKeyPress:PropTypes.func, - - - -onLayout:PropTypes.func, - - - -placeholder:PropTypes.string, - - - -placeholderTextColor:PropTypes.string, - - - - -secureTextEntry:PropTypes.bool, - - - - - -selectionState:PropTypes.instanceOf(DocumentSelectionState), - - - - - - - - - -value:PropTypes.string, - - - - - -defaultValue:PropTypes.string, - - - - -clearButtonMode:PropTypes.oneOf([ -'never', -'while-editing', -'unless-editing', -'always']), - - - - - -clearTextOnFocus:PropTypes.bool, - - - - -selectTextOnFocus:PropTypes.bool, - - - - - - - - -blurOnSubmit:PropTypes.bool, - - - -style:Text.propTypes.style, - - - -testID:PropTypes.string, - - - - -underlineColorAndroid:PropTypes.string}), - - - - - - -mixins:[NativeMethodsMixin,TimerMixin], - -viewConfig: -Platform.OS==='ios'&&RCTTextField? -RCTTextField.viewConfig: -Platform.OS==='android'&&AndroidTextInput? -AndroidTextInput.viewConfig: -{}, - -isFocused:function(){ -return TextInputState.currentlyFocusedField()=== -React.findNodeHandle(this.refs.input);}, - - -getInitialState:function(){ -return { -mostRecentEventCount:0};}, - - - -contextTypes:{ -onFocusRequested:React.PropTypes.func, -focusEmitter:React.PropTypes.instanceOf(EventEmitter)}, - - -_focusSubscription:undefined, - -componentDidMount:function(){var _this=this; -if(!this.context.focusEmitter){ -if(this.props.autoFocus){ -this.requestAnimationFrame(this.focus);} - -return;} - -this._focusSubscription=this.context.focusEmitter.addListener( -'focus', -function(el){ -if(_this===el){ -_this.requestAnimationFrame(_this.focus);}else -if(_this.isFocused()){ -_this.blur();}}); - - - -if(this.props.autoFocus){ -this.context.onFocusRequested(this);}}, - - - -componentWillUnmount:function(){ -this._focusSubscription&&this._focusSubscription.remove(); -if(this.isFocused()){ -this.blur();}}, - - - -getChildContext:function(){ -return {isInAParentText:true};}, - - -childContextTypes:{ -isInAParentText:React.PropTypes.bool}, - - -clear:function(){ -this.setNativeProps({text:''});}, - - -render:function(){ -if(Platform.OS==='ios'){ -return this._renderIOS();}else -if(Platform.OS==='android'){ -return this._renderAndroid();}}, - - - -_getText:function(){ -return typeof this.props.value==='string'? -this.props.value: -this.props.defaultValue;}, - - -_renderIOS:function(){var _this2=this; -var textContainer; - -var onSelectionChange; -if(this.props.selectionState||this.props.onSelectionChange){ -onSelectionChange=function(event){ -if(_this2.props.selectionState){ -var selection=event.nativeEvent.selection; -_this2.props.selectionState.update(selection.start,selection.end);} - -_this2.props.onSelectionChange&&_this2.props.onSelectionChange(event);};} - - - -var props=babelHelpers.extends({},this.props); -props.style=[styles.input,this.props.style]; -if(!props.multiline){ -for(var propKey in onlyMultiline){ -if(props[propKey]){ -throw new Error( -'TextInput prop `'+propKey+'` is only supported with multiline.');}} - - - -textContainer= -React.createElement(RCTTextField,babelHelpers.extends({ -ref:'input'}, -props,{ -onFocus:this._onFocus, -onBlur:this._onBlur, -onChange:this._onChange, -onSelectionChange:onSelectionChange, -onSelectionChangeShouldSetResponder:emptyFunction.thatReturnsTrue, -text:this._getText(), -mostRecentEventCount:this.state.mostRecentEventCount}));}else - -{ -for(var propKey in notMultiline){ -if(props[propKey]){ -throw new Error( -'TextInput prop `'+propKey+'` cannot be used with multiline.');}} - - - - -var children=props.children; -var childCount=0; -ReactChildren.forEach(children,function(){return ++childCount;}); -invariant( -!(props.value&&childCount), -'Cannot specify both value and children.'); - -if(childCount>1){ -children=React.createElement(Text,null,children);} - -if(props.inputView){ -children=[children,props.inputView];} - -textContainer= -React.createElement(RCTTextView,babelHelpers.extends({ -ref:'input'}, -props,{ -children:children, -mostRecentEventCount:this.state.mostRecentEventCount, -onFocus:this._onFocus, -onBlur:this._onBlur, -onChange:this._onChange, -onSelectionChange:onSelectionChange, -onTextInput:this._onTextInput, -onSelectionChangeShouldSetResponder:emptyFunction.thatReturnsTrue, -text:this._getText()}));} - - - -return ( -React.createElement(TouchableWithoutFeedback,{ -onPress:this._onPress, -rejectResponderTermination:true, -testID:props.testID}, -textContainer));}, - - - - -_renderAndroid:function(){ -var autoCapitalize=UIManager.UIText.AutocapitalizationType[this.props.autoCapitalize]; -var textAlign= -UIManager.AndroidTextInput.Constants.TextAlign[this.props.textAlign]; -var textAlignVertical= -UIManager.AndroidTextInput.Constants.TextAlignVertical[this.props.textAlignVertical]; -var children=this.props.children; -var childCount=0; -ReactChildren.forEach(children,function(){return ++childCount;}); -invariant( -!(this.props.value&&childCount), -'Cannot specify both value and children.'); - -if(childCount>1){ -children=React.createElement(Text,null,children);} - -var textContainer= -React.createElement(AndroidTextInput,{ -ref:'input', -style:[this.props.style], -autoCapitalize:autoCapitalize, -autoCorrect:this.props.autoCorrect, -textAlign:textAlign, -textAlignVertical:textAlignVertical, -keyboardType:this.props.keyboardType, -mostRecentEventCount:this.state.mostRecentEventCount, -multiline:this.props.multiline, -numberOfLines:this.props.numberOfLines, -maxLength:this.props.maxLength, -onFocus:this._onFocus, -onBlur:this._onBlur, -onChange:this._onChange, -onTextInput:this._onTextInput, -onEndEditing:this.props.onEndEditing, -onSubmitEditing:this.props.onSubmitEditing, -onLayout:this.props.onLayout, -password:this.props.password||this.props.secureTextEntry, -placeholder:this.props.placeholder, -placeholderTextColor:this.props.placeholderTextColor, -text:this._getText(), -underlineColorAndroid:this.props.underlineColorAndroid, -children:children, -editable:this.props.editable}); - - -return ( -React.createElement(TouchableWithoutFeedback,{ -onPress:this._onPress, -testID:this.props.testID}, -textContainer));}, - - - - -_onFocus:function(event){ -if(this.props.onFocus){ -this.props.onFocus(event);}}, - - - -_onPress:function(event){ -if(this.props.editable||this.props.editable===undefined){ -this.focus();}}, - - - -_onChange:function(event){var _this3=this; -if(Platform.OS==='android'){ - -this.refs.input.setNativeProps({ -mostRecentEventCount:event.nativeEvent.eventCount});} - - -var text=event.nativeEvent.text; -var eventCount=event.nativeEvent.eventCount; -this.props.onChange&&this.props.onChange(event); -this.props.onChangeText&&this.props.onChangeText(text); -this.setState({mostRecentEventCount:eventCount},function(){ - -if(Platform.OS==='android'){ - - - -if(text!==_this3.props.value&&typeof _this3.props.value==='string'){ -_this3.refs.input.setNativeProps({ -text:_this3.props.value});}}});}, - - - - - - -_onBlur:function(event){ -this.blur(); -if(this.props.onBlur){ -this.props.onBlur(event);}}, - - - -_onTextInput:function(event){ -this.props.onTextInput&&this.props.onTextInput(event);}}); - - - -var styles=StyleSheet.create({ -input:{ -alignSelf:'stretch'}}); - - - -module.exports=TextInput; -}); -__d('DocumentSelectionState',function(global, require, module, exports) { var - - - - - - - - - - - - - - - - - -mixInEventEmitter=require('mixInEventEmitter');var - - - - - - - - - - -DocumentSelectionState=(function(){ - - - - -function DocumentSelectionState(anchor,focus){babelHelpers.classCallCheck(this,DocumentSelectionState); -this._anchorOffset=anchor; -this._focusOffset=focus; -this._hasFocus=false;}babelHelpers.createClass(DocumentSelectionState,[{key:'update',value:function update( - - - - - - - - - -anchor,focus){ -if(this._anchorOffset!==anchor||this._focusOffset!==focus){ -this._anchorOffset=anchor; -this._focusOffset=focus; -this.emit('update');}}},{key:'constrainLength',value:function constrainLength( - - - - - - - - - -maxLength){ -this.update( -Math.min(this._anchorOffset,maxLength), -Math.min(this._focusOffset,maxLength));}},{key:'focus',value:function focus() - - - -{ -if(!this._hasFocus){ -this._hasFocus=true; -this.emit('focus');}}},{key:'blur',value:function blur() - - - -{ -if(this._hasFocus){ -this._hasFocus=false; -this.emit('blur');}}},{key:'hasFocus',value:function hasFocus() - - - - - - -{ -return this._hasFocus;}},{key:'isCollapsed',value:function isCollapsed() - - - - - -{ -return this._anchorOffset===this._focusOffset;}},{key:'isBackward',value:function isBackward() - - - - - -{ -return this._anchorOffset>this._focusOffset;}},{key:'getAnchorOffset',value:function getAnchorOffset() - - - - - -{ -return this._hasFocus?this._anchorOffset:null;}},{key:'getFocusOffset',value:function getFocusOffset() - - - - - -{ -return this._hasFocus?this._focusOffset:null;}},{key:'getStartOffset',value:function getStartOffset() - - - - - -{ -return ( -this._hasFocus?Math.min(this._anchorOffset,this._focusOffset):null);}},{key:'getEndOffset',value:function getEndOffset() - - - - - - -{ -return ( -this._hasFocus?Math.max(this._anchorOffset,this._focusOffset):null);}},{key:'overlaps',value:function overlaps( - - - - - - - - -start,end){ -return ( -this.hasFocus()&& -this.getStartOffset()<=end&&start<=this.getEndOffset());}}]);return DocumentSelectionState;})(); - - - - -mixInEventEmitter(DocumentSelectionState,{ -'blur':true, -'focus':true, -'update':true}); - - -module.exports=DocumentSelectionState; -}); -__d('mixInEventEmitter',function(global, require, module, exports) { var - - - - - - - - - - - - - - - - -EventEmitter=require('EventEmitter'); -var EventEmitterWithHolding=require('EventEmitterWithHolding'); -var EventHolder=require('EventHolder'); -var EventValidator=require('EventValidator'); - -var copyProperties=require('copyProperties'); -var invariant=require('invariant'); -var keyOf=require('keyOf'); - -var TYPES_KEY=keyOf({__types:true}); - - - - - - - - - - - - - - - - - - - - - - -function mixInEventEmitter(klass,types){ -invariant(types,'Must supply set of valid event types'); -invariant(!this.__eventEmitter,'An active emitter is already mixed in'); - - - -var target=klass.prototype||klass; - -var ctor=klass.constructor; -if(ctor){ -invariant( -ctor===Object||ctor===Function, -'Mix EventEmitter into a class, not an instance');} - - - - - -if(target.hasOwnProperty(TYPES_KEY)){ -copyProperties(target.__types,types);}else -if(target.__types){ -target.__types=copyProperties({},target.__types,types);}else -{ -target.__types=types;} - -copyProperties(target,EventEmitterMixin);} - - -var EventEmitterMixin={ -emit:function(eventType,a,b,c,d,e,_){ -return this.__getEventEmitter().emit(eventType,a,b,c,d,e,_);}, - - -emitAndHold:function(eventType,a,b,c,d,e,_){ -return this.__getEventEmitter().emitAndHold(eventType,a,b,c,d,e,_);}, - - -addListener:function(eventType,listener,context){ -return this.__getEventEmitter().addListener(eventType,listener,context);}, - - -once:function(eventType,listener,context){ -return this.__getEventEmitter().once(eventType,listener,context);}, - - -addRetroactiveListener:function(eventType,listener,context){ -return this.__getEventEmitter().addRetroactiveListener( -eventType, -listener, -context);}, - - - -addListenerMap:function(listenerMap,context){ -return this.__getEventEmitter().addListenerMap(listenerMap,context);}, - - -addRetroactiveListenerMap:function(listenerMap,context){ -return this.__getEventEmitter().addListenerMap(listenerMap,context);}, - - -removeAllListeners:function(){ -this.__getEventEmitter().removeAllListeners();}, - - -removeCurrentListener:function(){ -this.__getEventEmitter().removeCurrentListener();}, - - -releaseHeldEventType:function(eventType){ -this.__getEventEmitter().releaseHeldEventType(eventType);}, - - -__getEventEmitter:function(){ -if(!this.__eventEmitter){ -var emitter=new EventEmitter(); -emitter=EventValidator.addValidation(emitter,this.__types); - -var holder=new EventHolder(); -this.__eventEmitter=new EventEmitterWithHolding(emitter,holder);} - -return this.__eventEmitter;}}; - - - -module.exports=mixInEventEmitter; -}); -__d('EventEmitterWithHolding',function(global, require, module, exports) { 'use strict';var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EventEmitterWithHolding=(function(){ - - - - - - - -function EventEmitterWithHolding(emitter,holder){babelHelpers.classCallCheck(this,EventEmitterWithHolding); -this._emitter=emitter; -this._eventHolder=holder; -this._currentEventToken=null; -this._emittingHeldEvents=false;}babelHelpers.createClass(EventEmitterWithHolding,[{key:'addListener',value:function addListener( - - - - - -eventType,listener,context){ -return this._emitter.addListener(eventType,listener,context);}},{key:'once',value:function once( - - - - - -eventType,listener,context){ -return this._emitter.once(eventType,listener,context);}},{key:'addRetroactiveListener',value:function addRetroactiveListener( - - - - - - - - - - - - - - - - - - - - - - - -eventType,listener,context){ -var subscription=this._emitter.addListener(eventType,listener,context); - -this._emittingHeldEvents=true; -this._eventHolder.emitToListener(eventType,listener,context); -this._emittingHeldEvents=false; - -return subscription;}},{key:'removeAllListeners',value:function removeAllListeners( - - - - - -eventType){ -this._emitter.removeAllListeners(eventType);}},{key:'removeCurrentListener',value:function removeCurrentListener() - - - - - -{ -this._emitter.removeCurrentListener();}},{key:'listeners',value:function listeners( - - - - - -eventType){ -return this._emitter.listeners(eventType);}},{key:'emit',value:function emit( - - - - - -eventType,a,b,c,d,e,_){ -this._emitter.emit(eventType,a,b,c,d,e,_);}},{key:'emitAndHold',value:function emitAndHold( - - - - - - - - - - - - - - - - - -eventType,a,b,c,d,e,_){ -this._currentEventToken=this._eventHolder.holdEvent( -eventType, -a,b,c,d,e,_); - -this._emitter.emit(eventType,a,b,c,d,e,_); -this._currentEventToken=null;}},{key:'releaseCurrentEvent',value:function releaseCurrentEvent() - - - - - -{ -if(this._currentEventToken!==null){ -this._eventHolder.releaseEvent(this._currentEventToken);}else -if(this._emittingHeldEvents){ -this._eventHolder.releaseCurrentEvent();}}},{key:'releaseHeldEventType',value:function releaseHeldEventType( - - - - - - - -eventType){ -this._eventHolder.releaseEventType(eventType);}}]);return EventEmitterWithHolding;})(); - - - -module.exports=EventEmitterWithHolding; -}); -__d('EventHolder',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - -var invariant=require('invariant');var - -EventHolder=(function(){ -function EventHolder(){babelHelpers.classCallCheck(this,EventHolder); -this._heldEvents={}; -this._currentEventKey=null;}babelHelpers.createClass(EventHolder,[{key:'holdEvent',value:function holdEvent( - - - - - - - - - - - - - - - - - - - - - - - -eventType,a,b,c,d,e,_){ -this._heldEvents[eventType]=this._heldEvents[eventType]||[]; -var eventsOfType=this._heldEvents[eventType]; -var key={ -eventType:eventType, -index:eventsOfType.length}; - -eventsOfType.push([a,b,c,d,e,_]); -return key;}},{key:'emitToListener',value:function emitToListener( - - - - - - - - - - -eventType,listener,context){var _this=this; -var eventsOfType=this._heldEvents[eventType]; -if(!eventsOfType){ -return;} - -var origEventKey=this._currentEventKey; -eventsOfType.forEach(function(eventHeld,index){ -if(!eventHeld){ -return;} - -_this._currentEventKey={ -eventType:eventType, -index:index}; - -listener.apply(context,eventHeld);}); - -this._currentEventKey=origEventKey;}},{key:'releaseCurrentEvent',value:function releaseCurrentEvent() - - - - - - - - - - -{ -invariant( -this._currentEventKey!==null, -'Not in an emitting cycle; there is no current event'); - -this.releaseEvent(this._currentEventKey);}},{key:'releaseEvent',value:function releaseEvent( - - - - - - - - -token){ -delete this._heldEvents[token.eventType][token.index];}},{key:'releaseEventType',value:function releaseEventType( - - - - - - - -type){ -this._heldEvents[type]=[];}}]);return EventHolder;})(); - - - -module.exports=EventHolder; -}); -__d('EventValidator',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - -var copyProperties=require('copyProperties'); - - - - - - - - - - -var EventValidator={ - - - - - - - - - - -addValidation:function(emitter,types){ -var eventTypes=Object.keys(types); -var emitterWithValidation=Object.create(emitter); - -copyProperties(emitterWithValidation,{ -emit:function emit(type,a,b,c,d,e,_){ -assertAllowsEventType(type,eventTypes); -return emitter.emit.call(this,type,a,b,c,d,e,_);}}); - - - -return emitterWithValidation;}}; - - - -function assertAllowsEventType(type,allowedTypes){ -if(allowedTypes.indexOf(type)===-1){ -throw new TypeError(errorMessageFor(type,allowedTypes));}} - - - -function errorMessageFor(type,allowedTypes){ -var message='Unknown event type "'+type+'". '; -if(__DEV__){ -message+=recommendationFor(type,allowedTypes);} - -message+='Known event types: '+allowedTypes.join(', ')+'.'; -return message;} - - - -if(__DEV__){ -var recommendationFor=function(type,allowedTypes){ -var closestTypeRecommendation=closestTypeFor(type,allowedTypes); -if(isCloseEnough(closestTypeRecommendation,type)){ -return 'Did you mean "'+closestTypeRecommendation.type+'"? ';}else -{ -return '';}}; - - - -var closestTypeFor=function(type,allowedTypes){ -var typeRecommendations=allowedTypes.map( -typeRecommendationFor.bind(this,type)); - -return typeRecommendations.sort(recommendationSort)[0];}; - - -var typeRecommendationFor=function(type,recomendedType){ -return { -type:recomendedType, -distance:damerauLevenshteinDistance(type,recomendedType)};}; - - - -var recommendationSort=function(recommendationA,recommendationB){ -if(recommendationA.distancerecommendationB.distance){ -return 1;}else -{ -return 0;}}; - - - -var isCloseEnough=function(closestType,actualType){ -return closestType.distance/actualType.length<0.334;}; - - -var damerauLevenshteinDistance=function(a,b){ -var i,j; -var d=[]; - -for(i=0;i<=a.length;i++){ -d[i]=[i];} - - -for(j=1;j<=b.length;j++){ -d[0][j]=j;} - - -for(i=1;i<=a.length;i++){ -for(j=1;j<=b.length;j++){ -var cost=a.charAt(i-1)===b.charAt(j-1)?0:1; - -d[i][j]=Math.min( -d[i-1][j]+1, -d[i][j-1]+1, -d[i-1][j-1]+cost); - - -if(i>1&&j>1&& -a.charAt(i-1)==b.charAt(j-2)&& -a.charAt(i-2)==b.charAt(j-1)){ -d[i][j]=Math.min(d[i][j],d[i-2][j-2]+cost);}}} - - - - -return d[a.length][b.length];};} - - - -module.exports=EventValidator; -}); -__d('copyProperties',function(global, require, module, exports) { function - - - - - - - - - - - - - - - - - - - - - - - -copyProperties(obj,a,b,c,d,e,f){ -obj=obj||{}; - -if(__DEV__){ -if(f){ -throw new Error('Too many arguments passed to copyProperties');}} - - - -var args=[a,b,c,d,e]; -var ii=0,v; -while(args[ii]){ -v=args[ii++]; -for(var k in v){ -obj[k]=v[k];} - - - - -if(v.hasOwnProperty&&v.hasOwnProperty('toString')&& -typeof v.toString!='undefined'&&obj.toString!==v.toString){ -obj.toString=v.toString;}} - - - -return obj;} - - -module.exports=copyProperties; -}); -__d('TouchableWithoutFeedback',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var EdgeInsetsPropType=require('EdgeInsetsPropType'); -var React=require('React'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var Touchable=require('Touchable'); -var View=require('View'); -var ensurePositiveDelayProps=require('ensurePositiveDelayProps'); -var invariant=require('invariant'); -var onlyChild=require('onlyChild'); - - - -var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30}; - - - - - - -var TouchableWithoutFeedback=React.createClass({displayName:'TouchableWithoutFeedback', -mixins:[TimerMixin,Touchable.Mixin], - -propTypes:{ -accessible:React.PropTypes.bool, -accessibilityComponentType:React.PropTypes.oneOf(View.AccessibilityComponentType), -accessibilityTraits:React.PropTypes.oneOfType([ -React.PropTypes.oneOf(View.AccessibilityTraits), -React.PropTypes.arrayOf(React.PropTypes.oneOf(View.AccessibilityTraits))]), - - - - - -onPress:React.PropTypes.func, -onPressIn:React.PropTypes.func, -onPressOut:React.PropTypes.func, - - - - - -onLayout:React.PropTypes.func, - -onLongPress:React.PropTypes.func, - - - - -delayPressIn:React.PropTypes.number, - - - -delayPressOut:React.PropTypes.number, - - - -delayLongPress:React.PropTypes.number, - - - - - - - -pressRetentionOffset:EdgeInsetsPropType}, - - -getInitialState:function(){ -return this.touchableGetInitialState();}, - - -componentDidMount:function(){ -ensurePositiveDelayProps(this.props);}, - - -componentWillReceiveProps:function(nextProps){ -ensurePositiveDelayProps(nextProps);}, - - - - - - -touchableHandlePress:function(e){ -this.props.onPress&&this.props.onPress(e);}, - - -touchableHandleActivePressIn:function(e){ -this.props.onPressIn&&this.props.onPressIn(e);}, - - -touchableHandleActivePressOut:function(e){ -this.props.onPressOut&&this.props.onPressOut(e);}, - - -touchableHandleLongPress:function(e){ -this.props.onLongPress&&this.props.onLongPress(e);}, - - -touchableGetPressRectOffset:function(){ -return this.props.pressRetentionOffset||PRESS_RETENTION_OFFSET;}, - - -touchableGetHighlightDelayMS:function(){ -return this.props.delayPressIn||0;}, - - -touchableGetLongPressDelayMS:function(){ -return this.props.delayLongPress===0?0: -this.props.delayLongPress||500;}, - - -touchableGetPressOutDelayMS:function(){ -return this.props.delayPressOut||0;}, - - -render:function(){ - -return React.cloneElement(onlyChild(this.props.children),{ -accessible:this.props.accessible!==false, -accessibilityComponentType:this.props.accessibilityComponentType, -accessibilityTraits:this.props.accessibilityTraits, -testID:this.props.testID, -onLayout:this.props.onLayout, -onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder, -onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest, -onResponderGrant:this.touchableHandleResponderGrant, -onResponderMove:this.touchableHandleResponderMove, -onResponderRelease:this.touchableHandleResponderRelease, -onResponderTerminate:this.touchableHandleResponderTerminate});}}); - - - - -module.exports=TouchableWithoutFeedback; -}); -__d('ensurePositiveDelayProps',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); - -var ensurePositiveDelayProps=function(props){ -invariant( -!(props.delayPressIn<0||props.delayPressOut<0|| -props.delayLongPress<0), -'Touchable components cannot have negative delay properties');}; - - - -module.exports=ensurePositiveDelayProps; -}); -__d('ToastAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var warning=require('warning'); - -var ToastAndroid={ - -show:function( -message, -duration) -{ -warning(false,'Cannot use ToastAndroid on iOS.');}}; - - - - -module.exports=ToastAndroid; -}); -__d('ToolbarAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('TouchableHighlight',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var NativeMethodsMixin=require('NativeMethodsMixin'); -var React=require('React'); -var ReactNativeViewAttributes=require('ReactNativeViewAttributes'); -var StyleSheet=require('StyleSheet'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var Touchable=require('Touchable'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); -var View=require('View'); - -var ensureComponentIsNative=require('ensureComponentIsNative'); -var ensurePositiveDelayProps=require('ensurePositiveDelayProps'); -var keyOf=require('keyOf'); -var merge=require('merge'); -var onlyChild=require('onlyChild'); - - - -var DEFAULT_PROPS={ -activeOpacity:0.8, -underlayColor:'black'}; - - -var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var TouchableHighlight=React.createClass({displayName:'TouchableHighlight', -propTypes:babelHelpers.extends({}, -TouchableWithoutFeedback.propTypes,{ - - - - -activeOpacity:React.PropTypes.number, - - - - -underlayColor:React.PropTypes.string, -style:View.propTypes.style, - - - -onShowUnderlay:React.PropTypes.func, - - - -onHideUnderlay:React.PropTypes.func}), - - -mixins:[NativeMethodsMixin,TimerMixin,Touchable.Mixin], - -getDefaultProps:function(){return DEFAULT_PROPS;}, - - -computeSyntheticState:function(props){ -return { -activeProps:{ -style:{ -opacity:props.activeOpacity}}, - - -activeUnderlayProps:{ -style:{ -backgroundColor:props.underlayColor}}, - - -underlayStyle:[ -INACTIVE_UNDERLAY_PROPS.style, -props.style]};}, - - - - -getInitialState:function(){ -return merge( -this.touchableGetInitialState(),this.computeSyntheticState(this.props));}, - - - -componentDidMount:function(){ -ensurePositiveDelayProps(this.props); -ensureComponentIsNative(this.refs[CHILD_REF]);}, - - -componentDidUpdate:function(){ -ensureComponentIsNative(this.refs[CHILD_REF]);}, - - -componentWillReceiveProps:function(nextProps){ -ensurePositiveDelayProps(nextProps); -if(nextProps.activeOpacity!==this.props.activeOpacity|| -nextProps.underlayColor!==this.props.underlayColor|| -nextProps.style!==this.props.style){ -this.setState(this.computeSyntheticState(nextProps));}}, - - - -viewConfig:{ -uiViewClassName:'RCTView', -validAttributes:ReactNativeViewAttributes.RCTView}, - - - - - - -touchableHandleActivePressIn:function(e){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -this._showUnderlay(); -this.props.onPressIn&&this.props.onPressIn(e);}, - - -touchableHandleActivePressOut:function(e){ -if(!this._hideTimeout){ -this._hideUnderlay();} - -this.props.onPressOut&&this.props.onPressOut(e);}, - - -touchableHandlePress:function(e){ -this.clearTimeout(this._hideTimeout); -this._showUnderlay(); -this._hideTimeout=this.setTimeout(this._hideUnderlay, -this.props.delayPressOut||100); -this.props.onPress&&this.props.onPress(e);}, - - -touchableHandleLongPress:function(e){ -this.props.onLongPress&&this.props.onLongPress(e);}, - - -touchableGetPressRectOffset:function(){ -return this.props.pressRetentionOffset||PRESS_RETENTION_OFFSET;}, - - -touchableGetHighlightDelayMS:function(){ -return this.props.delayPressIn;}, - - -touchableGetLongPressDelayMS:function(){ -return this.props.delayLongPress;}, - - -touchableGetPressOutDelayMS:function(){ -return this.props.delayPressOut;}, - - -_showUnderlay:function(){ -if(!this.isMounted()){ -return;} - - -this.refs[UNDERLAY_REF].setNativeProps(this.state.activeUnderlayProps); -this.refs[CHILD_REF].setNativeProps(this.state.activeProps); -this.props.onShowUnderlay&&this.props.onShowUnderlay();}, - - -_hideUnderlay:function(){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -if(this.refs[UNDERLAY_REF]){ -this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS); -this.refs[UNDERLAY_REF].setNativeProps(babelHelpers.extends({}, -INACTIVE_UNDERLAY_PROPS,{ -style:this.state.underlayStyle})); - -this.props.onHideUnderlay&&this.props.onHideUnderlay();}}, - - - -render:function(){ -return ( -React.createElement(View,{ -accessible:true, -accessibilityComponentType:this.props.accessibilityComponentType, -accessibilityTraits:this.props.accessibilityTraits, -ref:UNDERLAY_REF, -style:this.state.underlayStyle, -onLayout:this.props.onLayout, -onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder, -onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest, -onResponderGrant:this.touchableHandleResponderGrant, -onResponderMove:this.touchableHandleResponderMove, -onResponderRelease:this.touchableHandleResponderRelease, -onResponderTerminate:this.touchableHandleResponderTerminate, -testID:this.props.testID}, -React.cloneElement( -onlyChild(this.props.children), -{ -ref:CHILD_REF})));}}); - - - - - - - -var CHILD_REF=keyOf({childRef:null}); -var UNDERLAY_REF=keyOf({underlayRef:null}); -var INACTIVE_CHILD_PROPS={ -style:StyleSheet.create({x:{opacity:1.0}}).x}; - -var INACTIVE_UNDERLAY_PROPS={ -style:StyleSheet.create({x:{backgroundColor:'transparent'}}).x}; - - -module.exports=TouchableHighlight; -}); -__d('ensureComponentIsNative',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var invariant=require('invariant'); - -var ensureComponentIsNative=function(component){ -invariant( -component&&typeof component.setNativeProps==='function', -'Touchable child must either be native or forward setNativeProps to a '+ -'native component');}; - - - -module.exports=ensureComponentIsNative; -}); -__d('TouchableNativeFeedback',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); - -var DummyTouchableNativeFeedback=React.createClass({displayName:'DummyTouchableNativeFeedback', -render:function(){ -return ( -React.createElement(View,{style:[styles.container,this.props.style]}, -React.createElement(Text,{style:styles.info},'TouchableNativeFeedback is not supported on this platform!')));}}); - - - - - -var styles=StyleSheet.create({ -container:{ -height:100, -width:300, -backgroundColor:'#ffbcbc', -borderWidth:1, -borderColor:'red', -alignItems:'center', -justifyContent:'center', -margin:10}, - -info:{ -color:'#333333', -margin:20}}); - - - -module.exports=DummyTouchableNativeFeedback; -}); -__d('TouchableOpacity',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - -var Animated=require('Animated'); -var NativeMethodsMixin=require('NativeMethodsMixin'); -var React=require('React'); -var TimerMixin=require('react-timer-mixin/TimerMixin.js'); -var Touchable=require('Touchable'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); - -var ensurePositiveDelayProps=require('ensurePositiveDelayProps'); -var flattenStyle=require('flattenStyle'); - - - -var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30}; - - - - - - - - - - - - - - - - - - - - - - -var TouchableOpacity=React.createClass({displayName:'TouchableOpacity', -mixins:[TimerMixin,Touchable.Mixin,NativeMethodsMixin], - -propTypes:babelHelpers.extends({}, -TouchableWithoutFeedback.propTypes,{ - - - - -activeOpacity:React.PropTypes.number}), - - -getDefaultProps:function(){ -return { -activeOpacity:0.2};}, - - - -getInitialState:function(){ -return babelHelpers.extends({}, -this.touchableGetInitialState(),{ -anim:new Animated.Value(1)});}, - - - -componentDidMount:function(){ -ensurePositiveDelayProps(this.props);}, - - -componentWillReceiveProps:function(nextProps){ -ensurePositiveDelayProps(nextProps);}, - - -setOpacityTo:function(value){ -Animated.timing( -this.state.anim, -{toValue:value,duration:150}). -start();}, - - - - - - -touchableHandleActivePressIn:function(e){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -this._opacityActive(); -this.props.onPressIn&&this.props.onPressIn(e);}, - - -touchableHandleActivePressOut:function(e){ -if(!this._hideTimeout){ -this._opacityInactive();} - -this.props.onPressOut&&this.props.onPressOut(e);}, - - -touchableHandlePress:function(e){ -this.clearTimeout(this._hideTimeout); -this._opacityActive(); -this._hideTimeout=this.setTimeout( -this._opacityInactive, -this.props.delayPressOut||100); - -this.props.onPress&&this.props.onPress(e);}, - - -touchableHandleLongPress:function(e){ -this.props.onLongPress&&this.props.onLongPress(e);}, - - -touchableGetPressRectOffset:function(){ -return this.props.pressRetentionOffset||PRESS_RETENTION_OFFSET;}, - - -touchableGetHighlightDelayMS:function(){ -return this.props.delayPressIn||0;}, - - -touchableGetLongPressDelayMS:function(){ -return this.props.delayLongPress===0?0: -this.props.delayLongPress||500;}, - - -touchableGetPressOutDelayMS:function(){ -return this.props.delayPressOut;}, - - -_opacityActive:function(){ -this.setOpacityTo(this.props.activeOpacity);}, - - -_opacityInactive:function(){ -this.clearTimeout(this._hideTimeout); -this._hideTimeout=null; -var childStyle=flattenStyle(this.props.style)||{}; -this.setOpacityTo( -childStyle.opacity===undefined?1:childStyle.opacity);}, - - - -render:function(){ -return ( -React.createElement(Animated.View,{ -accessible:true, -accessibilityComponentType:this.props.accessibilityComponentType, -accessibilityTraits:this.props.accessibilityTraits, -style:[this.props.style,{opacity:this.state.anim}], -testID:this.props.testID, -onLayout:this.props.onLayout, -onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder, -onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest, -onResponderGrant:this.touchableHandleResponderGrant, -onResponderMove:this.touchableHandleResponderMove, -onResponderRelease:this.touchableHandleResponderRelease, -onResponderTerminate:this.touchableHandleResponderTerminate}, -this.props.children));}}); - - - - - -module.exports=TouchableOpacity; -}); -__d('Animated',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var AnimatedImplementation=require('AnimatedImplementation'); -var Image=require('Image'); -var Text=require('Text'); -var View=require('View'); - -module.exports=babelHelpers.extends({}, -AnimatedImplementation,{ -View:AnimatedImplementation.createAnimatedComponent(View), -Text:AnimatedImplementation.createAnimatedComponent(Text), -Image:AnimatedImplementation.createAnimatedComponent(Image)}); -}); -__d('AnimatedImplementation',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Easing=require('Easing'); -var InteractionManager=require('InteractionManager'); -var Interpolation=require('Interpolation'); -var React=require('React'); -var Set=require('Set'); -var SpringConfig=require('SpringConfig'); -var ViewStylePropTypes=require('ViewStylePropTypes'); - -var flattenStyle=require('flattenStyle'); -var invariant=require('invariant'); -var requestAnimationFrame=require('requestAnimationFrame');var - - - - - - - - -Animated=(function(){function Animated(){babelHelpers.classCallCheck(this,Animated);}babelHelpers.createClass(Animated,[{key:'__attach',value:function __attach() -{}},{key:'__detach',value:function __detach() -{}},{key:'__getValue',value:function __getValue() -{}},{key:'__getAnimatedValue',value:function __getAnimatedValue() -{return this.__getValue();}},{key:'__addChild',value:function __addChild( -child){}},{key:'__removeChild',value:function __removeChild( -child){}},{key:'__getChildren',value:function __getChildren() -{return [];}}]);return Animated;})();var - - - - - - - - - -Animation=(function(){function Animation(){babelHelpers.classCallCheck(this,Animation);}babelHelpers.createClass(Animation,[{key:'start',value:function start( - - - - -fromValue, -onUpdate, -onEnd, -previousAnimation) -{}},{key:'stop',value:function stop() -{}},{key:'__debouncedOnEnd',value:function __debouncedOnEnd( - -result){ -var onEnd=this.__onEnd; -this.__onEnd=null; -onEnd&&onEnd(result);}}]);return Animation;})();var - - - -AnimatedWithChildren=(function(_Animated){babelHelpers.inherits(AnimatedWithChildren,_Animated); - - -function AnimatedWithChildren(){babelHelpers.classCallCheck(this,AnimatedWithChildren);var _this=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(AnimatedWithChildren).call(this)); - -_this._children=[];return _this;}babelHelpers.createClass(AnimatedWithChildren,[{key:'__addChild',value:function __addChild( - - -child){ -if(this._children.length===0){ -this.__attach();} - -this._children.push(child);}},{key:'__removeChild',value:function __removeChild( - - -child){ -var index=this._children.indexOf(child); -if(index===-1){ -console.warn('Trying to remove a child that doesn\'t exist'); -return;} - -this._children.splice(index,1); -if(this._children.length===0){ -this.__detach();}}},{key:'__getChildren',value:function __getChildren() - - - -{ -return this._children;}}]);return AnimatedWithChildren;})(Animated); - - - - - - - - - - - - - - - - - - - - - - - - - -function _flush(rootNode){ -var animatedStyles=new Set(); -function findAnimatedStyles(node){ -if(typeof node.update==='function'){ -animatedStyles.add(node);}else -{ -node.__getChildren().forEach(findAnimatedStyles);}} - - -findAnimatedStyles(rootNode); -animatedStyles.forEach(function(animatedStyle){return animatedStyle.update();});} - - - - - - - - - - - - - - - - -var easeInOut=Easing.inOut(Easing.ease);var - -TimingAnimation=(function(_Animation){babelHelpers.inherits(TimingAnimation,_Animation); - - - - - - - - - - -function TimingAnimation( -config) -{babelHelpers.classCallCheck(this,TimingAnimation);var _this2=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(TimingAnimation).call(this)); - -_this2._toValue=config.toValue; -_this2._easing=config.easing||easeInOut; -_this2._duration=config.duration!==undefined?config.duration:500; -_this2._delay=config.delay||0; -_this2.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;return _this2;}babelHelpers.createClass(TimingAnimation,[{key:'start',value:function start( - - - -fromValue, -onUpdate, -onEnd) -{var _this3=this; -this.__active=true; -this._fromValue=fromValue; -this._onUpdate=onUpdate; -this.__onEnd=onEnd; - -var start=function(){ -if(_this3._duration===0){ -_this3._onUpdate(_this3._toValue); -_this3.__debouncedOnEnd({finished:true});}else -{ -_this3._startTime=Date.now(); -_this3._animationFrame=requestAnimationFrame(_this3.onUpdate.bind(_this3));}}; - - -if(this._delay){ -this._timeout=setTimeout(start,this._delay);}else -{ -start();}}},{key:'onUpdate',value:function onUpdate() - - - -{ -var now=Date.now(); -if(now>=this._startTime+this._duration){ -if(this._duration===0){ -this._onUpdate(this._toValue);}else -{ -this._onUpdate( -this._fromValue+this._easing(1)*(this._toValue-this._fromValue));} - - -this.__debouncedOnEnd({finished:true}); -return;} - - -this._onUpdate( -this._fromValue+ -this._easing((now-this._startTime)/this._duration)*( -this._toValue-this._fromValue)); - -if(this.__active){ -this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'stop',value:function stop() - - - -{ -this.__active=false; -clearTimeout(this._timeout); -window.cancelAnimationFrame(this._animationFrame); -this.__debouncedOnEnd({finished:false});}}]);return TimingAnimation;})(Animation);var - - - - - - - - - - - - - -DecayAnimation=(function(_Animation2){babelHelpers.inherits(DecayAnimation,_Animation2); - - - - - - - - -function DecayAnimation( -config) -{babelHelpers.classCallCheck(this,DecayAnimation);var _this4=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(DecayAnimation).call(this)); - -_this4._deceleration=config.deceleration||0.998; -_this4._velocity=config.velocity; -_this4.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;return _this4;}babelHelpers.createClass(DecayAnimation,[{key:'start',value:function start( - - - -fromValue, -onUpdate, -onEnd) -{ -this.__active=true; -this._lastValue=fromValue; -this._fromValue=fromValue; -this._onUpdate=onUpdate; -this.__onEnd=onEnd; -this._startTime=Date.now(); -this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}},{key:'onUpdate',value:function onUpdate() - - -{ -var now=Date.now(); - -var value=this._fromValue+ -this._velocity/(1-this._deceleration)*( -1-Math.exp(-(1-this._deceleration)*(now-this._startTime))); - -this._onUpdate(value); - -if(Math.abs(this._lastValue-value)<0.1){ -this.__debouncedOnEnd({finished:true}); -return;} - - -this._lastValue=value; -if(this.__active){ -this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this));}}},{key:'stop',value:function stop() - - - -{ -this.__active=false; -window.cancelAnimationFrame(this._animationFrame); -this.__debouncedOnEnd({finished:false});}}]);return DecayAnimation;})(Animation); - - - - - - - - - - - - - - - - - - - - - - - - - - - -function withDefault(value,defaultValue){ -if(value===undefined||value===null){ -return defaultValue;} - -return value;}var - - -SpringAnimation=(function(_Animation3){babelHelpers.inherits(SpringAnimation,_Animation3); - - - - - - - - - - - - - - - -function SpringAnimation( -config) -{babelHelpers.classCallCheck(this,SpringAnimation);var _this5=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(SpringAnimation).call(this)); - - -_this5._overshootClamping=withDefault(config.overshootClamping,false); -_this5._restDisplacementThreshold=withDefault(config.restDisplacementThreshold,0.001); -_this5._restSpeedThreshold=withDefault(config.restSpeedThreshold,0.001); -_this5._initialVelocity=config.velocity; -_this5._lastVelocity=withDefault(config.velocity,0); -_this5._toValue=config.toValue; -_this5.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true; - -var springConfig; -if(config.bounciness!==undefined||config.speed!==undefined){ -invariant( -config.tension===undefined&&config.friction===undefined, -'You can only define bounciness/speed or tension/friction but not both'); - -springConfig=SpringConfig.fromBouncinessAndSpeed( -withDefault(config.bounciness,8), -withDefault(config.speed,12));}else - -{ -springConfig=SpringConfig.fromOrigamiTensionAndFriction( -withDefault(config.tension,40), -withDefault(config.friction,7));} - - -_this5._tension=springConfig.tension; -_this5._friction=springConfig.friction;return _this5;}babelHelpers.createClass(SpringAnimation,[{key:'start',value:function start( - - - -fromValue, -onUpdate, -onEnd, -previousAnimation) -{ -this.__active=true; -this._startPosition=fromValue; -this._lastPosition=this._startPosition; - -this._onUpdate=onUpdate; -this.__onEnd=onEnd; -this._lastTime=Date.now(); - -if(previousAnimation instanceof SpringAnimation){ -var internalState=previousAnimation.getInternalState(); -this._lastPosition=internalState.lastPosition; -this._lastVelocity=internalState.lastVelocity; -this._lastTime=internalState.lastTime;} - -if(this._initialVelocity!==undefined&& -this._initialVelocity!==null){ -this._lastVelocity=this._initialVelocity;} - -this.onUpdate();}},{key:'getInternalState',value:function getInternalState() - - -{ -return { -lastPosition:this._lastPosition, -lastVelocity:this._lastVelocity, -lastTime:this._lastTime};}},{key:'onUpdate',value:function onUpdate() - - - -{ -var position=this._lastPosition; -var velocity=this._lastVelocity; - -var tempPosition=this._lastPosition; -var tempVelocity=this._lastVelocity; - - - - - -var MAX_STEPS=64; -var now=Date.now(); -if(now>this._lastTime+MAX_STEPS){ -now=this._lastTime+MAX_STEPS;} - - - - - -var TIMESTEP_MSEC=1; -var numSteps=Math.floor((now-this._lastTime)/TIMESTEP_MSEC); - -for(var i=0;ithis._toValue;}else -{ -isOvershooting=positioninputMax){ -if(extrapolateRight==='identity'){ -return result;}else -if(extrapolateRight==='clamp'){ -result=inputMax;}else -if(extrapolateRight==='extend'){}} - - - - -if(outputMin===outputMax){ -return outputMin;} - - -if(inputMin===inputMax){ -if(input<=inputMin){ -return outputMin;} - -return outputMax;} - - - -if(inputMin===-Infinity){ -result=-result;}else -if(inputMax===Infinity){ -result=result-inputMin;}else -{ -result=(result-inputMin)/(inputMax-inputMin);} - - - -result=easing(result); - - -if(outputMin===-Infinity){ -result=-result;}else -if(outputMax===Infinity){ -result=result+outputMin;}else -{ -result=result*(outputMax-outputMin)+outputMin;} - - -return result;} - - -function colorToRgba( -input) -{ -var color=tinycolor(input); -if(color.isValid()){var _color$toRgb= -color.toRgb();var r=_color$toRgb.r;var g=_color$toRgb.g;var b=_color$toRgb.b;var a=_color$toRgb.a; -return 'rgba('+r+', '+g+', '+b+', '+(a===undefined?1:a)+')';}else -{ -return input;}} - - - -var stringShapeRegex=/[0-9\.-]+/g; - - - - - - - - - -function createInterpolationFromStringOutputRange( -config) -{ -var outputRange=config.outputRange; -invariant(outputRange.length>=2,'Bad output range'); -outputRange=outputRange.map(colorToRgba); -checkPattern(outputRange); - - - - - - - - - - - - -var outputRanges=outputRange[0].match(stringShapeRegex).map(function(){return [];}); -outputRange.forEach(function(value){ - - - -value.match(stringShapeRegex).forEach(function(number,i){ -outputRanges[i].push(+number);});}); - - - - - - -var interpolations=outputRange[0].match(stringShapeRegex).map(function(value,i){ -return Interpolation.create(babelHelpers.extends({}, -config,{ -outputRange:outputRanges[i]}));}); - - - -return function(input){ -var i=0; - - - -return outputRange[0].replace(stringShapeRegex,function(){ -return String(interpolations[i++](input));});};} - - - - -function checkPattern(arr){ -var pattern=arr[0].replace(stringShapeRegex,''); -for(var i=1;i=input){ -break;}} - - -return i-1;} - - -function checkValidInputRange(arr){ -invariant(arr.length>=2,'inputRange must have at least 2 elements'); -for(var i=1;i=arr[i-1], - - - - - - -'inputRange must be monotonically increasing '+arr);}} - - - - -function checkInfiniteRange(name,arr){ -invariant(arr.length>=2,name+' must have at least 2 elements'); -invariant( -arr.length!==2||arr[0]!==-Infinity||arr[1]!==Infinity, - - - - - - -name+'cannot be ]-infinity;+infinity[ '+arr);} - - - -module.exports=Interpolation; -}); -__d('Easing',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var _bezier=require('bezier');var - - - - - - -Easing=(function(){function Easing(){babelHelpers.classCallCheck(this,Easing);}babelHelpers.createClass(Easing,null,[{key:'step0',value:function step0( -n){ -return n>0?1:0;}},{key:'step1',value:function step1( - - -n){ -return n>=1?1:0;}},{key:'linear',value:function linear( - - -t){ -return t;}},{key:'ease',value:function ease( - - -t){ -return _ease(t);}},{key:'quad',value:function quad( - - -t){ -return t*t;}},{key:'cubic',value:function cubic( - - -t){ -return t*t*t;}},{key:'poly',value:function poly( - - -n){ -return function(t){return Math.pow(t,n);};}},{key:'sin',value:function sin( - - -t){ -return 1-Math.cos(t*Math.PI/2);}},{key:'circle',value:function circle( - - -t){ -return 1-Math.sqrt(1-t*t);}},{key:'exp',value:function exp( - - -t){ -return Math.pow(2,10*(t-1));}},{key:'elastic',value:function elastic() - - - - - - - - - - - - -{var bounciness=arguments.length<=0||arguments[0]===undefined?1:arguments[0]; -var p=bounciness*Math.PI; -return function(t){return 1-Math.pow(Math.cos(t*Math.PI/2),3)*Math.cos(t*p);};}},{key:'back',value:function back( - - -s){ -if(s===undefined){ -s=1.70158;} - -return function(t){return t*t*((s+1)*t-s);};}},{key:'bounce',value:function bounce( - - -t){ -if(t<1/2.75){ -return 7.5625*t*t;} - - -if(t<2/2.75){ -t-=1.5/2.75; -return 7.5625*t*t+0.75;} - - -if(t<2.5/2.75){ -t-=2.25/2.75; -return 7.5625*t*t+0.9375;} - - -t-=2.625/2.75; -return 7.5625*t*t+0.984375;}},{key:'bezier',value:function bezier( - - - -x1, -y1, -x2, -y2, -epsilon) -{ -if(epsilon===undefined){ - - -var duration=500; -epsilon=1000/60/duration/4;} - - -return _bezier(x1,y1,x2,y2,epsilon);}},{key:'in',value:function _in( - - - -easing) -{ -return easing;}},{key:'out',value:function out( - - - - - - -easing) -{ -return function(t){return 1-easing(1-t);};}},{key:'inOut',value:function inOut( - - - - - - -easing) -{ -return function(t){ -if(t<0.5){ -return easing(t*2)/2;} - -return 1-easing((1-t)*2)/2;};}}]);return Easing;})(); - - - - -var _ease=Easing.bezier(0.42,0,1,1); - - - -module.exports=Easing; -}); -__d('bezier',function(global, require, module, exports) { module. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -exports=function(x1,y1,x2,y2,epsilon){ - -var curveX=function(t){ -var v=1-t; -return 3*v*v*t*x1+3*v*t*t*x2+t*t*t;}; - - -var curveY=function(t){ -var v=1-t; -return 3*v*v*t*y1+3*v*t*t*y2+t*t*t;}; - - -var derivativeCurveX=function(t){ -var v=1-t; -return 3*(2*(t-1)*t+v*v)*x1+3*(-t*t*t+2*v*t)*x2;}; - - -return function(t){ - -var x=t,t0,t1,t2,x2,d2,i; - - -for(t2=x,i=0;i<8;i++){ -x2=curveX(t2)-x; -if(Math.abs(x2)t1)return curveY(t1); - - -while(t0x2)t0=t2;else -t1=t2; -t2=(t1-t0)*.5+t0;} - - - -return curveY(t2);};}; -}); -__d('SpringConfig',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - -function tensionFromOrigamiValue(oValue){ -return (oValue-30)*3.62+194;} - - -function frictionFromOrigamiValue(oValue){ -return (oValue-8)*3+25;} - - -function fromOrigamiTensionAndFriction( -tension, -friction) -{ -return { -tension:tensionFromOrigamiValue(tension), -friction:frictionFromOrigamiValue(friction)};} - - - -function fromBouncinessAndSpeed( -bounciness, -speed) -{ -function normalize(value,startValue,endValue){ -return (value-startValue)/(endValue-startValue);} - - -function projectNormal(n,start,end){ -return start+n*(end-start);} - - -function linearInterpolation(t,start,end){ -return t*end+(1-t)*start;} - - -function quadraticOutInterpolation(t,start,end){ -return linearInterpolation(2*t-t*t,start,end);} - - -function b3Friction1(x){ -return 0.0007*Math.pow(x,3)- -0.031*Math.pow(x,2)+0.64*x+1.28;} - - -function b3Friction2(x){ -return 0.000044*Math.pow(x,3)- -0.006*Math.pow(x,2)+0.36*x+2;} - - -function b3Friction3(x){ -return 0.00000045*Math.pow(x,3)- -0.000332*Math.pow(x,2)+0.1078*x+5.84;} - - -function b3Nobounce(tension){ -if(tension<=18){ -return b3Friction1(tension);}else -if(tension>18&&tension<=44){ -return b3Friction2(tension);}else -{ -return b3Friction3(tension);}} - - - -var b=normalize(bounciness/1.7,0,20); -b=projectNormal(b,0,0.8); -var s=normalize(speed/1.7,0,20); -var bouncyTension=projectNormal(s,0.5,200); -var bouncyFriction=quadraticOutInterpolation( -b, -b3Nobounce(bouncyTension), -0.01); - - -return { -tension:tensionFromOrigamiValue(bouncyTension), -friction:frictionFromOrigamiValue(bouncyFriction)};} - - - -module.exports={ -fromOrigamiTensionAndFriction:fromOrigamiTensionAndFriction, -fromBouncinessAndSpeed:fromBouncinessAndSpeed}; -}); -__d('requestAnimationFrame',function(global, require, module, exports) { var - - - - - - - - - - -emptyFunction=require('emptyFunction'); -var nativeRequestAnimationFrame=require('nativeRequestAnimationFrame'); - -var lastTime=0; - -var requestAnimationFrame= -nativeRequestAnimationFrame|| -function(callback){ -var currTime=Date.now(); -var timeDelay=Math.max(0,16-(currTime-lastTime)); -lastTime=currTime+timeDelay; -return global.setTimeout(function(){ -callback(Date.now());}, -timeDelay);}; - - - -requestAnimationFrame(emptyFunction); - -module.exports=requestAnimationFrame; -}); -__d('nativeRequestAnimationFrame',function(global, require, module, exports) { var - - - - - - - - - - -nativeRequestAnimationFrame= -global.requestAnimationFrame|| -global.webkitRequestAnimationFrame|| -global.mozRequestAnimationFrame|| -global.oRequestAnimationFrame|| -global.msRequestAnimationFrame; - -module.exports=nativeRequestAnimationFrame; -}); -__d('ViewPagerAndroid',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - -module.exports=require('UnimplementedView'); -}); -__d('WebView',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ActivityIndicatorIOS=require('ActivityIndicatorIOS'); -var EdgeInsetsPropType=require('EdgeInsetsPropType'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); - -var invariant=require('invariant'); -var keyMirror=require('keyMirror'); -var requireNativeComponent=require('requireNativeComponent'); - -var PropTypes=React.PropTypes; -var RCTWebViewManager=require('NativeModules').WebViewManager; - -var BGWASH='rgba(255,255,255,0.8)'; -var RCT_WEBVIEW_REF='webview'; - -var WebViewState=keyMirror({ -IDLE:null, -LOADING:null, -ERROR:null}); - - -var NavigationType={ -click:RCTWebViewManager.NavigationType.LinkClicked, -formsubmit:RCTWebViewManager.NavigationType.FormSubmitted, -backforward:RCTWebViewManager.NavigationType.BackForward, -reload:RCTWebViewManager.NavigationType.Reload, -formresubmit:RCTWebViewManager.NavigationType.FormResubmitted, -other:RCTWebViewManager.NavigationType.Other}; - - -var JSNavigationScheme=RCTWebViewManager.JSNavigationScheme; - - - - - - - - - -var defaultRenderLoading=function(){return ( -React.createElement(View,{style:styles.loadingView}, -React.createElement(ActivityIndicatorIOS,null)));}; - - -var defaultRenderError=function(errorDomain,errorCode,errorDesc){return ( -React.createElement(View,{style:styles.errorContainer}, -React.createElement(Text,{style:styles.errorTextTitle},'Error loading page'), - - -React.createElement(Text,{style:styles.errorText}, -'Domain: '+errorDomain), - -React.createElement(Text,{style:styles.errorText}, -'Error Code: '+errorCode), - -React.createElement(Text,{style:styles.errorText}, -'Description: '+errorDesc)));}; - - - - - - - -var WebView=React.createClass({displayName:'WebView', -statics:{ -JSNavigationScheme:JSNavigationScheme, -NavigationType:NavigationType}, - - -propTypes:babelHelpers.extends({}, -View.propTypes,{ -url:PropTypes.string, -html:PropTypes.string, - - - -renderError:PropTypes.func, - - - -renderLoading:PropTypes.func, - - - -bounces:PropTypes.bool, - - - -scrollEnabled:PropTypes.bool, -automaticallyAdjustContentInsets:PropTypes.bool, -contentInset:EdgeInsetsPropType, -onNavigationStateChange:PropTypes.func, -startInLoadingState:PropTypes.bool, -style:View.propTypes.style, - - - - - -javaScriptEnabledAndroid:PropTypes.bool, - - - - -injectedJavaScript:PropTypes.string, - - - - - -scalesPageToFit:PropTypes.bool, - - - - - - -onShouldStartLoadWithRequest:PropTypes.func, - - - - - - - - - - -allowsInlineMediaPlayback:PropTypes.bool}), - - -getInitialState:function(){ -return { -viewState:WebViewState.IDLE, -lastErrorEvent:null, -startInLoadingState:true};}, - - - -componentWillMount:function(){ -if(this.props.startInLoadingState){ -this.setState({viewState:WebViewState.LOADING});}}, - - - -render:function(){var _this=this; -var otherView=null; - -if(this.state.viewState===WebViewState.LOADING){ -otherView=(this.props.renderLoading||defaultRenderLoading)();}else -if(this.state.viewState===WebViewState.ERROR){ -var errorEvent=this.state.lastErrorEvent; -invariant( -errorEvent!=null, -'lastErrorEvent expected to be non-null'); - -otherView=(this.props.renderError||defaultRenderError)( -errorEvent.domain, -errorEvent.code, -errorEvent.description);}else - -if(this.state.viewState!==WebViewState.IDLE){ -console.error( -'RCTWebView invalid state encountered: '+this.state.loading);} - - - -var webViewStyles=[styles.container,styles.webView,this.props.style]; -if(this.state.viewState===WebViewState.LOADING|| -this.state.viewState===WebViewState.ERROR){ - -webViewStyles.push(styles.hidden);} - - -var onShouldStartLoadWithRequest=this.props.onShouldStartLoadWithRequest&&function(event){ -var shouldStart=_this.props.onShouldStartLoadWithRequest&& -_this.props.onShouldStartLoadWithRequest(event.nativeEvent); -RCTWebViewManager.startLoadWithResult(!!shouldStart,event.nativeEvent.lockIdentifier);}; - - -var webView= -React.createElement(RCTWebView,{ -ref:RCT_WEBVIEW_REF, -key:'webViewKey', -style:webViewStyles, -url:this.props.url, -html:this.props.html, -injectedJavaScript:this.props.injectedJavaScript, -bounces:this.props.bounces, -scrollEnabled:this.props.scrollEnabled, -contentInset:this.props.contentInset, -automaticallyAdjustContentInsets:this.props.automaticallyAdjustContentInsets, -onLoadingStart:this.onLoadingStart, -onLoadingFinish:this.onLoadingFinish, -onLoadingError:this.onLoadingError, -onShouldStartLoadWithRequest:onShouldStartLoadWithRequest, -scalesPageToFit:this.props.scalesPageToFit, -allowsInlineMediaPlayback:this.props.allowsInlineMediaPlayback}); - - -return ( -React.createElement(View,{style:styles.container}, -webView, -otherView));}, - - - - -goForward:function(){ -RCTWebViewManager.goForward(this.getWebViewHandle());}, - - -goBack:function(){ -RCTWebViewManager.goBack(this.getWebViewHandle());}, - - -reload:function(){ -RCTWebViewManager.reload(this.getWebViewHandle());}, - - - - - - -updateNavigationState:function(event){ -if(this.props.onNavigationStateChange){ -this.props.onNavigationStateChange(event.nativeEvent);}}, - - - -getWebViewHandle:function(){ -return React.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);}, - - -onLoadingStart:function(event){ -this.updateNavigationState(event);}, - - -onLoadingError:function(event){ -event.persist(); -console.warn('Encountered an error loading page',event.nativeEvent); - -this.setState({ -lastErrorEvent:event.nativeEvent, -viewState:WebViewState.ERROR});}, - - - -onLoadingFinish:function(event){ -this.setState({ -viewState:WebViewState.IDLE}); - -this.updateNavigationState(event);}}); - - - -var RCTWebView=requireNativeComponent('RCTWebView',WebView,{ -nativeOnly:{ -onLoadingStart:true, -onLoadingError:true, -onLoadingFinish:true}}); - - - -var styles=StyleSheet.create({ -container:{ -flex:1}, - -errorContainer:{ -flex:1, -justifyContent:'center', -alignItems:'center', -backgroundColor:BGWASH}, - -errorText:{ -fontSize:14, -textAlign:'center', -marginBottom:2}, - -errorTextTitle:{ -fontSize:15, -fontWeight:'500', -marginBottom:10}, - -hidden:{ -height:0, -flex:0}, - -loadingView:{ -backgroundColor:BGWASH, -flex:1, -justifyContent:'center', -alignItems:'center'}, - -webView:{ -backgroundColor:'#ffffff'}}); - - - -module.exports=WebView; -}); -__d('ActionSheetIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTActionSheetManager=require('NativeModules').ActionSheetManager; - -var invariant=require('invariant'); -var processColor=require('processColor'); - -var ActionSheetIOS={ -showActionSheetWithOptions:function(options,callback){ -invariant( -typeof options==='object'&&options!==null, -'Options must a valid object'); - -invariant( -typeof callback==='function', -'Must provide a valid callback'); - -RCTActionSheetManager.showActionSheetWithOptions(babelHelpers.extends({}, -options,{tintColor:processColor(options.tintColor)}), -callback);}, - - - -showShareActionSheetWithOptions:function( -options, -failureCallback, -successCallback) -{ -invariant( -typeof options==='object'&&options!==null, -'Options must a valid object'); - -invariant( -typeof failureCallback==='function', -'Must provide a valid failureCallback'); - -invariant( -typeof successCallback==='function', -'Must provide a valid successCallback'); - -RCTActionSheetManager.showShareActionSheetWithOptions(babelHelpers.extends({}, -options,{tintColor:processColor(options.tintColor)}), -failureCallback, -successCallback);}}; - - - - -module.exports=ActionSheetIOS; -}); -__d('AdSupportIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var AdSupport=require('NativeModules').AdSupport; - -module.exports={ -getAdvertisingId:function(onSuccess,onFailure){ -AdSupport.getAdvertisingId(onSuccess,onFailure);}, - - -getAdvertisingTrackingEnabled:function(onSuccess,onFailure){ -AdSupport.getAdvertisingTrackingEnabled(onSuccess,onFailure);}}; -}); -__d('Alert',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var AlertIOS=require('AlertIOS'); -var Platform=require('Platform'); -var DialogModuleAndroid=require('NativeModules').DialogManagerAndroid;var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Alert=(function(){function Alert(){babelHelpers.classCallCheck(this,Alert);}babelHelpers.createClass(Alert,null,[{key:'alert',value:function alert( - - -title, -message, -buttons, -type) -{ -if(Platform.OS==='ios'){ -AlertIOS.alert(title,message,buttons,type);}else -if(Platform.OS==='android'){ -AlertAndroid.alert(title,message,buttons);}}}]);return Alert;})();var - - - - - - - -AlertAndroid=(function(){function AlertAndroid(){babelHelpers.classCallCheck(this,AlertAndroid);}babelHelpers.createClass(AlertAndroid,null,[{key:'alert',value:function alert( - - -title, -message, -buttons) -{ -var config={ -title:title||'', -message:message||''}; - - - -var validButtons=buttons?buttons.slice(0,3):[{text:'OK'}]; -var buttonPositive=validButtons.pop(); -var buttonNegative=validButtons.pop(); -var buttonNeutral=validButtons.pop(); -if(buttonNeutral){ -config=babelHelpers.extends({},config,{buttonNeutral:buttonNeutral.text||''});} - -if(buttonNegative){ -config=babelHelpers.extends({},config,{buttonNegative:buttonNegative.text||''});} - -if(buttonPositive){ -config=babelHelpers.extends({},config,{buttonPositive:buttonPositive.text||''});} - -DialogModuleAndroid.showAlert( -config, -function(errorMessage){return console.warn(message);}, -function(action,buttonKey){ -if(action!==DialogModuleAndroid.buttonClicked){ -return;} - -if(buttonKey===DialogModuleAndroid.buttonNeutral){ -buttonNeutral.onPress&&buttonNeutral.onPress();}else -if(buttonKey===DialogModuleAndroid.buttonNegative){ -buttonNegative.onPress&&buttonNegative.onPress();}else -if(buttonKey===DialogModuleAndroid.buttonPositive){ -buttonPositive.onPress&&buttonPositive.onPress();}});}}]);return AlertAndroid;})(); - - - - - - -module.exports=Alert; -}); -__d('AlertIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var RCTAlertManager=require('NativeModules').AlertManager; -var invariant=require('invariant');var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AlertIOS=(function(){function AlertIOS(){babelHelpers.classCallCheck(this,AlertIOS);}babelHelpers.createClass(AlertIOS,null,[{key:'alert',value:function alert( - -title, -message, -buttons, - - - - -type) -{ -var callbacks=[]; -var buttonsSpec=[]; -var cancelButtonKey; -var destructiveButtonKey; -buttons&&buttons.forEach(function(btn,index){ -callbacks[index]=btn.onPress; -if(btn.style=='cancel'){ -cancelButtonKey=String(index);}else -if(btn.style=='destructive'){ -destructiveButtonKey=String(index);} - -if(btn.text||index<(buttons||[]).length-1){ -var btnDef={}; -btnDef[index]=btn.text||''; -buttonsSpec.push(btnDef);}}); - - -RCTAlertManager.alertWithArgs({ -title:title||undefined, -message:message||undefined, -buttons:buttonsSpec, -type:type||undefined, -cancelButtonKey:cancelButtonKey, -destructiveButtonKey:destructiveButtonKey}, -function(id,value){ -var cb=callbacks[id]; -cb&&cb(value);});}},{key:'prompt',value:function prompt( - - - - -title, -value, -buttons, - - - - -callback) -{ -if(arguments.length===2){ -if(typeof value==='object'){ -buttons=value; -value=undefined;}else -if(typeof value==='function'){ -callback=value; -value=undefined;}}else - -if(arguments.length===3&&typeof buttons==='function'){ -callback=buttons; -buttons=undefined;} - - -invariant( -!(callback&&buttons)&&(callback||buttons), -'Must provide either a button list or a callback, but not both'); - - -if(!buttons){ -buttons=[{onPress:callback}];} - -this.alert(title,value,buttons,'plain-text');}}]);return AlertIOS;})(); - - - -module.exports=AlertIOS; -}); -__d('AppRegistry',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var BatchedBridge=require('BatchedBridge'); -var ReactNative=require('ReactNative'); - -var invariant=require('invariant'); -var renderApplication=require('renderApplication'); - -if(__DEV__){ - - -require('RCTRenderingPerf');} - - -var runnables={}; - - - - - - - - - - - - - - - - - - - - - - - - -var AppRegistry={ -registerConfig:function(config){ -for(var i=0;iDimensions.get('window').height/2?'top':'bottom', -selection:hierarchy.length-1, -hierarchy:hierarchy, -inspected:{ -style:props.style||{}, -frame:frame}});}},{key:'setPerfing',value:function setPerfing( - - - - -val){ -this.setState({ -perfing:val, -inspecting:false, -inspected:null});}},{key:'setInspecting',value:function setInspecting( - - - -val){ -this.setState({ -inspecting:val, -inspected:null});}},{key:'render',value:function render() - - - -{ -var panelContainerStyle=this.state.panelPos==='bottom'?{bottom:0}:{top:0}; -return ( -React.createElement(View,{style:styles.container,pointerEvents:'box-none'}, -this.state.inspecting&& -React.createElement(InspectorOverlay,{ -rootTag:this.props.rootTag, -inspected:this.state.inspected, -inspectedViewTag:this.props.inspectedViewTag, -onTouchInstance:this.onTouchInstance.bind(this)}), - -React.createElement(View,{style:[styles.panelContainer,panelContainerStyle]}, -React.createElement(InspectorPanel,{ -devtoolsIsOpen:!!this.state.devtoolsAgent, -inspecting:this.state.inspecting, -perfing:this.state.perfing, -setPerfing:this.setPerfing.bind(this), -setInspecting:this.setInspecting.bind(this), -inspected:this.state.inspected, -hierarchy:this.state.hierarchy, -selection:this.state.selection, -setSelection:this.setSelection.bind(this)}))));}}]);return Inspector;})(React.Component); - - - - - - - -var styles=StyleSheet.create({ -container:{ -position:'absolute', -backgroundColor:'transparent', -top:0, -left:0, -right:0, -bottom:0}, - -panelContainer:{ -position:'absolute', -left:0, -right:0}}); - - - -module.exports=Inspector; -}); -__d('InspectorOverlay',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Dimensions=require('Dimensions'); -var InspectorUtils=require('InspectorUtils'); -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var UIManager=require('NativeModules').UIManager; -var View=require('View'); -var ElementBox=require('ElementBox'); - -var PropTypes=React.PropTypes; - - - - - -var InspectorOverlay=React.createClass({displayName:'InspectorOverlay', -propTypes:{ -inspected:PropTypes.shape({ -frame:PropTypes.object, -style:PropTypes.any}), - -inspectedViewTag:PropTypes.number, -onTouchInstance:PropTypes.func.isRequired}, - - -findViewForTouchEvent:function(e){var _this=this;var _e$nativeEvent$touche= -e.nativeEvent.touches[0];var locationX=_e$nativeEvent$touche.locationX;var locationY=_e$nativeEvent$touche.locationY; -UIManager.findSubviewIn( -this.props.inspectedViewTag, -[locationX,locationY], -function(nativeViewTag,left,top,width,height){ -var instance=InspectorUtils.findInstanceByNativeTag(_this.props.rootTag,nativeViewTag); -if(!instance){ -return;} - -_this.props.onTouchInstance(instance,{left:left,top:top,width:width,height:height},locationY);});}, - - - - -shouldSetResponser:function(e){ -this.findViewForTouchEvent(e); -return true;}, - - -render:function(){ -var content=null; -if(this.props.inspected){ -content=React.createElement(ElementBox,{frame:this.props.inspected.frame,style:this.props.inspected.style});} - - -return ( -React.createElement(View,{ -onStartShouldSetResponder:this.shouldSetResponser, -onResponderMove:this.findViewForTouchEvent, -style:[styles.inspector,{height:Dimensions.get('window').height}]}, -content));}}); - - - - - -var styles=StyleSheet.create({ -inspector:{ -backgroundColor:'transparent', -position:'absolute', -left:0, -top:0, -right:0}}); - - - -module.exports=InspectorOverlay; -}); -__d('ElementBox',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var View=require('View'); -var StyleSheet=require('StyleSheet'); -var BorderBox=require('BorderBox'); -var resolveBoxStyle=require('resolveBoxStyle'); - -var flattenStyle=require('flattenStyle');var - -ElementBox=(function(_React$Component){babelHelpers.inherits(ElementBox,_React$Component);function ElementBox(){babelHelpers.classCallCheck(this,ElementBox);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(ElementBox).apply(this,arguments));}babelHelpers.createClass(ElementBox,[{key:'render',value:function render() -{ -var style=flattenStyle(this.props.style)||{}; -var margin=resolveBoxStyle('margin',style); -var padding=resolveBoxStyle('padding',style); -var frameStyle=this.props.frame; -if(margin){ -frameStyle={ -top:frameStyle.top-margin.top, -left:frameStyle.left-margin.left, -height:frameStyle.height+margin.top+margin.bottom, -width:frameStyle.width+margin.left+margin.right};} - - -var contentStyle={ -width:this.props.frame.width, -height:this.props.frame.height}; - -if(padding){ -contentStyle={ -width:contentStyle.width-padding.left-padding.right, -height:contentStyle.height-padding.top-padding.bottom};} - - -return ( -React.createElement(View,{style:[styles.frame,frameStyle],pointerEvents:'none'}, -React.createElement(BorderBox,{box:margin,style:styles.margin}, -React.createElement(BorderBox,{box:padding,style:styles.padding}, -React.createElement(View,{style:[styles.content,contentStyle]})))));}}]);return ElementBox;})(React.Component); - - - - - - - -var styles=StyleSheet.create({ -frame:{ -position:'absolute'}, - -content:{ -backgroundColor:'rgba(200, 230, 255, 0.8)'}, - -padding:{ -borderColor:'rgba(77, 255, 0, 0.3)'}, - -margin:{ -borderColor:'rgba(255, 132, 0, 0.3)'}}); - - - -module.exports=ElementBox; -}); -__d('BorderBox',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var View=require('View');var - -BorderBox=(function(_React$Component){babelHelpers.inherits(BorderBox,_React$Component);function BorderBox(){babelHelpers.classCallCheck(this,BorderBox);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(BorderBox).apply(this,arguments));}babelHelpers.createClass(BorderBox,[{key:'render',value:function render() -{ -var box=this.props.box; -if(!box){ -return this.props.children;} - -var style={ -borderTopWidth:box.top, -borderBottomWidth:box.bottom, -borderLeftWidth:box.left, -borderRightWidth:box.right}; - -return ( -React.createElement(View,{style:[style,this.props.style]}, -this.props.children));}}]);return BorderBox;})(React.Component); - - - - - -module.exports=BorderBox; -}); -__d('resolveBoxStyle',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - - - - - - - - - -function resolveBoxStyle(prefix,style){ -var res={}; -var subs=['top','left','bottom','right']; -var set=false; -subs.forEach(function(sub){ -res[sub]=style[prefix]||0;}); - -if(style[prefix]){ -set=true;} - -if(style[prefix+'Vertical']){ -res.top=res.bottom=style[prefix+'Vertical']; -set=true;} - -if(style[prefix+'Horizontal']){ -res.left=res.right=style[prefix+'Horizontal']; -set=true;} - -subs.forEach(function(sub){ -var val=style[prefix+capFirst(sub)]; -if(val){ -res[sub]=val; -set=true;}}); - - -if(!set){ -return;} - -return res;} - - -function capFirst(text){ -return text[0].toUpperCase()+text.slice(1);} - - -module.exports=resolveBoxStyle; -}); -__d('InspectorPanel',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); -var ElementProperties=require('ElementProperties'); -var PerformanceOverlay=require('PerformanceOverlay'); -var TouchableHighlight=require('TouchableHighlight'); - -var PropTypes=React.PropTypes;var - -InspectorPanel=(function(_React$Component){babelHelpers.inherits(InspectorPanel,_React$Component);function InspectorPanel(){babelHelpers.classCallCheck(this,InspectorPanel);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(InspectorPanel).apply(this,arguments));}babelHelpers.createClass(InspectorPanel,[{key:'renderWaiting',value:function renderWaiting() -{ -if(this.props.inspecting){ -return ( -React.createElement(Text,{style:styles.waitingText},'Tap something to inspect it'));} - - - - -return React.createElement(Text,{style:styles.waitingText},'Nothing is inspected');}},{key:'render',value:function render() - - -{ -var contents; -if(this.props.inspected){ -contents= -React.createElement(ElementProperties,{ -style:this.props.inspected.style, -frame:this.props.inspected.frame, -hierarchy:this.props.hierarchy, -selection:this.props.selection, -setSelection:this.props.setSelection});}else - - -if(this.props.perfing){ -contents= -React.createElement(PerformanceOverlay,null);}else - -{ -contents= -React.createElement(View,{style:styles.waiting}, -this.renderWaiting());} - - - -return ( -React.createElement(View,{style:styles.container}, -!this.props.devtoolsIsOpen&&contents, -React.createElement(View,{style:styles.buttonRow}, -React.createElement(Button,{ -title:'Inspect', -pressed:this.props.inspecting, -onClick:this.props.setInspecting}), - -React.createElement(Button,{title:'Perf', -pressed:this.props.perfing, -onClick:this.props.setPerfing}))));}}]);return InspectorPanel;})(React.Component); - - - - - - - -InspectorPanel.propTypes={ -devtoolsIsOpen:PropTypes.bool, -inspecting:PropTypes.bool, -setInspecting:PropTypes.func, -inspected:PropTypes.object, -perfing:PropTypes.bool, -setPerfing:PropTypes.func};var - - -Button=(function(_React$Component2){babelHelpers.inherits(Button,_React$Component2);function Button(){babelHelpers.classCallCheck(this,Button);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(Button).apply(this,arguments));}babelHelpers.createClass(Button,[{key:'render',value:function render() -{var _this3=this; -return ( -React.createElement(TouchableHighlight,{onPress:function(){return _this3.props.onClick(!_this3.props.pressed);},style:[ -styles.button, -this.props.pressed&&styles.buttonPressed]}, - -React.createElement(Text,{style:styles.buttonText},this.props.title)));}}]);return Button;})(React.Component); - - - - - -var styles=StyleSheet.create({ -buttonRow:{ -flexDirection:'row'}, - -button:{ -backgroundColor:'rgba(0, 0, 0, 0.3)', -margin:2, -height:30, -justifyContent:'center', -alignItems:'center'}, - -buttonPressed:{ -backgroundColor:'rgba(255, 255, 255, 0.3)'}, - -buttonText:{ -textAlign:'center', -color:'white', -margin:5}, - -container:{ -backgroundColor:'rgba(0, 0, 0, 0.7)'}, - -waiting:{ -height:100}, - -waitingText:{ -fontSize:20, -textAlign:'center', -marginVertical:20}}); - - - -module.exports=InspectorPanel; -}); -__d('ElementProperties',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var BoxInspector=require('BoxInspector'); -var PropTypes=require('ReactPropTypes'); -var React=require('React'); -var StyleInspector=require('StyleInspector'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var TouchableHighlight=require('TouchableHighlight'); -var TouchableWithoutFeedback=require('TouchableWithoutFeedback'); -var View=require('View'); - -var flattenStyle=require('flattenStyle'); -var mapWithSeparator=require('mapWithSeparator'); - -var ElementProperties=React.createClass({displayName:'ElementProperties', -propTypes:{ -hierarchy:PropTypes.array.isRequired, -style:PropTypes.oneOfType([ -PropTypes.object, -PropTypes.array, -PropTypes.number])}, - - - -render:function(){var _this=this; -var style=flattenStyle(this.props.style); -var selection=this.props.selection; - - -return ( -React.createElement(TouchableWithoutFeedback,null, -React.createElement(View,{style:styles.info}, -React.createElement(View,{style:styles.breadcrumb}, -mapWithSeparator( -this.props.hierarchy, -function(item,i){return ( -React.createElement(TouchableHighlight,{ -style:[styles.breadItem,i===selection&&styles.selected], -onPress:function(){return _this.props.setSelection(i);}}, -React.createElement(Text,{style:styles.breadItemText}, -item.getName?item.getName():'Unknown')));}, - - - -function(){return React.createElement(Text,{style:styles.breadSep},'â–¸');})), - - -React.createElement(View,{style:styles.row}, -React.createElement(StyleInspector,{style:style}), -React.createElement(BoxInspector,{style:style,frame:this.props.frame})))));}}); - - - - - - - -var styles=StyleSheet.create({ -breadSep:{ -fontSize:8, -color:'white'}, - -breadcrumb:{ -flexDirection:'row', -flexWrap:'wrap', -marginBottom:5}, - -selected:{ -borderColor:'white', -borderRadius:5}, - -breadItem:{ -borderWidth:1, -borderColor:'transparent', -marginHorizontal:2}, - -breadItemText:{ -fontSize:10, -color:'white', -marginHorizontal:5}, - -row:{ -flexDirection:'row', -alignItems:'center', -justifyContent:'space-between'}, - -info:{ -padding:10}, - -path:{ -color:'white', -fontSize:9}}); - - - -module.exports=ElementProperties; -}); -__d('BoxInspector',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View'); -var resolveBoxStyle=require('resolveBoxStyle'); - -var blank={ -top:0, -left:0, -right:0, -bottom:0};var - - -BoxInspector=(function(_React$Component){babelHelpers.inherits(BoxInspector,_React$Component);function BoxInspector(){babelHelpers.classCallCheck(this,BoxInspector);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(BoxInspector).apply(this,arguments));}babelHelpers.createClass(BoxInspector,[{key:'render',value:function render() -{ -var frame=this.props.frame; -var style=this.props.style; -var margin=style&&resolveBoxStyle('margin',style)||blank; -var padding=style&&resolveBoxStyle('padding',style)||blank; -return ( -React.createElement(BoxContainer,{title:'margin',titleStyle:styles.marginLabel,box:margin}, -React.createElement(BoxContainer,{title:'padding',box:padding}, -React.createElement(View,null, -React.createElement(Text,{style:styles.innerText},'(', -frame.left,', ',frame.top,')'), - -React.createElement(Text,{style:styles.innerText}, -frame.width,' × ',frame.height)))));}}]);return BoxInspector;})(React.Component);var - - - - - - - - -BoxContainer=(function(_React$Component2){babelHelpers.inherits(BoxContainer,_React$Component2);function BoxContainer(){babelHelpers.classCallCheck(this,BoxContainer);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(BoxContainer).apply(this,arguments));}babelHelpers.createClass(BoxContainer,[{key:'render',value:function render() -{ -var box=this.props.box; -return ( -React.createElement(View,{style:styles.box}, -React.createElement(View,{style:styles.row}, -React.createElement(Text,{style:[this.props.titleStyle,styles.label]},this.props.title), -React.createElement(Text,{style:styles.boxText},box.top)), - -React.createElement(View,{style:styles.row}, -React.createElement(Text,{style:styles.boxText},box.left), -this.props.children, -React.createElement(Text,{style:styles.boxText},box.right)), - -React.createElement(Text,{style:styles.boxText},box.bottom)));}}]);return BoxContainer;})(React.Component); - - - - - -var styles=StyleSheet.create({ -row:{ -flexDirection:'row', -alignItems:'center', -justifyContent:'space-around'}, - -marginLabel:{ -width:60}, - -label:{ -fontSize:10, -color:'rgb(255,100,0)', -marginLeft:5, -flex:1, -textAlign:'left', -top:-3}, - -buffer:{ -fontSize:10, -color:'yellow', -flex:1, -textAlign:'center'}, - -innerText:{ -color:'yellow', -fontSize:12, -textAlign:'center', -width:70}, - -box:{ -borderWidth:1, -borderColor:'grey'}, - -boxText:{ -color:'white', -fontSize:12, -marginHorizontal:3, -marginVertical:2, -textAlign:'center'}}); - - - -module.exports=BoxInspector; -}); -__d('StyleInspector',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var React=require('React'); -var StyleSheet=require('StyleSheet'); -var Text=require('Text'); -var View=require('View');var - -StyleInspector=(function(_React$Component){babelHelpers.inherits(StyleInspector,_React$Component);function StyleInspector(){babelHelpers.classCallCheck(this,StyleInspector);return babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(StyleInspector).apply(this,arguments));}babelHelpers.createClass(StyleInspector,[{key:'render',value:function render() -{var _this2=this; -if(!this.props.style){ -return React.createElement(Text,{style:styles.noStyle},'No style');} - -var names=Object.keys(this.props.style); -return ( -React.createElement(View,{style:styles.container}, -React.createElement(View,null, -names.map(function(name){return React.createElement(Text,{style:styles.attr},name,':');})), - -React.createElement(View,null, -names.map(function(name){return React.createElement(Text,{style:styles.value},_this2.props.style[name]);}))));}}]);return StyleInspector;})(React.Component); - - - - - - -var styles=StyleSheet.create({ -container:{ -flexDirection:'row'}, - -row:{ -flexDirection:'row', -alignItems:'center', -justifyContent:'space-around'}, - -attr:{ -fontSize:10, -color:'#ccc'}, - -value:{ -fontSize:10, -color:'white', -marginLeft:10}, - -noStyle:{ -color:'white', -fontSize:10}}); - - - -module.exports=StyleInspector; -}); -__d('mapWithSeparator',function(global, require, module, exports) { 'use strict'; - - - - - - -function mapWithSeparator(array,valueFunction,separatorFunction){ -var results=[]; -for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];} -var index=0; -return format.replace(/%s/g,function(match){return args[index++];});} - - -function updateWarningMap(format){ -var stringifySafe=require('stringifySafe'); - -format=String(format); -var argCount=(format.match(/%s/g)||[]).length;for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];} -var warning=[ -sprintf.apply(undefined,[format].concat(babelHelpers.toConsumableArray(args.slice(0,argCount))))].concat(babelHelpers.toConsumableArray( -args.slice(argCount).map(stringifySafe))). -join(' '); - -var count=_warningMap.has(warning)?_warningMap.get(warning):0; -_warningMap.set(warning,count+2); -_warningEmitter.emit('warning',_warningMap);} - - -function isWarningIgnored(warning){ -return ( -Array.isArray(console.ignoredYellowBox)&& -console.ignoredYellowBox.some( -function(ignorePrefix){return warning.startsWith(ignorePrefix);}));} - - - - -var WarningRow=function(_ref){var count=_ref.count;var warning=_ref.warning;var onPress=_ref.onPress; -var Text=require('Text'); -var TouchableHighlight=require('TouchableHighlight'); -var View=require('View'); - -var countText=count>1? -React.createElement(Text,{style:styles.listRowCount},'('+count+') '): -null; - -return ( -React.createElement(View,{style:styles.listRow}, -React.createElement(TouchableHighlight,{ -activeOpacity:0.5, -onPress:onPress, -style:styles.listRowContent, -underlayColor:'transparent'}, -React.createElement(Text,{style:styles.listRowText,numberOfLines:2}, -countText, -warning))));}; - - - - - - -var WarningInspector=function(_ref2) - - - - - -{var count=_ref2.count;var warning=_ref2.warning;var onClose=_ref2.onClose;var onDismiss=_ref2.onDismiss;var onDismissAll=_ref2.onDismissAll; -var ScrollView=require('ScrollView'); -var Text=require('Text'); -var TouchableHighlight=require('TouchableHighlight'); -var View=require('View'); - -var countSentence= -'Warning encountered '+count+' time'+(count-1?'s':'')+'.'; - -return ( -React.createElement(TouchableHighlight,{ -activeOpacity:0.95, -underlayColor:backgroundColor(0.8), -onPress:onClose, -style:styles.inspector}, -React.createElement(View,{style:styles.inspectorContent}, -React.createElement(View,{style:styles.inspectorCount}, -React.createElement(Text,{style:styles.inspectorCountText},countSentence)), - -React.createElement(ScrollView,{style:styles.inspectorWarning}, -React.createElement(Text,{style:styles.inspectorWarningText},warning)), - -React.createElement(View,{style:styles.inspectorButtons}, -React.createElement(TouchableHighlight,{ -activeOpacity:0.5, -onPress:onDismiss, -style:styles.inspectorButton, -underlayColor:'transparent'}, -React.createElement(Text,{style:styles.inspectorButtonText},'Dismiss')), - - - -React.createElement(TouchableHighlight,{ -activeOpacity:0.5, -onPress:onDismissAll, -style:styles.inspectorButton, -underlayColor:'transparent'}, -React.createElement(Text,{style:styles.inspectorButtonText},'Dismiss All'))))));};var - - - - - - - - - -YellowBox=(function(_React$Component){babelHelpers.inherits(YellowBox,_React$Component); - - - - - - -function YellowBox(props,context){babelHelpers.classCallCheck(this,YellowBox);var _this=babelHelpers.possibleConstructorReturn(this,Object.getPrototypeOf(YellowBox).call(this, -props,context)); -_this.state={ -inspecting:null, -warningMap:_warningMap}; - -_this.dismissWarning=function(warning){var _this$state= -_this.state;var inspecting=_this$state.inspecting;var warningMap=_this$state.warningMap; -if(warning){ -warningMap.delete(warning);}else -{ -warningMap.clear();} - -_this.setState({ -inspecting:warning&&inspecting!==warning?inspecting:null, -warningMap:warningMap});};return _this;}babelHelpers.createClass(YellowBox,[{key:'componentDidMount',value:function componentDidMount() - - - - -{var _this2=this; -var scheduled=null; -this._listener=_warningEmitter.addListener('warning',function(warningMap){ - - -scheduled=scheduled||setImmediate(function(){ -scheduled=null; -_this2.setState({ -warningMap:warningMap});});});}},{key:'componentWillUnmount',value:function componentWillUnmount() - - - - - -{ -if(this._listener){ -this._listener.remove();}}},{key:'render',value:function render() - - - -{var _this3=this; -if(console.disableYellowBox||this.state.warningMap.size===0){ -return null;} - -var ScrollView=require('ScrollView'); -var View=require('View'); - -var inspecting=this.state.inspecting; -var inspector=inspecting!==null? -React.createElement(WarningInspector,{ -count:this.state.warningMap.get(inspecting), -warning:inspecting, -onClose:function(){return _this3.setState({inspecting:null});}, -onDismiss:function(){return _this3.dismissWarning(inspecting);}, -onDismissAll:function(){return _this3.dismissWarning(null);}}): - -null; - -var rows=[]; -this.state.warningMap.forEach(function(count,warning){ -if(!isWarningIgnored(warning)){ -rows.push( -React.createElement(WarningRow,{ -key:warning, -count:count, -warning:warning, -onPress:function(){return _this3.setState({inspecting:warning});}, -onDismiss:function(){return _this3.dismissWarning(warning);}}));}}); - - - - - -var listStyle=[ -styles.list, - -{height:Math.min(rows.length,4.4)*(rowGutter+rowHeight)}]; - -return ( -React.createElement(View,{style:inspector?styles.fullScreen:listStyle}, -React.createElement(ScrollView,{style:listStyle}, -rows), - -inspector));}}]);return YellowBox;})(React.Component); - - - - - -var backgroundColor=function(opacity){return 'rgba(250, 186, 48, '+opacity+')';}; -var textColor='white'; -var rowGutter=1; -var rowHeight=46; - -var styles=StyleSheet.create({ -fullScreen:{ -backgroundColor:'transparent', -position:'absolute', -left:0, -right:0, -top:0, -bottom:0}, - -inspector:{ -backgroundColor:backgroundColor(0.95), -flex:1}, - -inspectorContainer:{ -flex:1}, - -inspectorButtons:{ -flexDirection:'row', -position:'absolute', -left:0, -right:0, -bottom:0}, - -inspectorButton:{ -flex:1, -padding:22}, - -inspectorButtonText:{ -color:textColor, -fontSize:14, -opacity:0.8, -textAlign:'center'}, - -inspectorContent:{ -flex:1, -paddingTop:5}, - -inspectorCount:{ -padding:15, -paddingBottom:0}, - -inspectorCountText:{ -color:textColor, -fontSize:14}, - -inspectorWarning:{ -padding:15, -position:'absolute', -top:39, -bottom:60}, - -inspectorWarningText:{ -color:textColor, -fontSize:16, -fontWeight:'600'}, - -list:{ -backgroundColor:'transparent', -position:'absolute', -left:0, -right:0, -bottom:0}, - -listRow:{ -position:'relative', -backgroundColor:backgroundColor(0.95), -flex:1, -height:rowHeight, -marginTop:rowGutter}, - -listRowContent:{ -flex:1}, - -listRowCount:{ -color:'rgba(255, 255, 255, 0.5)'}, - -listRowText:{ -color:textColor, -position:'absolute', -left:0, -top:Platform.OS==='android'?5:7, -marginLeft:15, -marginRight:15}}); - - - -module.exports=YellowBox; -}); -__d('RCTRenderingPerf',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var ReactDefaultPerf=require('ReactDefaultPerf'); - -var invariant=require('invariant'); - - - - - - -var perfModules=[]; -var enabled=false; - -var RCTRenderingPerf={ - -toggle:function(){ -console.log('Render perfomance measurements enabled'); -enabled=true;}, - - -start:function(){ -if(!enabled){ -return;} - - -ReactDefaultPerf.start(); -perfModules.forEach(function(module){return module.start();});}, - - -stop:function(){ -if(!enabled){ -return;} - - -ReactDefaultPerf.stop(); -ReactDefaultPerf.printInclusive(); -ReactDefaultPerf.printWasted(); - -var totalRender=0; -var totalTime=0; -var measurements=ReactDefaultPerf.getLastMeasurements(); -for(var ii=0;ii component':item.componentName, -'Inclusive time (ms)':roundFloat(item.time), -'Instances':item.count};})); - - -console.log( -'Total time:', -ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2)+' ms');}, - - - -getMeasurementsSummaryMap:function(measurements){ -var summary=ReactDefaultPerfAnalysis.getInclusiveSummary( -measurements, -true); - -return summary.map(function(item){ -return { -'Owner > component':item.componentName, -'Wasted time (ms)':item.time, -'Instances':item.count};});}, - - - - -printWasted:function(measurements){ -measurements=measurements||ReactDefaultPerf._allMeasurements; -console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements)); -console.log( -'Total time:', -ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2)+' ms');}, - - - -printDOM:function(measurements){ -measurements=measurements||ReactDefaultPerf._allMeasurements; -var summary=ReactDefaultPerfAnalysis.getDOMSummary(measurements); -console.table(summary.map(function(item){ -var result={}; -result[DOMProperty.ID_ATTRIBUTE_NAME]=item.id; -result.type=item.type; -result.args=JSON.stringify(item.args); -return result;})); - -console.log( -'Total time:', -ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2)+' ms');}, - - - -_recordWrite:function(id,fnName,totalTime,args){ - -var writes= -ReactDefaultPerf. -_allMeasurements[ReactDefaultPerf._allMeasurements.length-1]. -writes; -writes[id]=writes[id]||[]; -writes[id].push({ -type:fnName, -time:totalTime, -args:args});}, - - - -measure:function(moduleName,fnName,func){ -return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];} -var totalTime; -var rv; -var start; - -if(fnName==='_renderNewRootComponent'|| -fnName==='flushBatchedUpdates'){ - - - - -ReactDefaultPerf._allMeasurements.push({ -exclusive:{}, -inclusive:{}, -render:{}, -counts:{}, -writes:{}, -displayNames:{}, -totalTime:0, -created:{}}); - -start=performanceNow(); -rv=func.apply(this,args); -ReactDefaultPerf._allMeasurements[ -ReactDefaultPerf._allMeasurements.length-1]. -totalTime=performanceNow()-start; -return rv;}else -if(fnName==='_mountImageIntoNode'|| -moduleName==='ReactBrowserEventEmitter'|| -moduleName==='ReactDOMIDOperations'|| -moduleName==='CSSPropertyOperations'|| -moduleName==='DOMChildrenOperations'|| -moduleName==='DOMPropertyOperations'){ -start=performanceNow(); -rv=func.apply(this,args); -totalTime=performanceNow()-start; - -if(fnName==='_mountImageIntoNode'){ -var mountID=ReactMount.getID(args[1]); -ReactDefaultPerf._recordWrite(mountID,fnName,totalTime,args[0]);}else -if(fnName==='dangerouslyProcessChildrenUpdates'){ - -args[0].forEach(function(update){ -var writeArgs={}; -if(update.fromIndex!==null){ -writeArgs.fromIndex=update.fromIndex;} - -if(update.toIndex!==null){ -writeArgs.toIndex=update.toIndex;} - -if(update.textContent!==null){ -writeArgs.textContent=update.textContent;} - -if(update.markupIndex!==null){ -writeArgs.markup=args[1][update.markupIndex];} - -ReactDefaultPerf._recordWrite( -update.parentID, -update.type, -totalTime, -writeArgs);});}else - - -{ - -var id=args[0]; -if(typeof id==='object'){ -id=ReactMount.getID(args[0]);} - -ReactDefaultPerf._recordWrite( -id, -fnName, -totalTime, -Array.prototype.slice.call(args,1));} - - -return rv;}else -if(moduleName==='ReactCompositeComponent'&&( -fnName==='mountComponent'|| -fnName==='updateComponent'|| -fnName==='_renderValidatedComponent')){ - -if(this._currentElement.type===ReactMount.TopLevelWrapper){ -return func.apply(this,args);} - - -var rootNodeID=fnName==='mountComponent'? -args[0]: -this._rootNodeID; -var isRender=fnName==='_renderValidatedComponent'; -var isMount=fnName==='mountComponent'; - -var mountStack=ReactDefaultPerf._mountStack; -var entry=ReactDefaultPerf._allMeasurements[ -ReactDefaultPerf._allMeasurements.length-1]; - - -if(isRender){ -addValue(entry.counts,rootNodeID,1);}else -if(isMount){ -entry.created[rootNodeID]=true; -mountStack.push(0);} - - -start=performanceNow(); -rv=func.apply(this,args); -totalTime=performanceNow()-start; - -if(isRender){ -addValue(entry.render,rootNodeID,totalTime);}else -if(isMount){ -var subMountTime=mountStack.pop(); -mountStack[mountStack.length-1]+=totalTime; -addValue(entry.exclusive,rootNodeID,totalTime-subMountTime); -addValue(entry.inclusive,rootNodeID,totalTime);}else -{ -addValue(entry.inclusive,rootNodeID,totalTime);} - - -entry.displayNames[rootNodeID]={ -current:this.getName(), -owner:this._currentElement._owner? -this._currentElement._owner.getName(): -''}; - - -return rv;}else -{ -return func.apply(this,args);}};}}; - - - - - -module.exports=ReactDefaultPerf; -}); -__d('DOMProperty',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var invariant=require('invariant'); - -function checkMask(value,bitmask){ -return (value&bitmask)===bitmask;} - - -var DOMPropertyInjection={ - - - - -MUST_USE_ATTRIBUTE:0x1, -MUST_USE_PROPERTY:0x2, -HAS_SIDE_EFFECTS:0x4, -HAS_BOOLEAN_VALUE:0x8, -HAS_NUMERIC_VALUE:0x10, -HAS_POSITIVE_NUMERIC_VALUE:0x20|0x10, -HAS_OVERLOADED_BOOLEAN_VALUE:0x40, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -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){ -invariant( -!DOMProperty.properties.hasOwnProperty(propName), -'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); - - -var lowerCased=propName.toLowerCase(); -var propConfig=Properties[propName]; - -var propertyInfo={ -attributeName:lowerCased, -attributeNamespace:null, -propertyName:propName, -mutationMethod:null, - -mustUseAttribute:checkMask(propConfig,Injection.MUST_USE_ATTRIBUTE), -mustUseProperty:checkMask(propConfig,Injection.MUST_USE_PROPERTY), -hasSideEffects:checkMask(propConfig,Injection.HAS_SIDE_EFFECTS), -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)}; - - -invariant( -!propertyInfo.mustUseAttribute||!propertyInfo.mustUseProperty, -'DOMProperty: Cannot require using both attribute and property: %s', -propName); - -invariant( -propertyInfo.mustUseProperty||!propertyInfo.hasSideEffects, -'DOMProperty: Properties that have side effects must use property: %s', -propName); - -invariant( -propertyInfo.hasBooleanValue+propertyInfo.hasNumericValue+ -propertyInfo.hasOverloadedBooleanValue<=1, -'DOMProperty: Value can be one of boolean, overloaded boolean, or '+ -'numeric value, but not a combination: %s', -propName); - - -if(__DEV__){ -DOMProperty.getPossibleStandardName[lowerCased]=propName;} - - -if(DOMAttributeNames.hasOwnProperty(propName)){ -var attributeName=DOMAttributeNames[propName]; -propertyInfo.attributeName=attributeName; -if(__DEV__){ -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;}}}; - - - -var defaultValueCache={}; - - - - - - - - - - - - - - -var DOMProperty={ - -ID_ATTRIBUTE_NAME:'data-reactid', - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -properties:{}, - - - - - - -getPossibleStandardName:__DEV__?{}:null, - - - - -_isCustomAttributeFunctions:[], - - - - - -isCustomAttribute:function(attributeName){ -for(var i=0;i=DONT_CARE_THRESHOLD){ -arr.push(candidates[displayName]);}} - - - -arr.sort(function(a,b){ -return b.exclusive-a.exclusive;}); - - -return arr;} - - -function getInclusiveSummary(measurements,onlyClean){ -var candidates={}; -var inclusiveKey; - -for(var i=0;i '+displayName.current; - -candidates[inclusiveKey]=candidates[inclusiveKey]||{ -componentName:inclusiveKey, -time:0, -count:0}; - - -if(measurement.inclusive[id]){ -candidates[inclusiveKey].time+=measurement.inclusive[id];} - -if(measurement.counts[id]){ -candidates[inclusiveKey].count+=measurement.counts[id];}}} - - - - - -var arr=[]; -for(inclusiveKey in candidates){ -if(candidates[inclusiveKey].time>=DONT_CARE_THRESHOLD){ -arr.push(candidates[inclusiveKey]);}} - - - -arr.sort(function(a,b){ -return b.time-a.time;}); - - -return arr;} - - -function getUnchangedComponents(measurement){ - - - -var cleanComponents={}; -var dirtyLeafIDs=Object.keys(measurement.writes); -var allIDs=assign({},measurement.exclusive,measurement.inclusive); - -for(var id in allIDs){ -var isDirty=false; - - -for(var i=0;i0){ -cleanComponents[id]=true;}} - - -return cleanComponents;} - - -var ReactDefaultPerfAnalysis={ -getExclusiveSummary:getExclusiveSummary, -getInclusiveSummary:getInclusiveSummary, -getDOMSummary:getDOMSummary, -getTotalTime:getTotalTime}; - - -module.exports=ReactDefaultPerfAnalysis; -}); -__d('ReactMount',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var DOMProperty=require('DOMProperty'); -var ReactBrowserEventEmitter=require('ReactBrowserEventEmitter'); -var ReactCurrentOwner=require('ReactCurrentOwner'); -var ReactDOMFeatureFlags=require('ReactDOMFeatureFlags'); -var ReactElement=require('ReactElement'); -var ReactEmptyComponentRegistry=require('ReactEmptyComponentRegistry'); -var ReactInstanceHandles=require('ReactInstanceHandles'); -var ReactInstanceMap=require('ReactInstanceMap'); -var ReactMarkupChecksum=require('ReactMarkupChecksum'); -var ReactPerf=require('ReactPerf'); -var ReactReconciler=require('ReactReconciler'); -var ReactUpdateQueue=require('ReactUpdateQueue'); -var ReactUpdates=require('ReactUpdates'); - -var assign=require('Object.assign'); -var emptyObject=require('emptyObject'); -var containsNode=require('containsNode'); -var instantiateReactComponent=require('instantiateReactComponent'); -var invariant=require('invariant'); -var setInnerHTML=require('setInnerHTML'); -var shouldUpdateReactComponent=require('shouldUpdateReactComponent'); -var validateDOMNesting=require('validateDOMNesting'); -var warning=require('warning'); - -var ATTR_NAME=DOMProperty.ID_ATTRIBUTE_NAME; -var nodeCache={}; - -var ELEMENT_NODE_TYPE=1; -var DOC_NODE_TYPE=9; -var DOCUMENT_FRAGMENT_NODE_TYPE=11; - -var ownerDocumentContextKey= -'__ReactMount_ownerDocument$'+Math.random().toString(36).slice(2); - - - -var instancesByReactRootID={}; - - -var containersByReactRootID={}; - -if(__DEV__){ - -var rootElementsByReactRootID={};} - - - -var findComponentRootReusableArray=[]; - - - - - - - -function firstDifferenceIndex(string1,string2){ -var minLen=Math.min(string1.length,string2.length); -for(var i=0;i when using tables, nesting tags '+ -'like ,

, or , or using non-SVG elements in an '+ -'parent. '+ -'Try inspecting the child nodes of the element with React ID `%s`.', -targetID, -ReactMount.getID(ancestorNode));}, - - - -_mountImageIntoNode:function( -markup, -container, -shouldReuseMarkup, -transaction) -{ -invariant( -container&&( -container.nodeType===ELEMENT_NODE_TYPE|| -container.nodeType===DOC_NODE_TYPE|| -container.nodeType===DOCUMENT_FRAGMENT_NODE_TYPE), - -'mountComponentIntoNode(...): Target container is not valid.'); - - -if(shouldReuseMarkup){ -var rootElement=getReactRootElementInContainer(container); -if(ReactMarkupChecksum.canReuseMarkup(markup,rootElement)){ -return;}else -{ -var checksum=rootElement.getAttribute( -ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - -rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - -var rootMarkup=rootElement.outerHTML; -rootElement.setAttribute( -ReactMarkupChecksum.CHECKSUM_ATTR_NAME, -checksum); - - -var normalizedMarkup=markup; -if(__DEV__){ - - - - -var normalizer; -if(container.nodeType===ELEMENT_NODE_TYPE){ -normalizer=document.createElement('div'); -normalizer.innerHTML=markup; -normalizedMarkup=normalizer.innerHTML;}else -{ -normalizer=document.createElement('iframe'); -document.body.appendChild(normalizer); -normalizer.contentDocument.write(markup); -normalizedMarkup=normalizer.contentDocument.documentElement.outerHTML; -document.body.removeChild(normalizer);}} - - - -var diffIndex=firstDifferenceIndex(normalizedMarkup,rootMarkup); -var difference=' (client) '+ -normalizedMarkup.substring(diffIndex-20,diffIndex+20)+ -'\n (server) '+rootMarkup.substring(diffIndex-20,diffIndex+20); - -invariant( -container.nodeType!==DOC_NODE_TYPE, -'You\'re trying to render a component to the document using '+ -'server rendering but the checksum was invalid. This usually '+ -'means you rendered a different component type or props on '+ -'the client from the one on the server, or your render() '+ -'methods are impure. React cannot handle this case due to '+ -'cross-browser quirks by rendering at the document root. You '+ -'should look for environment dependent code in your components '+ -'and ensure the props are the same client and server side:\n%s', -difference); - - -if(__DEV__){ -warning( -false, -'React attempted to reuse markup in a container but the '+ -'checksum was invalid. This generally means that you are '+ -'using server rendering and the markup generated on the '+ -'server was not what the client was expecting. React injected '+ -'new markup to compensate which works but you have lost many '+ -'of the benefits of server rendering. Instead, figure out '+ -'why the markup being generated is different on the client '+ -'or server:\n%s', -difference);}}} - - - - - -invariant( -container.nodeType!==DOC_NODE_TYPE, -'You\'re trying to render a component to the document but '+ -'you didn\'t use server rendering. We can\'t do this '+ -'without using server rendering due to cross-browser quirks. '+ -'See ReactDOMServer.renderToString() for server rendering.'); - - -if(transaction.useCreateElement){ -while(container.lastChild){ -container.removeChild(container.lastChild);} - -container.appendChild(markup);}else -{ -setInnerHTML(container,markup);}}, - - - -ownerDocumentContextKey:ownerDocumentContextKey, - - - - - -getReactRootID:getReactRootID, - -getID:getID, - -setID:setID, - -getNode:getNode, - -getNodeFromInstance:getNodeFromInstance, - -isValid:isValid, - -purgeID:purgeID}; - - -ReactPerf.measureMethods(ReactMount,'ReactMount',{ -_renderNewRootComponent:'_renderNewRootComponent', -_mountImageIntoNode:'_mountImageIntoNode'}); - - -module.exports=ReactMount; -}); -__d('ReactBrowserEventEmitter',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var EventConstants=require('EventConstants'); -var EventPluginHub=require('EventPluginHub'); -var EventPluginRegistry=require('EventPluginRegistry'); -var ReactEventEmitterMixin=require('ReactEventEmitterMixin'); -var ReactPerf=require('ReactPerf'); -var ViewportMetrics=require('ViewportMetrics'); - -var assign=require('Object.assign'); -var isEventSupported=require('isEventSupported'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var alreadyListeningTo={}; -var isMonitoringScrollValue=false; -var reactTopListenersCounter=0; - - - - -var topEventMapping={ -topAbort:'abort', -topBlur:'blur', -topCanPlay:'canplay', -topCanPlayThrough:'canplaythrough', -topChange:'change', -topClick:'click', -topCompositionEnd:'compositionend', -topCompositionStart:'compositionstart', -topCompositionUpdate:'compositionupdate', -topContextMenu:'contextmenu', -topCopy:'copy', -topCut:'cut', -topDoubleClick:'dblclick', -topDrag:'drag', -topDragEnd:'dragend', -topDragEnter:'dragenter', -topDragExit:'dragexit', -topDragLeave:'dragleave', -topDragOver:'dragover', -topDragStart:'dragstart', -topDrop:'drop', -topDurationChange:'durationchange', -topEmptied:'emptied', -topEncrypted:'encrypted', -topEnded:'ended', -topError:'error', -topFocus:'focus', -topInput:'input', -topKeyDown:'keydown', -topKeyPress:'keypress', -topKeyUp:'keyup', -topLoadedData:'loadeddata', -topLoadedMetadata:'loadedmetadata', -topLoadStart:'loadstart', -topMouseDown:'mousedown', -topMouseMove:'mousemove', -topMouseOut:'mouseout', -topMouseOver:'mouseover', -topMouseUp:'mouseup', -topPaste:'paste', -topPause:'pause', -topPlay:'play', -topPlaying:'playing', -topProgress:'progress', -topRateChange:'ratechange', -topScroll:'scroll', -topSeeked:'seeked', -topSeeking:'seeking', -topSelectionChange:'selectionchange', -topStalled:'stalled', -topSuspend:'suspend', -topTextInput:'textInput', -topTimeUpdate:'timeupdate', -topTouchCancel:'touchcancel', -topTouchEnd:'touchend', -topTouchMove:'touchmove', -topTouchStart:'touchstart', -topVolumeChange:'volumechange', -topWaiting:'waiting', -topWheel:'wheel'}; - - - - - -var topListenersIDKey='_reactListenersID'+String(Math.random()).slice(2); - -function getListeningForDocument(mountAt){ - - -if(!Object.prototype.hasOwnProperty.call(mountAt,topListenersIDKey)){ -mountAt[topListenersIDKey]=reactTopListenersCounter++; -alreadyListeningTo[mountAt[topListenersIDKey]]={};} - -return alreadyListeningTo[mountAt[topListenersIDKey]];} - - - - - - - - - - - - -var ReactBrowserEventEmitter=assign({},ReactEventEmitterMixin,{ - - - - -ReactEventListener:null, - -injection:{ - - - -injectReactEventListener:function(ReactEventListener){ -ReactEventListener.setHandleTopLevel( -ReactBrowserEventEmitter.handleTopLevel); - -ReactBrowserEventEmitter.ReactEventListener=ReactEventListener;}}, - - - - - - - - -setEnabled:function(enabled){ -if(ReactBrowserEventEmitter.ReactEventListener){ -ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);}}, - - - - - - -isEnabled:function(){ -return !!( -ReactBrowserEventEmitter.ReactEventListener&& -ReactBrowserEventEmitter.ReactEventListener.isEnabled());}, - - - - - - - - - - - - - - - - - - - - - - - - -listenTo:function(registrationName,contentDocumentHandle){ -var mountAt=contentDocumentHandle; -var isListening=getListeningForDocument(mountAt); -var dependencies= -EventPluginRegistry.registrationNameDependencies[registrationName]; - -var topLevelTypes=EventConstants.topLevelTypes; -for(var i=0;i/; - -var ReactMarkupChecksum={ -CHECKSUM_ATTR_NAME:'data-react-checksum', - - - - - -addChecksumToMarkup:function(markup){ -var checksum=adler32(markup); - - -return markup.replace( -TAG_END, -' '+ReactMarkupChecksum.CHECKSUM_ATTR_NAME+'="'+checksum+'"$&');}, - - - - - - - - -canReuseMarkup:function(markup,element){ -var existingChecksum=element.getAttribute( -ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - -existingChecksum=existingChecksum&&parseInt(existingChecksum,10); -var markupChecksum=adler32(markup); -return markupChecksum===existingChecksum;}}; - - - -module.exports=ReactMarkupChecksum; -}); -__d('adler32',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var MOD=65521; - - - - - - -function adler32(data){ -var a=1; -var b=0; -var i=0; -var l=data.length; -var m=l&~0x3; -while(i]/; - - - - - - - - - -var setInnerHTML=function(node,html){ -node.innerHTML=html;}; - - - -if(typeof MSApp!=='undefined'&&MSApp.execUnsafeLocalFunction){ -setInnerHTML=function(node,html){ -MSApp.execUnsafeLocalFunction(function(){ -node.innerHTML=html;});};} - - - - -if(ExecutionEnvironment.canUseDOM){ - - - - - - -var testElement=document.createElement('div'); -testElement.innerHTML=' '; -if(testElement.innerHTML===''){ -setInnerHTML=function(node,html){ - - - - - -if(node.parentNode){ -node.parentNode.replaceChild(node,node);} - - - - - - -if(WHITESPACE_TEST.test(html)|| -html[0]==='<'&&NONVISIBLE_TEST.test(html)){ - - - - - - -node.innerHTML=String.fromCharCode(0xFEFF)+html; - - - -var textNode=node.firstChild; -if(textNode.data.length===1){ -node.removeChild(textNode);}else -{ -textNode.deleteData(0,1);}}else - -{ -node.innerHTML=html;}};}} - - - - - -module.exports=setInnerHTML; -}); -__d('validateDOMNesting',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var assign=require('Object.assign'); -var emptyFunction=require('emptyFunction'); -var warning=require('warning'); - -var validateDOMNesting=emptyFunction; - -if(__DEV__){ - - - - - - - - - - - - -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']; - - - -var inScopeTags=[ -'applet','caption','html','table','td','th','marquee','object', -'template', - - - - -'foreignObject','desc','title']; - - - -var buttonScopeTags=inScopeTags.concat(['button']); - - -var impliedEndTags= -['dd','dt','li','option','optgroup','p','rp','rt']; - -var emptyAncestorInfo={ -parentTag: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;} - - - - -if( -specialTags.indexOf(tag)!==-1&& -tag!=='address'&&tag!=='div'&&tag!=='p') -{ -ancestorInfo.listItemTagAutoclosing=null; -ancestorInfo.dlItemTagAutoclosing=null;} - - -ancestorInfo.parentTag=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;}; - - - - - -var isTagValidWithParent=function(tag,parentTag){ - -switch(parentTag){ - -case 'select': -return tag==='option'||tag==='optgroup'||tag==='#text'; -case 'optgroup': -return tag==='option'||tag==='#text'; - - -case 'option': -return tag==='#text'; - - - - - - - -case 'tr': -return ( -tag==='th'||tag==='td'||tag==='style'||tag==='script'|| -tag==='template'); - - - -case 'tbody': -case 'thead': -case 'tfoot': -return ( -tag==='tr'||tag==='style'||tag==='script'|| -tag==='template'); - - - -case 'colgroup': -return tag==='col'||tag==='template'; - - -case 'table': -return ( -tag==='caption'||tag==='colgroup'||tag==='tbody'|| -tag==='tfoot'||tag==='thead'||tag==='style'|| -tag==='script'||tag==='template'); - - - -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'); - - - -case 'html': -return tag==='head'||tag==='body';} - - - - - -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 'caption': -case 'col': -case 'colgroup': -case 'frame': -case 'head': -case 'tbody': -case 'td': -case 'tfoot': -case 'th': -case 'thead': -case 'tr': - - - - -return parentTag==null;} - - -return true;}; - - - - - -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': - - -return ancestorInfo.aTagInScope; - -case 'nobr': -return ancestorInfo.nobrTagInScope;} - - -return null;}; - - - - - - -var findOwnerStack=function(instance){ -if(!instance){ -return [];} - - -var stack=[]; - -do { - -stack.push(instance);}while( -instance=instance._currentElement._owner); -stack.reverse(); -return stack;}; - - -var didWarn={}; - -validateDOMNesting=function(childTag,childInstance,ancestorInfo){ -ancestorInfo=ancestorInfo||emptyAncestorInfo; -var parentInfo=ancestorInfo.parentTag; -var parentTag=parentInfo&&parentInfo.tag; - -var invalidParent= -isTagValidWithParent(childTag,parentTag)?null:parentInfo; -var invalidAncestor= -invalidParent?null:findInvalidAncestorForTag(childTag,ancestorInfo); -var problematic=invalidParent||invalidAncestor; - -if(problematic){ -var ancestorTag=problematic.tag; -var ancestorInstance=problematic.instance; - -var childOwner=childInstance&&childInstance._currentElement._owner; -var ancestorOwner= -ancestorInstance&&ancestorInstance._currentElement._owner; - -var childOwners=findOwnerStack(childOwner); -var ancestorOwners=findOwnerStack(ancestorOwner); - -var minStackLen=Math.min(childOwners.length,ancestorOwners.length); -var i; - -var deepestCommon=-1; -for(i=0;i '); - -var warnKey= -!!invalidParent+'|'+childTag+'|'+ancestorTag+'|'+ownerInfo; -if(didWarn[warnKey]){ -return;} - -didWarn[warnKey]=true; - -if(invalidParent){ -var info=''; -if(ancestorTag==='table'&&childTag==='tr'){ -info+= -' Add a to your code to match the DOM tree generated by '+ -'the browser.';} - -warning( -false, -'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. '+ -'See %s.%s', -childTag, -ancestorTag, -ownerInfo, -info);}else - -{ -warning( -false, -'validateDOMNesting(...): <%s> cannot appear as a descendant of '+ -'<%s>. See %s.', -childTag, -ancestorTag, -ownerInfo);}}}; - - - - - -validateDOMNesting.ancestorInfoContextKey= -'__validateDOMNesting_ancestorInfo$'+Math.random().toString(36).slice(2); - -validateDOMNesting.updatedAncestorInfo=updatedAncestorInfo; - - -validateDOMNesting.isTagValidInContext=function(tag,ancestorInfo){ -ancestorInfo=ancestorInfo||emptyAncestorInfo; -var parentInfo=ancestorInfo.parentTag; -var parentTag=parentInfo&&parentInfo.tag; -return ( -isTagValidWithParent(tag,parentTag)&& -!findInvalidAncestorForTag(tag,ancestorInfo));};} - - - - -module.exports=validateDOMNesting; -}); -__d('AppStateIOS',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - -var Map=require('Map'); -var NativeModules=require('NativeModules'); -var RCTDeviceEventEmitter=require('RCTDeviceEventEmitter'); -var RCTAppState=NativeModules.AppState; - -var logError=require('logError'); -var invariant=require('invariant'); - -var _eventHandlers={ -change:new Map(), -memoryWarning:new Map()}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var AppStateIOS={ - - - - - -addEventListener:function( -type, -handler) -{ -invariant( -['change','memoryWarning'].indexOf(type)!==-1, -'Trying to subscribe to unknown event: "%s"',type); - -if(type==='change'){ -_eventHandlers[type].set(handler,RCTDeviceEventEmitter.addListener( -'appStateDidChange', -function(appStateData){ -handler(appStateData.app_state);}));}else - - -if(type==='memoryWarning'){ -_eventHandlers[type].set(handler,RCTDeviceEventEmitter.addListener( -'memoryWarning', -handler));}}, - - - - - - - -removeEventListener:function( -type, -handler) -{ -invariant( -['change','memoryWarning'].indexOf(type)!==-1, -'Trying to remove listener for unknown event: "%s"',type); - -if(!_eventHandlers[type].has(handler)){ -return;} - -_eventHandlers[type].get(handler).remove(); -_eventHandlers[type].delete(handler);}, - - - - - - -currentState:'active'}; - - - -RCTDeviceEventEmitter.addListener( -'appStateDidChange', -function(appStateData){ -AppStateIOS.currentState=appStateData.app_state;}); - - - -RCTAppState.getCurrentAppState( -function(appStateData){ -AppStateIOS.currentState=appStateData.app_state;}, - -logError); - - -module.exports=AppStateIOS; -}); -__d('AsyncStorage',function(global, require, module, exports) { 'use strict'; - - - - - - - - - - - - - -var NativeModules=require('NativeModules'); -var RCTAsyncSQLiteStorage=NativeModules.AsyncSQLiteDBStorage; -var RCTAsyncRocksDBStorage=NativeModules.AsyncRocksDBStorage; -var RCTAsyncFileStorage=NativeModules.AsyncLocalStorage; - - -var RCTAsyncStorage=RCTAsyncRocksDBStorage||RCTAsyncSQLiteStorage||RCTAsyncFileStorage; - - - - - - - - - - - - - -var AsyncStorage={ -_getRequests:[], -_getKeys:[], -_immediate:null, - - - - - -getItem:function( -key, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiGet([key],function(errors,result){ - -var value=result&&result[0]&&result[0][1]?result[0][1]:null; -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0],value); -if(errs){ -reject(errs[0]);}else -{ -resolve(value);}});});}, - - - - - - - - - -setItem:function( -key, -value, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiSet([[key,value]],function(errors){ -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0]); -if(errs){ -reject(errs[0]);}else -{ -resolve(null);}});});}, - - - - - - - - -removeItem:function( -key, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiRemove([key],function(errors){ -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0]); -if(errs){ -reject(errs[0]);}else -{ -resolve(null);}});});}, - - - - - - - - - -mergeItem:function( -key, -value, -callback) -{ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.multiMerge([[key,value]],function(errors){ -var errs=convertErrors(errors); -callback&&callback(errs&&errs[0]); -if(errs){ -reject(errs[0]);}else -{ -resolve(null);}});});}, - - - - - - - - - - -clear:function(callback){ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.clear(function(error){ -callback&&callback(convertError(error)); -if(error&&convertError(error)){ -reject(convertError(error));}else -{ -resolve(null);}});});}, - - - - - - - - -getAllKeys:function(callback){ -return new Promise(function(resolve,reject){ -RCTAsyncStorage.getAllKeys(function(error,keys){ -callback&&callback(convertError(error),keys); -if(error){ -reject(convertError(error));}else -{ -resolve(keys);}});});}, - - - - - - - - - - - - - - - - -flushGetRequests:function(){ -var getRequests=this._getRequests; -var getKeys=this._getKeys; - -this._getRequests=[]; -this._getKeys=[]; - -RCTAsyncStorage.multiGet(getKeys,function(errors,result){ - - - -var reqLength=getRequests.length;var _loop=function( -i){ -var request=getRequests[i]; -var requestKeys=request.keys; -requestResult=result.filter(function(resultPair){ -return requestKeys.indexOf(resultPair[0])!==-1;}); - - -request.callback&&request.callback(null,requestResult); -request.resolve&&request.resolve(requestResult);};for(var i=0;i1){ -for(var ii=1;ii