text: var requirejs,require,define;(function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.11",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!!(typeof window!=="undefined"&&typeof navigator!=="undefined"&&window.document),isWebWorker=!isBrowser&&typeof importScripts!=="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=false;function isFunction(it){return ostring.call(it)==="[object Function]"}function isArray(it){return ostring.call(it)==="[object Array]"}function each(ary,func){if(ary){var i;for(i=0;i<ary.length;i+=1){if(ary[i]&&func(ary[i],i,ary)){break}}}}function eachReverse(ary,func){if(ary){var i;for(i=ary.length-1;i>-1;i-=1){if(ary[i]&&func(ary[i],i,ary)){break}}}}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return hasProp(obj,prop)&&obj[prop]}function eachProp(obj,func){var prop;for(prop in obj){if(hasProp(obj,prop)){if(func(obj[prop],prop)){break}}}}function mixin(target,source,force,deepStringMixin){if(source){eachProp(source,function(value,prop){if(force||!hasProp(target,prop)){if(deepStringMixin&&typeof value==="object"&&value&&!isArray(value)&&!isFunction(value)&&!(value instanceof RegExp)){if(!target[prop]){target[prop]={}}mixin(target[prop],value,force,deepStringMixin)}else{target[prop]=value}}})}return target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(err){throw err}function getGlobal(value){if(!value){return value}var g=global;each(value.split("."),function(part){g=g[part]});return g}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);e.requireType=id;e.requireModules=requireModules;if(err){e.originalError=err}return e}if(typeof define!=="undefined"){return}if(typeof requirejs!=="undefined"){if(isFunction(requirejs)){return}cfg=requirejs;requirejs=undefined}if(typeof require!=="undefined"&&!isFunction(require)){cfg=require;require=undefined}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},registry={},enabledRegistry={},undefEvents={},defQueue=[],defined={},urlFetched={},bundlesMap={},requireCounter=1,unnormalizedCounter=1;function trimDots(ary){var i,part,length=ary.length;for(i=0;i<length;i++){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName,applyMap){var pkgMain,mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),normalizedBaseParts=baseParts,map=config.map,starMap=map&&map["*"];if(name&&name.charAt(0)==="."){if(baseName){normalizedBaseParts=baseParts.slice(0,baseParts.length-1);name=name.split("/");lastIndex=name.length-1;if(config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])){name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")}name=normalizedBaseParts.concat(name);trimDots(name);name=name.join("/")}else if(name.indexOf("./")===0){name=name.substring(2)}}if(applyMap&&map&&(baseParts||starMap)){nameParts=name.split("/");outerLoop:for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=getOwn(map,baseParts.slice(0,j).join("/"));if(mapValue){mapValue=getOwn(mapValue,nameSegment);if(mapValue){foundMap=mapValue;foundI=i;break outerLoop}}}}if(!foundStarMap&&starMap&&getOwn(starMap,nameSegment)){foundStarMap=getOwn(starMap,nameSegment);starI=i}}if(!foundMap&&foundStarMap){foundMap=foundStarMap;foundI=starI}if(foundMap){nameParts.splice(0,foundI,foundMap);name=nameParts.join("/")}}pkgMain=getOwn(config.pkgs,name);return pkgMain?pkgMain:name}function removeScript(name){if(isBrowser){each(scripts(),function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName){scriptNode.parentNode.removeChild(scriptNode);return true}})}}function hasPathFallback(id){var pathConfig=getOwn(config.paths,id);if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1){pathConfig.shift();context.require.undef(id);context.require([id]);return true}}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;if(index>-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}return[prefix,name]}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,nameParts,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=true,normalizedName="";if(!name){isDefine=false;name="_@r"+(requireCounter+=1)}nameParts=splitPrefix(name);prefix=nameParts[0];name=nameParts[1];if(prefix){prefix=normalize(prefix,parentName,applyMap);pluginModule=getOwn(defined,prefix)}if(name){if(prefix){if(pluginModule&&pluginModule.normalize){normalizedName=pluginModule.normalize(name,function(name){return normalize(name,parentName,applyMap)})}else{normalizedName=normalize(name,parentName,applyMap)}}else{normalizedName=normalize(name,parentName,applyMap);nameParts=splitPrefix(normalizedName);prefix=nameParts[0];normalizedName=nameParts[1];isNormalized=true;url=context.nameToUrl(normalizedName)}}suffix=prefix&&!pluginModule&&!isNormalized?"_unnormalized"+(unnormalizedCounter+=1):"";return{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!suffix,url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=getOwn(registry,id);if(!mod){mod=registry[id]=new context.Module(depMap)}return mod}function on(depMap,name,fn){var id=depMap.id,mod=getOwn(registry,id);if(hasProp(defined,id)&&(!mod||mod.defineEmitComplete)){if(name==="defined"){fn(defined[id])}}else{mod=getModule(depMap);if(mod.error&&name==="error"){fn(mod.error)}else{mod.on(name,fn)}}}function onError(err,errback){var ids=err.requireModules,notified=false;if(errback){errback(err)}else{each(ids,function(id){var mod=getOwn(registry,id);if(mod){mod.error=err;if(mod.events.error){notified=true;mod.emit("error",err)}}});if(!notified){req.onError(err)}}}function takeGlobalQueue(){if(globalDefQueue.length){apsp.apply(defQueue,[defQueue.length,0].concat(globalDefQueue));globalDefQueue=[]}}handlers={require:function(mod){if(mod.require){return mod.require}else{return mod.require=context.makeRequire(mod.map)}},exports:function(mod){mod.usingExports=true;if(mod.map.isDefine){if(mod.exports){return defined[mod.map.id]=mod.exports}else{return mod.exports=defined[mod.map.id]={}}}},module:function(mod){if(mod.module){return mod.module}else{return mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return getOwn(config.config,mod.map.id)||{}},exports:mod.exports||(mod.exports={})}}}};function cleanRegistry(id){delete registry[id];delete enabledRegistry[id]}function breakCycle(mod,traced,processed){var id=mod.map.id;if(mod.error){mod.emit("error",mod.error)}else{traced[id]=true;each(mod.depMaps,function(depMap,i){var depId=depMap.id,dep=getOwn(registry,depId);if(dep&&!mod.depMatched[i]&&!processed[depId]){if(getOwn(traced,depId)){mod.defineDep(i,defined[depId]);mod.check()}else{breakCycle(dep,traced,processed)}}});processed[id]=true}}function checkLoaded(){var err,usingPathFallback,waitInterval=config.waitSeconds*1e3,expired=waitInterval&&context.startTime+waitInterval<(new Date).getTime(),noLoads=[],reqCalls=[],stillLoading=false,needCycleCheck=true;if(inCheckLoaded){return}inCheckLoaded=true;eachProp(enabledRegistry,function(mod){var map=mod.map,modId=map.id;if(!mod.enabled){return}if(!map.isDefine){reqCalls.push(mod)}if(!mod.error){if(!mod.inited&&expired){if(hasPathFallback(modId)){usingPathFallback=true;stillLoading=true}else{noLoads.push(modId);removeScript(modId)}}else if(!mod.inited&&mod.fetched&&map.isDefine){stillLoading=true;if(!map.prefix){return needCycleCheck=false}}}});if(expired&&noLoads.length){err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads);err.contextName=context.contextName;return onError(err)}if(needCycleCheck){each(reqCalls,function(mod){breakCycle(mod,{},{})})}if((!expired||usingPathFallback)&&stillLoading){if((isBrowser||isWebWorker)&&!checkLoadedTimeoutId){checkLoadedTimeoutId=setTimeout(function(){checkLoadedTimeoutId=0;checkLoaded()},50)}}inCheckLoaded=false}Module=function(map){this.events=getOwn(undefEvents,map.id)||{};this.map=map;this.shim=getOwn(config.shim,map.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Module.prototype={init:function(depMaps,factory,errback,options){options=options||{};if(this.inited){return}this.factory=factory;if(errback){this.on("error",errback)}else if(this.events.error){errback=bind(this,function(err){this.emit("error",err)})}this.depMaps=depMaps&&depMaps.slice(0);this.errback=errback;this.inited=true;this.ignore=options.ignore;if(options.enabled||this.enabled){this.enable()}else{this.check()}},defineDep:function(i,depExports){if(!this.depMatched[i]){this.depMatched[i]=true;this.depCount-=1;this.depExports[i]=depExports}},fetch:function(){if(this.fetched){return}this.fetched=true;context.startTime=(new Date).getTime();var map=this.map;if(this.shim){context.makeRequire(this.map,{enableBuildCallback:true})(this.shim.deps||[],bind(this,function(){return map.prefix?this.callPlugin():this.load()}))}else{return map.prefix?this.callPlugin():this.load()}},load:function(){var url=this.map.url;if(!urlFetched[url]){urlFetched[url]=true;context.load(this.map.id,url)}},check:function(){if(!this.enabled||this.enabling){return}var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(!this.inited){this.fetch()}else if(this.error){this.emit("error",this.error)}else if(!this.defining){this.defining=true;if(this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError){try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}}else{exports=context.execCb(id,factory,depExports,exports)}if(this.map.isDefine&&exports===undefined){cjsModule=this.module;if(cjsModule){exports=cjsModule.exports}else if(this.usingExports){exports=this.exports}}if(err){err.requireMap=this.map;err.requireModules=this.map.isDefine?[this.map.id]:null;err.requireType=this.map.isDefine?"define":"require";return onError(this.error=err)}}else{exports=factory}this.exports=exports;if(this.map.isDefine&&!this.ignore){defined[id]=exports;if(req.onResourceLoad){req.onResourceLoad(context,this.map,this.depMaps)}}cleanRegistry(id);this.defined=true}this.defining=false;if(this.defined&&!this.defineEmitted){this.defineEmitted=true;this.emit("defined",this.exports);this.defineEmitComplete=true}}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix);this.depMaps.push(pluginMap);on(pluginMap,"defined",bind(this,function(plugin){var load,normalizedMap,normalizedMod,bundleId=getOwn(bundlesMap,this.map.id),name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null,localRequire=context.makeRequire(map.parentMap,{enableBuildCallback:true});if(this.map.unnormalized){if(plugin.normalize){name=plugin.normalize(name,function(name){return normalize(name,parentName,true)})||""}normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap);on(normalizedMap,"defined",bind(this,function(value){this.init([],function(){return value},null,{enabled:true,ignore:true})}));normalizedMod=getOwn(registry,normalizedMap.id);if(normalizedMod){this.depMaps.push(normalizedMap);if(this.events.error){normalizedMod.on("error",bind(this,function(err){this.emit("error",err)}))}normalizedMod.enable()}return}if(bundleId){this.map.url=context.nameToUrl(bundleId);this.load();return}load=bind(this,function(value){this.init([],function(){return value},null,{enabled:true})});load.error=bind(this,function(err){this.inited=true;this.error=err;err.requireModules=[id];eachProp(registry,function(mod){if(mod.map.id.indexOf(id+"_unnormalized")===0){cleanRegistry(mod.map.id)}});onError(err)});load.fromText=bind(this,function(text,textAlt){var moduleName=map.name,moduleMap=makeModuleMap(moduleName),hasInteractive=useInteractive;if(textAlt){text=textAlt}if(hasInteractive){useInteractive=false}getModule(moduleMap);if(hasProp(config.config,id)){config.config[moduleName]=config.config[id]}try{req.exec(text)}catch(e){return onError(makeError("fromtexteval","fromText eval for "+id+" failed: "+e,e,[id]))}if(hasInteractive){useInteractive=true}this.depMaps.push(moduleMap);context.completeLoad(moduleName);localRequire([moduleName],load)});plugin.load(map.name,localRequire,load,config)}));context.enable(pluginMap,this);this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){enabledRegistry[this.map.id]=this;this.enabled=true;this.enabling=true;each(this.depMaps,bind(this,function(depMap,i){var id,mod,handler;if(typeof depMap==="string"){depMap=makeModuleMap(depMap,this.map.isDefine?this.map:this.map.parentMap,false,!this.skipMap);this.depMaps[i]=depMap;handler=getOwn(handlers,depMap.id);if(handler){this.depExports[i]=handler(this);return}this.depCount+=1;on(depMap,"defined",bind(this,function(depExports){this.defineDep(i,depExports);this.check()}));if(this.errback){on(depMap,"error",bind(this,this.errback))}}id=depMap.id;mod=registry[id];if(!hasProp(handlers,id)&&mod&&!mod.enabled){context.enable(depMap,this)}}));eachProp(this.pluginMaps,bind(this,function(pluginMap){var mod=getOwn(registry,pluginMap.id);if(mod&&!mod.enabled){context.enable(pluginMap,this)}}));this.enabling=false;this.check()},on:function(name,cb){var cbs=this.events[name];if(!cbs){cbs=this.events[name]=[]}cbs.push(cb)},emit:function(name,evt){each(this.events[name],function(cb){cb(evt)});if(name==="error"){delete this.events[name]}}};function callGetModule(args){if(!hasProp(defined,args[0])){getModule(makeModuleMap(args[0],null,true)).init(args[1],args[2])}}function removeListener(node,func,name,ieName){if(node.detachEvent&&!isOpera){if(ieName){node.detachEvent(ieName,func)}}else{node.removeEventListener(name,func,false)}}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;removeListener(node,context.onScriptLoad,"load","onreadystatechange");removeListener(node,context.onScriptError,"error");return{node:node,id:node&&node.getAttribute("data-requiremodule")}}function intakeDefines(){var args;takeGlobalQueue();while(defQueue.length){args=defQueue.shift();if(args[0]===null){return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]))}else{callGetModule(args)}}}context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,defQueue:defQueue,Module:Module,makeModuleMap:makeModuleMap,nextTick:req.nextTick,onError:onError,configure:function(cfg){if(cfg.baseUrl){if(cfg.baseUrl.charAt(cfg.baseUrl.length-1)!=="/"){cfg.baseUrl+="/"}}var shim=config.shim,objs={paths:true,bundles:true,config:true,map:true};eachProp(cfg,function(value,prop){if(objs[prop]){if(!config[prop]){config[prop]={}}mixin(config[prop],value,true,true)}else{config[prop]=value}});if(cfg.bundles){eachProp(cfg.bundles,function(value,prop){each(value,function(v){if(v!==prop){bundlesMap[v]=prop}})})}if(cfg.shim){eachProp(cfg.shim,function(value,id){if(isArray(value)){value={deps:value}}if((value.exports||value.init)&&!value.exportsFn){value.exportsFn=context.makeShimExports(value)}shim[id]=value});config.shim=shim}if(cfg.packages){each(cfg.packages,function(pkgObj){var location,name;pkgObj=typeof pkgObj==="string"?{name:pkgObj}:pkgObj;name=pkgObj.name;location=pkgObj.location;if(location){config.paths[name]=pkgObj.location}config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})}eachProp(registry,function(mod,id){if(!mod.inited&&!mod.map.unnormalized){mod.map=makeModuleMap(id)}});if(cfg.deps||cfg.callback){context.require(cfg.deps||[],cfg.callback)}},makeShimExports:function(value){function fn(){var ret;if(value.init){ret=value.init.apply(global,arguments)}return ret||value.exports&&getGlobal(value.exports)}return fn},makeRequire:function(relMap,options){options=options||{};function localRequire(deps,callback,errback){var id,map,requireMod;if(options.enableBuildCallback&&callback&&isFunction(callback)){callback.__requireJsBuild=true}if(typeof deps==="string"){if(isFunction(callback)){return onError(makeError("requireargs","Invalid require call"),errback)}if(relMap&&hasProp(handlers,deps)){return handlers[deps](registry[relMap.id])}if(req.get){return req.get(context,deps,relMap,localRequire)}map=makeModuleMap(deps,relMap,false,true);id=map.id;if(!hasProp(defined,id)){return onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName+(relMap?"":". Use require([])")))}return defined[id]}intakeDefines();context.nextTick(function(){intakeDefines();requireMod=getModule(makeModuleMap(null,relMap));requireMod.skipMap=options.skipMap;requireMod.init(deps,callback,errback,{enabled:true});checkLoaded()});return localRequire}mixin(localRequire,{isBrowser:isBrowser,toUrl:function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0],isRelative=segment==="."||segment==="..";if(index!==-1&&(!isRelative||index>1)){ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length);moduleNamePlusExt=moduleNamePlusExt.substring(0,index)}return context.nameToUrl(normalize(moduleNamePlusExt,relMap&&relMap.id,true),ext,true)},defined:function(id){return hasProp(defined,makeModuleMap(id,relMap,false,true).id)},specified:function(id){id=makeModuleMap(id,relMap,false,true).id;return hasProp(defined,id)||hasProp(registry,id)}});if(!relMap){localRequire.undef=function(id){takeGlobalQueue();var map=makeModuleMap(id,relMap,true),mod=getOwn(registry,id);removeScript(id);delete defined[id];delete urlFetched[map.url];delete undefEvents[id];eachReverse(defQueue,function(args,i){if(args[0]===id){defQueue.splice(i,1)}});if(mod){if(mod.events.defined){undefEvents[id]=mod.events}cleanRegistry(id)}}}return localRequire},enable:function(depMap){var mod=getOwn(registry,depMap.id);if(mod){getModule(depMap).enable()}},completeLoad:function(moduleName){var found,args,mod,shim=getOwn(config.shim,moduleName)||{},shExports=shim.exports;takeGlobalQueue();while(defQueue.length){args=defQueue.shift();if(args[0]===null){args[0]=moduleName;if(found){break}found=true}else if(args[0]===moduleName){found=true}callGetModule(args)}mod=getOwn(registry,moduleName);if(!found&&!hasProp(defined,moduleName)&&mod&&!mod.inited){if(config.enforceDefine&&(!shExports||!getGlobal(shExports))){if(hasPathFallback(moduleName)){return}else{return onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]))}}else{callGetModule([moduleName,shim.deps||[],shim.exportsFn])}}checkLoaded()},nameToUrl:function(moduleName,ext,skipExt){var paths,syms,i,parentModule,url,parentPath,bundleId,pkgMain=getOwn(config.pkgs,moduleName);if(pkgMain){moduleName=pkgMain}bundleId=getOwn(bundlesMap,moduleName);if(bundleId){return context.nameToUrl(bundleId,ext,skipExt)}if(req.jsExtRegExp.test(moduleName)){url=moduleName+(ext||"")}else{paths=config.paths;syms=moduleName.split("/");for(i=syms.length;i>0;i-=1){parentModule=syms.slice(0,i).join("/");parentPath=getOwn(paths,parentModule);if(parentPath){if(isArray(parentPath)){parentPath=parentPath[0]}syms.splice(0,i,parentPath);break}}url=syms.join("/");url+=ext||(/^data\:|\?/.test(url)||skipExt?"":".js");url=(url.charAt(0)==="/"||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs?url+((url.indexOf("?")===-1?"?":"&")+config.urlArgs):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if(evt.type==="load"||readyRegExp.test((evt.currentTarget||evt.srcElement).readyState)){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){return onError(makeError("scripterror","Script error for: "+data.id,evt,[data.id]))}}};context.require=context.makeRequire();return context}req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;if(!isArray(deps)&&typeof deps!=="string"){config=deps;if(isArray(callback)){deps=callback;callback=errback;errback=optional}else{deps=[]}}if(config&&config.context){contextName=config.context}context=getOwn(contexts,contextName);if(!context){context=contexts[contextName]=req.s.newContext(contextName)}if(config){context.configure(config)}return context.require(deps,callback,errback)};req.config=function(config){return req(config)};req.nextTick=typeof setTimeout!=="undefined"?function(fn){setTimeout(fn,4)}:function(fn){fn()};if(!require){require=req}req.version=version;req.jsExtRegExp=/^\/|:|\?|\.js$/;req.isBrowser=isBrowser;s=req.s={contexts:contexts,newContext:newContext};req({});each(["toUrl","undef","defined","specified"],function(prop){req[prop]=function(){var ctx=contexts[defContextName];return ctx.require[prop].apply(ctx,arguments)}});if(isBrowser){head=s.head=document.getElementsByTagName("head")[0];baseElement=document.getElementsByTagName("base")[0];if(baseElement){head=s.head=baseElement.parentNode}}req.onError=defaultOnError;req.createNode=function(config,moduleName,url){var node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");node.type=config.scriptType||"text/javascript";node.charset="utf-8";node.async=true;return node};req.load=function(context,moduleName,url){var config=context&&context.config||{},node;if(isBrowser){node=req.createNode(config,moduleName,url);node.setAttribute("data-requirecontext",context.contextName);node.setAttribute("data-requiremodule",moduleName);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0)&&!isOpera){useInteractive=true;node.attachEvent("onreadystatechange",context.onScriptLoad)}else{node.addEventListener("load",context.onScriptLoad,false);node.addEventListener("error",context.onScriptError,false)}node.src=url;currentlyAddingScript=node;if(baseElement){head.insertBefore(node,baseElement)}else{head.appendChild(node)}currentlyAddingScript=null;return node}else if(isWebWorker){try{importScripts(url);context.completeLoad(moduleName)}catch(e){context.onError(makeError("importscripts","importScripts failed for "+moduleName+" at "+url,e,[moduleName]))}}};function getInteractiveScript(){if(interactiveScript&&interactiveScript.readyState==="interactive"){return interactiveScript}eachReverse(scripts(),function(script){if(script.readyState==="interactive"){return interactiveScript=script}});return interactiveScript}if(isBrowser&&!cfg.skipDataMain){eachReverse(scripts(),function(script){if(!head){head=script.parentNode}dataMain=script.getAttribute("data-main");if(dataMain){mainScript=dataMain;if(!cfg.baseUrl){src=mainScript.split("/");mainScript=src.pop();subPath=src.length?src.join("/")+"/":"./";cfg.baseUrl=subPath}mainScript=mainScript.replace(jsSuffixRegExp,"");if(req.jsExtRegExp.test(mainScript)){mainScript=dataMain}cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript];return true}})}define=function(name,deps,callback){var node,context;if(typeof name!=="string"){callback=deps;deps=name;name=null}if(!isArray(deps)){callback=deps;deps=null}if(!deps&&isFunction(callback)){deps=[];if(callback.length){callback.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(match,dep){deps.push(dep)});deps=(callback.length===1?["require"]:["require","exports","module"]).concat(deps)}}if(useInteractive){node=currentlyAddingScript||getInteractiveScript();if(node){if(!name){name=node.getAttribute("data-requiremodule")}context=contexts[node.getAttribute("data-requirecontext")]}}(context?context.defQueue:globalDefQueue).push([name,deps,callback])};define.amd={jQuery:true};req.exec=function(text){return eval(text)};req(cfg)})(this);!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";module.exports=function(Promise,Promise$_CreatePromiseArray,PromiseArray){var SomePromiseArray=require("./some_promise_array.js")(PromiseArray);function Promise$_Any(promises,useBound,caller){var ret=Promise$_CreatePromiseArray(promises,SomePromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0);var promise=ret.promise();if(promise.isRejected()){return promise}ret.setHowMany(1);ret.setUnwrap();ret.init();return promise}Promise.any=function Promise$Any(promises){return Promise$_Any(promises,false,Promise.any)};Promise.prototype.any=function Promise$any(){return Promise$_Any(this,true,this.any)}}},{"./some_promise_array.js":34}],2:[function(require,module,exports){"use strict";var schedule=require("./schedule.js");var Queue=require("./queue.js");var errorObj=require("./util.js").errorObj;var tryCatch1=require("./util.js").tryCatch1;var process=require("./global.js").process;function Async(){this._isTickUsed=false;this._length=0;this._lateBuffer=new Queue;this._functionBuffer=new Queue(25e3*3);var self=this;this.consumeFunctionBuffer=function Async$consumeFunctionBuffer(){self._consumeFunctionBuffer()}}Async.prototype.haveItemsQueued=function Async$haveItemsQueued(){return this._length>0};Async.prototype.invokeLater=function Async$invokeLater(fn,receiver,arg){if(process!==void 0&&process.domain!=null&&!fn.domain){fn=process.domain.bind(fn)}this._lateBuffer.push(fn,receiver,arg);this._queueTick()};Async.prototype.invoke=function Async$invoke(fn,receiver,arg){if(process!==void 0&&process.domain!=null&&!fn.domain){fn=process.domain.bind(fn)}var functionBuffer=this._functionBuffer;functionBuffer.push(fn,receiver,arg);this._length=functionBuffer.length();this._queueTick()};Async.prototype._consumeFunctionBuffer=function Async$_consumeFunctionBuffer(){var functionBuffer=this._functionBuffer;while(functionBuffer.length()>0){var fn=functionBuffer.shift();var receiver=functionBuffer.shift();var arg=functionBuffer.shift();fn.call(receiver,arg)}this._reset();this._consumeLateBuffer()};Async.prototype._consumeLateBuffer=function Async$_consumeLateBuffer(){var buffer=this._lateBuffer;while(buffer.length()>0){var fn=buffer.shift();var receiver=buffer.shift();var arg=buffer.shift();var res=tryCatch1(fn,receiver,arg);if(res===errorObj){this._queueTick();if(fn.domain!=null){fn.domain.emit("error",res.e)}else{throw res.e}}}};Async.prototype._queueTick=function Async$_queue(){if(!this._isTickUsed){schedule(this.consumeFunctionBuffer);this._isTickUsed=true}};Async.prototype._reset=function Async$_reset(){this._isTickUsed=false;this._length=0};module.exports=new Async},{"./global.js":15,"./queue.js":27,"./schedule.js":30,"./util.js":38}],3:[function(require,module,exports){"use strict";var Promise=require("./promise.js")();module.exports=Promise},{"./promise.js":19}],4:[function(require,module,exports){"use strict";module.exports=function(Promise){Promise.prototype.call=function Promise$call(propertyName){var $_len=arguments.length;var args=new Array($_len-1);for(var $_i=1;$_i<$_len;++$_i){args[$_i-1]=arguments[$_i]}return this._then(function(obj){return obj[propertyName].apply(obj,args)},void 0,void 0,void 0,void 0,this.call)};function Promise$getter(obj){var prop=typeof this==="string"?this:""+this;return obj[prop]}Promise.prototype.get=function Promise$get(propertyName){return this._then(Promise$getter,void 0,void 0,propertyName,void 0,this.get)}}},{}],5:[function(require,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var errors=require("./errors.js");var async=require("./async.js");var CancellationError=errors.CancellationError;var SYNC_TOKEN={};Promise.prototype._cancel=function Promise$_cancel(){if(!this.isCancellable())return this;var parent;if((parent=this._cancellationParent)!==void 0){parent.cancel(SYNC_TOKEN);return}var err=new CancellationError;this._attachExtraTrace(err);this._rejectUnchecked(err)};Promise.prototype.cancel=function Promise$cancel(token){if(!this.isCancellable())return this;if(token===SYNC_TOKEN){this._cancel();return this}async.invokeLater(this._cancel,this,void 0);return this};Promise.prototype.cancellable=function Promise$cancellable(){if(this._cancellable())return this;this._setCancellable();this._cancellationParent=void 0;return this};Promise.prototype.uncancellable=function Promise$uncancellable(){var ret=new Promise(INTERNAL);ret._setTrace(this.uncancellable,this);ret._follow(this);ret._unsetCancellable();if(this._isBound())ret._setBoundTo(this._boundTo);return ret};Promise.prototype.fork=function Promise$fork(didFulfill,didReject,didProgress){var ret=this._then(didFulfill,didReject,didProgress,void 0,void 0,this.fork);ret._setCancellable();ret._cancellationParent=void 0;return ret}}},{"./async.js":2,"./errors.js":9}],6:[function(require,module,exports){"use strict";module.exports=function(){var inherits=require("./util.js").inherits;var defineProperty=require("./es5.js").defineProperty;var rignore=new RegExp("\\b(?:[\\w.]*Promise(?:Array|Spawn)?\\$_\\w+|"+"tryCatch(?:1|2|Apply)|new \\w*PromiseArray|"+"\\w*PromiseArray\\.\\w*PromiseArray|"+"setTimeout|CatchFilter\\$_\\w+|makeNodePromisified|processImmediate|"+"process._tickCallback|nextTick|Async\\$\\w+)\\b");var rtraceline=null;var formatStack=null;var areNamesMangled=false;function formatNonError(obj){var str;if(typeof obj==="function"){str="[function "+(obj.name||"anonymous")+"]"}else{str=obj.toString();var ruselessToString=/\[object [a-zA-Z0-9$_]+\]/;if(ruselessToString.test(str)){try{var newStr=JSON.stringify(obj);str=newStr}catch(e){}}if(str.length===0){str="(empty array)"}}return"(<"+snip(str)+">, no stack trace)"}function snip(str){var maxChars=41;if(str.length<maxChars){return str}return str.substr(0,maxChars-3)+"..."}function CapturedTrace(ignoreUntil,isTopLevel){if(!areNamesMangled){}this.captureStackTrace(ignoreUntil,isTopLevel)}inherits(CapturedTrace,Error);CapturedTrace.prototype.captureStackTrace=function CapturedTrace$captureStackTrace(ignoreUntil,isTopLevel){captureStackTrace(this,ignoreUntil,isTopLevel)};CapturedTrace.possiblyUnhandledRejection=function CapturedTrace$PossiblyUnhandledRejection(reason){if(typeof console==="object"){var message;if(typeof reason==="object"||typeof reason==="function"){var stack=reason.stack;message="Possibly unhandled "+formatStack(stack,reason)}else{message="Possibly unhandled "+String(reason)}if(typeof console.error==="function"||typeof console.error==="object"){console.error(message)
  }else if(typeof console.log==="function"||typeof console.error==="object"){console.log(message)}}};areNamesMangled=CapturedTrace.prototype.captureStackTrace.name!=="CapturedTrace$captureStackTrace";CapturedTrace.combine=function CapturedTrace$Combine(current,prev){var curLast=current.length-1;for(var i=prev.length-1;i>=0;--i){var line=prev[i];if(current[curLast]===line){current.pop();curLast--}else{break}}current.push("From previous event:");var lines=current.concat(prev);var ret=[];for(var i=0,len=lines.length;i<len;++i){if(rignore.test(lines[i])||i>0&&!rtraceline.test(lines[i])&&lines[i]!=="From previous event:"){continue}ret.push(lines[i])}return ret};CapturedTrace.isSupported=function CapturedTrace$IsSupported(){return typeof captureStackTrace==="function"};var captureStackTrace=function stackDetection(){if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){rtraceline=/^\s*at\s*/;formatStack=function(stack,error){if(typeof stack==="string")return stack;if(error.name!==void 0&&error.message!==void 0){return error.name+". "+error.message}return formatNonError(error)};var captureStackTrace=Error.captureStackTrace;return function CapturedTrace$_captureStackTrace(receiver,ignoreUntil){captureStackTrace(receiver,ignoreUntil)}}var err=new Error;if(!areNamesMangled&&typeof err.stack==="string"&&typeof"".startsWith==="function"&&err.stack.startsWith("stackDetection@")&&stackDetection.name==="stackDetection"){defineProperty(Error,"stackTraceLimit",{writable:true,enumerable:false,configurable:false,value:25});rtraceline=/@/;var rline=/[@\n]/;formatStack=function(stack,error){if(typeof stack==="string"){return error.name+". "+error.message+"\n"+stack}if(error.name!==void 0&&error.message!==void 0){return error.name+". "+error.message}return formatNonError(error)};return function captureStackTrace(o,fn){var name=fn.name;var stack=(new Error).stack;var split=stack.split(rline);var i,len=split.length;for(i=0;i<len;i+=2){if(split[i]===name){break}}split=split.slice(i+2);len=split.length-2;var ret="";for(i=0;i<len;i+=2){ret+=split[i];ret+="@";ret+=split[i+1];ret+="\n"}o.stack=ret}}else{formatStack=function(stack,error){if(typeof stack==="string")return stack;if((typeof error==="object"||typeof error==="function")&&error.name!==void 0&&error.message!==void 0){return error.name+". "+error.message}return formatNonError(error)};return null}}();return CapturedTrace}},{"./es5.js":11,"./util.js":38}],7:[function(require,module,exports){"use strict";module.exports=function(NEXT_FILTER){var util=require("./util.js");var errors=require("./errors.js");var tryCatch1=util.tryCatch1;var errorObj=util.errorObj;var keys=require("./es5.js").keys;function CatchFilter(instances,callback,promise){this._instances=instances;this._callback=callback;this._promise=promise}function CatchFilter$_safePredicate(predicate,e){var safeObject={};var retfilter=tryCatch1(predicate,safeObject,e);if(retfilter===errorObj)return retfilter;var safeKeys=keys(safeObject);if(safeKeys.length){errorObj.e=new TypeError("Catch filter must inherit from Error "+"or be a simple predicate function");return errorObj}return retfilter}CatchFilter.prototype.doFilter=function CatchFilter$_doFilter(e){var cb=this._callback;var promise=this._promise;var boundTo=promise._isBound()?promise._boundTo:void 0;for(var i=0,len=this._instances.length;i<len;++i){var item=this._instances[i];var itemIsErrorType=item===Error||item!=null&&item.prototype instanceof Error;if(itemIsErrorType&&e instanceof item){var ret=tryCatch1(cb,boundTo,e);if(ret===errorObj){NEXT_FILTER.e=ret.e;return NEXT_FILTER}return ret}else if(typeof item==="function"&&!itemIsErrorType){var shouldHandle=CatchFilter$_safePredicate(item,e);if(shouldHandle===errorObj){var trace=errors.canAttach(errorObj.e)?errorObj.e:new Error(errorObj.e+"");this._promise._attachExtraTrace(trace);e=errorObj.e;break}else if(shouldHandle){var ret=tryCatch1(cb,boundTo,e);if(ret===errorObj){NEXT_FILTER.e=ret.e;return NEXT_FILTER}return ret}}}NEXT_FILTER.e=e;return NEXT_FILTER};return CatchFilter}},{"./errors.js":9,"./es5.js":11,"./util.js":38}],8:[function(require,module,exports){"use strict";var util=require("./util.js");var isPrimitive=util.isPrimitive;var wrapsPrimitiveReceiver=util.wrapsPrimitiveReceiver;module.exports=function(Promise){var returner=function Promise$_returner(){return this};var thrower=function Promise$_thrower(){throw this};var wrapper=function Promise$_wrapper(value,action){if(action===1){return function Promise$_thrower(){throw value}}else if(action===2){return function Promise$_returner(){return value}}};Promise.prototype["return"]=Promise.prototype.thenReturn=function Promise$thenReturn(value){if(wrapsPrimitiveReceiver&&isPrimitive(value)){return this._then(wrapper(value,2),void 0,void 0,void 0,void 0,this.thenReturn)}return this._then(returner,void 0,void 0,value,void 0,this.thenReturn)};Promise.prototype["throw"]=Promise.prototype.thenThrow=function Promise$thenThrow(reason){if(wrapsPrimitiveReceiver&&isPrimitive(reason)){return this._then(wrapper(reason,1),void 0,void 0,void 0,void 0,this.thenThrow)}return this._then(thrower,void 0,void 0,reason,void 0,this.thenThrow)}}},{"./util.js":38}],9:[function(require,module,exports){"use strict";var global=require("./global.js");var Objectfreeze=require("./es5.js").freeze;var util=require("./util.js");var inherits=util.inherits;var notEnumerableProp=util.notEnumerableProp;var Error=global.Error;function markAsOriginatingFromRejection(e){try{notEnumerableProp(e,"isAsync",true)}catch(ignore){}}function originatesFromRejection(e){if(e==null)return false;return e instanceof RejectionError||e["isAsync"]===true}function isError(obj){return obj instanceof Error}function canAttach(obj){return isError(obj)}function subError(nameProperty,defaultMessage){function SubError(message){if(!(this instanceof SubError))return new SubError(message);this.message=typeof message==="string"?message:defaultMessage;this.name=nameProperty;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}inherits(SubError,Error);return SubError}var TypeError=global.TypeError;if(typeof TypeError!=="function"){TypeError=subError("TypeError","type error")}var RangeError=global.RangeError;if(typeof RangeError!=="function"){RangeError=subError("RangeError","range error")}var CancellationError=subError("CancellationError","cancellation error");var TimeoutError=subError("TimeoutError","timeout error");function RejectionError(message){this.name="RejectionError";this.message=message;this.cause=message;this.isAsync=true;if(message instanceof Error){this.message=message.message;this.stack=message.stack}else if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}inherits(RejectionError,Error);var key="__BluebirdErrorTypes__";var errorTypes=global[key];if(!errorTypes){errorTypes=Objectfreeze({CancellationError:CancellationError,TimeoutError:TimeoutError,RejectionError:RejectionError});notEnumerableProp(global,key,errorTypes)}module.exports={Error:Error,TypeError:TypeError,RangeError:RangeError,CancellationError:errorTypes.CancellationError,RejectionError:errorTypes.RejectionError,TimeoutError:errorTypes.TimeoutError,originatesFromRejection:originatesFromRejection,markAsOriginatingFromRejection:markAsOriginatingFromRejection,canAttach:canAttach}},{"./es5.js":11,"./global.js":15,"./util.js":38}],10:[function(require,module,exports){"use strict";module.exports=function(Promise){var TypeError=require("./errors.js").TypeError;function apiRejection(msg){var error=new TypeError(msg);var ret=Promise.rejected(error);var parent=ret._peekContext();if(parent!=null){parent._attachExtraTrace(error)}return ret}return apiRejection}},{"./errors.js":9}],11:[function(require,module,exports){var isES5=function(){"use strict";return this===void 0}();if(isES5){module.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,keys:Object.keys,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:isES5}}else{var has={}.hasOwnProperty;var str={}.toString;var proto={}.constructor.prototype;function ObjectKeys(o){var ret=[];for(var key in o){if(has.call(o,key)){ret.push(key)}}return ret}function ObjectDefineProperty(o,key,desc){o[key]=desc.value;return o}function ObjectFreeze(obj){return obj}function ObjectGetPrototypeOf(obj){try{return Object(obj).constructor.prototype}catch(e){return proto}}function ArrayIsArray(obj){try{return str.call(obj)==="[object Array]"}catch(e){return false}}module.exports={isArray:ArrayIsArray,keys:ObjectKeys,defineProperty:ObjectDefineProperty,freeze:ObjectFreeze,getPrototypeOf:ObjectGetPrototypeOf,isES5:isES5}}},{}],12:[function(require,module,exports){"use strict";module.exports=function(Promise){var isArray=require("./util.js").isArray;function Promise$_filter(booleans){var values=this._settledValue;var len=values.length;var ret=new Array(len);var j=0;for(var i=0;i<len;++i){if(booleans[i])ret[j++]=values[i]}ret.length=j;return ret}var ref={ref:null};Promise.filter=function Promise$Filter(promises,fn){return Promise.map(promises,fn,ref)._then(Promise$_filter,void 0,void 0,ref.ref,void 0,Promise.filter)};Promise.prototype.filter=function Promise$filter(fn){return this.map(fn,ref)._then(Promise$_filter,void 0,void 0,ref.ref,void 0,this.filter)}}},{"./util.js":38}],13:[function(require,module,exports){"use strict";module.exports=function(Promise,NEXT_FILTER){var util=require("./util.js");var wrapsPrimitiveReceiver=util.wrapsPrimitiveReceiver;var isPrimitive=util.isPrimitive;var thrower=util.thrower;function returnThis(){return this}function throwThis(){throw this}function makeReturner(r){return function Promise$_returner(){return r}}function makeThrower(r){return function Promise$_thrower(){throw r}}function promisedFinally(ret,reasonOrValue,isFulfilled){var useConstantFunction=wrapsPrimitiveReceiver&&isPrimitive(reasonOrValue);if(isFulfilled){return ret._then(useConstantFunction?returnThis:makeReturner(reasonOrValue),thrower,void 0,reasonOrValue,void 0,promisedFinally)}else{return ret._then(useConstantFunction?throwThis:makeThrower(reasonOrValue),thrower,void 0,reasonOrValue,void 0,promisedFinally)}}function finallyHandler(reasonOrValue){var promise=this.promise;var handler=this.handler;var ret=promise._isBound()?handler.call(promise._boundTo):handler();if(ret!==void 0){var maybePromise=Promise._cast(ret,finallyHandler,void 0);if(maybePromise instanceof Promise){return promisedFinally(maybePromise,reasonOrValue,promise.isFulfilled())}}if(promise.isRejected()){NEXT_FILTER.e=reasonOrValue;return NEXT_FILTER}else{return reasonOrValue}}function tapHandler(value){var promise=this.promise;var handler=this.handler;var ret=promise._isBound()?handler.call(promise._boundTo,value):handler(value);if(ret!==void 0){var maybePromise=Promise._cast(ret,tapHandler,void 0);if(maybePromise instanceof Promise){return promisedFinally(maybePromise,value,true)}}return value}Promise.prototype._passThroughHandler=function Promise$_passThroughHandler(handler,isFinally,caller){if(typeof handler!=="function")return this.then();var promiseAndHandler={promise:this,handler:handler};return this._then(isFinally?finallyHandler:tapHandler,isFinally?finallyHandler:void 0,void 0,promiseAndHandler,void 0,caller)};Promise.prototype.lastly=Promise.prototype["finally"]=function Promise$finally(handler){return this._passThroughHandler(handler,true,this.lastly)};Promise.prototype.tap=function Promise$tap(handler){return this._passThroughHandler(handler,false,this.tap)}}},{"./util.js":38}],14:[function(require,module,exports){"use strict";module.exports=function(Promise,apiRejection,INTERNAL){var PromiseSpawn=require("./promise_spawn.js")(Promise,INTERNAL);var errors=require("./errors.js");var TypeError=errors.TypeError;var deprecated=require("./util.js").deprecated;Promise.coroutine=function Promise$Coroutine(generatorFunction){if(typeof generatorFunction!=="function"){throw new TypeError("generatorFunction must be a function")}var PromiseSpawn$=PromiseSpawn;return function anonymous(){var generator=generatorFunction.apply(this,arguments);var spawn=new PromiseSpawn$(void 0,void 0,anonymous);spawn._generator=generator;spawn._next(void 0);return spawn.promise()}};Promise.coroutine.addYieldHandler=PromiseSpawn.addYieldHandler;Promise.spawn=function Promise$Spawn(generatorFunction){deprecated("Promise.spawn is deprecated. Use Promise.coroutine instead.");if(typeof generatorFunction!=="function"){return apiRejection("generatorFunction must be a function")}var spawn=new PromiseSpawn(generatorFunction,this,Promise.spawn);var ret=spawn.promise();spawn._run(Promise.spawn);return ret}}},{"./errors.js":9,"./promise_spawn.js":23,"./util.js":38}],15:[function(require,module,exports){"use strict";module.exports=function(){if(typeof this!=="undefined"){return this}if(typeof process!=="undefined"&&typeof global!=="undefined"&&typeof process.execPath==="string"){return global}if(typeof window!=="undefined"&&typeof document!=="undefined"&&typeof navigator!=="undefined"&&navigator!==null&&typeof navigator.appName==="string"){if(window.wrappedJSObject!==undefined){return window.wrappedJSObject}return window}}()},{}],16:[function(require,module,exports){"use strict";module.exports=function(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection){function Promise$_mapper(values){var fn=this;var receiver=void 0;if(typeof fn!=="function"){receiver=fn.receiver;fn=fn.fn}var shouldDefer=false;var ret=new Array(values.length);if(receiver===void 0){for(var i=0,len=values.length;i<len;++i){var value=fn(values[i],i,len);if(!shouldDefer){var maybePromise=Promise._cast(value,Promise$_mapper,void 0);if(maybePromise instanceof Promise){if(maybePromise.isFulfilled()){ret[i]=maybePromise._settledValue;continue}else{shouldDefer=true}value=maybePromise}}ret[i]=value}}else{for(var i=0,len=values.length;i<len;++i){var value=fn.call(receiver,values[i],i,len);if(!shouldDefer){var maybePromise=Promise._cast(value,Promise$_mapper,void 0);if(maybePromise instanceof Promise){if(maybePromise.isFulfilled()){ret[i]=maybePromise._settledValue;continue}else{shouldDefer=true}value=maybePromise}}ret[i]=value}}return shouldDefer?Promise$_CreatePromiseArray(ret,PromiseArray,Promise$_mapper,void 0).promise():ret}function Promise$_Map(promises,fn,useBound,caller,ref){if(typeof fn!=="function"){return apiRejection("fn must be a function")}if(useBound===true&&promises._isBound()){fn={fn:fn,receiver:promises._boundTo}}var ret=Promise$_CreatePromiseArray(promises,PromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0).promise();if(ref!==void 0){ref.ref=ret}return ret._then(Promise$_mapper,void 0,void 0,fn,void 0,caller)}Promise.prototype.map=function Promise$map(fn,ref){return Promise$_Map(this,fn,true,this.map,ref)};Promise.map=function Promise$Map(promises,fn,ref){return Promise$_Map(promises,fn,false,Promise.map,ref)}}},{}],17:[function(require,module,exports){"use strict";module.exports=function(Promise){var util=require("./util.js");var async=require("./async.js");var tryCatch2=util.tryCatch2;var tryCatch1=util.tryCatch1;var errorObj=util.errorObj;function thrower(r){throw r}function Promise$_successAdapter(val,receiver){var nodeback=this;var ret=tryCatch2(nodeback,receiver,null,val);if(ret===errorObj){async.invokeLater(thrower,void 0,ret.e)}}function Promise$_errorAdapter(reason,receiver){var nodeback=this;var ret=tryCatch1(nodeback,receiver,reason);if(ret===errorObj){async.invokeLater(thrower,void 0,ret.e)}}Promise.prototype.nodeify=function Promise$nodeify(nodeback){if(typeof nodeback=="function"){this._then(Promise$_successAdapter,Promise$_errorAdapter,void 0,nodeback,this._isBound()?this._boundTo:null,this.nodeify);return}return this}}},{"./async.js":2,"./util.js":38}],18:[function(require,module,exports){"use strict";module.exports=function(Promise,isPromiseArrayProxy){var util=require("./util.js");var async=require("./async.js");var errors=require("./errors.js");var tryCatch1=util.tryCatch1;var errorObj=util.errorObj;Promise.prototype.progressed=function Promise$progressed(handler){return this._then(void 0,void 0,handler,void 0,void 0,this.progressed)};Promise.prototype._progress=function Promise$_progress(progressValue){if(this._isFollowingOrFulfilledOrRejected())return;this._progressUnchecked(progressValue)};Promise.prototype._progressHandlerAt=function Promise$_progressHandlerAt(index){if(index===0)return this._progressHandler0;return this[index+2-5]};Promise.prototype._doProgressWith=function Promise$_doProgressWith(progression){var progressValue=progression.value;var handler=progression.handler;var promise=progression.promise;var receiver=progression.receiver;this._pushContext();var ret=tryCatch1(handler,receiver,progressValue);this._popContext();if(ret===errorObj){if(ret.e!=null&&ret.e.name!=="StopProgressPropagation"){var trace=errors.canAttach(ret.e)?ret.e:new Error(ret.e+"");promise._attachExtraTrace(trace);promise._progress(ret.e)}}else if(Promise.is(ret)){ret._then(promise._progress,null,null,promise,void 0,this._progress)}else{promise._progress(ret)}};Promise.prototype._progressUnchecked=function Promise$_progressUnchecked(progressValue){if(!this.isPending())return;var len=this._length();for(var i=0;i<len;i+=5){var handler=this._progressHandlerAt(i);var promise=this._promiseAt(i);if(!Promise.is(promise)){var receiver=this._receiverAt(i);if(typeof handler==="function"){handler.call(receiver,progressValue,promise)}else if(Promise.is(receiver)&&receiver._isProxied()){receiver._progressUnchecked(progressValue)}else if(isPromiseArrayProxy(receiver,promise)){receiver._promiseProgressed(progressValue,promise)}continue}if(typeof handler==="function"){async.invoke(this._doProgressWith,this,{handler:handler,promise:promise,receiver:this._receiverAt(i),value:progressValue})}else{async.invoke(promise._progress,promise,progressValue)}}}}},{"./async.js":2,"./errors.js":9,"./util.js":38}],19:[function(require,module,exports){"use strict";module.exports=function(){var global=require("./global.js");var util=require("./util.js");var async=require("./async.js");var errors=require("./errors.js");var INTERNAL=function(){};var APPLY={};var NEXT_FILTER={e:null};var PromiseArray=require("./promise_array.js")(Promise,INTERNAL);var CapturedTrace=require("./captured_trace.js")();var CatchFilter=require("./catch_filter.js")(NEXT_FILTER);var PromiseResolver=require("./promise_resolver.js");var isArray=util.isArray;var errorObj=util.errorObj;var tryCatch1=util.tryCatch1;var tryCatch2=util.tryCatch2;var tryCatchApply=util.tryCatchApply;var RangeError=errors.RangeError;var TypeError=errors.TypeError;var CancellationError=errors.CancellationError;var TimeoutError=errors.TimeoutError;var RejectionError=errors.RejectionError;var originatesFromRejection=errors.originatesFromRejection;var markAsOriginatingFromRejection=errors.markAsOriginatingFromRejection;var canAttach=errors.canAttach;var thrower=util.thrower;var apiRejection=require("./errors_api_rejection")(Promise);var makeSelfResolutionError=function Promise$_makeSelfResolutionError(){return new TypeError("circular promise resolution chain")};function isPromise(obj){if(obj===void 0)return false;return obj instanceof Promise}function isPromiseArrayProxy(receiver,promiseSlotValue){if(receiver instanceof PromiseArray){return promiseSlotValue>=0}return false}function Promise(resolver){if(typeof resolver!=="function"){throw new TypeError("the promise constructor requires a resolver function")}if(this.constructor!==Promise){throw new TypeError("the promise constructor cannot be invoked directly")}this._bitField=0;this._fulfillmentHandler0=void 0;this._rejectionHandler0=void 0;this._promise0=void 0;this._receiver0=void 0;this._settledValue=void 0;this._boundTo=void 0;if(resolver!==INTERNAL)this._resolveFromResolver(resolver)}Promise.prototype.bind=function Promise$bind(thisArg){var ret=new Promise(INTERNAL);if(debugging)ret._setTrace(this.bind,this);ret._follow(this);ret._setBoundTo(thisArg);if(this._cancellable()){ret._setCancellable();ret._cancellationParent=this}return ret};Promise.prototype.toString=function Promise$toString(){return"[object Promise]"};Promise.prototype.caught=Promise.prototype["catch"]=function Promise$catch(fn){var len=arguments.length;if(len>1){var catchInstances=new Array(len-1),j=0,i;for(i=0;i<len-1;++i){var item=arguments[i];if(typeof item==="function"){catchInstances[j++]=item}else{var catchFilterTypeError=new TypeError("A catch filter must be an error constructor "+"or a filter function");this._attachExtraTrace(catchFilterTypeError);async.invoke(this._reject,this,catchFilterTypeError);return}}catchInstances.length=j;fn=arguments[i];this._resetTrace(this.caught);var catchFilter=new CatchFilter(catchInstances,fn,this);return this._then(void 0,catchFilter.doFilter,void 0,catchFilter,void 0,this.caught)}return this._then(void 0,fn,void 0,void 0,void 0,this.caught)};Promise.prototype.then=function Promise$then(didFulfill,didReject,didProgress){return this._then(didFulfill,didReject,didProgress,void 0,void 0,this.then)};Promise.prototype.done=function Promise$done(didFulfill,didReject,didProgress){var promise=this._then(didFulfill,didReject,didProgress,void 0,void 0,this.done);promise._setIsFinal()};Promise.prototype.spread=function Promise$spread(didFulfill,didReject){return this._then(didFulfill,didReject,void 0,APPLY,void 0,this.spread)};Promise.prototype.isFulfilled=function Promise$isFulfilled(){return(this._bitField&268435456)>0};Promise.prototype.isRejected=function Promise$isRejected(){return(this._bitField&134217728)>0};Promise.prototype.isPending=function Promise$isPending(){return!this.isResolved()};Promise.prototype.isResolved=function Promise$isResolved(){return(this._bitField&402653184)>0};Promise.prototype.isCancellable=function Promise$isCancellable(){return!this.isResolved()&&this._cancellable()};Promise.prototype.toJSON=function Promise$toJSON(){var ret={isFulfilled:false,isRejected:false,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled()){ret.fulfillmentValue=this._settledValue;ret.isFulfilled=true}else if(this.isRejected()){ret.rejectionReason=this._settledValue;ret.isRejected=true}return ret};Promise.prototype.all=function Promise$all(){return Promise$_all(this,true,this.all)};Promise.is=isPromise;function Promise$_all(promises,useBound,caller){return Promise$_CreatePromiseArray(promises,PromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0).promise()}Promise.all=function Promise$All(promises){return Promise$_all(promises,false,Promise.all)};Promise.join=function Promise$Join(){var $_len=arguments.length;var args=new Array($_len);for(var $_i=0;$_i<$_len;++$_i){args[$_i]=arguments[$_i]}return Promise$_CreatePromiseArray(args,PromiseArray,Promise.join,void 0).promise()};Promise.resolve=Promise.fulfilled=function Promise$Resolve(value,caller){var ret=new Promise(INTERNAL);if(debugging)ret._setTrace(typeof caller==="function"?caller:Promise.resolve,void 0);if(ret._tryFollow(value)){return ret}ret._cleanValues();ret._setFulfilled();ret._settledValue=value;return ret};Promise.reject=Promise.rejected=function Promise$Reject(reason){var ret=new Promise(INTERNAL);if(debugging)ret._setTrace(Promise.reject,void 0);markAsOriginatingFromRejection(reason);ret._cleanValues();ret._setRejected();ret._settledValue=reason;if(!canAttach(reason)){var trace=new Error(reason+"");ret._setCarriedStackTrace(trace)}ret._ensurePossibleRejectionHandled();return ret};Promise.prototype.error=function Promise$_error(fn){return this.caught(originatesFromRejection,fn)};Promise.prototype._resolveFromSyncValue=function Promise$_resolveFromSyncValue(value,caller){if(value===errorObj){this._cleanValues();this._setRejected();this._settledValue=value.e;this._ensurePossibleRejectionHandled()}else{var maybePromise=Promise._cast(value,caller,void 0);if(maybePromise instanceof Promise){this._follow(maybePromise)}else{this._cleanValues();this._setFulfilled();this._settledValue=value}}};Promise.method=function Promise$_Method(fn){if(typeof fn!=="function"){throw new TypeError("fn must be a function")}return function Promise$_method(){var value;switch(arguments.length){case 0:value=tryCatch1(fn,this,void 0);break;case 1:value=tryCatch1(fn,this,arguments[0]);break;case 2:value=tryCatch2(fn,this,arguments[0],arguments[1]);break;default:var $_len=arguments.length;var args=new Array($_len);for(var $_i=0;$_i<$_len;++$_i){args[$_i]=arguments[$_i]}value=tryCatchApply(fn,args,this);break}var ret=new Promise(INTERNAL);if(debugging)ret._setTrace(Promise$_method,void 0);ret._resolveFromSyncValue(value,Promise$_method);return ret}};Promise.attempt=Promise["try"]=function Promise$_Try(fn,args,ctx){if(typeof fn!=="function"){return apiRejection("fn must be a function")}var value=isArray(args)?tryCatchApply(fn,args,ctx):tryCatch1(fn,ctx,args);var ret=new Promise(INTERNAL);if(debugging)ret._setTrace(Promise.attempt,void 0);ret._resolveFromSyncValue(value,Promise.attempt);return ret};Promise.defer=Promise.pending=function Promise$Defer(caller){var promise=new Promise(INTERNAL);if(debugging)promise._setTrace(typeof caller==="function"?caller:Promise.defer,void 0);return new PromiseResolver(promise)};Promise.bind=function Promise$Bind(thisArg){var ret=new Promise(INTERNAL);if(debugging)ret._setTrace(Promise.bind,void 0);ret._setFulfilled();ret._setBoundTo(thisArg);return ret};Promise.cast=function Promise$_Cast(obj,caller){if(typeof caller!=="function"){caller=Promise.cast}var ret=Promise._cast(obj,caller,void 0);if(!(ret instanceof Promise)){return Promise.resolve(ret,caller)}return ret};Promise.onPossiblyUnhandledRejection=function Promise$OnPossiblyUnhandledRejection(fn){if(typeof fn==="function"){CapturedTrace.possiblyUnhandledRejection=fn}else{CapturedTrace.possiblyUnhandledRejection=void 0}};var debugging=false||!!(typeof process!=="undefined"&&typeof process.execPath==="string"&&typeof process.env==="object"&&(process.env["BLUEBIRD_DEBUG"]||process.env["NODE_ENV"]==="development"));Promise.longStackTraces=function Promise$LongStackTraces(){if(async.haveItemsQueued()&&debugging===false){throw new Error("cannot enable long stack traces after promises have been created")}debugging=CapturedTrace.isSupported()};Promise.hasLongStackTraces=function Promise$HasLongStackTraces(){return debugging&&CapturedTrace.isSupported()};Promise.prototype._setProxyHandlers=function Promise$_setProxyHandlers(receiver,promiseSlotValue){var index=this._length();if(index>=1048575-5){index=0;this._setLength(0)}if(index===0){this._promise0=promiseSlotValue;this._receiver0=receiver}else{var i=index-5;this[i+3]=promiseSlotValue;this[i+4]=receiver;this[i+0]=this[i+1]=this[i+2]=void 0}this._setLength(index+5)};Promise.prototype._proxyPromiseArray=function Promise$_proxyPromiseArray(promiseArray,index){this._setProxyHandlers(promiseArray,index)};Promise.prototype._proxyPromise=function Promise$_proxyPromise(promise){promise._setProxied();this._setProxyHandlers(promise,-1)};Promise.prototype._then=function Promise$_then(didFulfill,didReject,didProgress,receiver,internalData,caller){var haveInternalData=internalData!==void 0;var ret=haveInternalData?internalData:new Promise(INTERNAL);if(debugging&&!haveInternalData){var haveSameContext=this._peekContext()===this._traceParent;ret._traceParent=haveSameContext?this._traceParent:this;ret._setTrace(typeof caller==="function"?caller:this._then,this)}if(!haveInternalData&&this._isBound()){ret._setBoundTo(this._boundTo)}var callbackIndex=this._addCallbacks(didFulfill,didReject,didProgress,ret,receiver);if(!haveInternalData&&this._cancellable()){ret._setCancellable();ret._cancellationParent=this}if(this.isResolved()){async.invoke(this._queueSettleAt,this,callbackIndex)}return ret};Promise.prototype._length=function Promise$_length(){return this._bitField&1048575};Promise.prototype._isFollowingOrFulfilledOrRejected=function Promise$_isFollowingOrFulfilledOrRejected(){return(this._bitField&939524096)>0};Promise.prototype._isFollowing=function Promise$_isFollowing(){return(this._bitField&536870912)===536870912};Promise.prototype._setLength=function Promise$_setLength(len){this._bitField=this._bitField&-1048576|len&1048575};Promise.prototype._setFulfilled=function Promise$_setFulfilled(){this._bitField=this._bitField|268435456};Promise.prototype._setRejected=function Promise$_setRejected(){this._bitField=this._bitField|134217728};Promise.prototype._setFollowing=function Promise$_setFollowing(){this._bitField=this._bitField|536870912};Promise.prototype._setIsFinal=function Promise$_setIsFinal(){this._bitField=this._bitField|33554432};Promise.prototype._isFinal=function Promise$_isFinal(){return(this._bitField&33554432)>0};Promise.prototype._cancellable=function Promise$_cancellable(){return(this._bitField&67108864)>0};Promise.prototype._setCancellable=function Promise$_setCancellable(){this._bitField=this._bitField|67108864};Promise.prototype._unsetCancellable=function Promise$_unsetCancellable(){this._bitField=this._bitField&~67108864};Promise.prototype._setRejectionIsUnhandled=function Promise$_setRejectionIsUnhandled(){this._bitField=this._bitField|2097152};Promise.prototype._unsetRejectionIsUnhandled=function Promise$_unsetRejectionIsUnhandled(){this._bitField=this._bitField&~2097152};Promise.prototype._isRejectionUnhandled=function Promise$_isRejectionUnhandled(){return(this._bitField&2097152)>0};Promise.prototype._setCarriedStackTrace=function Promise$_setCarriedStackTrace(capturedTrace){this._bitField=this._bitField|1048576;this._fulfillmentHandler0=capturedTrace};Promise.prototype._unsetCarriedStackTrace=function Promise$_unsetCarriedStackTrace(){this._bitField=this._bitField&~1048576;this._fulfillmentHandler0=void 0};Promise.prototype._isCarryingStackTrace=function Promise$_isCarryingStackTrace(){return(this._bitField&1048576)>0};Promise.prototype._getCarriedStackTrace=function Promise$_getCarriedStackTrace(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0};Promise.prototype._receiverAt=function Promise$_receiverAt(index){var ret;if(index===0){ret=this._receiver0}else{ret=this[index+4-5]}if(this._isBound()&&ret===void 0){return this._boundTo}return ret};Promise.prototype._promiseAt=function Promise$_promiseAt(index){if(index===0)return this._promise0;return this[index+3-5]};Promise.prototype._fulfillmentHandlerAt=function Promise$_fulfillmentHandlerAt(index){if(index===0)return this._fulfillmentHandler0;return this[index+0-5]};Promise.prototype._rejectionHandlerAt=function Promise$_rejectionHandlerAt(index){if(index===0)return this._rejectionHandler0;return this[index+1-5]};Promise.prototype._unsetAt=function Promise$_unsetAt(index){if(index===0){this._rejectionHandler0=this._progressHandler0=this._promise0=this._receiver0=void 0;if(!this._isCarryingStackTrace()){this._fulfillmentHandler0=void 0}}else{this[index-5+0]=this[index-5+1]=this[index-5+2]=this[index-5+3]=this[index-5+4]=void 0}};Promise.prototype._resolveFromResolver=function Promise$_resolveFromResolver(resolver){var promise=this;var localDebugging=debugging;if(localDebugging){this._setTrace(this._resolveFromResolver,void 0);this._pushContext()}function Promise$_resolver(val){if(promise._tryFollow(val)){return}promise._fulfill(val)}function Promise$_rejecter(val){var trace=canAttach(val)?val:new Error(val+"");promise._attachExtraTrace(trace);markAsOriginatingFromRejection(val);promise._reject(val,trace===val?void 0:trace)}var r=tryCatch2(resolver,void 0,Promise$_resolver,Promise$_rejecter);if(localDebugging)this._popContext();if(r!==void 0&&r===errorObj){var e=r.e;var trace=canAttach(e)?e:new Error(e+"");promise._reject(e,trace)}};Promise.prototype._addCallbacks=function Promise$_addCallbacks(fulfill,reject,progress,promise,receiver){var index=this._length();if(index>=1048575-5){index=0;this._setLength(0)}if(index===0){this._promise0=promise;if(receiver!==void 0)this._receiver0=receiver;if(typeof fulfill==="function"&&!this._isCarryingStackTrace())this._fulfillmentHandler0=fulfill;
  if(typeof reject==="function")this._rejectionHandler0=reject;if(typeof progress==="function")this._progressHandler0=progress}else{var i=index-5;this[i+3]=promise;this[i+4]=receiver;this[i+0]=typeof fulfill==="function"?fulfill:void 0;this[i+1]=typeof reject==="function"?reject:void 0;this[i+2]=typeof progress==="function"?progress:void 0}this._setLength(index+5);return index};Promise.prototype._setBoundTo=function Promise$_setBoundTo(obj){if(obj!==void 0){this._bitField=this._bitField|8388608;this._boundTo=obj}else{this._bitField=this._bitField&~8388608}};Promise.prototype._isBound=function Promise$_isBound(){return(this._bitField&8388608)===8388608};Promise.prototype._spreadSlowCase=function Promise$_spreadSlowCase(targetFn,promise,values,boundTo){var promiseForAll=Promise$_CreatePromiseArray(values,PromiseArray,this._spreadSlowCase,boundTo).promise()._then(function(){return targetFn.apply(boundTo,arguments)},void 0,void 0,APPLY,void 0,this._spreadSlowCase);promise._follow(promiseForAll)};Promise.prototype._callSpread=function Promise$_callSpread(handler,promise,value,localDebugging){var boundTo=this._isBound()?this._boundTo:void 0;if(isArray(value)){var caller=this._settlePromiseFromHandler;for(var i=0,len=value.length;i<len;++i){if(isPromise(Promise._cast(value[i],caller,void 0))){this._spreadSlowCase(handler,promise,value,boundTo);return}}}if(localDebugging)promise._pushContext();return tryCatchApply(handler,value,boundTo)};Promise.prototype._callHandler=function Promise$_callHandler(handler,receiver,promise,value,localDebugging){var x;if(receiver===APPLY&&!this.isRejected()){x=this._callSpread(handler,promise,value,localDebugging)}else{if(localDebugging)promise._pushContext();x=tryCatch1(handler,receiver,value)}if(localDebugging)promise._popContext();return x};Promise.prototype._settlePromiseFromHandler=function Promise$_settlePromiseFromHandler(handler,receiver,value,promise){if(!isPromise(promise)){handler.call(receiver,value,promise);return}var localDebugging=debugging;var x=this._callHandler(handler,receiver,promise,value,localDebugging);if(promise._isFollowing())return;if(x===errorObj||x===promise||x===NEXT_FILTER){var err=x===promise?makeSelfResolutionError():x.e;var trace=canAttach(err)?err:new Error(err+"");if(x!==NEXT_FILTER)promise._attachExtraTrace(trace);promise._rejectUnchecked(err,trace)}else{var castValue=Promise._cast(x,localDebugging?this._settlePromiseFromHandler:void 0,promise);if(isPromise(castValue)){if(castValue.isRejected()&&!castValue._isCarryingStackTrace()&&!canAttach(castValue._settledValue)){var trace=new Error(castValue._settledValue+"");promise._attachExtraTrace(trace);castValue._setCarriedStackTrace(trace)}promise._follow(castValue);if(castValue._cancellable()){promise._cancellationParent=castValue;promise._setCancellable()}}else{promise._fulfillUnchecked(x)}}};Promise.prototype._follow=function Promise$_follow(promise){this._setFollowing();if(promise.isPending()){if(promise._cancellable()){this._cancellationParent=promise;this._setCancellable()}promise._proxyPromise(this)}else if(promise.isFulfilled()){this._fulfillUnchecked(promise._settledValue)}else{this._rejectUnchecked(promise._settledValue,promise._getCarriedStackTrace())}if(promise._isRejectionUnhandled())promise._unsetRejectionIsUnhandled();if(debugging&&promise._traceParent==null){promise._traceParent=this}};Promise.prototype._tryFollow=function Promise$_tryFollow(value){if(this._isFollowingOrFulfilledOrRejected()||value===this){return false}var maybePromise=Promise._cast(value,this._tryFollow,void 0);if(!isPromise(maybePromise)){return false}this._follow(maybePromise);return true};Promise.prototype._resetTrace=function Promise$_resetTrace(caller){if(debugging){var context=this._peekContext();var isTopLevel=context===void 0;this._trace=new CapturedTrace(typeof caller==="function"?caller:this._resetTrace,isTopLevel)}};Promise.prototype._setTrace=function Promise$_setTrace(caller,parent){if(debugging){var context=this._peekContext();this._traceParent=context;var isTopLevel=context===void 0;if(parent!==void 0&&parent._traceParent===context){this._trace=parent._trace}else{this._trace=new CapturedTrace(typeof caller==="function"?caller:this._setTrace,isTopLevel)}}return this};Promise.prototype._attachExtraTrace=function Promise$_attachExtraTrace(error){if(debugging){var promise=this;var stack=error.stack;stack=typeof stack==="string"?stack.split("\n"):[];var headerLineCount=1;while(promise!=null&&promise._trace!=null){stack=CapturedTrace.combine(stack,promise._trace.stack.split("\n"));promise=promise._traceParent}var max=Error.stackTraceLimit+headerLineCount;var len=stack.length;if(len>max){stack.length=max}if(stack.length<=headerLineCount){error.stack="(No stack trace)"}else{error.stack=stack.join("\n")}}};Promise.prototype._cleanValues=function Promise$_cleanValues(){if(this._cancellable()){this._cancellationParent=void 0}};Promise.prototype._fulfill=function Promise$_fulfill(value){if(this._isFollowingOrFulfilledOrRejected())return;this._fulfillUnchecked(value)};Promise.prototype._reject=function Promise$_reject(reason,carriedStackTrace){if(this._isFollowingOrFulfilledOrRejected())return;this._rejectUnchecked(reason,carriedStackTrace)};Promise.prototype._settlePromiseAt=function Promise$_settlePromiseAt(index){var handler=this.isFulfilled()?this._fulfillmentHandlerAt(index):this._rejectionHandlerAt(index);var value=this._settledValue;var receiver=this._receiverAt(index);var promise=this._promiseAt(index);if(typeof handler==="function"){this._settlePromiseFromHandler(handler,receiver,value,promise)}else{var done=false;var isFulfilled=this.isFulfilled();if(receiver!==void 0){if(receiver instanceof Promise&&receiver._isProxied()){receiver._unsetProxied();if(isFulfilled)receiver._fulfillUnchecked(value);else receiver._rejectUnchecked(value,this._getCarriedStackTrace());done=true}else if(isPromiseArrayProxy(receiver,promise)){if(isFulfilled)receiver._promiseFulfilled(value,promise);else receiver._promiseRejected(value,promise);done=true}}if(!done){if(isFulfilled)promise._fulfill(value);else promise._reject(value,this._getCarriedStackTrace())}}if(index>=256){this._queueGC()}};Promise.prototype._isProxied=function Promise$_isProxied(){return(this._bitField&4194304)===4194304};Promise.prototype._setProxied=function Promise$_setProxied(){this._bitField=this._bitField|4194304};Promise.prototype._unsetProxied=function Promise$_unsetProxied(){this._bitField=this._bitField&~4194304};Promise.prototype._isGcQueued=function Promise$_isGcQueued(){return(this._bitField&-1073741824)===-1073741824};Promise.prototype._setGcQueued=function Promise$_setGcQueued(){this._bitField=this._bitField|-1073741824};Promise.prototype._unsetGcQueued=function Promise$_unsetGcQueued(){this._bitField=this._bitField&~-1073741824};Promise.prototype._queueGC=function Promise$_queueGC(){if(this._isGcQueued())return;this._setGcQueued();async.invokeLater(this._gc,this,void 0)};Promise.prototype._gc=function Promise$gc(){var len=this._length();this._unsetAt(0);for(var i=0;i<len;i++){delete this[i]}this._setLength(0);this._unsetGcQueued()};Promise.prototype._queueSettleAt=function Promise$_queueSettleAt(index){if(this._isRejectionUnhandled())this._unsetRejectionIsUnhandled();async.invoke(this._settlePromiseAt,this,index)};Promise.prototype._fulfillUnchecked=function Promise$_fulfillUnchecked(value){if(!this.isPending())return;if(value===this){var err=makeSelfResolutionError();this._attachExtraTrace(err);return this._rejectUnchecked(err,void 0)}this._cleanValues();this._setFulfilled();this._settledValue=value;var len=this._length();if(len>0){async.invoke(this._fulfillPromises,this,len)}};Promise.prototype._rejectUncheckedCheckError=function Promise$_rejectUncheckedCheckError(reason){var trace=canAttach(reason)?reason:new Error(reason+"");this._rejectUnchecked(reason,trace===reason?void 0:trace)};Promise.prototype._rejectUnchecked=function Promise$_rejectUnchecked(reason,trace){if(!this.isPending())return;if(reason===this){var err=makeSelfResolutionError();this._attachExtraTrace(err);return this._rejectUnchecked(err)}this._cleanValues();this._setRejected();this._settledValue=reason;if(this._isFinal()){async.invokeLater(thrower,void 0,trace===void 0?reason:trace);return}var len=this._length();if(trace!==void 0)this._setCarriedStackTrace(trace);if(len>0){async.invoke(this._rejectPromises,this,null)}else{this._ensurePossibleRejectionHandled()}};Promise.prototype._rejectPromises=function Promise$_rejectPromises(){var len=this._length();for(var i=0;i<len;i+=5){this._settlePromiseAt(i)}this._unsetCarriedStackTrace()};Promise.prototype._fulfillPromises=function Promise$_fulfillPromises(len){len=this._length();for(var i=0;i<len;i+=5){this._settlePromiseAt(i)}};Promise.prototype._ensurePossibleRejectionHandled=function Promise$_ensurePossibleRejectionHandled(){this._setRejectionIsUnhandled();if(CapturedTrace.possiblyUnhandledRejection!==void 0){async.invokeLater(this._notifyUnhandledRejection,this,void 0)}};Promise.prototype._notifyUnhandledRejection=function Promise$_notifyUnhandledRejection(){if(this._isRejectionUnhandled()){var reason=this._settledValue;var trace=this._getCarriedStackTrace();this._unsetRejectionIsUnhandled();if(trace!==void 0){this._unsetCarriedStackTrace();reason=trace}if(typeof CapturedTrace.possiblyUnhandledRejection==="function"){CapturedTrace.possiblyUnhandledRejection(reason,this)}}};var contextStack=[];Promise.prototype._peekContext=function Promise$_peekContext(){var lastIndex=contextStack.length-1;if(lastIndex>=0){return contextStack[lastIndex]}return void 0};Promise.prototype._pushContext=function Promise$_pushContext(){if(!debugging)return;contextStack.push(this)};Promise.prototype._popContext=function Promise$_popContext(){if(!debugging)return;contextStack.pop()};function Promise$_CreatePromiseArray(promises,PromiseArrayConstructor,caller,boundTo){var list=null;if(isArray(promises)){list=promises}else{list=Promise._cast(promises,caller,void 0);if(list!==promises){list._setBoundTo(boundTo)}else if(!isPromise(list)){list=null}}if(list!==null){return new PromiseArrayConstructor(list,typeof caller==="function"?caller:Promise$_CreatePromiseArray,boundTo)}return{promise:function(){return apiRejection("expecting an array, a promise or a thenable")}}}var old=global.Promise;Promise.noConflict=function(){if(global.Promise===Promise){global.Promise=old}return Promise};if(!CapturedTrace.isSupported()){Promise.longStackTraces=function(){};debugging=false}Promise._makeSelfResolutionError=makeSelfResolutionError;require("./finally.js")(Promise,NEXT_FILTER);require("./direct_resolve.js")(Promise);require("./thenables.js")(Promise,INTERNAL);Promise.RangeError=RangeError;Promise.CancellationError=CancellationError;Promise.TimeoutError=TimeoutError;Promise.TypeError=TypeError;Promise.RejectionError=RejectionError;util.toFastProperties(Promise);util.toFastProperties(Promise.prototype);require("./timers.js")(Promise,INTERNAL);require("./synchronous_inspection.js")(Promise);require("./any.js")(Promise,Promise$_CreatePromiseArray,PromiseArray);require("./race.js")(Promise,INTERNAL);require("./call_get.js")(Promise);require("./filter.js")(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection);require("./generators.js")(Promise,apiRejection,INTERNAL);require("./map.js")(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection);require("./nodeify.js")(Promise);require("./promisify.js")(Promise,INTERNAL);require("./props.js")(Promise,PromiseArray);require("./reduce.js")(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection,INTERNAL);require("./settle.js")(Promise,Promise$_CreatePromiseArray,PromiseArray);require("./some.js")(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection);require("./progress.js")(Promise,isPromiseArrayProxy);require("./cancel.js")(Promise,INTERNAL);Promise.prototype=Promise.prototype;return Promise}},{"./any.js":1,"./async.js":2,"./call_get.js":4,"./cancel.js":5,"./captured_trace.js":6,"./catch_filter.js":7,"./direct_resolve.js":8,"./errors.js":9,"./errors_api_rejection":10,"./filter.js":12,"./finally.js":13,"./generators.js":14,"./global.js":15,"./map.js":16,"./nodeify.js":17,"./progress.js":18,"./promise_array.js":20,"./promise_resolver.js":22,"./promisify.js":24,"./props.js":26,"./race.js":28,"./reduce.js":29,"./settle.js":31,"./some.js":33,"./synchronous_inspection.js":35,"./thenables.js":36,"./timers.js":37,"./util.js":38}],20:[function(require,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var canAttach=require("./errors.js").canAttach;var util=require("./util.js");var async=require("./async.js");var hasOwn={}.hasOwnProperty;var isArray=util.isArray;function toResolutionValue(val){switch(val){case-1:return void 0;case-2:return[];case-3:return{}}}function PromiseArray(values,caller,boundTo){var promise=this._promise=new Promise(INTERNAL);var parent=void 0;if(Promise.is(values)){parent=values;if(values._cancellable()){promise._setCancellable();promise._cancellationParent=values}if(values._isBound()){promise._setBoundTo(boundTo)}}promise._setTrace(caller,parent);this._values=values;this._length=0;this._totalResolved=0;this._init(void 0,-2)}PromiseArray.PropertiesPromiseArray=function(){};PromiseArray.prototype.length=function PromiseArray$length(){return this._length};PromiseArray.prototype.promise=function PromiseArray$promise(){return this._promise};PromiseArray.prototype._init=function PromiseArray$_init(_,resolveValueIfEmpty){var values=this._values;if(Promise.is(values)){if(values.isFulfilled()){values=values._settledValue;if(!isArray(values)){var err=new Promise.TypeError("expecting an array, a promise or a thenable");this.__hardReject__(err);return}this._values=values}else if(values.isPending()){values._then(this._init,this._reject,void 0,this,resolveValueIfEmpty,this.constructor);return}else{this._reject(values._settledValue);return}}if(values.length===0){this._resolve(toResolutionValue(resolveValueIfEmpty));return}var len=values.length;var newLen=len;var newValues;if(this instanceof PromiseArray.PropertiesPromiseArray){newValues=this._values}else{newValues=new Array(len)}var isDirectScanNeeded=false;for(var i=0;i<len;++i){var promise=values[i];if(promise===void 0&&!hasOwn.call(values,i)){newLen--;continue}var maybePromise=Promise._cast(promise,void 0,void 0);if(maybePromise instanceof Promise){if(maybePromise.isPending()){maybePromise._proxyPromiseArray(this,i)}else{maybePromise._unsetRejectionIsUnhandled();isDirectScanNeeded=true}}else{isDirectScanNeeded=true}newValues[i]=maybePromise}if(newLen===0){if(resolveValueIfEmpty===-2){this._resolve(newValues)}else{this._resolve(toResolutionValue(resolveValueIfEmpty))}return}this._values=newValues;this._length=newLen;if(isDirectScanNeeded){var scanMethod=newLen===len?this._scanDirectValues:this._scanDirectValuesHoled;async.invoke(scanMethod,this,len)}};PromiseArray.prototype._settlePromiseAt=function PromiseArray$_settlePromiseAt(index){var value=this._values[index];if(!Promise.is(value)){this._promiseFulfilled(value,index)}else if(value.isFulfilled()){this._promiseFulfilled(value._settledValue,index)}else if(value.isRejected()){this._promiseRejected(value._settledValue,index)}};PromiseArray.prototype._scanDirectValuesHoled=function PromiseArray$_scanDirectValuesHoled(len){for(var i=0;i<len;++i){if(this._isResolved()){break}if(hasOwn.call(this._values,i)){this._settlePromiseAt(i)}}};PromiseArray.prototype._scanDirectValues=function PromiseArray$_scanDirectValues(len){for(var i=0;i<len;++i){if(this._isResolved()){break}this._settlePromiseAt(i)}};PromiseArray.prototype._isResolved=function PromiseArray$_isResolved(){return this._values===null};PromiseArray.prototype._resolve=function PromiseArray$_resolve(value){this._values=null;this._promise._fulfill(value)};PromiseArray.prototype.__hardReject__=PromiseArray.prototype._reject=function PromiseArray$_reject(reason){this._values=null;var trace=canAttach(reason)?reason:new Error(reason+"");this._promise._attachExtraTrace(trace);this._promise._reject(reason,trace)};PromiseArray.prototype._promiseProgressed=function PromiseArray$_promiseProgressed(progressValue,index){if(this._isResolved())return;this._promise._progress({index:index,value:progressValue})};PromiseArray.prototype._promiseFulfilled=function PromiseArray$_promiseFulfilled(value,index){if(this._isResolved())return;this._values[index]=value;var totalResolved=++this._totalResolved;if(totalResolved>=this._length){this._resolve(this._values)}};PromiseArray.prototype._promiseRejected=function PromiseArray$_promiseRejected(reason,index){if(this._isResolved())return;this._totalResolved++;this._reject(reason)};return PromiseArray}},{"./async.js":2,"./errors.js":9,"./util.js":38}],21:[function(require,module,exports){"use strict";var TypeError=require("./errors.js").TypeError;function PromiseInspection(promise){if(promise!==void 0){this._bitField=promise._bitField;this._settledValue=promise.isResolved()?promise._settledValue:void 0}else{this._bitField=0;this._settledValue=void 0}}PromiseInspection.prototype.isFulfilled=function PromiseInspection$isFulfilled(){return(this._bitField&268435456)>0};PromiseInspection.prototype.isRejected=function PromiseInspection$isRejected(){return(this._bitField&134217728)>0};PromiseInspection.prototype.isPending=function PromiseInspection$isPending(){return(this._bitField&402653184)===0};PromiseInspection.prototype.value=function PromiseInspection$value(){if(!this.isFulfilled()){throw new TypeError("cannot get fulfillment value of a non-fulfilled promise")}return this._settledValue};PromiseInspection.prototype.error=function PromiseInspection$error(){if(!this.isRejected()){throw new TypeError("cannot get rejection reason of a non-rejected promise")}return this._settledValue};module.exports=PromiseInspection},{"./errors.js":9}],22:[function(require,module,exports){"use strict";var util=require("./util.js");var maybeWrapAsError=util.maybeWrapAsError;var errors=require("./errors.js");var TimeoutError=errors.TimeoutError;var RejectionError=errors.RejectionError;var async=require("./async.js");var haveGetters=util.haveGetters;var es5=require("./es5.js");function isUntypedError(obj){return obj instanceof Error&&es5.getPrototypeOf(obj)===Error.prototype}function wrapAsRejectionError(obj){var ret;if(isUntypedError(obj)){ret=new RejectionError(obj)}else{ret=obj}errors.markAsOriginatingFromRejection(ret);return ret}function nodebackForPromise(promise){function PromiseResolver$_callback(err,value){if(promise===null)return;if(err){var wrapped=wrapAsRejectionError(maybeWrapAsError(err));promise._attachExtraTrace(wrapped);promise._reject(wrapped)}else{if(arguments.length>2){var $_len=arguments.length;var args=new Array($_len-1);for(var $_i=1;$_i<$_len;++$_i){args[$_i-1]=arguments[$_i]}promise._fulfill(args)}else{promise._fulfill(value)}}promise=null}return PromiseResolver$_callback}var PromiseResolver;if(!haveGetters){PromiseResolver=function PromiseResolver(promise){this.promise=promise;this.asCallback=nodebackForPromise(promise);this.callback=this.asCallback}}else{PromiseResolver=function PromiseResolver(promise){this.promise=promise}}if(haveGetters){var prop={get:function(){return nodebackForPromise(this.promise)}};es5.defineProperty(PromiseResolver.prototype,"asCallback",prop);es5.defineProperty(PromiseResolver.prototype,"callback",prop)}PromiseResolver._nodebackForPromise=nodebackForPromise;PromiseResolver.prototype.toString=function PromiseResolver$toString(){return"[object PromiseResolver]"};PromiseResolver.prototype.resolve=PromiseResolver.prototype.fulfill=function PromiseResolver$resolve(value){var promise=this.promise;if(promise._tryFollow(value)){return}async.invoke(promise._fulfill,promise,value)};PromiseResolver.prototype.reject=function PromiseResolver$reject(reason){var promise=this.promise;errors.markAsOriginatingFromRejection(reason);var trace=errors.canAttach(reason)?reason:new Error(reason+"");promise._attachExtraTrace(trace);async.invoke(promise._reject,promise,reason);if(trace!==reason){async.invoke(this._setCarriedStackTrace,this,trace)}};PromiseResolver.prototype.progress=function PromiseResolver$progress(value){async.invoke(this.promise._progress,this.promise,value)};PromiseResolver.prototype.cancel=function PromiseResolver$cancel(){async.invoke(this.promise.cancel,this.promise,void 0)};PromiseResolver.prototype.timeout=function PromiseResolver$timeout(){this.reject(new TimeoutError("timeout"))};PromiseResolver.prototype.isResolved=function PromiseResolver$isResolved(){return this.promise.isResolved()};PromiseResolver.prototype.toJSON=function PromiseResolver$toJSON(){return this.promise.toJSON()};PromiseResolver.prototype._setCarriedStackTrace=function PromiseResolver$_setCarriedStackTrace(trace){if(this.promise.isRejected()){this.promise._setCarriedStackTrace(trace)}};module.exports=PromiseResolver},{"./async.js":2,"./errors.js":9,"./es5.js":11,"./util.js":38}],23:[function(require,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var errors=require("./errors.js");var TypeError=errors.TypeError;var util=require("./util.js");var isArray=util.isArray;var errorObj=util.errorObj;var tryCatch1=util.tryCatch1;var yieldHandlers=[];function promiseFromYieldHandler(value){var _yieldHandlers=yieldHandlers;var _errorObj=errorObj;var _Promise=Promise;var len=_yieldHandlers.length;for(var i=0;i<len;++i){var result=tryCatch1(_yieldHandlers[i],void 0,value);if(result===_errorObj){return _Promise.reject(_errorObj.e)}var maybePromise=_Promise._cast(result,promiseFromYieldHandler,void 0);if(maybePromise instanceof _Promise)return maybePromise}return null}function PromiseSpawn(generatorFunction,receiver,caller){var promise=this._promise=new Promise(INTERNAL);promise._setTrace(caller,void 0);this._generatorFunction=generatorFunction;this._receiver=receiver;this._generator=void 0}PromiseSpawn.prototype.promise=function PromiseSpawn$promise(){return this._promise};PromiseSpawn.prototype._run=function PromiseSpawn$_run(){this._generator=this._generatorFunction.call(this._receiver);this._receiver=this._generatorFunction=void 0;this._next(void 0)};PromiseSpawn.prototype._continue=function PromiseSpawn$_continue(result){if(result===errorObj){this._generator=void 0;var trace=errors.canAttach(result.e)?result.e:new Error(result.e+"");this._promise._attachExtraTrace(trace);this._promise._reject(result.e,trace);return}var value=result.value;if(result.done===true){this._generator=void 0;if(!this._promise._tryFollow(value)){this._promise._fulfill(value)}}else{var maybePromise=Promise._cast(value,PromiseSpawn$_continue,void 0);if(!(maybePromise instanceof Promise)){if(isArray(maybePromise)){maybePromise=Promise.all(maybePromise)}else{maybePromise=promiseFromYieldHandler(maybePromise)}if(maybePromise===null){this._throw(new TypeError("A value was yielded that could not be treated as a promise"));return}}maybePromise._then(this._next,this._throw,void 0,this,null,void 0)}};PromiseSpawn.prototype._throw=function PromiseSpawn$_throw(reason){if(errors.canAttach(reason))this._promise._attachExtraTrace(reason);this._continue(tryCatch1(this._generator["throw"],this._generator,reason))};PromiseSpawn.prototype._next=function PromiseSpawn$_next(value){this._continue(tryCatch1(this._generator.next,this._generator,value))};PromiseSpawn.addYieldHandler=function PromiseSpawn$AddYieldHandler(fn){if(typeof fn!=="function")throw new TypeError("fn must be a function");yieldHandlers.push(fn)};return PromiseSpawn}},{"./errors.js":9,"./util.js":38}],24:[function(require,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var THIS={};var util=require("./util.js");var es5=require("./es5.js");var nodebackForPromise=require("./promise_resolver.js")._nodebackForPromise;var withAppended=util.withAppended;var maybeWrapAsError=util.maybeWrapAsError;var canEvaluate=util.canEvaluate;var notEnumerableProp=util.notEnumerableProp;var deprecated=util.deprecated;var roriginal=new RegExp("__beforePromisified__"+"$");var hasProp={}.hasOwnProperty;function isPromisified(fn){return fn.__isPromisified__===true}var inheritedMethods=function(){if(es5.isES5){var create=Object.create;var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;return function(cur){var original=cur;var ret=[];var visitedKeys=create(null);while(cur!==null){var keys=es5.keys(cur);for(var i=0,len=keys.length;i<len;++i){var key=keys[i];if(visitedKeys[key]||roriginal.test(key)||hasProp.call(original,key+"__beforePromisified__")){continue}visitedKeys[key]=true;var desc=getOwnPropertyDescriptor(cur,key);if(desc!=null&&typeof desc.value==="function"&&!isPromisified(desc.value)){ret.push(key,desc.value)}}cur=es5.getPrototypeOf(cur)}return ret}}else{return function(obj){var ret=[];for(var key in obj){if(roriginal.test(key)||hasProp.call(obj,key+"__beforePromisified__")){continue}var fn=obj[key];if(typeof fn==="function"&&!isPromisified(fn)){ret.push(key,fn)}}return ret}}}();function switchCaseArgumentOrder(likelyArgumentCount){var ret=[likelyArgumentCount];var min=Math.max(0,likelyArgumentCount-1-5);for(var i=likelyArgumentCount-1;i>=min;--i){if(i===likelyArgumentCount)continue;ret.push(i)}for(var i=likelyArgumentCount+1;i<=5;++i){ret.push(i)}return ret}function parameterDeclaration(parameterCount){var ret=new Array(parameterCount);for(var i=0;i<ret.length;++i){ret[i]="_arg"+i}return ret.join(", ")}function parameterCount(fn){if(typeof fn.length==="number"){return Math.max(Math.min(fn.length,1023+1),0)}return 0}function propertyAccess(id){var rident=/^[a-z$_][a-z$_0-9]*$/i;if(rident.test(id)){return"."+id}else return"['"+id.replace(/(['\\])/g,"\\$1")+"']"}function makeNodePromisifiedEval(callback,receiver,originalName,fn){var newParameterCount=Math.max(0,parameterCount(fn)-1);var argumentOrder=switchCaseArgumentOrder(newParameterCount);var callbackName=typeof originalName==="string"?originalName+"Async":"promisified";function generateCallForArgumentCount(count){var args=new Array(count);for(var i=0,len=args.length;i<len;++i){args[i]="arguments["+i+"]"}var comma=count>0?",":"";if(typeof callback==="string"&&receiver===THIS){return"this"+propertyAccess(callback)+"("+args.join(",")+comma+" fn);"+"break;"}return(receiver===void 0?"callback("+args.join(",")+comma+" fn);":"callback.call("+(receiver===THIS?"this":"receiver")+", "+args.join(",")+comma+" fn);")+"break;"}function generateArgumentSwitchCase(){var ret="";for(var i=0;i<argumentOrder.length;++i){ret+="case "+argumentOrder[i]+":"+generateCallForArgumentCount(argumentOrder[i])}ret+="default: var args = new Array(len + 1);"+"var i = 0;"+"for (var i = 0; i < len; ++i) { "+"   args[i] = arguments[i];"+"}"+"args[i] = fn;"+(typeof callback==="string"?"this"+propertyAccess(callback)+".apply(":"callback.apply(")+(receiver===THIS?"this":"receiver")+", args); break;";return ret}return new Function("Promise","callback","receiver","withAppended","maybeWrapAsError","nodebackForPromise","INTERNAL","var ret = function "+callbackName+"("+parameterDeclaration(newParameterCount)+') {"use strict";'+"var len = arguments.length;"+"var promise = new Promise(INTERNAL);"+"promise._setTrace("+callbackName+", void 0);"+"var fn = nodebackForPromise(promise);"+"try {"+"switch(len) {"+generateArgumentSwitchCase()+"}"+"}"+"catch(e){ "+"var wrapped = maybeWrapAsError(e);"+"promise._attachExtraTrace(wrapped);"+"promise._reject(wrapped);"+"}"+"return promise;"+""+"}; ret.__isPromisified__ = true; return ret;")(Promise,callback,receiver,withAppended,maybeWrapAsError,nodebackForPromise,INTERNAL)}function makeNodePromisifiedClosure(callback,receiver){function promisified(){var _receiver=receiver;if(receiver===THIS)_receiver=this;if(typeof callback==="string"){callback=_receiver[callback]}var promise=new Promise(INTERNAL);promise._setTrace(promisified,void 0);var fn=nodebackForPromise(promise);try{callback.apply(_receiver,withAppended(arguments,fn))}catch(e){var wrapped=maybeWrapAsError(e);promise._attachExtraTrace(wrapped);promise._reject(wrapped)}return promise}promisified.__isPromisified__=true;return promisified}var makeNodePromisified=canEvaluate?makeNodePromisifiedEval:makeNodePromisifiedClosure;function _promisify(callback,receiver,isAll){if(isAll){var methods=inheritedMethods(callback);for(var i=0,len=methods.length;i<len;i+=2){var key=methods[i];var fn=methods[i+1];var originalKey=key+"__beforePromisified__";var promisifiedKey=key+"Async";notEnumerableProp(callback,originalKey,fn);callback[promisifiedKey]=makeNodePromisified(originalKey,THIS,key,fn)}util.toFastProperties(callback);return callback}else{return makeNodePromisified(callback,receiver,void 0,callback)}}Promise.promisify=function Promise$Promisify(fn,receiver){if(typeof fn==="object"&&fn!==null){deprecated("Promise.promisify for promisifying entire objects is deprecated. Use Promise.promisifyAll instead.");return _promisify(fn,receiver,true)}if(typeof fn!=="function"){throw new TypeError("fn must be a function")}if(isPromisified(fn)){return fn}return _promisify(fn,arguments.length<2?THIS:receiver,false)};Promise.promisifyAll=function Promise$PromisifyAll(target){if(typeof target!=="function"&&typeof target!=="object"){throw new TypeError("the target of promisifyAll must be an object or a function")}return _promisify(target,void 0,true)}}},{"./es5.js":11,"./promise_resolver.js":22,"./util.js":38}],25:[function(require,module,exports){"use strict";module.exports=function(Promise,PromiseArray){var util=require("./util.js");var inherits=util.inherits;var es5=require("./es5.js");function PropertiesPromiseArray(obj,caller,boundTo){var keys=es5.keys(obj);var values=new Array(keys.length);for(var i=0,len=values.length;i<len;++i){values[i]=obj[keys[i]]}this.constructor$(values,caller,boundTo);if(!this._isResolved()){for(var i=0,len=keys.length;i<len;++i){values.push(keys[i])}}}inherits(PropertiesPromiseArray,PromiseArray);PropertiesPromiseArray.prototype._init=function PropertiesPromiseArray$_init(){this._init$(void 0,-3)};PropertiesPromiseArray.prototype._promiseFulfilled=function PropertiesPromiseArray$_promiseFulfilled(value,index){if(this._isResolved())return;this._values[index]=value;var totalResolved=++this._totalResolved;if(totalResolved>=this._length){var val={};var keyOffset=this.length();for(var i=0,len=this.length();i<len;++i){val[this._values[i+keyOffset]]=this._values[i]}this._resolve(val)}};PropertiesPromiseArray.prototype._promiseProgressed=function PropertiesPromiseArray$_promiseProgressed(value,index){if(this._isResolved())return;this._promise._progress({key:this._values[index+this.length()],value:value})};PromiseArray.PropertiesPromiseArray=PropertiesPromiseArray;return PropertiesPromiseArray}},{"./es5.js":11,"./util.js":38}],26:[function(require,module,exports){"use strict";module.exports=function(Promise,PromiseArray){var PropertiesPromiseArray=require("./properties_promise_array.js")(Promise,PromiseArray);var util=require("./util.js");var apiRejection=require("./errors_api_rejection")(Promise);var isObject=util.isObject;function Promise$_Props(promises,useBound,caller){var ret;var castValue=Promise._cast(promises,caller,void 0);if(!isObject(castValue)){return apiRejection("cannot await properties of a non-object")}else if(Promise.is(castValue)){ret=castValue._then(Promise.props,void 0,void 0,void 0,void 0,caller)}else{ret=new PropertiesPromiseArray(castValue,caller,useBound===true&&castValue._isBound()?castValue._boundTo:void 0).promise();useBound=false}if(useBound===true&&castValue._isBound()){ret._setBoundTo(castValue._boundTo)}return ret}Promise.prototype.props=function Promise$props(){return Promise$_Props(this,true,this.props)};Promise.props=function Promise$Props(promises){return Promise$_Props(promises,false,Promise.props)}}},{"./errors_api_rejection":10,"./properties_promise_array.js":25,"./util.js":38}],27:[function(require,module,exports){"use strict";function arrayCopy(src,srcIndex,dst,dstIndex,len){for(var j=0;j<len;++j){dst[j+dstIndex]=src[j+srcIndex]
  }}function pow2AtLeast(n){n=n>>>0;n=n-1;n=n|n>>1;n=n|n>>2;n=n|n>>4;n=n|n>>8;n=n|n>>16;return n+1}function getCapacity(capacity){if(typeof capacity!=="number")return 16;return pow2AtLeast(Math.min(Math.max(16,capacity),1073741824))}function Queue(capacity){this._capacity=getCapacity(capacity);this._length=0;this._front=0;this._makeCapacity()}Queue.prototype._willBeOverCapacity=function Queue$_willBeOverCapacity(size){return this._capacity<size};Queue.prototype._pushOne=function Queue$_pushOne(arg){var length=this.length();this._checkCapacity(length+1);var i=this._front+length&this._capacity-1;this[i]=arg;this._length=length+1};Queue.prototype.push=function Queue$push(fn,receiver,arg){var length=this.length()+3;if(this._willBeOverCapacity(length)){this._pushOne(fn);this._pushOne(receiver);this._pushOne(arg);return}var j=this._front+length-3;this._checkCapacity(length);var wrapMask=this._capacity-1;this[j+0&wrapMask]=fn;this[j+1&wrapMask]=receiver;this[j+2&wrapMask]=arg;this._length=length};Queue.prototype.shift=function Queue$shift(){var front=this._front,ret=this[front];this[front]=void 0;this._front=front+1&this._capacity-1;this._length--;return ret};Queue.prototype.length=function Queue$length(){return this._length};Queue.prototype._makeCapacity=function Queue$_makeCapacity(){var len=this._capacity;for(var i=0;i<len;++i){this[i]=void 0}};Queue.prototype._checkCapacity=function Queue$_checkCapacity(size){if(this._capacity<size){this._resizeTo(this._capacity<<3)}};Queue.prototype._resizeTo=function Queue$_resizeTo(capacity){var oldFront=this._front;var oldCapacity=this._capacity;var oldQueue=new Array(oldCapacity);var length=this.length();arrayCopy(this,0,oldQueue,0,oldCapacity);this._capacity=capacity;this._makeCapacity();this._front=0;if(oldFront+length<=oldCapacity){arrayCopy(oldQueue,oldFront,this,0,length)}else{var lengthBeforeWrapping=length-(oldFront+length&oldCapacity-1);arrayCopy(oldQueue,oldFront,this,0,lengthBeforeWrapping);arrayCopy(oldQueue,0,this,lengthBeforeWrapping,length-lengthBeforeWrapping)}};module.exports=Queue},{}],28:[function(require,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var apiRejection=require("./errors_api_rejection.js")(Promise);var isArray=require("./util.js").isArray;var raceLater=function Promise$_raceLater(promise){return promise.then(function Promise$_lateRacer(array){return Promise$_Race(array,Promise$_lateRacer,promise)})};var hasOwn={}.hasOwnProperty;function Promise$_Race(promises,caller,parent){var maybePromise=Promise._cast(promises,caller,void 0);if(Promise.is(maybePromise)){return raceLater(maybePromise)}else if(!isArray(promises)){return apiRejection("expecting an array, a promise or a thenable")}var ret=new Promise(INTERNAL);ret._setTrace(caller,parent);if(parent!==void 0){if(parent._isBound()){ret._setBoundTo(parent._boundTo)}if(parent._cancellable()){ret._setCancellable();ret._cancellationParent=parent}}var fulfill=ret._fulfill;var reject=ret._reject;for(var i=0,len=promises.length;i<len;++i){var val=promises[i];if(val===void 0&&!hasOwn.call(promises,i)){continue}Promise.cast(val)._then(fulfill,reject,void 0,ret,null,caller)}return ret}Promise.race=function Promise$Race(promises){return Promise$_Race(promises,Promise.race,void 0)};Promise.prototype.race=function Promise$race(){return Promise$_Race(this,this.race,void 0)}}},{"./errors_api_rejection.js":10,"./util.js":38}],29:[function(require,module,exports){"use strict";module.exports=function(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection,INTERNAL){function Reduction(callback,index,accum,items,receiver){this.promise=new Promise(INTERNAL);this.index=index;this.length=items.length;this.items=items;this.callback=callback;this.receiver=receiver;this.accum=accum}Reduction.prototype.reject=function Reduction$reject(e){this.promise._reject(e)};Reduction.prototype.fulfill=function Reduction$fulfill(value,index){this.accum=value;this.index=index+1;this.iterate()};Reduction.prototype.iterate=function Reduction$iterate(){var i=this.index;var len=this.length;var items=this.items;var result=this.accum;var receiver=this.receiver;var callback=this.callback;var iterate=this.iterate;for(;i<len;++i){result=Promise._cast(callback.call(receiver,result,items[i],i,len),iterate,void 0);if(result instanceof Promise){result._then(this.fulfill,this.reject,void 0,this,i,iterate);return}}this.promise._fulfill(result)};function Promise$_reducer(fulfilleds,initialValue){var fn=this;var receiver=void 0;if(typeof fn!=="function"){receiver=fn.receiver;fn=fn.fn}var len=fulfilleds.length;var accum=void 0;var startIndex=0;if(initialValue!==void 0){accum=initialValue;startIndex=0}else{startIndex=1;if(len>0)accum=fulfilleds[0]}var i=startIndex;if(i>=len){return accum}var reduction=new Reduction(fn,i,accum,fulfilleds,receiver);reduction.iterate();return reduction.promise}function Promise$_unpackReducer(fulfilleds){var fn=this.fn;var initialValue=this.initialValue;return Promise$_reducer.call(fn,fulfilleds,initialValue)}function Promise$_slowReduce(promises,fn,initialValue,useBound,caller){return initialValue._then(function callee(initialValue){return Promise$_Reduce(promises,fn,initialValue,useBound,callee)},void 0,void 0,void 0,void 0,caller)}function Promise$_Reduce(promises,fn,initialValue,useBound,caller){if(typeof fn!=="function"){return apiRejection("fn must be a function")}if(useBound===true&&promises._isBound()){fn={fn:fn,receiver:promises._boundTo}}if(initialValue!==void 0){if(Promise.is(initialValue)){if(initialValue.isFulfilled()){initialValue=initialValue._settledValue}else{return Promise$_slowReduce(promises,fn,initialValue,useBound,caller)}}return Promise$_CreatePromiseArray(promises,PromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0).promise()._then(Promise$_unpackReducer,void 0,void 0,{fn:fn,initialValue:initialValue},void 0,Promise.reduce)}return Promise$_CreatePromiseArray(promises,PromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0).promise()._then(Promise$_reducer,void 0,void 0,fn,void 0,caller)}Promise.reduce=function Promise$Reduce(promises,fn,initialValue){return Promise$_Reduce(promises,fn,initialValue,false,Promise.reduce)};Promise.prototype.reduce=function Promise$reduce(fn,initialValue){return Promise$_Reduce(this,fn,initialValue,true,this.reduce)}}},{}],30:[function(require,module,exports){"use strict";var global=require("./global.js");var schedule;if(typeof process!=="undefined"&&process!==null&&typeof process.cwd==="function"&&typeof process.nextTick==="function"&&typeof process.version==="string"){schedule=function Promise$_Scheduler(fn){process.nextTick(fn)}}else if((typeof global.MutationObserver==="function"||typeof global.WebkitMutationObserver==="function"||typeof global.WebKitMutationObserver==="function")&&typeof document!=="undefined"&&typeof document.createElement==="function"){schedule=function(){var MutationObserver=global.MutationObserver||global.WebkitMutationObserver||global.WebKitMutationObserver;var div=document.createElement("div");var queuedFn=void 0;var observer=new MutationObserver(function Promise$_Scheduler(){var fn=queuedFn;queuedFn=void 0;fn()});observer.observe(div,{attributes:true});return function Promise$_Scheduler(fn){queuedFn=fn;div.setAttribute("class","foo")}}()}else if(typeof global.postMessage==="function"&&typeof global.importScripts!=="function"&&typeof global.addEventListener==="function"&&typeof global.removeEventListener==="function"){var MESSAGE_KEY="bluebird_message_key_"+Math.random();schedule=function(){var queuedFn=void 0;function Promise$_Scheduler(e){if(e.source===global&&e.data===MESSAGE_KEY){var fn=queuedFn;queuedFn=void 0;fn()}}global.addEventListener("message",Promise$_Scheduler,false);return function Promise$_Scheduler(fn){queuedFn=fn;global.postMessage(MESSAGE_KEY,"*")}}()}else if(typeof global.MessageChannel==="function"){schedule=function(){var queuedFn=void 0;var channel=new global.MessageChannel;channel.port1.onmessage=function Promise$_Scheduler(){var fn=queuedFn;queuedFn=void 0;fn()};return function Promise$_Scheduler(fn){queuedFn=fn;channel.port2.postMessage(null)}}()}else if(global.setTimeout){schedule=function Promise$_Scheduler(fn){setTimeout(fn,4)}}else{schedule=function Promise$_Scheduler(fn){fn()}}module.exports=schedule},{"./global.js":15}],31:[function(require,module,exports){"use strict";module.exports=function(Promise,Promise$_CreatePromiseArray,PromiseArray){var SettledPromiseArray=require("./settled_promise_array.js")(Promise,PromiseArray);function Promise$_Settle(promises,useBound,caller){return Promise$_CreatePromiseArray(promises,SettledPromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0).promise()}Promise.settle=function Promise$Settle(promises){return Promise$_Settle(promises,false,Promise.settle)};Promise.prototype.settle=function Promise$settle(){return Promise$_Settle(this,true,this.settle)}}},{"./settled_promise_array.js":32}],32:[function(require,module,exports){"use strict";module.exports=function(Promise,PromiseArray){var PromiseInspection=require("./promise_inspection.js");var util=require("./util.js");var inherits=util.inherits;function SettledPromiseArray(values,caller,boundTo){this.constructor$(values,caller,boundTo)}inherits(SettledPromiseArray,PromiseArray);SettledPromiseArray.prototype._promiseResolved=function SettledPromiseArray$_promiseResolved(index,inspection){this._values[index]=inspection;var totalResolved=++this._totalResolved;if(totalResolved>=this._length){this._resolve(this._values)}};SettledPromiseArray.prototype._promiseFulfilled=function SettledPromiseArray$_promiseFulfilled(value,index){if(this._isResolved())return;var ret=new PromiseInspection;ret._bitField=268435456;ret._settledValue=value;this._promiseResolved(index,ret)};SettledPromiseArray.prototype._promiseRejected=function SettledPromiseArray$_promiseRejected(reason,index){if(this._isResolved())return;var ret=new PromiseInspection;ret._bitField=134217728;ret._settledValue=reason;this._promiseResolved(index,ret)};return SettledPromiseArray}},{"./promise_inspection.js":21,"./util.js":38}],33:[function(require,module,exports){"use strict";module.exports=function(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection){var SomePromiseArray=require("./some_promise_array.js")(PromiseArray);function Promise$_Some(promises,howMany,useBound,caller){if((howMany|0)!==howMany||howMany<0){return apiRejection("expecting a positive integer")}var ret=Promise$_CreatePromiseArray(promises,SomePromiseArray,caller,useBound===true&&promises._isBound()?promises._boundTo:void 0);var promise=ret.promise();if(promise.isRejected()){return promise}ret.setHowMany(howMany);ret.init();return promise}Promise.some=function Promise$Some(promises,howMany){return Promise$_Some(promises,howMany,false,Promise.some)};Promise.prototype.some=function Promise$some(count){return Promise$_Some(this,count,true,this.some)}}},{"./some_promise_array.js":34}],34:[function(require,module,exports){"use strict";module.exports=function(PromiseArray){var util=require("./util.js");var RangeError=require("./errors.js").RangeError;var inherits=util.inherits;var isArray=util.isArray;function SomePromiseArray(values,caller,boundTo){this.constructor$(values,caller,boundTo);this._howMany=0;this._unwrap=false;this._initialized=false}inherits(SomePromiseArray,PromiseArray);SomePromiseArray.prototype._init=function SomePromiseArray$_init(){if(!this._initialized){return}if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-2);var isArrayResolved=isArray(this._values);this._holes=isArrayResolved?this._values.length-this.length():0;if(!this._isResolved()&&isArrayResolved&&this._howMany>this._canPossiblyFulfill()){var message="(Promise.some) input array contains less than "+this._howMany+" promises";this._reject(new RangeError(message))}};SomePromiseArray.prototype.init=function SomePromiseArray$init(){this._initialized=true;this._init()};SomePromiseArray.prototype.setUnwrap=function SomePromiseArray$setUnwrap(){this._unwrap=true};SomePromiseArray.prototype.howMany=function SomePromiseArray$howMany(){return this._howMany};SomePromiseArray.prototype.setHowMany=function SomePromiseArray$setHowMany(count){if(this._isResolved())return;this._howMany=count};SomePromiseArray.prototype._promiseFulfilled=function SomePromiseArray$_promiseFulfilled(value){if(this._isResolved())return;this._addFulfilled(value);if(this._fulfilled()===this.howMany()){this._values.length=this.howMany();if(this.howMany()===1&&this._unwrap){this._resolve(this._values[0])}else{this._resolve(this._values)}}};SomePromiseArray.prototype._promiseRejected=function SomePromiseArray$_promiseRejected(reason){if(this._isResolved())return;this._addRejected(reason);if(this.howMany()>this._canPossiblyFulfill()){if(this._values.length===this.length()){this._reject([])}else{this._reject(this._values.slice(this.length()+this._holes))}}};SomePromiseArray.prototype._fulfilled=function SomePromiseArray$_fulfilled(){return this._totalResolved};SomePromiseArray.prototype._rejected=function SomePromiseArray$_rejected(){return this._values.length-this.length()-this._holes};SomePromiseArray.prototype._addRejected=function SomePromiseArray$_addRejected(reason){this._values.push(reason)};SomePromiseArray.prototype._addFulfilled=function SomePromiseArray$_addFulfilled(value){this._values[this._totalResolved++]=value};SomePromiseArray.prototype._canPossiblyFulfill=function SomePromiseArray$_canPossiblyFulfill(){return this.length()-this._rejected()};return SomePromiseArray}},{"./errors.js":9,"./util.js":38}],35:[function(require,module,exports){"use strict";module.exports=function(Promise){var PromiseInspection=require("./promise_inspection.js");Promise.prototype.inspect=function Promise$inspect(){return new PromiseInspection(this)}}},{"./promise_inspection.js":21}],36:[function(require,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var util=require("./util.js");var canAttach=require("./errors.js").canAttach;var errorObj=util.errorObj;var isObject=util.isObject;function getThen(obj){try{return obj.then}catch(e){errorObj.e=e;return errorObj}}function Promise$_Cast(obj,caller,originalPromise){if(isObject(obj)){if(obj instanceof Promise){return obj}else if(isAnyBluebirdPromise(obj)){var ret=new Promise(INTERNAL);ret._setTrace(caller,void 0);obj._then(ret._fulfillUnchecked,ret._rejectUncheckedCheckError,ret._progressUnchecked,ret,null,void 0);ret._setFollowing();return ret}var then=getThen(obj);if(then===errorObj){caller=typeof caller==="function"?caller:Promise$_Cast;if(originalPromise!==void 0&&canAttach(then.e)){originalPromise._attachExtraTrace(then.e)}return Promise.reject(then.e,caller)}else if(typeof then==="function"){caller=typeof caller==="function"?caller:Promise$_Cast;return Promise$_doThenable(obj,then,caller,originalPromise)}}return obj}var hasProp={}.hasOwnProperty;function isAnyBluebirdPromise(obj){return hasProp.call(obj,"_promise0")}function Promise$_doThenable(x,then,caller,originalPromise){var resolver=Promise.defer(caller);var called=false;try{then.call(x,Promise$_resolveFromThenable,Promise$_rejectFromThenable,Promise$_progressFromThenable)}catch(e){if(!called){called=true;var trace=canAttach(e)?e:new Error(e+"");if(originalPromise!==void 0){originalPromise._attachExtraTrace(trace)}resolver.promise._reject(e,trace)}}return resolver.promise;function Promise$_resolveFromThenable(y){if(called)return;called=true;if(x===y){var e=Promise._makeSelfResolutionError();if(originalPromise!==void 0){originalPromise._attachExtraTrace(e)}resolver.promise._reject(e,void 0);return}resolver.resolve(y)}function Promise$_rejectFromThenable(r){if(called)return;called=true;var trace=canAttach(r)?r:new Error(r+"");if(originalPromise!==void 0){originalPromise._attachExtraTrace(trace)}resolver.promise._reject(r,trace)}function Promise$_progressFromThenable(v){if(called)return;var promise=resolver.promise;if(typeof promise._progress==="function"){promise._progress(v)}}}Promise._cast=Promise$_Cast}},{"./errors.js":9,"./util.js":38}],37:[function(require,module,exports){"use strict";var global=require("./global.js");var setTimeout=function(fn,time){var $_len=arguments.length;var args=new Array($_len-2);for(var $_i=2;$_i<$_len;++$_i){args[$_i-2]=arguments[$_i]}global.setTimeout(function(){fn.apply(void 0,args)},time)};var pass={};global.setTimeout(function(_){if(_===pass){setTimeout=global.setTimeout}},1,pass);module.exports=function(Promise,INTERNAL){var util=require("./util.js");var errors=require("./errors.js");var apiRejection=require("./errors_api_rejection")(Promise);var TimeoutError=Promise.TimeoutError;var afterTimeout=function Promise$_afterTimeout(promise,message,ms){if(!promise.isPending())return;if(typeof message!=="string"){message="operation timed out after"+" "+ms+" ms"}var err=new TimeoutError(message);errors.markAsOriginatingFromRejection(err);promise._attachExtraTrace(err);promise._rejectUnchecked(err)};var afterDelay=function Promise$_afterDelay(value,promise){promise._fulfill(value)};Promise.delay=function Promise$Delay(value,ms,caller){if(ms===void 0){ms=value;value=void 0}ms=+ms;if(typeof caller!=="function"){caller=Promise.delay}var maybePromise=Promise._cast(value,caller,void 0);var promise=new Promise(INTERNAL);if(Promise.is(maybePromise)){if(maybePromise._isBound()){promise._setBoundTo(maybePromise._boundTo)}if(maybePromise._cancellable()){promise._setCancellable();promise._cancellationParent=maybePromise}promise._setTrace(caller,maybePromise);promise._follow(maybePromise);return promise.then(function(value){return Promise.delay(value,ms)})}else{promise._setTrace(caller,void 0);setTimeout(afterDelay,ms,value,promise)}return promise};Promise.prototype.delay=function Promise$delay(ms){return Promise.delay(this,ms,this.delay)};Promise.prototype.timeout=function Promise$timeout(ms,message){ms=+ms;var ret=new Promise(INTERNAL);ret._setTrace(this.timeout,this);if(this._isBound())ret._setBoundTo(this._boundTo);if(this._cancellable()){ret._setCancellable();ret._cancellationParent=this}ret._follow(this);setTimeout(afterTimeout,ms,ret,message,ms);return ret}}},{"./errors.js":9,"./errors_api_rejection":10,"./global.js":15,"./util.js":38}],38:[function(require,module,exports){"use strict";var global=require("./global.js");var es5=require("./es5.js");var haveGetters=function(){try{var o={};es5.defineProperty(o,"f",{get:function(){return 3}});return o.f===3}catch(e){return false}}();var canEvaluate=function(){if(typeof window!=="undefined"&&window!==null&&typeof window.document!=="undefined"&&typeof navigator!=="undefined"&&navigator!==null&&typeof navigator.appName==="string"&&window===global){return false}return true}();function deprecated(msg){if(typeof console!=="undefined"&&console!==null&&typeof console.warn==="function"){console.warn("Bluebird: "+msg)}}var errorObj={e:{}};function tryCatch1(fn,receiver,arg){try{return fn.call(receiver,arg)}catch(e){errorObj.e=e;return errorObj}}function tryCatch2(fn,receiver,arg,arg2){try{return fn.call(receiver,arg,arg2)}catch(e){errorObj.e=e;return errorObj}}function tryCatchApply(fn,args,receiver){try{return fn.apply(receiver,args)}catch(e){errorObj.e=e;return errorObj}}var inherits=function(Child,Parent){var hasProp={}.hasOwnProperty;function T(){this.constructor=Child;this.constructor$=Parent;for(var propertyName in Parent.prototype){if(hasProp.call(Parent.prototype,propertyName)&&propertyName.charAt(propertyName.length-1)!=="$"){this[propertyName+"$"]=Parent.prototype[propertyName]}}}T.prototype=Parent.prototype;Child.prototype=new T;return Child.prototype};function asString(val){return typeof val==="string"?val:""+val}function isPrimitive(val){return val==null||val===true||val===false||typeof val==="string"||typeof val==="number"}function isObject(value){return!isPrimitive(value)}function maybeWrapAsError(maybeError){if(!isPrimitive(maybeError))return maybeError;return new Error(asString(maybeError))}function withAppended(target,appendee){var len=target.length;var ret=new Array(len+1);var i;for(i=0;i<len;++i){ret[i]=target[i]}ret[i]=appendee;return ret}function notEnumerableProp(obj,name,value){if(isPrimitive(obj))return obj;var descriptor={value:value,configurable:true,enumerable:false,writable:true};es5.defineProperty(obj,name,descriptor);return obj}var wrapsPrimitiveReceiver=function(){return this!=="string"}.call("string");function thrower(r){throw r}function toFastProperties(obj){function f(){}f.prototype=obj;return f;eval(obj)}var ret={thrower:thrower,isArray:es5.isArray,haveGetters:haveGetters,notEnumerableProp:notEnumerableProp,isPrimitive:isPrimitive,isObject:isObject,canEvaluate:canEvaluate,deprecated:deprecated,errorObj:errorObj,tryCatch1:tryCatch1,tryCatch2:tryCatch2,tryCatchApply:tryCatchApply,inherits:inherits,withAppended:withAppended,asString:asString,maybeWrapAsError:maybeWrapAsError,wrapsPrimitiveReceiver:wrapsPrimitiveReceiver,toFastProperties:toFastProperties};module.exports=ret},{"./es5.js":11,"./global.js":15}]},{},[3])(3)});var colorbrewer={YlGn:{3:["rgb(247,252,185)","rgb(173,221,142)","rgb(49,163,84)"],4:["rgb(255,255,204)","rgb(194,230,153)","rgb(120,198,121)","rgb(35,132,67)"],5:["rgb(255,255,204)","rgb(194,230,153)","rgb(120,198,121)","rgb(49,163,84)","rgb(0,104,55)"],6:["rgb(255,255,204)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(49,163,84)","rgb(0,104,55)"],7:["rgb(255,255,204)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,90,50)"],8:["rgb(255,255,229)","rgb(247,252,185)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,90,50)"],9:["rgb(255,255,229)","rgb(247,252,185)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,104,55)","rgb(0,69,41)"]},YlGnBu:{3:["rgb(237,248,177)","rgb(127,205,187)","rgb(44,127,184)"],4:["rgb(255,255,204)","rgb(161,218,180)","rgb(65,182,196)","rgb(34,94,168)"],5:["rgb(255,255,204)","rgb(161,218,180)","rgb(65,182,196)","rgb(44,127,184)","rgb(37,52,148)"],6:["rgb(255,255,204)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(44,127,184)","rgb(37,52,148)"],7:["rgb(255,255,204)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(29,145,192)","rgb(34,94,168)","rgb(12,44,132)"],8:["rgb(255,255,217)","rgb(237,248,177)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(29,145,192)","rgb(34,94,168)","rgb(12,44,132)"],9:["rgb(255,255,217)","rgb(237,248,177)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(29,145,192)","rgb(34,94,168)","rgb(37,52,148)","rgb(8,29,88)"]},GnBu:{3:["rgb(224,243,219)","rgb(168,221,181)","rgb(67,162,202)"],4:["rgb(240,249,232)","rgb(186,228,188)","rgb(123,204,196)","rgb(43,140,190)"],5:["rgb(240,249,232)","rgb(186,228,188)","rgb(123,204,196)","rgb(67,162,202)","rgb(8,104,172)"],6:["rgb(240,249,232)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(67,162,202)","rgb(8,104,172)"],7:["rgb(240,249,232)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(78,179,211)","rgb(43,140,190)","rgb(8,88,158)"],8:["rgb(247,252,240)","rgb(224,243,219)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(78,179,211)","rgb(43,140,190)","rgb(8,88,158)"],9:["rgb(247,252,240)","rgb(224,243,219)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(78,179,211)","rgb(43,140,190)","rgb(8,104,172)","rgb(8,64,129)"]},BuGn:{3:["rgb(229,245,249)","rgb(153,216,201)","rgb(44,162,95)"],4:["rgb(237,248,251)","rgb(178,226,226)","rgb(102,194,164)","rgb(35,139,69)"],5:["rgb(237,248,251)","rgb(178,226,226)","rgb(102,194,164)","rgb(44,162,95)","rgb(0,109,44)"],6:["rgb(237,248,251)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(44,162,95)","rgb(0,109,44)"],7:["rgb(237,248,251)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(65,174,118)","rgb(35,139,69)","rgb(0,88,36)"],8:["rgb(247,252,253)","rgb(229,245,249)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(65,174,118)","rgb(35,139,69)","rgb(0,88,36)"],9:["rgb(247,252,253)","rgb(229,245,249)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(65,174,118)","rgb(35,139,69)","rgb(0,109,44)","rgb(0,68,27)"]},PuBuGn:{3:["rgb(236,226,240)","rgb(166,189,219)","rgb(28,144,153)"],4:["rgb(246,239,247)","rgb(189,201,225)","rgb(103,169,207)","rgb(2,129,138)"],5:["rgb(246,239,247)","rgb(189,201,225)","rgb(103,169,207)","rgb(28,144,153)","rgb(1,108,89)"],6:["rgb(246,239,247)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(28,144,153)","rgb(1,108,89)"],7:["rgb(246,239,247)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(54,144,192)","rgb(2,129,138)","rgb(1,100,80)"],8:["rgb(255,247,251)","rgb(236,226,240)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(54,144,192)","rgb(2,129,138)","rgb(1,100,80)"],9:["rgb(255,247,251)","rgb(236,226,240)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(54,144,192)","rgb(2,129,138)","rgb(1,108,89)","rgb(1,70,54)"]},PuBu:{3:["rgb(236,231,242)","rgb(166,189,219)","rgb(43,140,190)"],4:["rgb(241,238,246)","rgb(189,201,225)","rgb(116,169,207)","rgb(5,112,176)"],5:["rgb(241,238,246)","rgb(189,201,225)","rgb(116,169,207)","rgb(43,140,190)","rgb(4,90,141)"],6:["rgb(241,238,246)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(43,140,190)","rgb(4,90,141)"],7:["rgb(241,238,246)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(54,144,192)","rgb(5,112,176)","rgb(3,78,123)"],8:["rgb(255,247,251)","rgb(236,231,242)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(54,144,192)","rgb(5,112,176)","rgb(3,78,123)"],9:["rgb(255,247,251)","rgb(236,231,242)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(54,144,192)","rgb(5,112,176)","rgb(4,90,141)","rgb(2,56,88)"]},BuPu:{3:["rgb(224,236,244)","rgb(158,188,218)","rgb(136,86,167)"],4:["rgb(237,248,251)","rgb(179,205,227)","rgb(140,150,198)","rgb(136,65,157)"],5:["rgb(237,248,251)","rgb(179,205,227)","rgb(140,150,198)","rgb(136,86,167)","rgb(129,15,124)"],6:["rgb(237,248,251)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(136,86,167)","rgb(129,15,124)"],7:["rgb(237,248,251)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(140,107,177)","rgb(136,65,157)","rgb(110,1,107)"],8:["rgb(247,252,253)","rgb(224,236,244)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(140,107,177)","rgb(136,65,157)","rgb(110,1,107)"],9:["rgb(247,252,253)","rgb(224,236,244)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(140,107,177)","rgb(136,65,157)","rgb(129,15,124)","rgb(77,0,75)"]},RdPu:{3:["rgb(253,224,221)","rgb(250,159,181)","rgb(197,27,138)"],4:["rgb(254,235,226)","rgb(251,180,185)","rgb(247,104,161)","rgb(174,1,126)"],5:["rgb(254,235,226)","rgb(251,180,185)","rgb(247,104,161)","rgb(197,27,138)","rgb(122,1,119)"],6:["rgb(254,235,226)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(197,27,138)","rgb(122,1,119)"],7:["rgb(254,235,226)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(221,52,151)","rgb(174,1,126)","rgb(122,1,119)"],8:["rgb(255,247,243)","rgb(253,224,221)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(221,52,151)","rgb(174,1,126)","rgb(122,1,119)"],9:["rgb(255,247,243)","rgb(253,224,221)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(221,52,151)","rgb(174,1,126)","rgb(122,1,119)","rgb(73,0,106)"]},PuRd:{3:["rgb(231,225,239)","rgb(201,148,199)","rgb(221,28,119)"],4:["rgb(241,238,246)","rgb(215,181,216)","rgb(223,101,176)","rgb(206,18,86)"],5:["rgb(241,238,246)","rgb(215,181,216)","rgb(223,101,176)","rgb(221,28,119)","rgb(152,0,67)"],6:["rgb(241,238,246)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(221,28,119)","rgb(152,0,67)"],7:["rgb(241,238,246)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(231,41,138)","rgb(206,18,86)","rgb(145,0,63)"],8:["rgb(247,244,249)","rgb(231,225,239)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(231,41,138)","rgb(206,18,86)","rgb(145,0,63)"],9:["rgb(247,244,249)","rgb(231,225,239)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(231,41,138)","rgb(206,18,86)","rgb(152,0,67)","rgb(103,0,31)"]},OrRd:{3:["rgb(254,232,200)","rgb(253,187,132)","rgb(227,74,51)"],4:["rgb(254,240,217)","rgb(253,204,138)","rgb(252,141,89)","rgb(215,48,31)"],5:["rgb(254,240,217)","rgb(253,204,138)","rgb(252,141,89)","rgb(227,74,51)","rgb(179,0,0)"],6:["rgb(254,240,217)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(227,74,51)","rgb(179,0,0)"],7:["rgb(254,240,217)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(239,101,72)","rgb(215,48,31)","rgb(153,0,0)"],8:["rgb(255,247,236)","rgb(254,232,200)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(239,101,72)","rgb(215,48,31)","rgb(153,0,0)"],9:["rgb(255,247,236)","rgb(254,232,200)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(239,101,72)","rgb(215,48,31)","rgb(179,0,0)","rgb(127,0,0)"]},YlOrRd:{3:["rgb(255,237,160)","rgb(254,178,76)","rgb(240,59,32)"],4:["rgb(255,255,178)","rgb(254,204,92)","rgb(253,141,60)","rgb(227,26,28)"],5:["rgb(255,255,178)","rgb(254,204,92)","rgb(253,141,60)","rgb(240,59,32)","rgb(189,0,38)"],6:["rgb(255,255,178)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(240,59,32)","rgb(189,0,38)"],7:["rgb(255,255,178)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(252,78,42)","rgb(227,26,28)","rgb(177,0,38)"],8:["rgb(255,255,204)","rgb(255,237,160)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(252,78,42)","rgb(227,26,28)","rgb(177,0,38)"],9:["rgb(255,255,204)","rgb(255,237,160)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(252,78,42)","rgb(227,26,28)","rgb(189,0,38)","rgb(128,0,38)"]},YlOrBr:{3:["rgb(255,247,188)","rgb(254,196,79)","rgb(217,95,14)"],4:["rgb(255,255,212)","rgb(254,217,142)","rgb(254,153,41)","rgb(204,76,2)"],5:["rgb(255,255,212)","rgb(254,217,142)","rgb(254,153,41)","rgb(217,95,14)","rgb(153,52,4)"],6:["rgb(255,255,212)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(217,95,14)","rgb(153,52,4)"],7:["rgb(255,255,212)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(236,112,20)","rgb(204,76,2)","rgb(140,45,4)"],8:["rgb(255,255,229)","rgb(255,247,188)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(236,112,20)","rgb(204,76,2)","rgb(140,45,4)"],9:["rgb(255,255,229)","rgb(255,247,188)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(236,112,20)","rgb(204,76,2)","rgb(153,52,4)","rgb(102,37,6)"]},Purples:{3:["rgb(239,237,245)","rgb(188,189,220)","rgb(117,107,177)"],4:["rgb(242,240,247)","rgb(203,201,226)","rgb(158,154,200)","rgb(106,81,163)"],5:["rgb(242,240,247)","rgb(203,201,226)","rgb(158,154,200)","rgb(117,107,177)","rgb(84,39,143)"],6:["rgb(242,240,247)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(117,107,177)","rgb(84,39,143)"],7:["rgb(242,240,247)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(128,125,186)","rgb(106,81,163)","rgb(74,20,134)"],8:["rgb(252,251,253)","rgb(239,237,245)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(128,125,186)","rgb(106,81,163)","rgb(74,20,134)"],9:["rgb(252,251,253)","rgb(239,237,245)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(128,125,186)","rgb(106,81,163)","rgb(84,39,143)","rgb(63,0,125)"]},Blues:{3:["rgb(222,235,247)","rgb(158,202,225)","rgb(49,130,189)"],4:["rgb(239,243,255)","rgb(189,215,231)","rgb(107,174,214)","rgb(33,113,181)"],5:["rgb(239,243,255)","rgb(189,215,231)","rgb(107,174,214)","rgb(49,130,189)","rgb(8,81,156)"],6:["rgb(239,243,255)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(49,130,189)","rgb(8,81,156)"],7:["rgb(239,243,255)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(66,146,198)","rgb(33,113,181)","rgb(8,69,148)"],8:["rgb(247,251,255)","rgb(222,235,247)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(66,146,198)","rgb(33,113,181)","rgb(8,69,148)"],9:["rgb(247,251,255)","rgb(222,235,247)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(66,146,198)","rgb(33,113,181)","rgb(8,81,156)","rgb(8,48,107)"]},Greens:{3:["rgb(229,245,224)","rgb(161,217,155)","rgb(49,163,84)"],4:["rgb(237,248,233)","rgb(186,228,179)","rgb(116,196,118)","rgb(35,139,69)"],5:["rgb(237,248,233)","rgb(186,228,179)","rgb(116,196,118)","rgb(49,163,84)","rgb(0,109,44)"],6:["rgb(237,248,233)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(49,163,84)","rgb(0,109,44)"],7:["rgb(237,248,233)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(65,171,93)","rgb(35,139,69)","rgb(0,90,50)"],8:["rgb(247,252,245)","rgb(229,245,224)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(65,171,93)","rgb(35,139,69)","rgb(0,90,50)"],9:["rgb(247,252,245)","rgb(229,245,224)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(65,171,93)","rgb(35,139,69)","rgb(0,109,44)","rgb(0,68,27)"]},Oranges:{3:["rgb(254,230,206)","rgb(253,174,107)","rgb(230,85,13)"],4:["rgb(254,237,222)","rgb(253,190,133)","rgb(253,141,60)","rgb(217,71,1)"],5:["rgb(254,237,222)","rgb(253,190,133)","rgb(253,141,60)","rgb(230,85,13)","rgb(166,54,3)"],6:["rgb(254,237,222)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(230,85,13)","rgb(166,54,3)"],7:["rgb(254,237,222)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(241,105,19)","rgb(217,72,1)","rgb(140,45,4)"],8:["rgb(255,245,235)","rgb(254,230,206)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(241,105,19)","rgb(217,72,1)","rgb(140,45,4)"],9:["rgb(255,245,235)","rgb(254,230,206)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(241,105,19)","rgb(217,72,1)","rgb(166,54,3)","rgb(127,39,4)"]},Reds:{3:["rgb(254,224,210)","rgb(252,146,114)","rgb(222,45,38)"],4:["rgb(254,229,217)","rgb(252,174,145)","rgb(251,106,74)","rgb(203,24,29)"],5:["rgb(254,229,217)","rgb(252,174,145)","rgb(251,106,74)","rgb(222,45,38)","rgb(165,15,21)"],6:["rgb(254,229,217)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(222,45,38)","rgb(165,15,21)"],7:["rgb(254,229,217)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(239,59,44)","rgb(203,24,29)","rgb(153,0,13)"],8:["rgb(255,245,240)","rgb(254,224,210)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(239,59,44)","rgb(203,24,29)","rgb(153,0,13)"],9:["rgb(255,245,240)","rgb(254,224,210)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(239,59,44)","rgb(203,24,29)","rgb(165,15,21)","rgb(103,0,13)"]},Greys:{3:["rgb(240,240,240)","rgb(189,189,189)","rgb(99,99,99)"],4:["rgb(247,247,247)","rgb(204,204,204)","rgb(150,150,150)","rgb(82,82,82)"],5:["rgb(247,247,247)","rgb(204,204,204)","rgb(150,150,150)","rgb(99,99,99)","rgb(37,37,37)"],6:["rgb(247,247,247)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(99,99,99)","rgb(37,37,37)"],7:["rgb(247,247,247)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(115,115,115)","rgb(82,82,82)","rgb(37,37,37)"],8:["rgb(255,255,255)","rgb(240,240,240)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(115,115,115)","rgb(82,82,82)","rgb(37,37,37)"],9:["rgb(255,255,255)","rgb(240,240,240)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(115,115,115)","rgb(82,82,82)","rgb(37,37,37)","rgb(0,0,0)"]},PuOr:{3:["rgb(241,163,64)","rgb(247,247,247)","rgb(153,142,195)"],4:["rgb(230,97,1)","rgb(253,184,99)","rgb(178,171,210)","rgb(94,60,153)"],5:["rgb(230,97,1)","rgb(253,184,99)","rgb(247,247,247)","rgb(178,171,210)","rgb(94,60,153)"],6:["rgb(179,88,6)","rgb(241,163,64)","rgb(254,224,182)","rgb(216,218,235)","rgb(153,142,195)","rgb(84,39,136)"],7:["rgb(179,88,6)","rgb(241,163,64)","rgb(254,224,182)","rgb(247,247,247)","rgb(216,218,235)","rgb(153,142,195)","rgb(84,39,136)"],8:["rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)"],9:["rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(247,247,247)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)"],10:["rgb(127,59,8)","rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)","rgb(45,0,75)"],11:["rgb(127,59,8)","rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(247,247,247)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)","rgb(45,0,75)"]},BrBG:{3:["rgb(216,179,101)","rgb(245,245,245)","rgb(90,180,172)"],4:["rgb(166,97,26)","rgb(223,194,125)","rgb(128,205,193)","rgb(1,133,113)"],5:["rgb(166,97,26)","rgb(223,194,125)","rgb(245,245,245)","rgb(128,205,193)","rgb(1,133,113)"],6:["rgb(140,81,10)","rgb(216,179,101)","rgb(246,232,195)","rgb(199,234,229)","rgb(90,180,172)","rgb(1,102,94)"],7:["rgb(140,81,10)","rgb(216,179,101)","rgb(246,232,195)","rgb(245,245,245)","rgb(199,234,229)","rgb(90,180,172)","rgb(1,102,94)"],8:["rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)"],9:["rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(245,245,245)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)"],10:["rgb(84,48,5)","rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)","rgb(0,60,48)"],11:["rgb(84,48,5)","rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(245,245,245)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)","rgb(0,60,48)"]},PRGn:{3:["rgb(175,141,195)","rgb(247,247,247)","rgb(127,191,123)"],4:["rgb(123,50,148)","rgb(194,165,207)","rgb(166,219,160)","rgb(0,136,55)"],5:["rgb(123,50,148)","rgb(194,165,207)","rgb(247,247,247)","rgb(166,219,160)","rgb(0,136,55)"],6:["rgb(118,42,131)","rgb(175,141,195)","rgb(231,212,232)","rgb(217,240,211)","rgb(127,191,123)","rgb(27,120,55)"],7:["rgb(118,42,131)","rgb(175,141,195)","rgb(231,212,232)","rgb(247,247,247)","rgb(217,240,211)","rgb(127,191,123)","rgb(27,120,55)"],8:["rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)"],9:["rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(247,247,247)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)"],10:["rgb(64,0,75)","rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)","rgb(0,68,27)"],11:["rgb(64,0,75)","rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(247,247,247)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)","rgb(0,68,27)"]},PiYG:{3:["rgb(233,163,201)","rgb(247,247,247)","rgb(161,215,106)"],4:["rgb(208,28,139)","rgb(241,182,218)","rgb(184,225,134)","rgb(77,172,38)"],5:["rgb(208,28,139)","rgb(241,182,218)","rgb(247,247,247)","rgb(184,225,134)","rgb(77,172,38)"],6:["rgb(197,27,125)","rgb(233,163,201)","rgb(253,224,239)","rgb(230,245,208)","rgb(161,215,106)","rgb(77,146,33)"],7:["rgb(197,27,125)","rgb(233,163,201)","rgb(253,224,239)","rgb(247,247,247)","rgb(230,245,208)","rgb(161,215,106)","rgb(77,146,33)"],8:["rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)"],9:["rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(247,247,247)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)"],10:["rgb(142,1,82)","rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)","rgb(39,100,25)"],11:["rgb(142,1,82)","rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(247,247,247)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)","rgb(39,100,25)"]},RdBu:{3:["rgb(239,138,98)","rgb(247,247,247)","rgb(103,169,207)"],4:["rgb(202,0,32)","rgb(244,165,130)","rgb(146,197,222)","rgb(5,113,176)"],5:["rgb(202,0,32)","rgb(244,165,130)","rgb(247,247,247)","rgb(146,197,222)","rgb(5,113,176)"],6:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(209,229,240)","rgb(103,169,207)","rgb(33,102,172)"],7:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(103,169,207)","rgb(33,102,172)"],8:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)"],9:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)"],10:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],11:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"]},RdGy:{3:["rgb(239,138,98)","rgb(255,255,255)","rgb(153,153,153)"],4:["rgb(202,0,32)","rgb(244,165,130)","rgb(186,186,186)","rgb(64,64,64)"],5:["rgb(202,0,32)","rgb(244,165,130)","rgb(255,255,255)","rgb(186,186,186)","rgb(64,64,64)"],6:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(224,224,224)","rgb(153,153,153)","rgb(77,77,77)"],7:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(255,255,255)","rgb(224,224,224)","rgb(153,153,153)","rgb(77,77,77)"],8:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)"],9:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(255,255,255)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)"],10:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)","rgb(26,26,26)"],11:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(255,255,255)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)","rgb(26,26,26)"]},RdYlBu:{3:["rgb(252,141,89)","rgb(255,255,191)","rgb(145,191,219)"],4:["rgb(215,25,28)","rgb(253,174,97)","rgb(171,217,233)","rgb(44,123,182)"],5:["rgb(215,25,28)","rgb(253,174,97)","rgb(255,255,191)","rgb(171,217,233)","rgb(44,123,182)"],6:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,144)","rgb(224,243,248)","rgb(145,191,219)","rgb(69,117,180)"],7:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,144)","rgb(255,255,191)","rgb(224,243,248)","rgb(145,191,219)","rgb(69,117,180)"],8:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)"],9:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(255,255,191)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)"],10:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)","rgb(49,54,149)"],11:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(255,255,191)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)","rgb(49,54,149)"]},Spectral:{3:["rgb(252,141,89)","rgb(255,255,191)","rgb(153,213,148)"],4:["rgb(215,25,28)","rgb(253,174,97)","rgb(171,221,164)","rgb(43,131,186)"],5:["rgb(215,25,28)","rgb(253,174,97)","rgb(255,255,191)","rgb(171,221,164)","rgb(43,131,186)"],6:["rgb(213,62,79)","rgb(252,141,89)","rgb(254,224,139)","rgb(230,245,152)","rgb(153,213,148)","rgb(50,136,189)"],7:["rgb(213,62,79)","rgb(252,141,89)","rgb(254,224,139)","rgb(255,255,191)","rgb(230,245,152)","rgb(153,213,148)","rgb(50,136,189)"],8:["rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)"],9:["rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)"],10:["rgb(158,1,66)","rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)","rgb(94,79,162)"],11:["rgb(158,1,66)","rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)","rgb(94,79,162)"]},RdYlGn:{3:["rgb(252,141,89)","rgb(255,255,191)","rgb(145,207,96)"],4:["rgb(215,25,28)","rgb(253,174,97)","rgb(166,217,106)","rgb(26,150,65)"],5:["rgb(215,25,28)","rgb(253,174,97)","rgb(255,255,191)","rgb(166,217,106)","rgb(26,150,65)"],6:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,139)","rgb(217,239,139)","rgb(145,207,96)","rgb(26,152,80)"],7:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,139)","rgb(255,255,191)","rgb(217,239,139)","rgb(145,207,96)","rgb(26,152,80)"],8:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)"],9:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)"],10:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)","rgb(0,104,55)"],11:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)","rgb(0,104,55)"]}};
  !function(){var d3={version:"3.4.8"};if(!Date.now)Date.now=function(){return+new Date};var d3_arraySlice=[].slice,d3_array=function(list){return d3_arraySlice.call(list)};var d3_document=document,d3_documentElement=d3_document.documentElement,d3_window=window;try{d3_array(d3_documentElement.childNodes)[0].nodeType}catch(e){d3_array=function(list){var i=list.length,array=new Array(i);while(i--)array[i]=list[i];return array}}try{d3_document.createElement("div").style.setProperty("opacity",0,"")}catch(error){var d3_element_prototype=d3_window.Element.prototype,d3_element_setAttribute=d3_element_prototype.setAttribute,d3_element_setAttributeNS=d3_element_prototype.setAttributeNS,d3_style_prototype=d3_window.CSSStyleDeclaration.prototype,d3_style_setProperty=d3_style_prototype.setProperty;d3_element_prototype.setAttribute=function(name,value){d3_element_setAttribute.call(this,name,value+"")};d3_element_prototype.setAttributeNS=function(space,local,value){d3_element_setAttributeNS.call(this,space,local,value+"")};d3_style_prototype.setProperty=function(name,value,priority){d3_style_setProperty.call(this,name,value+"",priority)}}d3.ascending=d3_ascending;function d3_ascending(a,b){return a<b?-1:a>b?1:a>=b?0:NaN}d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN};d3.min=function(array,f){var i=-1,n=array.length,a,b;if(arguments.length===1){while(++i<n&&!((a=array[i])!=null&&a<=a))a=undefined;while(++i<n)if((b=array[i])!=null&&a>b)a=b}else{while(++i<n&&!((a=f.call(array,array[i],i))!=null&&a<=a))a=undefined;while(++i<n)if((b=f.call(array,array[i],i))!=null&&a>b)a=b}return a};d3.max=function(array,f){var i=-1,n=array.length,a,b;if(arguments.length===1){while(++i<n&&!((a=array[i])!=null&&a<=a))a=undefined;while(++i<n)if((b=array[i])!=null&&b>a)a=b}else{while(++i<n&&!((a=f.call(array,array[i],i))!=null&&a<=a))a=undefined;while(++i<n)if((b=f.call(array,array[i],i))!=null&&b>a)a=b}return a};d3.extent=function(array,f){var i=-1,n=array.length,a,b,c;if(arguments.length===1){while(++i<n&&!((a=c=array[i])!=null&&a<=a))a=c=undefined;while(++i<n)if((b=array[i])!=null){if(a>b)a=b;if(c<b)c=b}}else{while(++i<n&&!((a=c=f.call(array,array[i],i))!=null&&a<=a))a=undefined;while(++i<n)if((b=f.call(array,array[i],i))!=null){if(a>b)a=b;if(c<b)c=b}}return[a,c]};d3.sum=function(array,f){var s=0,n=array.length,a,i=-1;if(arguments.length===1){while(++i<n)if(!isNaN(a=+array[i]))s+=a}else{while(++i<n)if(!isNaN(a=+f.call(array,array[i],i)))s+=a}return s};function d3_number(x){return x!=null&&!isNaN(x)}d3.mean=function(array,f){var s=0,n=array.length,a,i=-1,j=n;if(arguments.length===1){while(++i<n)if(d3_number(a=array[i]))s+=a;else--j}else{while(++i<n)if(d3_number(a=f.call(array,array[i],i)))s+=a;else--j}return j?s/j:undefined};d3.quantile=function(values,p){var H=(values.length-1)*p+1,h=Math.floor(H),v=+values[h-1],e=H-h;return e?v+e*(values[h]-v):v};d3.median=function(array,f){if(arguments.length>1)array=array.map(f);array=array.filter(d3_number);return array.length?d3.quantile(array.sort(d3_ascending),.5):undefined};function d3_bisector(compare){return{left:function(a,x,lo,hi){if(arguments.length<3)lo=0;if(arguments.length<4)hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(compare(a[mid],x)<0)lo=mid+1;else hi=mid}return lo},right:function(a,x,lo,hi){if(arguments.length<3)lo=0;if(arguments.length<4)hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(compare(a[mid],x)>0)hi=mid;else lo=mid+1}return lo}}}var d3_bisect=d3_bisector(d3_ascending);d3.bisectLeft=d3_bisect.left;d3.bisect=d3.bisectRight=d3_bisect.right;d3.bisector=function(f){return d3_bisector(f.length===1?function(d,x){return d3_ascending(f(d),x)}:f)};d3.shuffle=function(array){var m=array.length,t,i;while(m){i=Math.random()*m--|0;t=array[m],array[m]=array[i],array[i]=t}return array};d3.permute=function(array,indexes){var i=indexes.length,permutes=new Array(i);while(i--)permutes[i]=array[indexes[i]];return permutes};d3.pairs=function(array){var i=0,n=array.length-1,p0,p1=array[0],pairs=new Array(n<0?0:n);while(i<n)pairs[i]=[p0=p1,p1=array[++i]];return pairs};d3.zip=function(){if(!(n=arguments.length))return[];for(var i=-1,m=d3.min(arguments,d3_zipLength),zips=new Array(m);++i<m;){for(var j=-1,n,zip=zips[i]=new Array(n);++j<n;){zip[j]=arguments[j][i]}}return zips};function d3_zipLength(d){return d.length}d3.transpose=function(matrix){return d3.zip.apply(d3,matrix)};d3.keys=function(map){var keys=[];for(var key in map)keys.push(key);return keys};d3.values=function(map){var values=[];for(var key in map)values.push(map[key]);return values};d3.entries=function(map){var entries=[];for(var key in map)entries.push({key:key,value:map[key]});return entries};d3.merge=function(arrays){var n=arrays.length,m,i=-1,j=0,merged,array;while(++i<n)j+=arrays[i].length;merged=new Array(j);while(--n>=0){array=arrays[n];m=array.length;while(--m>=0){merged[--j]=array[m]}}return merged};var abs=Math.abs;d3.range=function(start,stop,step){if(arguments.length<3){step=1;if(arguments.length<2){stop=start;start=0}}if((stop-start)/step===Infinity)throw new Error("infinite range");var range=[],k=d3_range_integerScale(abs(step)),i=-1,j;start*=k,stop*=k,step*=k;if(step<0)while((j=start+step*++i)>stop)range.push(j/k);else while((j=start+step*++i)<stop)range.push(j/k);return range};function d3_range_integerScale(x){var k=1;while(x*k%1)k*=10;return k}function d3_class(ctor,properties){try{for(var key in properties){Object.defineProperty(ctor.prototype,key,{value:properties[key],enumerable:false})}}catch(e){ctor.prototype=properties}}d3.map=function(object){var map=new d3_Map;if(object instanceof d3_Map)object.forEach(function(key,value){map.set(key,value)});else for(var key in object)map.set(key,object[key]);return map};function d3_Map(){}d3_class(d3_Map,{has:d3_map_has,get:function(key){return this[d3_map_prefix+key]},set:function(key,value){return this[d3_map_prefix+key]=value},remove:d3_map_remove,keys:d3_map_keys,values:function(){var values=[];this.forEach(function(key,value){values.push(value)});return values},entries:function(){var entries=[];this.forEach(function(key,value){entries.push({key:key,value:value})});return entries},size:d3_map_size,empty:d3_map_empty,forEach:function(f){for(var key in this)if(key.charCodeAt(0)===d3_map_prefixCode)f.call(this,key.substring(1),this[key])}});var d3_map_prefix="\0",d3_map_prefixCode=d3_map_prefix.charCodeAt(0);function d3_map_has(key){return d3_map_prefix+key in this}function d3_map_remove(key){key=d3_map_prefix+key;return key in this&&delete this[key]}function d3_map_keys(){var keys=[];this.forEach(function(key){keys.push(key)});return keys}function d3_map_size(){var size=0;for(var key in this)if(key.charCodeAt(0)===d3_map_prefixCode)++size;return size}function d3_map_empty(){for(var key in this)if(key.charCodeAt(0)===d3_map_prefixCode)return false;return true}d3.nest=function(){var nest={},keys=[],sortKeys=[],sortValues,rollup;function map(mapType,array,depth){if(depth>=keys.length)return rollup?rollup.call(nest,array):sortValues?array.sort(sortValues):array;var i=-1,n=array.length,key=keys[depth++],keyValue,object,setter,valuesByKey=new d3_Map,values;while(++i<n){if(values=valuesByKey.get(keyValue=key(object=array[i]))){values.push(object)}else{valuesByKey.set(keyValue,[object])}}if(mapType){object=mapType();setter=function(keyValue,values){object.set(keyValue,map(mapType,values,depth))}}else{object={};setter=function(keyValue,values){object[keyValue]=map(mapType,values,depth)}}valuesByKey.forEach(setter);return object}function entries(map,depth){if(depth>=keys.length)return map;var array=[],sortKey=sortKeys[depth++];map.forEach(function(key,keyMap){array.push({key:key,values:entries(keyMap,depth)})});return sortKey?array.sort(function(a,b){return sortKey(a.key,b.key)}):array}nest.map=function(array,mapType){return map(mapType,array,0)};nest.entries=function(array){return entries(map(d3.map,array,0),0)};nest.key=function(d){keys.push(d);return nest};nest.sortKeys=function(order){sortKeys[keys.length-1]=order;return nest};nest.sortValues=function(order){sortValues=order;return nest};nest.rollup=function(f){rollup=f;return nest};return nest};d3.set=function(array){var set=new d3_Set;if(array)for(var i=0,n=array.length;i<n;++i)set.add(array[i]);return set};function d3_Set(){}d3_class(d3_Set,{has:d3_map_has,add:function(value){this[d3_map_prefix+value]=true;return value},remove:function(value){value=d3_map_prefix+value;return value in this&&delete this[value]},values:d3_map_keys,size:d3_map_size,empty:d3_map_empty,forEach:function(f){for(var value in this)if(value.charCodeAt(0)===d3_map_prefixCode)f.call(this,value.substring(1))}});d3.behavior={};d3.rebind=function(target,source){var i=1,n=arguments.length,method;while(++i<n)target[method=arguments[i]]=d3_rebind(target,source,source[method]);return target};function d3_rebind(target,source,method){return function(){var value=method.apply(source,arguments);return value===source?target:value}}function d3_vendorSymbol(object,name){if(name in object)return name;name=name.charAt(0).toUpperCase()+name.substring(1);for(var i=0,n=d3_vendorPrefixes.length;i<n;++i){var prefixName=d3_vendorPrefixes[i]+name;if(prefixName in object)return prefixName}}var d3_vendorPrefixes=["webkit","ms","moz","Moz","o","O"];function d3_noop(){}d3.dispatch=function(){var dispatch=new d3_dispatch,i=-1,n=arguments.length;while(++i<n)dispatch[arguments[i]]=d3_dispatch_event(dispatch);return dispatch};function d3_dispatch(){}d3_dispatch.prototype.on=function(type,listener){var i=type.indexOf("."),name="";if(i>=0){name=type.substring(i+1);type=type.substring(0,i)}if(type)return arguments.length<2?this[type].on(name):this[type].on(name,listener);if(arguments.length===2){if(listener==null)for(type in this){if(this.hasOwnProperty(type))this[type].on(name,null)}return this}};function d3_dispatch_event(dispatch){var listeners=[],listenerByName=new d3_Map;function event(){var z=listeners,i=-1,n=z.length,l;while(++i<n)if(l=z[i].on)l.apply(this,arguments);return dispatch}event.on=function(name,listener){var l=listenerByName.get(name),i;if(arguments.length<2)return l&&l.on;if(l){l.on=null;listeners=listeners.slice(0,i=listeners.indexOf(l)).concat(listeners.slice(i+1));listenerByName.remove(name)}if(listener)listeners.push(listenerByName.set(name,{on:listener}));return dispatch};return event}d3.event=null;function d3_eventPreventDefault(){d3.event.preventDefault()}function d3_eventSource(){var e=d3.event,s;while(s=e.sourceEvent)e=s;return e}function d3_eventDispatch(target){var dispatch=new d3_dispatch,i=0,n=arguments.length;while(++i<n)dispatch[arguments[i]]=d3_dispatch_event(dispatch);dispatch.of=function(thiz,argumentz){return function(e1){try{var e0=e1.sourceEvent=d3.event;e1.target=target;d3.event=e1;dispatch[e1.type].apply(thiz,argumentz)}finally{d3.event=e0}}};return dispatch}d3.requote=function(s){return s.replace(d3_requote_re,"\\$&")};var d3_requote_re=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;var d3_subclass={}.__proto__?function(object,prototype){object.__proto__=prototype}:function(object,prototype){for(var property in prototype)object[property]=prototype[property]};function d3_selection(groups){d3_subclass(groups,d3_selectionPrototype);return groups}var d3_select=function(s,n){return n.querySelector(s)},d3_selectAll=function(s,n){return n.querySelectorAll(s)},d3_selectMatcher=d3_documentElement[d3_vendorSymbol(d3_documentElement,"matchesSelector")],d3_selectMatches=function(n,s){return d3_selectMatcher.call(n,s)};if(typeof Sizzle==="function"){d3_select=function(s,n){return Sizzle(s,n)[0]||null};d3_selectAll=Sizzle;d3_selectMatches=Sizzle.matchesSelector}d3.selection=function(){return d3_selectionRoot};var d3_selectionPrototype=d3.selection.prototype=[];d3_selectionPrototype.select=function(selector){var subgroups=[],subgroup,subnode,group,node;selector=d3_selection_selector(selector);for(var j=-1,m=this.length;++j<m;){subgroups.push(subgroup=[]);subgroup.parentNode=(group=this[j]).parentNode;for(var i=-1,n=group.length;++i<n;){if(node=group[i]){subgroup.push(subnode=selector.call(node,node.__data__,i,j));if(subnode&&"__data__"in node)subnode.__data__=node.__data__}else{subgroup.push(null)}}}return d3_selection(subgroups)};function d3_selection_selector(selector){return typeof selector==="function"?selector:function(){return d3_select(selector,this)}}d3_selectionPrototype.selectAll=function(selector){var subgroups=[],subgroup,node;selector=d3_selection_selectorAll(selector);for(var j=-1,m=this.length;++j<m;){for(var group=this[j],i=-1,n=group.length;++i<n;){if(node=group[i]){subgroups.push(subgroup=d3_array(selector.call(node,node.__data__,i,j)));subgroup.parentNode=node}}}return d3_selection(subgroups)};function d3_selection_selectorAll(selector){return typeof selector==="function"?selector:function(){return d3_selectAll(selector,this)}}var d3_nsPrefix={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:d3_nsPrefix,qualify:function(name){var i=name.indexOf(":"),prefix=name;if(i>=0){prefix=name.substring(0,i);name=name.substring(i+1)}return d3_nsPrefix.hasOwnProperty(prefix)?{space:d3_nsPrefix[prefix],local:name}:name}};d3_selectionPrototype.attr=function(name,value){if(arguments.length<2){if(typeof name==="string"){var node=this.node();name=d3.ns.qualify(name);return name.local?node.getAttributeNS(name.space,name.local):node.getAttribute(name)}for(value in name)this.each(d3_selection_attr(value,name[value]));return this}return this.each(d3_selection_attr(name,value))};function d3_selection_attr(name,value){name=d3.ns.qualify(name);function attrNull(){this.removeAttribute(name)}function attrNullNS(){this.removeAttributeNS(name.space,name.local)}function attrConstant(){this.setAttribute(name,value)}function attrConstantNS(){this.setAttributeNS(name.space,name.local,value)}function attrFunction(){var x=value.apply(this,arguments);if(x==null)this.removeAttribute(name);else this.setAttribute(name,x)}function attrFunctionNS(){var x=value.apply(this,arguments);if(x==null)this.removeAttributeNS(name.space,name.local);else this.setAttributeNS(name.space,name.local,x)}return value==null?name.local?attrNullNS:attrNull:typeof value==="function"?name.local?attrFunctionNS:attrFunction:name.local?attrConstantNS:attrConstant}function d3_collapse(s){return s.trim().replace(/\s+/g," ")}d3_selectionPrototype.classed=function(name,value){if(arguments.length<2){if(typeof name==="string"){var node=this.node(),n=(name=d3_selection_classes(name)).length,i=-1;if(value=node.classList){while(++i<n)if(!value.contains(name[i]))return false}else{value=node.getAttribute("class");while(++i<n)if(!d3_selection_classedRe(name[i]).test(value))return false}return true}for(value in name)this.each(d3_selection_classed(value,name[value]));return this}return this.each(d3_selection_classed(name,value))};function d3_selection_classedRe(name){return new RegExp("(?:^|\\s+)"+d3.requote(name)+"(?:\\s+|$)","g")}function d3_selection_classes(name){return name.trim().split(/^|\s+/)}function d3_selection_classed(name,value){name=d3_selection_classes(name).map(d3_selection_classedName);var n=name.length;function classedConstant(){var i=-1;while(++i<n)name[i](this,value)}function classedFunction(){var i=-1,x=value.apply(this,arguments);while(++i<n)name[i](this,x)}return typeof value==="function"?classedFunction:classedConstant}function d3_selection_classedName(name){var re=d3_selection_classedRe(name);return function(node,value){if(c=node.classList)return value?c.add(name):c.remove(name);var c=node.getAttribute("class")||"";if(value){re.lastIndex=0;if(!re.test(c))node.setAttribute("class",d3_collapse(c+" "+name))}else{node.setAttribute("class",d3_collapse(c.replace(re," ")))}}}d3_selectionPrototype.style=function(name,value,priority){var n=arguments.length;if(n<3){if(typeof name!=="string"){if(n<2)value="";for(priority in name)this.each(d3_selection_style(priority,name[priority],value));return this}if(n<2)return d3_window.getComputedStyle(this.node(),null).getPropertyValue(name);priority=""}return this.each(d3_selection_style(name,value,priority))};function d3_selection_style(name,value,priority){function styleNull(){this.style.removeProperty(name)}function styleConstant(){this.style.setProperty(name,value,priority)}function styleFunction(){var x=value.apply(this,arguments);if(x==null)this.style.removeProperty(name);else this.style.setProperty(name,x,priority)}return value==null?styleNull:typeof value==="function"?styleFunction:styleConstant}d3_selectionPrototype.property=function(name,value){if(arguments.length<2){if(typeof name==="string")return this.node()[name];for(value in name)this.each(d3_selection_property(value,name[value]));return this}return this.each(d3_selection_property(name,value))};function d3_selection_property(name,value){function propertyNull(){delete this[name]}function propertyConstant(){this[name]=value}function propertyFunction(){var x=value.apply(this,arguments);if(x==null)delete this[name];else this[name]=x}return value==null?propertyNull:typeof value==="function"?propertyFunction:propertyConstant}d3_selectionPrototype.text=function(value){return arguments.length?this.each(typeof value==="function"?function(){var v=value.apply(this,arguments);this.textContent=v==null?"":v}:value==null?function(){this.textContent=""}:function(){this.textContent=value}):this.node().textContent};d3_selectionPrototype.html=function(value){return arguments.length?this.each(typeof value==="function"?function(){var v=value.apply(this,arguments);this.innerHTML=v==null?"":v}:value==null?function(){this.innerHTML=""}:function(){this.innerHTML=value}):this.node().innerHTML};d3_selectionPrototype.append=function(name){name=d3_selection_creator(name);return this.select(function(){return this.appendChild(name.apply(this,arguments))})};function d3_selection_creator(name){return typeof name==="function"?name:(name=d3.ns.qualify(name)).local?function(){return this.ownerDocument.createElementNS(name.space,name.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,name)}}d3_selectionPrototype.insert=function(name,before){name=d3_selection_creator(name);before=d3_selection_selector(before);return this.select(function(){return this.insertBefore(name.apply(this,arguments),before.apply(this,arguments)||null)})};d3_selectionPrototype.remove=function(){return this.each(function(){var parent=this.parentNode;if(parent)parent.removeChild(this)})};d3_selectionPrototype.data=function(value,key){var i=-1,n=this.length,group,node;if(!arguments.length){value=new Array(n=(group=this[0]).length);while(++i<n){if(node=group[i]){value[i]=node.__data__}}return value}function bind(group,groupData){var i,n=group.length,m=groupData.length,n0=Math.min(n,m),updateNodes=new Array(m),enterNodes=new Array(m),exitNodes=new Array(n),node,nodeData;if(key){var nodeByKeyValue=new d3_Map,dataByKeyValue=new d3_Map,keyValues=[],keyValue;for(i=-1;++i<n;){keyValue=key.call(node=group[i],node.__data__,i);if(nodeByKeyValue.has(keyValue)){exitNodes[i]=node}else{nodeByKeyValue.set(keyValue,node)}keyValues.push(keyValue)}for(i=-1;++i<m;){keyValue=key.call(groupData,nodeData=groupData[i],i);if(node=nodeByKeyValue.get(keyValue)){updateNodes[i]=node;node.__data__=nodeData}else if(!dataByKeyValue.has(keyValue)){enterNodes[i]=d3_selection_dataNode(nodeData)}dataByKeyValue.set(keyValue,nodeData);nodeByKeyValue.remove(keyValue)}for(i=-1;++i<n;){if(nodeByKeyValue.has(keyValues[i])){exitNodes[i]=group[i]}}}else{for(i=-1;++i<n0;){node=group[i];nodeData=groupData[i];if(node){node.__data__=nodeData;updateNodes[i]=node}else{enterNodes[i]=d3_selection_dataNode(nodeData)}}for(;i<m;++i){enterNodes[i]=d3_selection_dataNode(groupData[i])}for(;i<n;++i){exitNodes[i]=group[i]}}enterNodes.update=updateNodes;enterNodes.parentNode=updateNodes.parentNode=exitNodes.parentNode=group.parentNode;enter.push(enterNodes);update.push(updateNodes);exit.push(exitNodes)}var enter=d3_selection_enter([]),update=d3_selection([]),exit=d3_selection([]);if(typeof value==="function"){while(++i<n){bind(group=this[i],value.call(group,group.parentNode.__data__,i))}}else{while(++i<n){bind(group=this[i],value)}}update.enter=function(){return enter};update.exit=function(){return exit};return update};function d3_selection_dataNode(data){return{__data__:data}}d3_selectionPrototype.datum=function(value){return arguments.length?this.property("__data__",value):this.property("__data__")};d3_selectionPrototype.filter=function(filter){var subgroups=[],subgroup,group,node;if(typeof filter!=="function")filter=d3_selection_filter(filter);for(var j=0,m=this.length;j<m;j++){subgroups.push(subgroup=[]);subgroup.parentNode=(group=this[j]).parentNode;for(var i=0,n=group.length;i<n;i++){if((node=group[i])&&filter.call(node,node.__data__,i,j)){subgroup.push(node)}}}return d3_selection(subgroups)};function d3_selection_filter(selector){return function(){return d3_selectMatches(this,selector)}}d3_selectionPrototype.order=function(){for(var j=-1,m=this.length;++j<m;){for(var group=this[j],i=group.length-1,next=group[i],node;--i>=0;){if(node=group[i]){if(next&&next!==node.nextSibling)next.parentNode.insertBefore(node,next);next=node}}}return this};d3_selectionPrototype.sort=function(comparator){comparator=d3_selection_sortComparator.apply(this,arguments);for(var j=-1,m=this.length;++j<m;)this[j].sort(comparator);return this.order()};function d3_selection_sortComparator(comparator){if(!arguments.length)comparator=d3_ascending;return function(a,b){return a&&b?comparator(a.__data__,b.__data__):!a-!b}}d3_selectionPrototype.each=function(callback){return d3_selection_each(this,function(node,i,j){callback.call(node,node.__data__,i,j)})};function d3_selection_each(groups,callback){for(var j=0,m=groups.length;j<m;j++){for(var group=groups[j],i=0,n=group.length,node;i<n;i++){if(node=group[i])callback(node,i,j)}}return groups}d3_selectionPrototype.call=function(callback){var args=d3_array(arguments);callback.apply(args[0]=this,args);return this};d3_selectionPrototype.empty=function(){return!this.node()};d3_selectionPrototype.node=function(){for(var j=0,m=this.length;j<m;j++){for(var group=this[j],i=0,n=group.length;i<n;i++){var node=group[i];if(node)return node}}return null};d3_selectionPrototype.size=function(){var n=0;this.each(function(){++n});return n};function d3_selection_enter(selection){d3_subclass(selection,d3_selection_enterPrototype);return selection}var d3_selection_enterPrototype=[];d3.selection.enter=d3_selection_enter;d3.selection.enter.prototype=d3_selection_enterPrototype;d3_selection_enterPrototype.append=d3_selectionPrototype.append;d3_selection_enterPrototype.empty=d3_selectionPrototype.empty;d3_selection_enterPrototype.node=d3_selectionPrototype.node;d3_selection_enterPrototype.call=d3_selectionPrototype.call;d3_selection_enterPrototype.size=d3_selectionPrototype.size;d3_selection_enterPrototype.select=function(selector){var subgroups=[],subgroup,subnode,upgroup,group,node;for(var j=-1,m=this.length;++j<m;){upgroup=(group=this[j]).update;subgroups.push(subgroup=[]);subgroup.parentNode=group.parentNode;for(var i=-1,n=group.length;++i<n;){if(node=group[i]){subgroup.push(upgroup[i]=subnode=selector.call(group.parentNode,node.__data__,i,j));subnode.__data__=node.__data__}else{subgroup.push(null)}}}return d3_selection(subgroups)};d3_selection_enterPrototype.insert=function(name,before){if(arguments.length<2)before=d3_selection_enterInsertBefore(this);return d3_selectionPrototype.insert.call(this,name,before)};function d3_selection_enterInsertBefore(enter){var i0,j0;return function(d,i,j){var group=enter[j].update,n=group.length,node;if(j!=j0)j0=j,i0=0;if(i>=i0)i0=i+1;while(!(node=group[i0])&&++i0<n);return node}}d3_selectionPrototype.transition=function(){var id=d3_transitionInheritId||++d3_transitionId,subgroups=[],subgroup,node,transition=d3_transitionInherit||{time:Date.now(),ease:d3_ease_cubicInOut,delay:0,duration:250};for(var j=-1,m=this.length;++j<m;){subgroups.push(subgroup=[]);for(var group=this[j],i=-1,n=group.length;++i<n;){if(node=group[i])d3_transitionNode(node,i,id,transition);subgroup.push(node)}}return d3_transition(subgroups,id)};d3_selectionPrototype.interrupt=function(){return this.each(d3_selection_interrupt)};function d3_selection_interrupt(){var lock=this.__transition__;if(lock)++lock.active}d3.select=function(node){var group=[typeof node==="string"?d3_select(node,d3_document):node];group.parentNode=d3_documentElement;return d3_selection([group])};d3.selectAll=function(nodes){var group=d3_array(typeof nodes==="string"?d3_selectAll(nodes,d3_document):nodes);group.parentNode=d3_documentElement;return d3_selection([group])};var d3_selectionRoot=d3.select(d3_documentElement);d3_selectionPrototype.on=function(type,listener,capture){var n=arguments.length;if(n<3){if(typeof type!=="string"){if(n<2)listener=false;for(capture in type)this.each(d3_selection_on(capture,type[capture],listener));return this}if(n<2)return(n=this.node()["__on"+type])&&n._;capture=false}return this.each(d3_selection_on(type,listener,capture))};function d3_selection_on(type,listener,capture){var name="__on"+type,i=type.indexOf("."),wrap=d3_selection_onListener;if(i>0)type=type.substring(0,i);var filter=d3_selection_onFilters.get(type);if(filter)type=filter,wrap=d3_selection_onFilter;function onRemove(){var l=this[name];if(l){this.removeEventListener(type,l,l.$);delete this[name]}}function onAdd(){var l=wrap(listener,d3_array(arguments));onRemove.call(this);this.addEventListener(type,this[name]=l,l.$=capture);l._=listener}function removeAll(){var re=new RegExp("^__on([^.]+)"+d3.requote(type)+"$"),match;for(var name in this){if(match=name.match(re)){var l=this[name];this.removeEventListener(match[1],l,l.$);delete this[name]}}}return i?listener?onAdd:onRemove:listener?d3_noop:removeAll}var d3_selection_onFilters=d3.map({mouseenter:"mouseover",mouseleave:"mouseout"});d3_selection_onFilters.forEach(function(k){if("on"+k in d3_document)d3_selection_onFilters.remove(k)});function d3_selection_onListener(listener,argumentz){return function(e){var o=d3.event;d3.event=e;argumentz[0]=this.__data__;try{listener.apply(this,argumentz)}finally{d3.event=o}}}function d3_selection_onFilter(listener,argumentz){var l=d3_selection_onListener(listener,argumentz);return function(e){var target=this,related=e.relatedTarget;if(!related||related!==target&&!(related.compareDocumentPosition(target)&8)){l.call(target,e)}}}var d3_event_dragSelect="onselectstart"in d3_document?null:d3_vendorSymbol(d3_documentElement.style,"userSelect"),d3_event_dragId=0;function d3_event_dragSuppress(){var name=".dragsuppress-"+ ++d3_event_dragId,click="click"+name,w=d3.select(d3_window).on("touchmove"+name,d3_eventPreventDefault).on("dragstart"+name,d3_eventPreventDefault).on("selectstart"+name,d3_eventPreventDefault);if(d3_event_dragSelect){var style=d3_documentElement.style,select=style[d3_event_dragSelect];style[d3_event_dragSelect]="none"}return function(suppressClick){w.on(name,null);if(d3_event_dragSelect)style[d3_event_dragSelect]=select;if(suppressClick){function off(){w.on(click,null)}w.on(click,function(){d3_eventPreventDefault();off()},true);setTimeout(off,0)}}}d3.mouse=function(container){return d3_mousePoint(container,d3_eventSource())};function d3_mousePoint(container,e){if(e.changedTouches)e=e.changedTouches[0];var svg=container.ownerSVGElement||container;if(svg.createSVGPoint){var point=svg.createSVGPoint();point.x=e.clientX,point.y=e.clientY;point=point.matrixTransform(container.getScreenCTM().inverse());return[point.x,point.y]}var rect=container.getBoundingClientRect();return[e.clientX-rect.left-container.clientLeft,e.clientY-rect.top-container.clientTop]}d3.touches=function(container,touches){if(arguments.length<2)touches=d3_eventSource().touches;return touches?d3_array(touches).map(function(touch){var point=d3_mousePoint(container,touch);point.identifier=touch.identifier;return point}):[]};d3.behavior.drag=function(){var event=d3_eventDispatch(drag,"drag","dragstart","dragend"),origin=null,mousedown=dragstart(d3_noop,d3.mouse,d3_behavior_dragMouseSubject,"mousemove","mouseup"),touchstart=dragstart(d3_behavior_dragTouchId,d3.touch,d3_behavior_dragTouchSubject,"touchmove","touchend");function drag(){this.on("mousedown.drag",mousedown).on("touchstart.drag",touchstart)}function dragstart(id,position,subject,move,end){return function(){var that=this,target=d3.event.target,parent=that.parentNode,dispatch=event.of(that,arguments),dragged=0,dragId=id(),dragName=".drag"+(dragId==null?"":"-"+dragId),dragOffset,dragSubject=d3.select(subject()).on(move+dragName,moved).on(end+dragName,ended),dragRestore=d3_event_dragSuppress(),position0=position(parent,dragId);if(origin){dragOffset=origin.apply(that,arguments);dragOffset=[dragOffset.x-position0[0],dragOffset.y-position0[1]]}else{dragOffset=[0,0]}dispatch({type:"dragstart"});function moved(){var position1=position(parent,dragId),dx,dy;if(!position1)return;dx=position1[0]-position0[0];dy=position1[1]-position0[1];dragged|=dx|dy;position0=position1;dispatch({type:"drag",x:position1[0]+dragOffset[0],y:position1[1]+dragOffset[1],dx:dx,dy:dy})}function ended(){if(!position(parent,dragId))return;dragSubject.on(move+dragName,null).on(end+dragName,null);dragRestore(dragged&&d3.event.target===target);dispatch({type:"dragend"})}}}drag.origin=function(x){if(!arguments.length)return origin;origin=x;return drag};return d3.rebind(drag,event,"on")};function d3_behavior_dragTouchId(){return d3.event.changedTouches[0].identifier}function d3_behavior_dragTouchSubject(){return d3.event.target}function d3_behavior_dragMouseSubject(){return d3_window}var π=Math.PI,τ=2*π,halfπ=π/2,ε=1e-6,ε2=ε*ε,d3_radians=π/180,d3_degrees=180/π;function d3_sgn(x){return x>0?1:x<0?-1:0}function d3_cross2d(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function d3_acos(x){return x>1?0:x<-1?π:Math.acos(x)}function d3_asin(x){return x>1?halfπ:x<-1?-halfπ:Math.asin(x)}function d3_sinh(x){return((x=Math.exp(x))-1/x)/2}function d3_cosh(x){return((x=Math.exp(x))+1/x)/2}function d3_tanh(x){return((x=Math.exp(2*x))-1)/(x+1)}function d3_haversin(x){return(x=Math.sin(x/2))*x}var ρ=Math.SQRT2,ρ2=2,ρ4=4;d3.interpolateZoom=function(p0,p1){var ux0=p0[0],uy0=p0[1],w0=p0[2],ux1=p1[0],uy1=p1[1],w1=p1[2];var dx=ux1-ux0,dy=uy1-uy0,d2=dx*dx+dy*dy,d1=Math.sqrt(d2),b0=(w1*w1-w0*w0+ρ4*d2)/(2*w0*ρ2*d1),b1=(w1*w1-w0*w0-ρ4*d2)/(2*w1*ρ2*d1),r0=Math.log(Math.sqrt(b0*b0+1)-b0),r1=Math.log(Math.sqrt(b1*b1+1)-b1),dr=r1-r0,S=(dr||Math.log(w1/w0))/ρ;function interpolate(t){var s=t*S;if(dr){var coshr0=d3_cosh(r0),u=w0/(ρ2*d1)*(coshr0*d3_tanh(ρ*s+r0)-d3_sinh(r0));return[ux0+u*dx,uy0+u*dy,w0*coshr0/d3_cosh(ρ*s+r0)]}return[ux0+t*dx,uy0+t*dy,w0*Math.exp(ρ*s)]}interpolate.duration=S*1e3;return interpolate};d3.behavior.zoom=function(){var view={x:0,y:0,k:1},translate0,center,size=[960,500],scaleExtent=d3_behavior_zoomInfinity,mousedown="mousedown.zoom",mousemove="mousemove.zoom",mouseup="mouseup.zoom",mousewheelTimer,touchstart="touchstart.zoom",touchtime,event=d3_eventDispatch(zoom,"zoomstart","zoom","zoomend"),x0,x1,y0,y1;function zoom(g){g.on(mousedown,mousedowned).on(d3_behavior_zoomWheel+".zoom",mousewheeled).on(mousemove,mousewheelreset).on("dblclick.zoom",dblclicked).on(touchstart,touchstarted)}zoom.event=function(g){g.each(function(){var dispatch=event.of(this,arguments),view1=view;if(d3_transitionInheritId){d3.select(this).transition().each("start.zoom",function(){view=this.__chart__||{x:0,y:0,k:1};zoomstarted(dispatch)}).tween("zoom:zoom",function(){var dx=size[0],dy=size[1],cx=dx/2,cy=dy/2,i=d3.interpolateZoom([(cx-view.x)/view.k,(cy-view.y)/view.k,dx/view.k],[(cx-view1.x)/view1.k,(cy-view1.y)/view1.k,dx/view1.k]);return function(t){var l=i(t),k=dx/l[2];this.__chart__=view={x:cx-l[0]*k,y:cy-l[1]*k,k:k};zoomed(dispatch)}}).each("end.zoom",function(){zoomended(dispatch)})}else{this.__chart__=view;
  zoomstarted(dispatch);zoomed(dispatch);zoomended(dispatch)}})};zoom.translate=function(_){if(!arguments.length)return[view.x,view.y];view={x:+_[0],y:+_[1],k:view.k};rescale();return zoom};zoom.scale=function(_){if(!arguments.length)return view.k;view={x:view.x,y:view.y,k:+_};rescale();return zoom};zoom.scaleExtent=function(_){if(!arguments.length)return scaleExtent;scaleExtent=_==null?d3_behavior_zoomInfinity:[+_[0],+_[1]];return zoom};zoom.center=function(_){if(!arguments.length)return center;center=_&&[+_[0],+_[1]];return zoom};zoom.size=function(_){if(!arguments.length)return size;size=_&&[+_[0],+_[1]];return zoom};zoom.x=function(z){if(!arguments.length)return x1;x1=z;x0=z.copy();view={x:0,y:0,k:1};return zoom};zoom.y=function(z){if(!arguments.length)return y1;y1=z;y0=z.copy();view={x:0,y:0,k:1};return zoom};function location(p){return[(p[0]-view.x)/view.k,(p[1]-view.y)/view.k]}function point(l){return[l[0]*view.k+view.x,l[1]*view.k+view.y]}function scaleTo(s){view.k=Math.max(scaleExtent[0],Math.min(scaleExtent[1],s))}function translateTo(p,l){l=point(l);view.x+=p[0]-l[0];view.y+=p[1]-l[1]}function rescale(){if(x1)x1.domain(x0.range().map(function(x){return(x-view.x)/view.k}).map(x0.invert));if(y1)y1.domain(y0.range().map(function(y){return(y-view.y)/view.k}).map(y0.invert))}function zoomstarted(dispatch){dispatch({type:"zoomstart"})}function zoomed(dispatch){rescale();dispatch({type:"zoom",scale:view.k,translate:[view.x,view.y]})}function zoomended(dispatch){dispatch({type:"zoomend"})}function mousedowned(){var that=this,target=d3.event.target,dispatch=event.of(that,arguments),dragged=0,subject=d3.select(d3_window).on(mousemove,moved).on(mouseup,ended),location0=location(d3.mouse(that)),dragRestore=d3_event_dragSuppress();d3_selection_interrupt.call(that);zoomstarted(dispatch);function moved(){dragged=1;translateTo(d3.mouse(that),location0);zoomed(dispatch)}function ended(){subject.on(mousemove,d3_window===that?mousewheelreset:null).on(mouseup,null);dragRestore(dragged&&d3.event.target===target);zoomended(dispatch)}}function touchstarted(){var that=this,dispatch=event.of(that,arguments),locations0={},distance0=0,scale0,zoomName=".zoom-"+d3.event.changedTouches[0].identifier,touchmove="touchmove"+zoomName,touchend="touchend"+zoomName,targets=[],subject=d3.select(that).on(mousedown,null).on(touchstart,started),dragRestore=d3_event_dragSuppress();d3_selection_interrupt.call(that);started();zoomstarted(dispatch);function relocate(){var touches=d3.touches(that);scale0=view.k;touches.forEach(function(t){if(t.identifier in locations0)locations0[t.identifier]=location(t)});return touches}function started(){var target=d3.event.target;d3.select(target).on(touchmove,moved).on(touchend,ended);targets.push(target);var changed=d3.event.changedTouches;for(var i=0,n=changed.length;i<n;++i){locations0[changed[i].identifier]=null}var touches=relocate(),now=Date.now();if(touches.length===1){if(now-touchtime<500){var p=touches[0],l=locations0[p.identifier];scaleTo(view.k*2);translateTo(p,l);d3_eventPreventDefault();zoomed(dispatch)}touchtime=now}else if(touches.length>1){var p=touches[0],q=touches[1],dx=p[0]-q[0],dy=p[1]-q[1];distance0=dx*dx+dy*dy}}function moved(){var touches=d3.touches(that),p0,l0,p1,l1;for(var i=0,n=touches.length;i<n;++i,l1=null){p1=touches[i];if(l1=locations0[p1.identifier]){if(l0)break;p0=p1,l0=l1}}if(l1){var distance1=(distance1=p1[0]-p0[0])*distance1+(distance1=p1[1]-p0[1])*distance1,scale1=distance0&&Math.sqrt(distance1/distance0);p0=[(p0[0]+p1[0])/2,(p0[1]+p1[1])/2];l0=[(l0[0]+l1[0])/2,(l0[1]+l1[1])/2];scaleTo(scale1*scale0)}touchtime=null;translateTo(p0,l0);zoomed(dispatch)}function ended(){if(d3.event.touches.length){var changed=d3.event.changedTouches;for(var i=0,n=changed.length;i<n;++i){delete locations0[changed[i].identifier]}for(var identifier in locations0){return void relocate()}}d3.selectAll(targets).on(zoomName,null);subject.on(mousedown,mousedowned).on(touchstart,touchstarted);dragRestore();zoomended(dispatch)}}function mousewheeled(){var dispatch=event.of(this,arguments);if(mousewheelTimer)clearTimeout(mousewheelTimer);else d3_selection_interrupt.call(this),zoomstarted(dispatch);mousewheelTimer=setTimeout(function(){mousewheelTimer=null;zoomended(dispatch)},50);d3_eventPreventDefault();var point=center||d3.mouse(this);if(!translate0)translate0=location(point);scaleTo(Math.pow(2,d3_behavior_zoomDelta()*.002)*view.k);translateTo(point,translate0);zoomed(dispatch)}function mousewheelreset(){translate0=null}function dblclicked(){var dispatch=event.of(this,arguments),p=d3.mouse(this),l=location(p),k=Math.log(view.k)/Math.LN2;zoomstarted(dispatch);scaleTo(Math.pow(2,d3.event.shiftKey?Math.ceil(k)-1:Math.floor(k)+1));translateTo(p,l);zoomed(dispatch);zoomended(dispatch)}return d3.rebind(zoom,event,"on")};var d3_behavior_zoomInfinity=[0,Infinity];var d3_behavior_zoomDelta,d3_behavior_zoomWheel="onwheel"in d3_document?(d3_behavior_zoomDelta=function(){return-d3.event.deltaY*(d3.event.deltaMode?120:1)},"wheel"):"onmousewheel"in d3_document?(d3_behavior_zoomDelta=function(){return d3.event.wheelDelta},"mousewheel"):(d3_behavior_zoomDelta=function(){return-d3.event.detail},"MozMousePixelScroll");function d3_Color(){}d3_Color.prototype.toString=function(){return this.rgb()+""};d3.hsl=function(h,s,l){return arguments.length===1?h instanceof d3_Hsl?d3_hsl(h.h,h.s,h.l):d3_rgb_parse(""+h,d3_rgb_hsl,d3_hsl):d3_hsl(+h,+s,+l)};function d3_hsl(h,s,l){return new d3_Hsl(h,s,l)}function d3_Hsl(h,s,l){this.h=h;this.s=s;this.l=l}var d3_hslPrototype=d3_Hsl.prototype=new d3_Color;d3_hslPrototype.brighter=function(k){k=Math.pow(.7,arguments.length?k:1);return d3_hsl(this.h,this.s,this.l/k)};d3_hslPrototype.darker=function(k){k=Math.pow(.7,arguments.length?k:1);return d3_hsl(this.h,this.s,k*this.l)};d3_hslPrototype.rgb=function(){return d3_hsl_rgb(this.h,this.s,this.l)};function d3_hsl_rgb(h,s,l){var m1,m2;h=isNaN(h)?0:(h%=360)<0?h+360:h;s=isNaN(s)?0:s<0?0:s>1?1:s;l=l<0?0:l>1?1:l;m2=l<=.5?l*(1+s):l+s-l*s;m1=2*l-m2;function v(h){if(h>360)h-=360;else if(h<0)h+=360;if(h<60)return m1+(m2-m1)*h/60;if(h<180)return m2;if(h<240)return m1+(m2-m1)*(240-h)/60;return m1}function vv(h){return Math.round(v(h)*255)}return d3_rgb(vv(h+120),vv(h),vv(h-120))}d3.hcl=function(h,c,l){return arguments.length===1?h instanceof d3_Hcl?d3_hcl(h.h,h.c,h.l):h instanceof d3_Lab?d3_lab_hcl(h.l,h.a,h.b):d3_lab_hcl((h=d3_rgb_lab((h=d3.rgb(h)).r,h.g,h.b)).l,h.a,h.b):d3_hcl(+h,+c,+l)};function d3_hcl(h,c,l){return new d3_Hcl(h,c,l)}function d3_Hcl(h,c,l){this.h=h;this.c=c;this.l=l}var d3_hclPrototype=d3_Hcl.prototype=new d3_Color;d3_hclPrototype.brighter=function(k){return d3_hcl(this.h,this.c,Math.min(100,this.l+d3_lab_K*(arguments.length?k:1)))};d3_hclPrototype.darker=function(k){return d3_hcl(this.h,this.c,Math.max(0,this.l-d3_lab_K*(arguments.length?k:1)))};d3_hclPrototype.rgb=function(){return d3_hcl_lab(this.h,this.c,this.l).rgb()};function d3_hcl_lab(h,c,l){if(isNaN(h))h=0;if(isNaN(c))c=0;return d3_lab(l,Math.cos(h*=d3_radians)*c,Math.sin(h)*c)}d3.lab=function(l,a,b){return arguments.length===1?l instanceof d3_Lab?d3_lab(l.l,l.a,l.b):l instanceof d3_Hcl?d3_hcl_lab(l.l,l.c,l.h):d3_rgb_lab((l=d3.rgb(l)).r,l.g,l.b):d3_lab(+l,+a,+b)};function d3_lab(l,a,b){return new d3_Lab(l,a,b)}function d3_Lab(l,a,b){this.l=l;this.a=a;this.b=b}var d3_lab_K=18;var d3_lab_X=.95047,d3_lab_Y=1,d3_lab_Z=1.08883;var d3_labPrototype=d3_Lab.prototype=new d3_Color;d3_labPrototype.brighter=function(k){return d3_lab(Math.min(100,this.l+d3_lab_K*(arguments.length?k:1)),this.a,this.b)};d3_labPrototype.darker=function(k){return d3_lab(Math.max(0,this.l-d3_lab_K*(arguments.length?k:1)),this.a,this.b)};d3_labPrototype.rgb=function(){return d3_lab_rgb(this.l,this.a,this.b)};function d3_lab_rgb(l,a,b){var y=(l+16)/116,x=y+a/500,z=y-b/200;x=d3_lab_xyz(x)*d3_lab_X;y=d3_lab_xyz(y)*d3_lab_Y;z=d3_lab_xyz(z)*d3_lab_Z;return d3_rgb(d3_xyz_rgb(3.2404542*x-1.5371385*y-.4985314*z),d3_xyz_rgb(-.969266*x+1.8760108*y+.041556*z),d3_xyz_rgb(.0556434*x-.2040259*y+1.0572252*z))}function d3_lab_hcl(l,a,b){return l>0?d3_hcl(Math.atan2(b,a)*d3_degrees,Math.sqrt(a*a+b*b),l):d3_hcl(NaN,NaN,l)}function d3_lab_xyz(x){return x>.206893034?x*x*x:(x-4/29)/7.787037}function d3_xyz_lab(x){return x>.008856?Math.pow(x,1/3):7.787037*x+4/29}function d3_xyz_rgb(r){return Math.round(255*(r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055))}d3.rgb=function(r,g,b){return arguments.length===1?r instanceof d3_Rgb?d3_rgb(r.r,r.g,r.b):d3_rgb_parse(""+r,d3_rgb,d3_hsl_rgb):d3_rgb(~~r,~~g,~~b)};function d3_rgbNumber(value){return d3_rgb(value>>16,value>>8&255,value&255)}function d3_rgbString(value){return d3_rgbNumber(value)+""}function d3_rgb(r,g,b){return new d3_Rgb(r,g,b)}function d3_Rgb(r,g,b){this.r=r;this.g=g;this.b=b}var d3_rgbPrototype=d3_Rgb.prototype=new d3_Color;d3_rgbPrototype.brighter=function(k){k=Math.pow(.7,arguments.length?k:1);var r=this.r,g=this.g,b=this.b,i=30;if(!r&&!g&&!b)return d3_rgb(i,i,i);if(r&&r<i)r=i;if(g&&g<i)g=i;if(b&&b<i)b=i;return d3_rgb(Math.min(255,~~(r/k)),Math.min(255,~~(g/k)),Math.min(255,~~(b/k)))};d3_rgbPrototype.darker=function(k){k=Math.pow(.7,arguments.length?k:1);return d3_rgb(~~(k*this.r),~~(k*this.g),~~(k*this.b))};d3_rgbPrototype.hsl=function(){return d3_rgb_hsl(this.r,this.g,this.b)};d3_rgbPrototype.toString=function(){return"#"+d3_rgb_hex(this.r)+d3_rgb_hex(this.g)+d3_rgb_hex(this.b)};function d3_rgb_hex(v){return v<16?"0"+Math.max(0,v).toString(16):Math.min(255,v).toString(16)}function d3_rgb_parse(format,rgb,hsl){var r=0,g=0,b=0,m1,m2,color;m1=/([a-z]+)\((.*)\)/i.exec(format);if(m1){m2=m1[2].split(",");switch(m1[1]){case"hsl":{return hsl(parseFloat(m2[0]),parseFloat(m2[1])/100,parseFloat(m2[2])/100)}case"rgb":{return rgb(d3_rgb_parseNumber(m2[0]),d3_rgb_parseNumber(m2[1]),d3_rgb_parseNumber(m2[2]))}}}if(color=d3_rgb_names.get(format))return rgb(color.r,color.g,color.b);if(format!=null&&format.charAt(0)==="#"&&!isNaN(color=parseInt(format.substring(1),16))){if(format.length===4){r=(color&3840)>>4;r=r>>4|r;g=color&240;g=g>>4|g;b=color&15;b=b<<4|b}else if(format.length===7){r=(color&16711680)>>16;g=(color&65280)>>8;b=color&255}}return rgb(r,g,b)}function d3_rgb_hsl(r,g,b){var min=Math.min(r/=255,g/=255,b/=255),max=Math.max(r,g,b),d=max-min,h,s,l=(max+min)/2;if(d){s=l<.5?d/(max+min):d/(2-max-min);if(r==max)h=(g-b)/d+(g<b?6:0);else if(g==max)h=(b-r)/d+2;else h=(r-g)/d+4;h*=60}else{h=NaN;s=l>0&&l<1?0:h}return d3_hsl(h,s,l)}function d3_rgb_lab(r,g,b){r=d3_rgb_xyz(r);g=d3_rgb_xyz(g);b=d3_rgb_xyz(b);var x=d3_xyz_lab((.4124564*r+.3575761*g+.1804375*b)/d3_lab_X),y=d3_xyz_lab((.2126729*r+.7151522*g+.072175*b)/d3_lab_Y),z=d3_xyz_lab((.0193339*r+.119192*g+.9503041*b)/d3_lab_Z);return d3_lab(116*y-16,500*(x-y),200*(y-z))}function d3_rgb_xyz(r){return(r/=255)<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function d3_rgb_parseNumber(c){var f=parseFloat(c);return c.charAt(c.length-1)==="%"?Math.round(f*2.55):f}var d3_rgb_names=d3.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});d3_rgb_names.forEach(function(key,value){d3_rgb_names.set(key,d3_rgbNumber(value))});function d3_functor(v){return typeof v==="function"?v:function(){return v}}d3.functor=d3_functor;function d3_identity(d){return d}d3.xhr=d3_xhrType(d3_identity);function d3_xhrType(response){return function(url,mimeType,callback){if(arguments.length===2&&typeof mimeType==="function")callback=mimeType,mimeType=null;return d3_xhr(url,mimeType,response,callback)}}function d3_xhr(url,mimeType,response,callback){var xhr={},dispatch=d3.dispatch("beforesend","progress","load","error"),headers={},request=new XMLHttpRequest,responseType=null;if(d3_window.XDomainRequest&&!("withCredentials"in request)&&/^(http(s)?:)?\/\//.test(url))request=new XDomainRequest;"onload"in request?request.onload=request.onerror=respond:request.onreadystatechange=function(){request.readyState>3&&respond()};function respond(){var status=request.status,result;if(!status&&request.responseText||status>=200&&status<300||status===304){try{result=response.call(xhr,request)}catch(e){dispatch.error.call(xhr,e);return}dispatch.load.call(xhr,result)}else{dispatch.error.call(xhr,request)}}request.onprogress=function(event){var o=d3.event;d3.event=event;try{dispatch.progress.call(xhr,request)}finally{d3.event=o}};xhr.header=function(name,value){name=(name+"").toLowerCase();if(arguments.length<2)return headers[name];if(value==null)delete headers[name];else headers[name]=value+"";return xhr};xhr.mimeType=function(value){if(!arguments.length)return mimeType;mimeType=value==null?null:value+"";return xhr};xhr.responseType=function(value){if(!arguments.length)return responseType;responseType=value;return xhr};xhr.response=function(value){response=value;return xhr};["get","post"].forEach(function(method){xhr[method]=function(){return xhr.send.apply(xhr,[method].concat(d3_array(arguments)))}});xhr.send=function(method,data,callback){if(arguments.length===2&&typeof data==="function")callback=data,data=null;request.open(method,url,true);if(mimeType!=null&&!("accept"in headers))headers["accept"]=mimeType+",*/*";if(request.setRequestHeader)for(var name in headers)request.setRequestHeader(name,headers[name]);if(mimeType!=null&&request.overrideMimeType)request.overrideMimeType(mimeType);if(responseType!=null)request.responseType=responseType;if(callback!=null)xhr.on("error",callback).on("load",function(request){callback(null,request)});dispatch.beforesend.call(xhr,request);request.send(data==null?null:data);return xhr};xhr.abort=function(){request.abort();return xhr};d3.rebind(xhr,dispatch,"on");return callback==null?xhr:xhr.get(d3_xhr_fixCallback(callback))}function d3_xhr_fixCallback(callback){return callback.length===1?function(error,request){callback(error==null?request:null)}:callback}d3.dsv=function(delimiter,mimeType){var reFormat=new RegExp('["'+delimiter+"\n]"),delimiterCode=delimiter.charCodeAt(0);function dsv(url,row,callback){if(arguments.length<3)callback=row,row=null;var xhr=d3_xhr(url,mimeType,row==null?response:typedResponse(row),callback);xhr.row=function(_){return arguments.length?xhr.response((row=_)==null?response:typedResponse(_)):row};return xhr}function response(request){return dsv.parse(request.responseText)}function typedResponse(f){return function(request){return dsv.parse(request.responseText,f)}}dsv.parse=function(text,f){var o;return dsv.parseRows(text,function(row,i){if(o)return o(row,i-1);var a=new Function("d","return {"+row.map(function(name,i){return JSON.stringify(name)+": d["+i+"]"}).join(",")+"}");o=f?function(row,i){return f(a(row),i)}:a})};dsv.parseRows=function(text,f){var EOL={},EOF={},rows=[],N=text.length,I=0,n=0,t,eol;function token(){if(I>=N)return EOF;if(eol)return eol=false,EOL;var j=I;if(text.charCodeAt(j)===34){var i=j;while(i++<N){if(text.charCodeAt(i)===34){if(text.charCodeAt(i+1)!==34)break;++i}}I=i+2;var c=text.charCodeAt(i+1);if(c===13){eol=true;if(text.charCodeAt(i+2)===10)++I}else if(c===10){eol=true}return text.substring(j+1,i).replace(/""/g,'"')}while(I<N){var c=text.charCodeAt(I++),k=1;if(c===10)eol=true;else if(c===13){eol=true;if(text.charCodeAt(I)===10)++I,++k}else if(c!==delimiterCode)continue;return text.substring(j,I-k)}return text.substring(j)}while((t=token())!==EOF){var a=[];while(t!==EOL&&t!==EOF){a.push(t);t=token()}if(f&&!(a=f(a,n++)))continue;rows.push(a)}return rows};dsv.format=function(rows){if(Array.isArray(rows[0]))return dsv.formatRows(rows);var fieldSet=new d3_Set,fields=[];rows.forEach(function(row){for(var field in row){if(!fieldSet.has(field)){fields.push(fieldSet.add(field))}}});return[fields.map(formatValue).join(delimiter)].concat(rows.map(function(row){return fields.map(function(field){return formatValue(row[field])}).join(delimiter)})).join("\n")};dsv.formatRows=function(rows){return rows.map(formatRow).join("\n")};function formatRow(row){return row.map(formatValue).join(delimiter)}function formatValue(text){return reFormat.test(text)?'"'+text.replace(/\"/g,'""')+'"':text}return dsv};d3.csv=d3.dsv(",","text/csv");d3.tsv=d3.dsv("	","text/tab-separated-values");d3.touch=function(container,touches,identifier){if(arguments.length<3)identifier=touches,touches=d3_eventSource().changedTouches;if(touches)for(var i=0,n=touches.length,touch;i<n;++i){if((touch=touches[i]).identifier===identifier){return d3_mousePoint(container,touch)}}};var d3_timer_queueHead,d3_timer_queueTail,d3_timer_interval,d3_timer_timeout,d3_timer_active,d3_timer_frame=d3_window[d3_vendorSymbol(d3_window,"requestAnimationFrame")]||function(callback){setTimeout(callback,17)};d3.timer=function(callback,delay,then){var n=arguments.length;if(n<2)delay=0;if(n<3)then=Date.now();var time=then+delay,timer={c:callback,t:time,f:false,n:null};if(d3_timer_queueTail)d3_timer_queueTail.n=timer;else d3_timer_queueHead=timer;d3_timer_queueTail=timer;if(!d3_timer_interval){d3_timer_timeout=clearTimeout(d3_timer_timeout);d3_timer_interval=1;d3_timer_frame(d3_timer_step)}};function d3_timer_step(){var now=d3_timer_mark(),delay=d3_timer_sweep()-now;if(delay>24){if(isFinite(delay)){clearTimeout(d3_timer_timeout);d3_timer_timeout=setTimeout(d3_timer_step,delay)}d3_timer_interval=0}else{d3_timer_interval=1;d3_timer_frame(d3_timer_step)}}d3.timer.flush=function(){d3_timer_mark();d3_timer_sweep()};function d3_timer_mark(){var now=Date.now();d3_timer_active=d3_timer_queueHead;while(d3_timer_active){if(now>=d3_timer_active.t)d3_timer_active.f=d3_timer_active.c(now-d3_timer_active.t);d3_timer_active=d3_timer_active.n}return now}function d3_timer_sweep(){var t0,t1=d3_timer_queueHead,time=Infinity;while(t1){if(t1.f){t1=t0?t0.n=t1.n:d3_timer_queueHead=t1.n}else{if(t1.t<time)time=t1.t;t1=(t0=t1).n}}d3_timer_queueTail=t0;return time}function d3_format_precision(x,p){return p-(x?Math.ceil(Math.log(x)/Math.LN10):1)}d3.round=function(x,n){return n?Math.round(x*(n=Math.pow(10,n)))/n:Math.round(x)};var d3_formatPrefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix);d3.formatPrefix=function(value,precision){var i=0;if(value){if(value<0)value*=-1;if(precision)value=d3.round(value,d3_format_precision(value,precision));i=1+Math.floor(1e-12+Math.log(value)/Math.LN10);i=Math.max(-24,Math.min(24,Math.floor((i-1)/3)*3))}return d3_formatPrefixes[8+i/3]};function d3_formatPrefix(d,i){var k=Math.pow(10,abs(8-i)*3);return{scale:i>8?function(d){return d/k}:function(d){return d*k},symbol:d}}function d3_locale_numberFormat(locale){var locale_decimal=locale.decimal,locale_thousands=locale.thousands,locale_grouping=locale.grouping,locale_currency=locale.currency,formatGroup=locale_grouping?function(value){var i=value.length,t=[],j=0,g=locale_grouping[0];while(i>0&&g>0){t.push(value.substring(i-=g,i+g));g=locale_grouping[j=(j+1)%locale_grouping.length]}return t.reverse().join(locale_thousands)}:d3_identity;return function(specifier){var match=d3_format_re.exec(specifier),fill=match[1]||" ",align=match[2]||">",sign=match[3]||"",symbol=match[4]||"",zfill=match[5],width=+match[6],comma=match[7],precision=match[8],type=match[9],scale=1,prefix="",suffix="",integer=false;if(precision)precision=+precision.substring(1);if(zfill||fill==="0"&&align==="="){zfill=fill="0";align="=";if(comma)width-=Math.floor((width-1)/4)}switch(type){case"n":comma=true;type="g";break;case"%":scale=100;suffix="%";type="f";break;case"p":scale=100;suffix="%";type="r";break;case"b":case"o":case"x":case"X":if(symbol==="#")prefix="0"+type.toLowerCase();case"c":case"d":integer=true;precision=0;break;case"s":scale=-1;type="r";break}if(symbol==="$")prefix=locale_currency[0],suffix=locale_currency[1];if(type=="r"&&!precision)type="g";if(precision!=null){if(type=="g")precision=Math.max(1,Math.min(21,precision));else if(type=="e"||type=="f")precision=Math.max(0,Math.min(20,precision))}type=d3_format_types.get(type)||d3_format_typeDefault;var zcomma=zfill&&comma;return function(value){var fullSuffix=suffix;if(integer&&value%1)return"";var negative=value<0||value===0&&1/value<0?(value=-value,"-"):sign;if(scale<0){var unit=d3.formatPrefix(value,precision);value=unit.scale(value);fullSuffix=unit.symbol+suffix}else{value*=scale}value=type(value,precision);var i=value.lastIndexOf("."),before=i<0?value:value.substring(0,i),after=i<0?"":locale_decimal+value.substring(i+1);if(!zfill&&comma)before=formatGroup(before);var length=prefix.length+before.length+after.length+(zcomma?0:negative.length),padding=length<width?new Array(length=width-length+1).join(fill):"";if(zcomma)before=formatGroup(padding+before);negative+=prefix;value=before+after;return(align==="<"?negative+value+padding:align===">"?padding+negative+value:align==="^"?padding.substring(0,length>>=1)+negative+value+padding.substring(length):negative+(zcomma?value:padding+value))+fullSuffix}}}var d3_format_re=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;var d3_format_types=d3.map({b:function(x){return x.toString(2)},c:function(x){return String.fromCharCode(x)},o:function(x){return x.toString(8)},x:function(x){return x.toString(16)},X:function(x){return x.toString(16).toUpperCase()},g:function(x,p){return x.toPrecision(p)},e:function(x,p){return x.toExponential(p)},f:function(x,p){return x.toFixed(p)},r:function(x,p){return(x=d3.round(x,d3_format_precision(x,p))).toFixed(Math.max(0,Math.min(20,d3_format_precision(x*(1+1e-15),p))))}});function d3_format_typeDefault(x){return x+""}var d3_time=d3.time={},d3_date=Date;function d3_date_utc(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}d3_date_utc.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){d3_time_prototype.setUTCDate.apply(this._,arguments)},setDay:function(){d3_time_prototype.setUTCDay.apply(this._,arguments)},setFullYear:function(){d3_time_prototype.setUTCFullYear.apply(this._,arguments)},setHours:function(){d3_time_prototype.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){d3_time_prototype.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){d3_time_prototype.setUTCMinutes.apply(this._,arguments)},setMonth:function(){d3_time_prototype.setUTCMonth.apply(this._,arguments)},setSeconds:function(){d3_time_prototype.setUTCSeconds.apply(this._,arguments)},setTime:function(){d3_time_prototype.setTime.apply(this._,arguments)}};var d3_time_prototype=Date.prototype;function d3_time_interval(local,step,number){function round(date){var d0=local(date),d1=offset(d0,1);return date-d0<d1-date?d0:d1}function ceil(date){step(date=local(new d3_date(date-1)),1);return date}function offset(date,k){step(date=new d3_date(+date),k);return date}function range(t0,t1,dt){var time=ceil(t0),times=[];if(dt>1){while(time<t1){if(!(number(time)%dt))times.push(new Date(+time));step(time,1)}}else{while(time<t1)times.push(new Date(+time)),step(time,1)}return times}function range_utc(t0,t1,dt){try{d3_date=d3_date_utc;var utc=new d3_date_utc;utc._=t0;return range(utc,t1,dt)}finally{d3_date=Date}}local.floor=local;local.round=round;local.ceil=ceil;local.offset=offset;local.range=range;var utc=local.utc=d3_time_interval_utc(local);utc.floor=utc;utc.round=d3_time_interval_utc(round);utc.ceil=d3_time_interval_utc(ceil);utc.offset=d3_time_interval_utc(offset);utc.range=range_utc;return local}function d3_time_interval_utc(method){return function(date,k){try{d3_date=d3_date_utc;var utc=new d3_date_utc;utc._=date;return method(utc,k)._}finally{d3_date=Date}}}d3_time.year=d3_time_interval(function(date){date=d3_time.day(date);date.setMonth(0,1);return date},function(date,offset){date.setFullYear(date.getFullYear()+offset)},function(date){return date.getFullYear()});d3_time.years=d3_time.year.range;d3_time.years.utc=d3_time.year.utc.range;d3_time.day=d3_time_interval(function(date){var day=new d3_date(2e3,0);day.setFullYear(date.getFullYear(),date.getMonth(),date.getDate());return day},function(date,offset){date.setDate(date.getDate()+offset)},function(date){return date.getDate()-1});d3_time.days=d3_time.day.range;d3_time.days.utc=d3_time.day.utc.range;d3_time.dayOfYear=function(date){var year=d3_time.year(date);return Math.floor((date-year-(date.getTimezoneOffset()-year.getTimezoneOffset())*6e4)/864e5)};["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(day,i){i=7-i;var interval=d3_time[day]=d3_time_interval(function(date){(date=d3_time.day(date)).setDate(date.getDate()-(date.getDay()+i)%7);return date},function(date,offset){date.setDate(date.getDate()+Math.floor(offset)*7)},function(date){var day=d3_time.year(date).getDay();return Math.floor((d3_time.dayOfYear(date)+(day+i)%7)/7)-(day!==i)});d3_time[day+"s"]=interval.range;d3_time[day+"s"].utc=interval.utc.range;d3_time[day+"OfYear"]=function(date){var day=d3_time.year(date).getDay();return Math.floor((d3_time.dayOfYear(date)+(day+i)%7)/7)}});d3_time.week=d3_time.sunday;d3_time.weeks=d3_time.sunday.range;d3_time.weeks.utc=d3_time.sunday.utc.range;d3_time.weekOfYear=d3_time.sundayOfYear;function d3_locale_timeFormat(locale){var locale_dateTime=locale.dateTime,locale_date=locale.date,locale_time=locale.time,locale_periods=locale.periods,locale_days=locale.days,locale_shortDays=locale.shortDays,locale_months=locale.months,locale_shortMonths=locale.shortMonths;function d3_time_format(template){var n=template.length;function format(date){var string=[],i=-1,j=0,c,p,f;while(++i<n){if(template.charCodeAt(i)===37){string.push(template.substring(j,i));if((p=d3_time_formatPads[c=template.charAt(++i)])!=null)c=template.charAt(++i);if(f=d3_time_formats[c])c=f(date,p==null?c==="e"?" ":"0":p);string.push(c);j=i+1}}string.push(template.substring(j,i));return string.join("")}format.parse=function(string){var d={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=d3_time_parse(d,template,string,0);if(i!=string.length)return null;if("p"in d)d.H=d.H%12+d.p*12;var localZ=d.Z!=null&&d3_date!==d3_date_utc,date=new(localZ?d3_date_utc:d3_date);if("j"in d)date.setFullYear(d.y,0,d.j);else if("w"in d&&("W"in d||"U"in d)){date.setFullYear(d.y,0,1);date.setFullYear(d.y,0,"W"in d?(d.w+6)%7+d.W*7-(date.getDay()+5)%7:d.w+d.U*7-(date.getDay()+6)%7)}else date.setFullYear(d.y,d.m,d.d);date.setHours(d.H+Math.floor(d.Z/100),d.M+d.Z%100,d.S,d.L);return localZ?date._:date};format.toString=function(){return template};return format}function d3_time_parse(date,template,string,j){var c,p,t,i=0,n=template.length,m=string.length;while(i<n){if(j>=m)return-1;c=template.charCodeAt(i++);if(c===37){t=template.charAt(i++);p=d3_time_parsers[t in d3_time_formatPads?template.charAt(i++):t];if(!p||(j=p(date,string,j))<0)return-1}else if(c!=string.charCodeAt(j++)){return-1}}return j}d3_time_format.utc=function(template){var local=d3_time_format(template);function format(date){try{d3_date=d3_date_utc;var utc=new d3_date;utc._=date;return local(utc)}finally{d3_date=Date}}format.parse=function(string){try{d3_date=d3_date_utc;var date=local.parse(string);return date&&date._}finally{d3_date=Date}};format.toString=local.toString;return format};d3_time_format.multi=d3_time_format.utc.multi=d3_time_formatMulti;var d3_time_periodLookup=d3.map(),d3_time_dayRe=d3_time_formatRe(locale_days),d3_time_dayLookup=d3_time_formatLookup(locale_days),d3_time_dayAbbrevRe=d3_time_formatRe(locale_shortDays),d3_time_dayAbbrevLookup=d3_time_formatLookup(locale_shortDays),d3_time_monthRe=d3_time_formatRe(locale_months),d3_time_monthLookup=d3_time_formatLookup(locale_months),d3_time_monthAbbrevRe=d3_time_formatRe(locale_shortMonths),d3_time_monthAbbrevLookup=d3_time_formatLookup(locale_shortMonths);locale_periods.forEach(function(p,i){d3_time_periodLookup.set(p.toLowerCase(),i)});var d3_time_formats={a:function(d){return locale_shortDays[d.getDay()]},A:function(d){return locale_days[d.getDay()]},b:function(d){return locale_shortMonths[d.getMonth()]},B:function(d){return locale_months[d.getMonth()]},c:d3_time_format(locale_dateTime),d:function(d,p){return d3_time_formatPad(d.getDate(),p,2)},e:function(d,p){return d3_time_formatPad(d.getDate(),p,2)},H:function(d,p){return d3_time_formatPad(d.getHours(),p,2)},I:function(d,p){return d3_time_formatPad(d.getHours()%12||12,p,2)},j:function(d,p){return d3_time_formatPad(1+d3_time.dayOfYear(d),p,3)},L:function(d,p){return d3_time_formatPad(d.getMilliseconds(),p,3)},m:function(d,p){return d3_time_formatPad(d.getMonth()+1,p,2)},M:function(d,p){return d3_time_formatPad(d.getMinutes(),p,2)},p:function(d){return locale_periods[+(d.getHours()>=12)]},S:function(d,p){return d3_time_formatPad(d.getSeconds(),p,2)},U:function(d,p){return d3_time_formatPad(d3_time.sundayOfYear(d),p,2)},w:function(d){return d.getDay()},W:function(d,p){return d3_time_formatPad(d3_time.mondayOfYear(d),p,2)},x:d3_time_format(locale_date),X:d3_time_format(locale_time),y:function(d,p){return d3_time_formatPad(d.getFullYear()%100,p,2)},Y:function(d,p){return d3_time_formatPad(d.getFullYear()%1e4,p,4)},Z:d3_time_zone,"%":function(){return"%"
  }};var d3_time_parsers={a:d3_time_parseWeekdayAbbrev,A:d3_time_parseWeekday,b:d3_time_parseMonthAbbrev,B:d3_time_parseMonth,c:d3_time_parseLocaleFull,d:d3_time_parseDay,e:d3_time_parseDay,H:d3_time_parseHour24,I:d3_time_parseHour24,j:d3_time_parseDayOfYear,L:d3_time_parseMilliseconds,m:d3_time_parseMonthNumber,M:d3_time_parseMinutes,p:d3_time_parseAmPm,S:d3_time_parseSeconds,U:d3_time_parseWeekNumberSunday,w:d3_time_parseWeekdayNumber,W:d3_time_parseWeekNumberMonday,x:d3_time_parseLocaleDate,X:d3_time_parseLocaleTime,y:d3_time_parseYear,Y:d3_time_parseFullYear,Z:d3_time_parseZone,"%":d3_time_parseLiteralPercent};function d3_time_parseWeekdayAbbrev(date,string,i){d3_time_dayAbbrevRe.lastIndex=0;var n=d3_time_dayAbbrevRe.exec(string.substring(i));return n?(date.w=d3_time_dayAbbrevLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function d3_time_parseWeekday(date,string,i){d3_time_dayRe.lastIndex=0;var n=d3_time_dayRe.exec(string.substring(i));return n?(date.w=d3_time_dayLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function d3_time_parseMonthAbbrev(date,string,i){d3_time_monthAbbrevRe.lastIndex=0;var n=d3_time_monthAbbrevRe.exec(string.substring(i));return n?(date.m=d3_time_monthAbbrevLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function d3_time_parseMonth(date,string,i){d3_time_monthRe.lastIndex=0;var n=d3_time_monthRe.exec(string.substring(i));return n?(date.m=d3_time_monthLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function d3_time_parseLocaleFull(date,string,i){return d3_time_parse(date,d3_time_formats.c.toString(),string,i)}function d3_time_parseLocaleDate(date,string,i){return d3_time_parse(date,d3_time_formats.x.toString(),string,i)}function d3_time_parseLocaleTime(date,string,i){return d3_time_parse(date,d3_time_formats.X.toString(),string,i)}function d3_time_parseAmPm(date,string,i){var n=d3_time_periodLookup.get(string.substring(i,i+=2).toLowerCase());return n==null?-1:(date.p=n,i)}return d3_time_format}var d3_time_formatPads={"-":"",_:" ",0:"0"},d3_time_numberRe=/^\s*\d+/,d3_time_percentRe=/^%/;function d3_time_formatPad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length<width?new Array(width-length+1).join(fill)+string:string)}function d3_time_formatRe(names){return new RegExp("^(?:"+names.map(d3.requote).join("|")+")","i")}function d3_time_formatLookup(names){var map=new d3_Map,i=-1,n=names.length;while(++i<n)map.set(names[i].toLowerCase(),i);return map}function d3_time_parseWeekdayNumber(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+1));return n?(date.w=+n[0],i+n[0].length):-1}function d3_time_parseWeekNumberSunday(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i));return n?(date.U=+n[0],i+n[0].length):-1}function d3_time_parseWeekNumberMonday(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i));return n?(date.W=+n[0],i+n[0].length):-1}function d3_time_parseFullYear(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+4));return n?(date.y=+n[0],i+n[0].length):-1}function d3_time_parseYear(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+2));return n?(date.y=d3_time_expandYear(+n[0]),i+n[0].length):-1}function d3_time_parseZone(date,string,i){return/^[+-]\d{4}$/.test(string=string.substring(i,i+5))?(date.Z=-string,i+5):-1}function d3_time_expandYear(d){return d+(d>68?1900:2e3)}function d3_time_parseMonthNumber(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+2));return n?(date.m=n[0]-1,i+n[0].length):-1}function d3_time_parseDay(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+2));return n?(date.d=+n[0],i+n[0].length):-1}function d3_time_parseDayOfYear(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+3));return n?(date.j=+n[0],i+n[0].length):-1}function d3_time_parseHour24(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+2));return n?(date.H=+n[0],i+n[0].length):-1}function d3_time_parseMinutes(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+2));return n?(date.M=+n[0],i+n[0].length):-1}function d3_time_parseSeconds(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+2));return n?(date.S=+n[0],i+n[0].length):-1}function d3_time_parseMilliseconds(date,string,i){d3_time_numberRe.lastIndex=0;var n=d3_time_numberRe.exec(string.substring(i,i+3));return n?(date.L=+n[0],i+n[0].length):-1}function d3_time_zone(d){var z=d.getTimezoneOffset(),zs=z>0?"-":"+",zh=~~(abs(z)/60),zm=abs(z)%60;return zs+d3_time_formatPad(zh,"0",2)+d3_time_formatPad(zm,"0",2)}function d3_time_parseLiteralPercent(date,string,i){d3_time_percentRe.lastIndex=0;var n=d3_time_percentRe.exec(string.substring(i,i+1));return n?i+n[0].length:-1}function d3_time_formatMulti(formats){var n=formats.length,i=-1;while(++i<n)formats[i][0]=this(formats[i][0]);return function(date){var i=0,f=formats[i];while(!f[1](date))f=formats[++i];return f[0](date)}}d3.locale=function(locale){return{numberFormat:d3_locale_numberFormat(locale),timeFormat:d3_locale_timeFormat(locale)}};var d3_locale_enUS=d3.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});d3.format=d3_locale_enUS.numberFormat;d3.geo={};function d3_adder(){}d3_adder.prototype={s:0,t:0,add:function(y){d3_adderSum(y,this.t,d3_adderTemp);d3_adderSum(d3_adderTemp.s,this.s,this);if(this.s)this.t+=d3_adderTemp.t;else this.s=d3_adderTemp.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var d3_adderTemp=new d3_adder;function d3_adderSum(a,b,o){var x=o.s=a+b,bv=x-a,av=x-bv;o.t=a-av+(b-bv)}d3.geo.stream=function(object,listener){if(object&&d3_geo_streamObjectType.hasOwnProperty(object.type)){d3_geo_streamObjectType[object.type](object,listener)}else{d3_geo_streamGeometry(object,listener)}};function d3_geo_streamGeometry(geometry,listener){if(geometry&&d3_geo_streamGeometryType.hasOwnProperty(geometry.type)){d3_geo_streamGeometryType[geometry.type](geometry,listener)}}var d3_geo_streamObjectType={Feature:function(feature,listener){d3_geo_streamGeometry(feature.geometry,listener)},FeatureCollection:function(object,listener){var features=object.features,i=-1,n=features.length;while(++i<n)d3_geo_streamGeometry(features[i].geometry,listener)}};var d3_geo_streamGeometryType={Sphere:function(object,listener){listener.sphere()},Point:function(object,listener){object=object.coordinates;listener.point(object[0],object[1],object[2])},MultiPoint:function(object,listener){var coordinates=object.coordinates,i=-1,n=coordinates.length;while(++i<n)object=coordinates[i],listener.point(object[0],object[1],object[2])},LineString:function(object,listener){d3_geo_streamLine(object.coordinates,listener,0)},MultiLineString:function(object,listener){var coordinates=object.coordinates,i=-1,n=coordinates.length;while(++i<n)d3_geo_streamLine(coordinates[i],listener,0)},Polygon:function(object,listener){d3_geo_streamPolygon(object.coordinates,listener)},MultiPolygon:function(object,listener){var coordinates=object.coordinates,i=-1,n=coordinates.length;while(++i<n)d3_geo_streamPolygon(coordinates[i],listener)},GeometryCollection:function(object,listener){var geometries=object.geometries,i=-1,n=geometries.length;while(++i<n)d3_geo_streamGeometry(geometries[i],listener)}};function d3_geo_streamLine(coordinates,listener,closed){var i=-1,n=coordinates.length-closed,coordinate;listener.lineStart();while(++i<n)coordinate=coordinates[i],listener.point(coordinate[0],coordinate[1],coordinate[2]);listener.lineEnd()}function d3_geo_streamPolygon(coordinates,listener){var i=-1,n=coordinates.length;listener.polygonStart();while(++i<n)d3_geo_streamLine(coordinates[i],listener,1);listener.polygonEnd()}d3.geo.area=function(object){d3_geo_areaSum=0;d3.geo.stream(object,d3_geo_area);return d3_geo_areaSum};var d3_geo_areaSum,d3_geo_areaRingSum=new d3_adder;var d3_geo_area={sphere:function(){d3_geo_areaSum+=4*π},point:d3_noop,lineStart:d3_noop,lineEnd:d3_noop,polygonStart:function(){d3_geo_areaRingSum.reset();d3_geo_area.lineStart=d3_geo_areaRingStart},polygonEnd:function(){var area=2*d3_geo_areaRingSum;d3_geo_areaSum+=area<0?4*π+area:area;d3_geo_area.lineStart=d3_geo_area.lineEnd=d3_geo_area.point=d3_noop}};function d3_geo_areaRingStart(){var λ00,φ00,λ0,cosφ0,sinφ0;d3_geo_area.point=function(λ,φ){d3_geo_area.point=nextPoint;λ0=(λ00=λ)*d3_radians,cosφ0=Math.cos(φ=(φ00=φ)*d3_radians/2+π/4),sinφ0=Math.sin(φ)};function nextPoint(λ,φ){λ*=d3_radians;φ=φ*d3_radians/2+π/4;var dλ=λ-λ0,sdλ=dλ>=0?1:-1,adλ=sdλ*dλ,cosφ=Math.cos(φ),sinφ=Math.sin(φ),k=sinφ0*sinφ,u=cosφ0*cosφ+k*Math.cos(adλ),v=k*sdλ*Math.sin(adλ);d3_geo_areaRingSum.add(Math.atan2(v,u));λ0=λ,cosφ0=cosφ,sinφ0=sinφ}d3_geo_area.lineEnd=function(){nextPoint(λ00,φ00)}}function d3_geo_cartesian(spherical){var λ=spherical[0],φ=spherical[1],cosφ=Math.cos(φ);return[cosφ*Math.cos(λ),cosφ*Math.sin(λ),Math.sin(φ)]}function d3_geo_cartesianDot(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function d3_geo_cartesianCross(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]]}function d3_geo_cartesianAdd(a,b){a[0]+=b[0];a[1]+=b[1];a[2]+=b[2]}function d3_geo_cartesianScale(vector,k){return[vector[0]*k,vector[1]*k,vector[2]*k]}function d3_geo_cartesianNormalize(d){var l=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]);d[0]/=l;d[1]/=l;d[2]/=l}function d3_geo_spherical(cartesian){return[Math.atan2(cartesian[1],cartesian[0]),d3_asin(cartesian[2])]}function d3_geo_sphericalEqual(a,b){return abs(a[0]-b[0])<ε&&abs(a[1]-b[1])<ε}d3.geo.bounds=function(){var λ0,φ0,λ1,φ1,λ_,λ__,φ__,p0,dλSum,ranges,range;var bound={point:point,lineStart:lineStart,lineEnd:lineEnd,polygonStart:function(){bound.point=ringPoint;bound.lineStart=ringStart;bound.lineEnd=ringEnd;dλSum=0;d3_geo_area.polygonStart()},polygonEnd:function(){d3_geo_area.polygonEnd();bound.point=point;bound.lineStart=lineStart;bound.lineEnd=lineEnd;if(d3_geo_areaRingSum<0)λ0=-(λ1=180),φ0=-(φ1=90);else if(dλSum>ε)φ1=90;else if(dλSum<-ε)φ0=-90;range[0]=λ0,range[1]=λ1}};function point(λ,φ){ranges.push(range=[λ0=λ,λ1=λ]);if(φ<φ0)φ0=φ;if(φ>φ1)φ1=φ}function linePoint(λ,φ){var p=d3_geo_cartesian([λ*d3_radians,φ*d3_radians]);if(p0){var normal=d3_geo_cartesianCross(p0,p),equatorial=[normal[1],-normal[0],0],inflection=d3_geo_cartesianCross(equatorial,normal);d3_geo_cartesianNormalize(inflection);inflection=d3_geo_spherical(inflection);var dλ=λ-λ_,s=dλ>0?1:-1,λi=inflection[0]*d3_degrees*s,antimeridian=abs(dλ)>180;if(antimeridian^(s*λ_<λi&&λi<s*λ)){var φi=inflection[1]*d3_degrees;if(φi>φ1)φ1=φi}else if(λi=(λi+360)%360-180,antimeridian^(s*λ_<λi&&λi<s*λ)){var φi=-inflection[1]*d3_degrees;if(φi<φ0)φ0=φi}else{if(φ<φ0)φ0=φ;if(φ>φ1)φ1=φ}if(antimeridian){if(λ<λ_){if(angle(λ0,λ)>angle(λ0,λ1))λ1=λ}else{if(angle(λ,λ1)>angle(λ0,λ1))λ0=λ}}else{if(λ1>=λ0){if(λ<λ0)λ0=λ;if(λ>λ1)λ1=λ}else{if(λ>λ_){if(angle(λ0,λ)>angle(λ0,λ1))λ1=λ}else{if(angle(λ,λ1)>angle(λ0,λ1))λ0=λ}}}}else{point(λ,φ)}p0=p,λ_=λ}function lineStart(){bound.point=linePoint}function lineEnd(){range[0]=λ0,range[1]=λ1;bound.point=point;p0=null}function ringPoint(λ,φ){if(p0){var dλ=λ-λ_;dλSum+=abs(dλ)>180?dλ+(dλ>0?360:-360):dλ}else λ__=λ,φ__=φ;d3_geo_area.point(λ,φ);linePoint(λ,φ)}function ringStart(){d3_geo_area.lineStart()}function ringEnd(){ringPoint(λ__,φ__);d3_geo_area.lineEnd();if(abs(dλSum)>ε)λ0=-(λ1=180);range[0]=λ0,range[1]=λ1;p0=null}function angle(λ0,λ1){return(λ1-=λ0)<0?λ1+360:λ1}function compareRanges(a,b){return a[0]-b[0]}function withinRange(x,range){return range[0]<=range[1]?range[0]<=x&&x<=range[1]:x<range[0]||range[1]<x}return function(feature){φ1=λ1=-(λ0=φ0=Infinity);ranges=[];d3.geo.stream(feature,bound);var n=ranges.length;if(n){ranges.sort(compareRanges);for(var i=1,a=ranges[0],b,merged=[a];i<n;++i){b=ranges[i];if(withinRange(b[0],a)||withinRange(b[1],a)){if(angle(a[0],b[1])>angle(a[0],a[1]))a[1]=b[1];if(angle(b[0],a[1])>angle(a[0],a[1]))a[0]=b[0]}else{merged.push(a=b)}}var best=-Infinity,dλ;for(var n=merged.length-1,i=0,a=merged[n],b;i<=n;a=b,++i){b=merged[i];if((dλ=angle(a[1],b[0]))>best)best=dλ,λ0=b[0],λ1=a[1]}}ranges=range=null;return λ0===Infinity||φ0===Infinity?[[NaN,NaN],[NaN,NaN]]:[[λ0,φ0],[λ1,φ1]]}}();d3.geo.centroid=function(object){d3_geo_centroidW0=d3_geo_centroidW1=d3_geo_centroidX0=d3_geo_centroidY0=d3_geo_centroidZ0=d3_geo_centroidX1=d3_geo_centroidY1=d3_geo_centroidZ1=d3_geo_centroidX2=d3_geo_centroidY2=d3_geo_centroidZ2=0;d3.geo.stream(object,d3_geo_centroid);var x=d3_geo_centroidX2,y=d3_geo_centroidY2,z=d3_geo_centroidZ2,m=x*x+y*y+z*z;if(m<ε2){x=d3_geo_centroidX1,y=d3_geo_centroidY1,z=d3_geo_centroidZ1;if(d3_geo_centroidW1<ε)x=d3_geo_centroidX0,y=d3_geo_centroidY0,z=d3_geo_centroidZ0;m=x*x+y*y+z*z;if(m<ε2)return[NaN,NaN]}return[Math.atan2(y,x)*d3_degrees,d3_asin(z/Math.sqrt(m))*d3_degrees]};var d3_geo_centroidW0,d3_geo_centroidW1,d3_geo_centroidX0,d3_geo_centroidY0,d3_geo_centroidZ0,d3_geo_centroidX1,d3_geo_centroidY1,d3_geo_centroidZ1,d3_geo_centroidX2,d3_geo_centroidY2,d3_geo_centroidZ2;var d3_geo_centroid={sphere:d3_noop,point:d3_geo_centroidPoint,lineStart:d3_geo_centroidLineStart,lineEnd:d3_geo_centroidLineEnd,polygonStart:function(){d3_geo_centroid.lineStart=d3_geo_centroidRingStart},polygonEnd:function(){d3_geo_centroid.lineStart=d3_geo_centroidLineStart}};function d3_geo_centroidPoint(λ,φ){λ*=d3_radians;var cosφ=Math.cos(φ*=d3_radians);d3_geo_centroidPointXYZ(cosφ*Math.cos(λ),cosφ*Math.sin(λ),Math.sin(φ))}function d3_geo_centroidPointXYZ(x,y,z){++d3_geo_centroidW0;d3_geo_centroidX0+=(x-d3_geo_centroidX0)/d3_geo_centroidW0;d3_geo_centroidY0+=(y-d3_geo_centroidY0)/d3_geo_centroidW0;d3_geo_centroidZ0+=(z-d3_geo_centroidZ0)/d3_geo_centroidW0}function d3_geo_centroidLineStart(){var x0,y0,z0;d3_geo_centroid.point=function(λ,φ){λ*=d3_radians;var cosφ=Math.cos(φ*=d3_radians);x0=cosφ*Math.cos(λ);y0=cosφ*Math.sin(λ);z0=Math.sin(φ);d3_geo_centroid.point=nextPoint;d3_geo_centroidPointXYZ(x0,y0,z0)};function nextPoint(λ,φ){λ*=d3_radians;var cosφ=Math.cos(φ*=d3_radians),x=cosφ*Math.cos(λ),y=cosφ*Math.sin(λ),z=Math.sin(φ),w=Math.atan2(Math.sqrt((w=y0*z-z0*y)*w+(w=z0*x-x0*z)*w+(w=x0*y-y0*x)*w),x0*x+y0*y+z0*z);d3_geo_centroidW1+=w;d3_geo_centroidX1+=w*(x0+(x0=x));d3_geo_centroidY1+=w*(y0+(y0=y));d3_geo_centroidZ1+=w*(z0+(z0=z));d3_geo_centroidPointXYZ(x0,y0,z0)}}function d3_geo_centroidLineEnd(){d3_geo_centroid.point=d3_geo_centroidPoint}function d3_geo_centroidRingStart(){var λ00,φ00,x0,y0,z0;d3_geo_centroid.point=function(λ,φ){λ00=λ,φ00=φ;d3_geo_centroid.point=nextPoint;λ*=d3_radians;var cosφ=Math.cos(φ*=d3_radians);x0=cosφ*Math.cos(λ);y0=cosφ*Math.sin(λ);z0=Math.sin(φ);d3_geo_centroidPointXYZ(x0,y0,z0)};d3_geo_centroid.lineEnd=function(){nextPoint(λ00,φ00);d3_geo_centroid.lineEnd=d3_geo_centroidLineEnd;d3_geo_centroid.point=d3_geo_centroidPoint};function nextPoint(λ,φ){λ*=d3_radians;var cosφ=Math.cos(φ*=d3_radians),x=cosφ*Math.cos(λ),y=cosφ*Math.sin(λ),z=Math.sin(φ),cx=y0*z-z0*y,cy=z0*x-x0*z,cz=x0*y-y0*x,m=Math.sqrt(cx*cx+cy*cy+cz*cz),u=x0*x+y0*y+z0*z,v=m&&-d3_acos(u)/m,w=Math.atan2(m,u);d3_geo_centroidX2+=v*cx;d3_geo_centroidY2+=v*cy;d3_geo_centroidZ2+=v*cz;d3_geo_centroidW1+=w;d3_geo_centroidX1+=w*(x0+(x0=x));d3_geo_centroidY1+=w*(y0+(y0=y));d3_geo_centroidZ1+=w*(z0+(z0=z));d3_geo_centroidPointXYZ(x0,y0,z0)}}function d3_true(){return true}function d3_geo_clipPolygon(segments,compare,clipStartInside,interpolate,listener){var subject=[],clip=[];segments.forEach(function(segment){if((n=segment.length-1)<=0)return;var n,p0=segment[0],p1=segment[n];if(d3_geo_sphericalEqual(p0,p1)){listener.lineStart();for(var i=0;i<n;++i)listener.point((p0=segment[i])[0],p0[1]);listener.lineEnd();return}var a=new d3_geo_clipPolygonIntersection(p0,segment,null,true),b=new d3_geo_clipPolygonIntersection(p0,null,a,false);a.o=b;subject.push(a);clip.push(b);a=new d3_geo_clipPolygonIntersection(p1,segment,null,false);b=new d3_geo_clipPolygonIntersection(p1,null,a,true);a.o=b;subject.push(a);clip.push(b)});clip.sort(compare);d3_geo_clipPolygonLinkCircular(subject);d3_geo_clipPolygonLinkCircular(clip);if(!subject.length)return;for(var i=0,entry=clipStartInside,n=clip.length;i<n;++i){clip[i].e=entry=!entry}var start=subject[0],points,point;while(1){var current=start,isSubject=true;while(current.v)if((current=current.n)===start)return;points=current.z;listener.lineStart();do{current.v=current.o.v=true;if(current.e){if(isSubject){for(var i=0,n=points.length;i<n;++i)listener.point((point=points[i])[0],point[1])}else{interpolate(current.x,current.n.x,1,listener)}current=current.n}else{if(isSubject){points=current.p.z;for(var i=points.length-1;i>=0;--i)listener.point((point=points[i])[0],point[1])}else{interpolate(current.x,current.p.x,-1,listener)}current=current.p}current=current.o;points=current.z;isSubject=!isSubject}while(!current.v);listener.lineEnd()}}function d3_geo_clipPolygonLinkCircular(array){if(!(n=array.length))return;var n,i=0,a=array[0],b;while(++i<n){a.n=b=array[i];b.p=a;a=b}a.n=b=array[0];b.p=a}function d3_geo_clipPolygonIntersection(point,points,other,entry){this.x=point;this.z=points;this.o=other;this.e=entry;this.v=false;this.n=this.p=null}function d3_geo_clip(pointVisible,clipLine,interpolate,clipStart){return function(rotate,listener){var line=clipLine(listener),rotatedClipStart=rotate.invert(clipStart[0],clipStart[1]);var clip={point:point,lineStart:lineStart,lineEnd:lineEnd,polygonStart:function(){clip.point=pointRing;clip.lineStart=ringStart;clip.lineEnd=ringEnd;segments=[];polygon=[]},polygonEnd:function(){clip.point=point;clip.lineStart=lineStart;clip.lineEnd=lineEnd;segments=d3.merge(segments);var clipStartInside=d3_geo_pointInPolygon(rotatedClipStart,polygon);if(segments.length){if(!polygonStarted)listener.polygonStart(),polygonStarted=true;d3_geo_clipPolygon(segments,d3_geo_clipSort,clipStartInside,interpolate,listener)}else if(clipStartInside){if(!polygonStarted)listener.polygonStart(),polygonStarted=true;listener.lineStart();interpolate(null,null,1,listener);listener.lineEnd()}if(polygonStarted)listener.polygonEnd(),polygonStarted=false;segments=polygon=null},sphere:function(){listener.polygonStart();listener.lineStart();interpolate(null,null,1,listener);listener.lineEnd();listener.polygonEnd()}};function point(λ,φ){var point=rotate(λ,φ);if(pointVisible(λ=point[0],φ=point[1]))listener.point(λ,φ)}function pointLine(λ,φ){var point=rotate(λ,φ);line.point(point[0],point[1])}function lineStart(){clip.point=pointLine;line.lineStart()}function lineEnd(){clip.point=point;line.lineEnd()}var segments;var buffer=d3_geo_clipBufferListener(),ringListener=clipLine(buffer),polygonStarted=false,polygon,ring;function pointRing(λ,φ){ring.push([λ,φ]);var point=rotate(λ,φ);ringListener.point(point[0],point[1])}function ringStart(){ringListener.lineStart();ring=[]}function ringEnd(){pointRing(ring[0][0],ring[0][1]);ringListener.lineEnd();var clean=ringListener.clean(),ringSegments=buffer.buffer(),segment,n=ringSegments.length;ring.pop();polygon.push(ring);ring=null;if(!n)return;if(clean&1){segment=ringSegments[0];var n=segment.length-1,i=-1,point;if(n>0){if(!polygonStarted)listener.polygonStart(),polygonStarted=true;listener.lineStart();while(++i<n)listener.point((point=segment[i])[0],point[1]);listener.lineEnd()}return}if(n>1&&clean&2)ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));segments.push(ringSegments.filter(d3_geo_clipSegmentLength1))}return clip}}function d3_geo_clipSegmentLength1(segment){return segment.length>1}function d3_geo_clipBufferListener(){var lines=[],line;return{lineStart:function(){lines.push(line=[])},point:function(λ,φ){line.push([λ,φ])},lineEnd:d3_noop,buffer:function(){var buffer=lines;lines=[];line=null;return buffer},rejoin:function(){if(lines.length>1)lines.push(lines.pop().concat(lines.shift()))}}}function d3_geo_clipSort(a,b){return((a=a.x)[0]<0?a[1]-halfπ-ε:halfπ-a[1])-((b=b.x)[0]<0?b[1]-halfπ-ε:halfπ-b[1])}function d3_geo_pointInPolygon(point,polygon){var meridian=point[0],parallel=point[1],meridianNormal=[Math.sin(meridian),-Math.cos(meridian),0],polarAngle=0,winding=0;d3_geo_areaRingSum.reset();for(var i=0,n=polygon.length;i<n;++i){var ring=polygon[i],m=ring.length;if(!m)continue;var point0=ring[0],λ0=point0[0],φ0=point0[1]/2+π/4,sinφ0=Math.sin(φ0),cosφ0=Math.cos(φ0),j=1;while(true){if(j===m)j=0;point=ring[j];var λ=point[0],φ=point[1]/2+π/4,sinφ=Math.sin(φ),cosφ=Math.cos(φ),dλ=λ-λ0,sdλ=dλ>=0?1:-1,adλ=sdλ*dλ,antimeridian=adλ>π,k=sinφ0*sinφ;d3_geo_areaRingSum.add(Math.atan2(k*sdλ*Math.sin(adλ),cosφ0*cosφ+k*Math.cos(adλ)));polarAngle+=antimeridian?dλ+sdλ*τ:dλ;if(antimeridian^λ0>=meridian^λ>=meridian){var arc=d3_geo_cartesianCross(d3_geo_cartesian(point0),d3_geo_cartesian(point));d3_geo_cartesianNormalize(arc);var intersection=d3_geo_cartesianCross(meridianNormal,arc);d3_geo_cartesianNormalize(intersection);var φarc=(antimeridian^dλ>=0?-1:1)*d3_asin(intersection[2]);if(parallel>φarc||parallel===φarc&&(arc[0]||arc[1])){winding+=antimeridian^dλ>=0?1:-1}}if(!j++)break;λ0=λ,sinφ0=sinφ,cosφ0=cosφ,point0=point}}return(polarAngle<-ε||polarAngle<ε&&d3_geo_areaRingSum<0)^winding&1}var d3_geo_clipAntimeridian=d3_geo_clip(d3_true,d3_geo_clipAntimeridianLine,d3_geo_clipAntimeridianInterpolate,[-π,-π/2]);function d3_geo_clipAntimeridianLine(listener){var λ0=NaN,φ0=NaN,sλ0=NaN,clean;return{lineStart:function(){listener.lineStart();clean=1},point:function(λ1,φ1){var sλ1=λ1>0?π:-π,dλ=abs(λ1-λ0);if(abs(dλ-π)<ε){listener.point(λ0,φ0=(φ0+φ1)/2>0?halfπ:-halfπ);listener.point(sλ0,φ0);listener.lineEnd();listener.lineStart();listener.point(sλ1,φ0);listener.point(λ1,φ0);clean=0}else if(sλ0!==sλ1&&dλ>=π){if(abs(λ0-sλ0)<ε)λ0-=sλ0*ε;if(abs(λ1-sλ1)<ε)λ1-=sλ1*ε;φ0=d3_geo_clipAntimeridianIntersect(λ0,φ0,λ1,φ1);listener.point(sλ0,φ0);listener.lineEnd();listener.lineStart();listener.point(sλ1,φ0);clean=0}listener.point(λ0=λ1,φ0=φ1);sλ0=sλ1},lineEnd:function(){listener.lineEnd();λ0=φ0=NaN},clean:function(){return 2-clean}}}function d3_geo_clipAntimeridianIntersect(λ0,φ0,λ1,φ1){var cosφ0,cosφ1,sinλ0_λ1=Math.sin(λ0-λ1);return abs(sinλ0_λ1)>ε?Math.atan((Math.sin(φ0)*(cosφ1=Math.cos(φ1))*Math.sin(λ1)-Math.sin(φ1)*(cosφ0=Math.cos(φ0))*Math.sin(λ0))/(cosφ0*cosφ1*sinλ0_λ1)):(φ0+φ1)/2}function d3_geo_clipAntimeridianInterpolate(from,to,direction,listener){var φ;if(from==null){φ=direction*halfπ;listener.point(-π,φ);listener.point(0,φ);listener.point(π,φ);listener.point(π,0);listener.point(π,-φ);listener.point(0,-φ);listener.point(-π,-φ);listener.point(-π,0);listener.point(-π,φ)}else if(abs(from[0]-to[0])>ε){var s=from[0]<to[0]?π:-π;φ=direction*s/2;listener.point(-s,φ);listener.point(0,φ);listener.point(s,φ)}else{listener.point(to[0],to[1])}}function d3_geo_clipCircle(radius){var cr=Math.cos(radius),smallRadius=cr>0,notHemisphere=abs(cr)>ε,interpolate=d3_geo_circleInterpolate(radius,6*d3_radians);return d3_geo_clip(visible,clipLine,interpolate,smallRadius?[0,-radius]:[-π,radius-π]);function visible(λ,φ){return Math.cos(λ)*Math.cos(φ)>cr}function clipLine(listener){var point0,c0,v0,v00,clean;return{lineStart:function(){v00=v0=false;clean=1},point:function(λ,φ){var point1=[λ,φ],point2,v=visible(λ,φ),c=smallRadius?v?0:code(λ,φ):v?code(λ+(λ<0?π:-π),φ):0;if(!point0&&(v00=v0=v))listener.lineStart();if(v!==v0){point2=intersect(point0,point1);if(d3_geo_sphericalEqual(point0,point2)||d3_geo_sphericalEqual(point1,point2)){point1[0]+=ε;point1[1]+=ε;v=visible(point1[0],point1[1])}}if(v!==v0){clean=0;if(v){listener.lineStart();point2=intersect(point1,point0);listener.point(point2[0],point2[1])}else{point2=intersect(point0,point1);listener.point(point2[0],point2[1]);listener.lineEnd()}point0=point2}else if(notHemisphere&&point0&&smallRadius^v){var t;if(!(c&c0)&&(t=intersect(point1,point0,true))){clean=0;if(smallRadius){listener.lineStart();listener.point(t[0][0],t[0][1]);listener.point(t[1][0],t[1][1]);listener.lineEnd()}else{listener.point(t[1][0],t[1][1]);listener.lineEnd();listener.lineStart();listener.point(t[0][0],t[0][1])}}}if(v&&(!point0||!d3_geo_sphericalEqual(point0,point1))){listener.point(point1[0],point1[1])}point0=point1,v0=v,c0=c},lineEnd:function(){if(v0)listener.lineEnd();point0=null},clean:function(){return clean|(v00&&v0)<<1}}}function intersect(a,b,two){var pa=d3_geo_cartesian(a),pb=d3_geo_cartesian(b);var n1=[1,0,0],n2=d3_geo_cartesianCross(pa,pb),n2n2=d3_geo_cartesianDot(n2,n2),n1n2=n2[0],determinant=n2n2-n1n2*n1n2;if(!determinant)return!two&&a;var c1=cr*n2n2/determinant,c2=-cr*n1n2/determinant,n1xn2=d3_geo_cartesianCross(n1,n2),A=d3_geo_cartesianScale(n1,c1),B=d3_geo_cartesianScale(n2,c2);d3_geo_cartesianAdd(A,B);var u=n1xn2,w=d3_geo_cartesianDot(A,u),uu=d3_geo_cartesianDot(u,u),t2=w*w-uu*(d3_geo_cartesianDot(A,A)-1);if(t2<0)return;var t=Math.sqrt(t2),q=d3_geo_cartesianScale(u,(-w-t)/uu);d3_geo_cartesianAdd(q,A);q=d3_geo_spherical(q);if(!two)return q;var λ0=a[0],λ1=b[0],φ0=a[1],φ1=b[1],z;if(λ1<λ0)z=λ0,λ0=λ1,λ1=z;var δλ=λ1-λ0,polar=abs(δλ-π)<ε,meridian=polar||δλ<ε;if(!polar&&φ1<φ0)z=φ0,φ0=φ1,φ1=z;if(meridian?polar?φ0+φ1>0^q[1]<(abs(q[0]-λ0)<ε?φ0:φ1):φ0<=q[1]&&q[1]<=φ1:δλ>π^(λ0<=q[0]&&q[0]<=λ1)){var q1=d3_geo_cartesianScale(u,(-w+t)/uu);d3_geo_cartesianAdd(q1,A);return[q,d3_geo_spherical(q1)]}}function code(λ,φ){var r=smallRadius?radius:π-radius,code=0;if(λ<-r)code|=1;else if(λ>r)code|=2;if(φ<-r)code|=4;else if(φ>r)code|=8;return code}}function d3_geom_clipLine(x0,y0,x1,y1){return function(line){var a=line.a,b=line.b,ax=a.x,ay=a.y,bx=b.x,by=b.y,t0=0,t1=1,dx=bx-ax,dy=by-ay,r;r=x0-ax;if(!dx&&r>0)return;r/=dx;if(dx<0){if(r<t0)return;if(r<t1)t1=r}else if(dx>0){if(r>t1)return;if(r>t0)t0=r}r=x1-ax;if(!dx&&r<0)return;r/=dx;if(dx<0){if(r>t1)return;if(r>t0)t0=r}else if(dx>0){if(r<t0)return;if(r<t1)t1=r}r=y0-ay;if(!dy&&r>0)return;r/=dy;if(dy<0){if(r<t0)return;if(r<t1)t1=r}else if(dy>0){if(r>t1)return;if(r>t0)t0=r}r=y1-ay;if(!dy&&r<0)return;r/=dy;if(dy<0){if(r>t1)return;if(r>t0)t0=r}else if(dy>0){if(r<t0)return;if(r<t1)t1=r}if(t0>0)line.a={x:ax+t0*dx,y:ay+t0*dy};if(t1<1)line.b={x:ax+t1*dx,y:ay+t1*dy};return line}}var d3_geo_clipExtentMAX=1e9;d3.geo.clipExtent=function(){var x0,y0,x1,y1,stream,clip,clipExtent={stream:function(output){if(stream)stream.valid=false;stream=clip(output);stream.valid=true;return stream},extent:function(_){if(!arguments.length)return[[x0,y0],[x1,y1]];clip=d3_geo_clipExtent(x0=+_[0][0],y0=+_[0][1],x1=+_[1][0],y1=+_[1][1]);if(stream)stream.valid=false,stream=null;return clipExtent}};return clipExtent.extent([[0,0],[960,500]])};function d3_geo_clipExtent(x0,y0,x1,y1){return function(listener){var listener_=listener,bufferListener=d3_geo_clipBufferListener(),clipLine=d3_geom_clipLine(x0,y0,x1,y1),segments,polygon,ring;var clip={point:point,lineStart:lineStart,lineEnd:lineEnd,polygonStart:function(){listener=bufferListener;segments=[];polygon=[];clean=true},polygonEnd:function(){listener=listener_;segments=d3.merge(segments);var clipStartInside=insidePolygon([x0,y1]),inside=clean&&clipStartInside,visible=segments.length;if(inside||visible){listener.polygonStart();if(inside){listener.lineStart();interpolate(null,null,1,listener);listener.lineEnd()}if(visible){d3_geo_clipPolygon(segments,compare,clipStartInside,interpolate,listener)}listener.polygonEnd()}segments=polygon=ring=null}};function insidePolygon(p){var wn=0,n=polygon.length,y=p[1];for(var i=0;i<n;++i){for(var j=1,v=polygon[i],m=v.length,a=v[0],b;j<m;++j){b=v[j];if(a[1]<=y){if(b[1]>y&&d3_cross2d(a,b,p)>0)++wn}else{if(b[1]<=y&&d3_cross2d(a,b,p)<0)--wn}a=b}}return wn!==0}function interpolate(from,to,direction,listener){var a=0,a1=0;if(from==null||(a=corner(from,direction))!==(a1=corner(to,direction))||comparePoints(from,to)<0^direction>0){do{listener.point(a===0||a===3?x0:x1,a>1?y1:y0)}while((a=(a+direction+4)%4)!==a1)}else{listener.point(to[0],to[1])}}function pointVisible(x,y){return x0<=x&&x<=x1&&y0<=y&&y<=y1}function point(x,y){if(pointVisible(x,y))listener.point(x,y)}var x__,y__,v__,x_,y_,v_,first,clean;function lineStart(){clip.point=linePoint;if(polygon)polygon.push(ring=[]);first=true;v_=false;x_=y_=NaN}function lineEnd(){if(segments){linePoint(x__,y__);if(v__&&v_)bufferListener.rejoin();segments.push(bufferListener.buffer())}clip.point=point;if(v_)listener.lineEnd()}function linePoint(x,y){x=Math.max(-d3_geo_clipExtentMAX,Math.min(d3_geo_clipExtentMAX,x));y=Math.max(-d3_geo_clipExtentMAX,Math.min(d3_geo_clipExtentMAX,y));var v=pointVisible(x,y);if(polygon)ring.push([x,y]);if(first){x__=x,y__=y,v__=v;first=false;if(v){listener.lineStart();listener.point(x,y)}}else{if(v&&v_)listener.point(x,y);else{var l={a:{x:x_,y:y_},b:{x:x,y:y}};if(clipLine(l)){if(!v_){listener.lineStart();listener.point(l.a.x,l.a.y)}listener.point(l.b.x,l.b.y);if(!v)listener.lineEnd();clean=false}else if(v){listener.lineStart();listener.point(x,y);clean=false}}}x_=x,y_=y,v_=v}return clip};function corner(p,direction){return abs(p[0]-x0)<ε?direction>0?0:3:abs(p[0]-x1)<ε?direction>0?2:1:abs(p[1]-y0)<ε?direction>0?1:0:direction>0?3:2}function compare(a,b){return comparePoints(a.x,b.x)}function comparePoints(a,b){var ca=corner(a,1),cb=corner(b,1);return ca!==cb?ca-cb:ca===0?b[1]-a[1]:ca===1?a[0]-b[0]:ca===2?a[1]-b[1]:b[0]-a[0]}}function d3_geo_compose(a,b){function compose(x,y){return x=a(x,y),b(x[0],x[1])}if(a.invert&&b.invert)compose.invert=function(x,y){return x=b.invert(x,y),x&&a.invert(x[0],x[1])};return compose}function d3_geo_conic(projectAt){var φ0=0,φ1=π/3,m=d3_geo_projectionMutator(projectAt),p=m(φ0,φ1);p.parallels=function(_){if(!arguments.length)return[φ0/π*180,φ1/π*180];return m(φ0=_[0]*π/180,φ1=_[1]*π/180)};return p}function d3_geo_conicEqualArea(φ0,φ1){var sinφ0=Math.sin(φ0),n=(sinφ0+Math.sin(φ1))/2,C=1+sinφ0*(2*n-sinφ0),ρ0=Math.sqrt(C)/n;function forward(λ,φ){var ρ=Math.sqrt(C-2*n*Math.sin(φ))/n;return[ρ*Math.sin(λ*=n),ρ0-ρ*Math.cos(λ)]}forward.invert=function(x,y){var ρ0_y=ρ0-y;return[Math.atan2(x,ρ0_y)/n,d3_asin((C-(x*x+ρ0_y*ρ0_y)*n*n)/(2*n))]};return forward}(d3.geo.conicEqualArea=function(){return d3_geo_conic(d3_geo_conicEqualArea)}).raw=d3_geo_conicEqualArea;d3.geo.albers=function(){return d3.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};d3.geo.albersUsa=function(){var lower48=d3.geo.albers();var alaska=d3.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]);var hawaii=d3.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]);var point,pointStream={point:function(x,y){point=[x,y]}},lower48Point,alaskaPoint,hawaiiPoint;function albersUsa(coordinates){var x=coordinates[0],y=coordinates[1];point=null;(lower48Point(x,y),point)||(alaskaPoint(x,y),point)||hawaiiPoint(x,y);return point}albersUsa.invert=function(coordinates){var k=lower48.scale(),t=lower48.translate(),x=(coordinates[0]-t[0])/k,y=(coordinates[1]-t[1])/k;return(y>=.12&&y<.234&&x>=-.425&&x<-.214?alaska:y>=.166&&y<.234&&x>=-.214&&x<-.115?hawaii:lower48).invert(coordinates)};albersUsa.stream=function(stream){var lower48Stream=lower48.stream(stream),alaskaStream=alaska.stream(stream),hawaiiStream=hawaii.stream(stream);return{point:function(x,y){lower48Stream.point(x,y);alaskaStream.point(x,y);hawaiiStream.point(x,y)},sphere:function(){lower48Stream.sphere();alaskaStream.sphere();hawaiiStream.sphere()},lineStart:function(){lower48Stream.lineStart();alaskaStream.lineStart();hawaiiStream.lineStart()},lineEnd:function(){lower48Stream.lineEnd();alaskaStream.lineEnd();hawaiiStream.lineEnd()},polygonStart:function(){lower48Stream.polygonStart();
  alaskaStream.polygonStart();hawaiiStream.polygonStart()},polygonEnd:function(){lower48Stream.polygonEnd();alaskaStream.polygonEnd();hawaiiStream.polygonEnd()}}};albersUsa.precision=function(_){if(!arguments.length)return lower48.precision();lower48.precision(_);alaska.precision(_);hawaii.precision(_);return albersUsa};albersUsa.scale=function(_){if(!arguments.length)return lower48.scale();lower48.scale(_);alaska.scale(_*.35);hawaii.scale(_);return albersUsa.translate(lower48.translate())};albersUsa.translate=function(_){if(!arguments.length)return lower48.translate();var k=lower48.scale(),x=+_[0],y=+_[1];lower48Point=lower48.translate(_).clipExtent([[x-.455*k,y-.238*k],[x+.455*k,y+.238*k]]).stream(pointStream).point;alaskaPoint=alaska.translate([x-.307*k,y+.201*k]).clipExtent([[x-.425*k+ε,y+.12*k+ε],[x-.214*k-ε,y+.234*k-ε]]).stream(pointStream).point;hawaiiPoint=hawaii.translate([x-.205*k,y+.212*k]).clipExtent([[x-.214*k+ε,y+.166*k+ε],[x-.115*k-ε,y+.234*k-ε]]).stream(pointStream).point;return albersUsa};return albersUsa.scale(1070)};var d3_geo_pathAreaSum,d3_geo_pathAreaPolygon,d3_geo_pathArea={point:d3_noop,lineStart:d3_noop,lineEnd:d3_noop,polygonStart:function(){d3_geo_pathAreaPolygon=0;d3_geo_pathArea.lineStart=d3_geo_pathAreaRingStart},polygonEnd:function(){d3_geo_pathArea.lineStart=d3_geo_pathArea.lineEnd=d3_geo_pathArea.point=d3_noop;d3_geo_pathAreaSum+=abs(d3_geo_pathAreaPolygon/2)}};function d3_geo_pathAreaRingStart(){var x00,y00,x0,y0;d3_geo_pathArea.point=function(x,y){d3_geo_pathArea.point=nextPoint;x00=x0=x,y00=y0=y};function nextPoint(x,y){d3_geo_pathAreaPolygon+=y0*x-x0*y;x0=x,y0=y}d3_geo_pathArea.lineEnd=function(){nextPoint(x00,y00)}}var d3_geo_pathBoundsX0,d3_geo_pathBoundsY0,d3_geo_pathBoundsX1,d3_geo_pathBoundsY1;var d3_geo_pathBounds={point:d3_geo_pathBoundsPoint,lineStart:d3_noop,lineEnd:d3_noop,polygonStart:d3_noop,polygonEnd:d3_noop};function d3_geo_pathBoundsPoint(x,y){if(x<d3_geo_pathBoundsX0)d3_geo_pathBoundsX0=x;if(x>d3_geo_pathBoundsX1)d3_geo_pathBoundsX1=x;if(y<d3_geo_pathBoundsY0)d3_geo_pathBoundsY0=y;if(y>d3_geo_pathBoundsY1)d3_geo_pathBoundsY1=y}function d3_geo_pathBuffer(){var pointCircle=d3_geo_pathBufferCircle(4.5),buffer=[];var stream={point:point,lineStart:function(){stream.point=pointLineStart},lineEnd:lineEnd,polygonStart:function(){stream.lineEnd=lineEndPolygon},polygonEnd:function(){stream.lineEnd=lineEnd;stream.point=point},pointRadius:function(_){pointCircle=d3_geo_pathBufferCircle(_);return stream},result:function(){if(buffer.length){var result=buffer.join("");buffer=[];return result}}};function point(x,y){buffer.push("M",x,",",y,pointCircle)}function pointLineStart(x,y){buffer.push("M",x,",",y);stream.point=pointLine}function pointLine(x,y){buffer.push("L",x,",",y)}function lineEnd(){stream.point=point}function lineEndPolygon(){buffer.push("Z")}return stream}function d3_geo_pathBufferCircle(radius){return"m0,"+radius+"a"+radius+","+radius+" 0 1,1 0,"+-2*radius+"a"+radius+","+radius+" 0 1,1 0,"+2*radius+"z"}var d3_geo_pathCentroid={point:d3_geo_pathCentroidPoint,lineStart:d3_geo_pathCentroidLineStart,lineEnd:d3_geo_pathCentroidLineEnd,polygonStart:function(){d3_geo_pathCentroid.lineStart=d3_geo_pathCentroidRingStart},polygonEnd:function(){d3_geo_pathCentroid.point=d3_geo_pathCentroidPoint;d3_geo_pathCentroid.lineStart=d3_geo_pathCentroidLineStart;d3_geo_pathCentroid.lineEnd=d3_geo_pathCentroidLineEnd}};function d3_geo_pathCentroidPoint(x,y){d3_geo_centroidX0+=x;d3_geo_centroidY0+=y;++d3_geo_centroidZ0}function d3_geo_pathCentroidLineStart(){var x0,y0;d3_geo_pathCentroid.point=function(x,y){d3_geo_pathCentroid.point=nextPoint;d3_geo_pathCentroidPoint(x0=x,y0=y)};function nextPoint(x,y){var dx=x-x0,dy=y-y0,z=Math.sqrt(dx*dx+dy*dy);d3_geo_centroidX1+=z*(x0+x)/2;d3_geo_centroidY1+=z*(y0+y)/2;d3_geo_centroidZ1+=z;d3_geo_pathCentroidPoint(x0=x,y0=y)}}function d3_geo_pathCentroidLineEnd(){d3_geo_pathCentroid.point=d3_geo_pathCentroidPoint}function d3_geo_pathCentroidRingStart(){var x00,y00,x0,y0;d3_geo_pathCentroid.point=function(x,y){d3_geo_pathCentroid.point=nextPoint;d3_geo_pathCentroidPoint(x00=x0=x,y00=y0=y)};function nextPoint(x,y){var dx=x-x0,dy=y-y0,z=Math.sqrt(dx*dx+dy*dy);d3_geo_centroidX1+=z*(x0+x)/2;d3_geo_centroidY1+=z*(y0+y)/2;d3_geo_centroidZ1+=z;z=y0*x-x0*y;d3_geo_centroidX2+=z*(x0+x);d3_geo_centroidY2+=z*(y0+y);d3_geo_centroidZ2+=z*3;d3_geo_pathCentroidPoint(x0=x,y0=y)}d3_geo_pathCentroid.lineEnd=function(){nextPoint(x00,y00)}}function d3_geo_pathContext(context){var pointRadius=4.5;var stream={point:point,lineStart:function(){stream.point=pointLineStart},lineEnd:lineEnd,polygonStart:function(){stream.lineEnd=lineEndPolygon},polygonEnd:function(){stream.lineEnd=lineEnd;stream.point=point},pointRadius:function(_){pointRadius=_;return stream},result:d3_noop};function point(x,y){context.moveTo(x,y);context.arc(x,y,pointRadius,0,τ)}function pointLineStart(x,y){context.moveTo(x,y);stream.point=pointLine}function pointLine(x,y){context.lineTo(x,y)}function lineEnd(){stream.point=point}function lineEndPolygon(){context.closePath()}return stream}function d3_geo_resample(project){var δ2=.5,cosMinDistance=Math.cos(30*d3_radians),maxDepth=16;function resample(stream){return(maxDepth?resampleRecursive:resampleNone)(stream)}function resampleNone(stream){return d3_geo_transformPoint(stream,function(x,y){x=project(x,y);stream.point(x[0],x[1])})}function resampleRecursive(stream){var λ00,φ00,x00,y00,a00,b00,c00,λ0,x0,y0,a0,b0,c0;var resample={point:point,lineStart:lineStart,lineEnd:lineEnd,polygonStart:function(){stream.polygonStart();resample.lineStart=ringStart},polygonEnd:function(){stream.polygonEnd();resample.lineStart=lineStart}};function point(x,y){x=project(x,y);stream.point(x[0],x[1])}function lineStart(){x0=NaN;resample.point=linePoint;stream.lineStart()}function linePoint(λ,φ){var c=d3_geo_cartesian([λ,φ]),p=project(λ,φ);resampleLineTo(x0,y0,λ0,a0,b0,c0,x0=p[0],y0=p[1],λ0=λ,a0=c[0],b0=c[1],c0=c[2],maxDepth,stream);stream.point(x0,y0)}function lineEnd(){resample.point=point;stream.lineEnd()}function ringStart(){lineStart();resample.point=ringPoint;resample.lineEnd=ringEnd}function ringPoint(λ,φ){linePoint(λ00=λ,φ00=φ),x00=x0,y00=y0,a00=a0,b00=b0,c00=c0;resample.point=linePoint}function ringEnd(){resampleLineTo(x0,y0,λ0,a0,b0,c0,x00,y00,λ00,a00,b00,c00,maxDepth,stream);resample.lineEnd=lineEnd;lineEnd()}return resample}function resampleLineTo(x0,y0,λ0,a0,b0,c0,x1,y1,λ1,a1,b1,c1,depth,stream){var dx=x1-x0,dy=y1-y0,d2=dx*dx+dy*dy;if(d2>4*δ2&&depth--){var a=a0+a1,b=b0+b1,c=c0+c1,m=Math.sqrt(a*a+b*b+c*c),φ2=Math.asin(c/=m),λ2=abs(abs(c)-1)<ε||abs(λ0-λ1)<ε?(λ0+λ1)/2:Math.atan2(b,a),p=project(λ2,φ2),x2=p[0],y2=p[1],dx2=x2-x0,dy2=y2-y0,dz=dy*dx2-dx*dy2;if(dz*dz/d2>δ2||abs((dx*dx2+dy*dy2)/d2-.5)>.3||a0*a1+b0*b1+c0*c1<cosMinDistance){resampleLineTo(x0,y0,λ0,a0,b0,c0,x2,y2,λ2,a/=m,b/=m,c,depth,stream);stream.point(x2,y2);resampleLineTo(x2,y2,λ2,a,b,c,x1,y1,λ1,a1,b1,c1,depth,stream)}}}resample.precision=function(_){if(!arguments.length)return Math.sqrt(δ2);maxDepth=(δ2=_*_)>0&&16;return resample};return resample}d3.geo.path=function(){var pointRadius=4.5,projection,context,projectStream,contextStream,cacheStream;function path(object){if(object){if(typeof pointRadius==="function")contextStream.pointRadius(+pointRadius.apply(this,arguments));if(!cacheStream||!cacheStream.valid)cacheStream=projectStream(contextStream);d3.geo.stream(object,cacheStream)}return contextStream.result()}path.area=function(object){d3_geo_pathAreaSum=0;d3.geo.stream(object,projectStream(d3_geo_pathArea));return d3_geo_pathAreaSum};path.centroid=function(object){d3_geo_centroidX0=d3_geo_centroidY0=d3_geo_centroidZ0=d3_geo_centroidX1=d3_geo_centroidY1=d3_geo_centroidZ1=d3_geo_centroidX2=d3_geo_centroidY2=d3_geo_centroidZ2=0;d3.geo.stream(object,projectStream(d3_geo_pathCentroid));return d3_geo_centroidZ2?[d3_geo_centroidX2/d3_geo_centroidZ2,d3_geo_centroidY2/d3_geo_centroidZ2]:d3_geo_centroidZ1?[d3_geo_centroidX1/d3_geo_centroidZ1,d3_geo_centroidY1/d3_geo_centroidZ1]:d3_geo_centroidZ0?[d3_geo_centroidX0/d3_geo_centroidZ0,d3_geo_centroidY0/d3_geo_centroidZ0]:[NaN,NaN]};path.bounds=function(object){d3_geo_pathBoundsX1=d3_geo_pathBoundsY1=-(d3_geo_pathBoundsX0=d3_geo_pathBoundsY0=Infinity);d3.geo.stream(object,projectStream(d3_geo_pathBounds));return[[d3_geo_pathBoundsX0,d3_geo_pathBoundsY0],[d3_geo_pathBoundsX1,d3_geo_pathBoundsY1]]};path.projection=function(_){if(!arguments.length)return projection;projectStream=(projection=_)?_.stream||d3_geo_pathProjectStream(_):d3_identity;return reset()};path.context=function(_){if(!arguments.length)return context;contextStream=(context=_)==null?new d3_geo_pathBuffer:new d3_geo_pathContext(_);if(typeof pointRadius!=="function")contextStream.pointRadius(pointRadius);return reset()};path.pointRadius=function(_){if(!arguments.length)return pointRadius;pointRadius=typeof _==="function"?_:(contextStream.pointRadius(+_),+_);return path};function reset(){cacheStream=null;return path}return path.projection(d3.geo.albersUsa()).context(null)};function d3_geo_pathProjectStream(project){var resample=d3_geo_resample(function(x,y){return project([x*d3_degrees,y*d3_degrees])});return function(stream){return d3_geo_projectionRadians(resample(stream))}}d3.geo.transform=function(methods){return{stream:function(stream){var transform=new d3_geo_transform(stream);for(var k in methods)transform[k]=methods[k];return transform}}};function d3_geo_transform(stream){this.stream=stream}d3_geo_transform.prototype={point:function(x,y){this.stream.point(x,y)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function d3_geo_transformPoint(stream,point){return{point:point,sphere:function(){stream.sphere()},lineStart:function(){stream.lineStart()},lineEnd:function(){stream.lineEnd()},polygonStart:function(){stream.polygonStart()},polygonEnd:function(){stream.polygonEnd()}}}d3.geo.projection=d3_geo_projection;d3.geo.projectionMutator=d3_geo_projectionMutator;function d3_geo_projection(project){return d3_geo_projectionMutator(function(){return project})()}function d3_geo_projectionMutator(projectAt){var project,rotate,projectRotate,projectResample=d3_geo_resample(function(x,y){x=project(x,y);return[x[0]*k+δx,δy-x[1]*k]}),k=150,x=480,y=250,λ=0,φ=0,δλ=0,δφ=0,δγ=0,δx,δy,preclip=d3_geo_clipAntimeridian,postclip=d3_identity,clipAngle=null,clipExtent=null,stream;function projection(point){point=projectRotate(point[0]*d3_radians,point[1]*d3_radians);return[point[0]*k+δx,δy-point[1]*k]}function invert(point){point=projectRotate.invert((point[0]-δx)/k,(δy-point[1])/k);return point&&[point[0]*d3_degrees,point[1]*d3_degrees]}projection.stream=function(output){if(stream)stream.valid=false;stream=d3_geo_projectionRadians(preclip(rotate,projectResample(postclip(output))));stream.valid=true;return stream};projection.clipAngle=function(_){if(!arguments.length)return clipAngle;preclip=_==null?(clipAngle=_,d3_geo_clipAntimeridian):d3_geo_clipCircle((clipAngle=+_)*d3_radians);return invalidate()};projection.clipExtent=function(_){if(!arguments.length)return clipExtent;clipExtent=_;postclip=_?d3_geo_clipExtent(_[0][0],_[0][1],_[1][0],_[1][1]):d3_identity;return invalidate()};projection.scale=function(_){if(!arguments.length)return k;k=+_;return reset()};projection.translate=function(_){if(!arguments.length)return[x,y];x=+_[0];y=+_[1];return reset()};projection.center=function(_){if(!arguments.length)return[λ*d3_degrees,φ*d3_degrees];λ=_[0]%360*d3_radians;φ=_[1]%360*d3_radians;return reset()};projection.rotate=function(_){if(!arguments.length)return[δλ*d3_degrees,δφ*d3_degrees,δγ*d3_degrees];δλ=_[0]%360*d3_radians;δφ=_[1]%360*d3_radians;δγ=_.length>2?_[2]%360*d3_radians:0;return reset()};d3.rebind(projection,projectResample,"precision");function reset(){projectRotate=d3_geo_compose(rotate=d3_geo_rotation(δλ,δφ,δγ),project);var center=project(λ,φ);δx=x-center[0]*k;δy=y+center[1]*k;return invalidate()}function invalidate(){if(stream)stream.valid=false,stream=null;return projection}return function(){project=projectAt.apply(this,arguments);projection.invert=project.invert&&invert;return reset()}}function d3_geo_projectionRadians(stream){return d3_geo_transformPoint(stream,function(x,y){stream.point(x*d3_radians,y*d3_radians)})}function d3_geo_equirectangular(λ,φ){return[λ,φ]}(d3.geo.equirectangular=function(){return d3_geo_projection(d3_geo_equirectangular)}).raw=d3_geo_equirectangular.invert=d3_geo_equirectangular;d3.geo.rotation=function(rotate){rotate=d3_geo_rotation(rotate[0]%360*d3_radians,rotate[1]*d3_radians,rotate.length>2?rotate[2]*d3_radians:0);function forward(coordinates){coordinates=rotate(coordinates[0]*d3_radians,coordinates[1]*d3_radians);return coordinates[0]*=d3_degrees,coordinates[1]*=d3_degrees,coordinates}forward.invert=function(coordinates){coordinates=rotate.invert(coordinates[0]*d3_radians,coordinates[1]*d3_radians);return coordinates[0]*=d3_degrees,coordinates[1]*=d3_degrees,coordinates};return forward};function d3_geo_identityRotation(λ,φ){return[λ>π?λ-τ:λ<-π?λ+τ:λ,φ]}d3_geo_identityRotation.invert=d3_geo_equirectangular;function d3_geo_rotation(δλ,δφ,δγ){return δλ?δφ||δγ?d3_geo_compose(d3_geo_rotationλ(δλ),d3_geo_rotationφγ(δφ,δγ)):d3_geo_rotationλ(δλ):δφ||δγ?d3_geo_rotationφγ(δφ,δγ):d3_geo_identityRotation}function d3_geo_forwardRotationλ(δλ){return function(λ,φ){return λ+=δλ,[λ>π?λ-τ:λ<-π?λ+τ:λ,φ]}}function d3_geo_rotationλ(δλ){var rotation=d3_geo_forwardRotationλ(δλ);rotation.invert=d3_geo_forwardRotationλ(-δλ);return rotation}function d3_geo_rotationφγ(δφ,δγ){var cosδφ=Math.cos(δφ),sinδφ=Math.sin(δφ),cosδγ=Math.cos(δγ),sinδγ=Math.sin(δγ);function rotation(λ,φ){var cosφ=Math.cos(φ),x=Math.cos(λ)*cosφ,y=Math.sin(λ)*cosφ,z=Math.sin(φ),k=z*cosδφ+x*sinδφ;return[Math.atan2(y*cosδγ-k*sinδγ,x*cosδφ-z*sinδφ),d3_asin(k*cosδγ+y*sinδγ)]}rotation.invert=function(λ,φ){var cosφ=Math.cos(φ),x=Math.cos(λ)*cosφ,y=Math.sin(λ)*cosφ,z=Math.sin(φ),k=z*cosδγ-y*sinδγ;return[Math.atan2(y*cosδγ+z*sinδγ,x*cosδφ+k*sinδφ),d3_asin(k*cosδφ-x*sinδφ)]};return rotation}d3.geo.circle=function(){var origin=[0,0],angle,precision=6,interpolate;function circle(){var center=typeof origin==="function"?origin.apply(this,arguments):origin,rotate=d3_geo_rotation(-center[0]*d3_radians,-center[1]*d3_radians,0).invert,ring=[];interpolate(null,null,1,{point:function(x,y){ring.push(x=rotate(x,y));x[0]*=d3_degrees,x[1]*=d3_degrees}});return{type:"Polygon",coordinates:[ring]}}circle.origin=function(x){if(!arguments.length)return origin;origin=x;return circle};circle.angle=function(x){if(!arguments.length)return angle;interpolate=d3_geo_circleInterpolate((angle=+x)*d3_radians,precision*d3_radians);return circle};circle.precision=function(_){if(!arguments.length)return precision;interpolate=d3_geo_circleInterpolate(angle*d3_radians,(precision=+_)*d3_radians);return circle};return circle.angle(90)};function d3_geo_circleInterpolate(radius,precision){var cr=Math.cos(radius),sr=Math.sin(radius);return function(from,to,direction,listener){var step=direction*precision;if(from!=null){from=d3_geo_circleAngle(cr,from);to=d3_geo_circleAngle(cr,to);if(direction>0?from<to:from>to)from+=direction*τ}else{from=radius+direction*τ;to=radius-.5*step}for(var point,t=from;direction>0?t>to:t<to;t-=step){listener.point((point=d3_geo_spherical([cr,-sr*Math.cos(t),-sr*Math.sin(t)]))[0],point[1])}}}function d3_geo_circleAngle(cr,point){var a=d3_geo_cartesian(point);a[0]-=cr;d3_geo_cartesianNormalize(a);var angle=d3_acos(-a[1]);return((-a[2]<0?-angle:angle)+2*Math.PI-ε)%(2*Math.PI)}d3.geo.distance=function(a,b){var Δλ=(b[0]-a[0])*d3_radians,φ0=a[1]*d3_radians,φ1=b[1]*d3_radians,sinΔλ=Math.sin(Δλ),cosΔλ=Math.cos(Δλ),sinφ0=Math.sin(φ0),cosφ0=Math.cos(φ0),sinφ1=Math.sin(φ1),cosφ1=Math.cos(φ1),t;return Math.atan2(Math.sqrt((t=cosφ1*sinΔλ)*t+(t=cosφ0*sinφ1-sinφ0*cosφ1*cosΔλ)*t),sinφ0*sinφ1+cosφ0*cosφ1*cosΔλ)};d3.geo.graticule=function(){var x1,x0,X1,X0,y1,y0,Y1,Y0,dx=10,dy=dx,DX=90,DY=360,x,y,X,Y,precision=2.5;function graticule(){return{type:"MultiLineString",coordinates:lines()}}function lines(){return d3.range(Math.ceil(X0/DX)*DX,X1,DX).map(X).concat(d3.range(Math.ceil(Y0/DY)*DY,Y1,DY).map(Y)).concat(d3.range(Math.ceil(x0/dx)*dx,x1,dx).filter(function(x){return abs(x%DX)>ε}).map(x)).concat(d3.range(Math.ceil(y0/dy)*dy,y1,dy).filter(function(y){return abs(y%DY)>ε}).map(y))}graticule.lines=function(){return lines().map(function(coordinates){return{type:"LineString",coordinates:coordinates}})};graticule.outline=function(){return{type:"Polygon",coordinates:[X(X0).concat(Y(Y1).slice(1),X(X1).reverse().slice(1),Y(Y0).reverse().slice(1))]}};graticule.extent=function(_){if(!arguments.length)return graticule.minorExtent();return graticule.majorExtent(_).minorExtent(_)};graticule.majorExtent=function(_){if(!arguments.length)return[[X0,Y0],[X1,Y1]];X0=+_[0][0],X1=+_[1][0];Y0=+_[0][1],Y1=+_[1][1];if(X0>X1)_=X0,X0=X1,X1=_;if(Y0>Y1)_=Y0,Y0=Y1,Y1=_;return graticule.precision(precision)};graticule.minorExtent=function(_){if(!arguments.length)return[[x0,y0],[x1,y1]];x0=+_[0][0],x1=+_[1][0];y0=+_[0][1],y1=+_[1][1];if(x0>x1)_=x0,x0=x1,x1=_;if(y0>y1)_=y0,y0=y1,y1=_;return graticule.precision(precision)};graticule.step=function(_){if(!arguments.length)return graticule.minorStep();return graticule.majorStep(_).minorStep(_)};graticule.majorStep=function(_){if(!arguments.length)return[DX,DY];DX=+_[0],DY=+_[1];return graticule};graticule.minorStep=function(_){if(!arguments.length)return[dx,dy];dx=+_[0],dy=+_[1];return graticule};graticule.precision=function(_){if(!arguments.length)return precision;precision=+_;x=d3_geo_graticuleX(y0,y1,90);y=d3_geo_graticuleY(x0,x1,precision);X=d3_geo_graticuleX(Y0,Y1,90);Y=d3_geo_graticuleY(X0,X1,precision);return graticule};return graticule.majorExtent([[-180,-90+ε],[180,90-ε]]).minorExtent([[-180,-80-ε],[180,80+ε]])};function d3_geo_graticuleX(y0,y1,dy){var y=d3.range(y0,y1-ε,dy).concat(y1);return function(x){return y.map(function(y){return[x,y]})}}function d3_geo_graticuleY(x0,x1,dx){var x=d3.range(x0,x1-ε,dx).concat(x1);return function(y){return x.map(function(x){return[x,y]})}}function d3_source(d){return d.source}function d3_target(d){return d.target}d3.geo.greatArc=function(){var source=d3_source,source_,target=d3_target,target_;function greatArc(){return{type:"LineString",coordinates:[source_||source.apply(this,arguments),target_||target.apply(this,arguments)]}}greatArc.distance=function(){return d3.geo.distance(source_||source.apply(this,arguments),target_||target.apply(this,arguments))};greatArc.source=function(_){if(!arguments.length)return source;source=_,source_=typeof _==="function"?null:_;return greatArc};greatArc.target=function(_){if(!arguments.length)return target;target=_,target_=typeof _==="function"?null:_;return greatArc};greatArc.precision=function(){return arguments.length?greatArc:0};return greatArc};d3.geo.interpolate=function(source,target){return d3_geo_interpolate(source[0]*d3_radians,source[1]*d3_radians,target[0]*d3_radians,target[1]*d3_radians)};function d3_geo_interpolate(x0,y0,x1,y1){var cy0=Math.cos(y0),sy0=Math.sin(y0),cy1=Math.cos(y1),sy1=Math.sin(y1),kx0=cy0*Math.cos(x0),ky0=cy0*Math.sin(x0),kx1=cy1*Math.cos(x1),ky1=cy1*Math.sin(x1),d=2*Math.asin(Math.sqrt(d3_haversin(y1-y0)+cy0*cy1*d3_haversin(x1-x0))),k=1/Math.sin(d);var interpolate=d?function(t){var B=Math.sin(t*=d)*k,A=Math.sin(d-t)*k,x=A*kx0+B*kx1,y=A*ky0+B*ky1,z=A*sy0+B*sy1;return[Math.atan2(y,x)*d3_degrees,Math.atan2(z,Math.sqrt(x*x+y*y))*d3_degrees]}:function(){return[x0*d3_degrees,y0*d3_degrees]};interpolate.distance=d;return interpolate}d3.geo.length=function(object){d3_geo_lengthSum=0;d3.geo.stream(object,d3_geo_length);return d3_geo_lengthSum};var d3_geo_lengthSum;var d3_geo_length={sphere:d3_noop,point:d3_noop,lineStart:d3_geo_lengthLineStart,lineEnd:d3_noop,polygonStart:d3_noop,polygonEnd:d3_noop};function d3_geo_lengthLineStart(){var λ0,sinφ0,cosφ0;d3_geo_length.point=function(λ,φ){λ0=λ*d3_radians,sinφ0=Math.sin(φ*=d3_radians),cosφ0=Math.cos(φ);d3_geo_length.point=nextPoint};d3_geo_length.lineEnd=function(){d3_geo_length.point=d3_geo_length.lineEnd=d3_noop};function nextPoint(λ,φ){var sinφ=Math.sin(φ*=d3_radians),cosφ=Math.cos(φ),t=abs((λ*=d3_radians)-λ0),cosΔλ=Math.cos(t);d3_geo_lengthSum+=Math.atan2(Math.sqrt((t=cosφ*Math.sin(t))*t+(t=cosφ0*sinφ-sinφ0*cosφ*cosΔλ)*t),sinφ0*sinφ+cosφ0*cosφ*cosΔλ);λ0=λ,sinφ0=sinφ,cosφ0=cosφ}}function d3_geo_azimuthal(scale,angle){function azimuthal(λ,φ){var cosλ=Math.cos(λ),cosφ=Math.cos(φ),k=scale(cosλ*cosφ);return[k*cosφ*Math.sin(λ),k*Math.sin(φ)]}azimuthal.invert=function(x,y){var ρ=Math.sqrt(x*x+y*y),c=angle(ρ),sinc=Math.sin(c),cosc=Math.cos(c);return[Math.atan2(x*sinc,ρ*cosc),Math.asin(ρ&&y*sinc/ρ)]};return azimuthal}var d3_geo_azimuthalEqualArea=d3_geo_azimuthal(function(cosλcosφ){return Math.sqrt(2/(1+cosλcosφ))},function(ρ){return 2*Math.asin(ρ/2)});(d3.geo.azimuthalEqualArea=function(){return d3_geo_projection(d3_geo_azimuthalEqualArea)}).raw=d3_geo_azimuthalEqualArea;var d3_geo_azimuthalEquidistant=d3_geo_azimuthal(function(cosλcosφ){var c=Math.acos(cosλcosφ);return c&&c/Math.sin(c)},d3_identity);(d3.geo.azimuthalEquidistant=function(){return d3_geo_projection(d3_geo_azimuthalEquidistant)}).raw=d3_geo_azimuthalEquidistant;function d3_geo_conicConformal(φ0,φ1){var cosφ0=Math.cos(φ0),t=function(φ){return Math.tan(π/4+φ/2)},n=φ0===φ1?Math.sin(φ0):Math.log(cosφ0/Math.cos(φ1))/Math.log(t(φ1)/t(φ0)),F=cosφ0*Math.pow(t(φ0),n)/n;if(!n)return d3_geo_mercator;function forward(λ,φ){if(F>0){if(φ<-halfπ+ε)φ=-halfπ+ε}else{if(φ>halfπ-ε)φ=halfπ-ε}var ρ=F/Math.pow(t(φ),n);return[ρ*Math.sin(n*λ),F-ρ*Math.cos(n*λ)]}forward.invert=function(x,y){var ρ0_y=F-y,ρ=d3_sgn(n)*Math.sqrt(x*x+ρ0_y*ρ0_y);return[Math.atan2(x,ρ0_y)/n,2*Math.atan(Math.pow(F/ρ,1/n))-halfπ]};return forward}(d3.geo.conicConformal=function(){return d3_geo_conic(d3_geo_conicConformal)}).raw=d3_geo_conicConformal;function d3_geo_conicEquidistant(φ0,φ1){var cosφ0=Math.cos(φ0),n=φ0===φ1?Math.sin(φ0):(cosφ0-Math.cos(φ1))/(φ1-φ0),G=cosφ0/n+φ0;if(abs(n)<ε)return d3_geo_equirectangular;function forward(λ,φ){var ρ=G-φ;return[ρ*Math.sin(n*λ),G-ρ*Math.cos(n*λ)]}forward.invert=function(x,y){var ρ0_y=G-y;return[Math.atan2(x,ρ0_y)/n,G-d3_sgn(n)*Math.sqrt(x*x+ρ0_y*ρ0_y)]};return forward}(d3.geo.conicEquidistant=function(){return d3_geo_conic(d3_geo_conicEquidistant)}).raw=d3_geo_conicEquidistant;var d3_geo_gnomonic=d3_geo_azimuthal(function(cosλcosφ){return 1/cosλcosφ},Math.atan);(d3.geo.gnomonic=function(){return d3_geo_projection(d3_geo_gnomonic)}).raw=d3_geo_gnomonic;function d3_geo_mercator(λ,φ){return[λ,Math.log(Math.tan(π/4+φ/2))]}d3_geo_mercator.invert=function(x,y){return[x,2*Math.atan(Math.exp(y))-halfπ]};function d3_geo_mercatorProjection(project){var m=d3_geo_projection(project),scale=m.scale,translate=m.translate,clipExtent=m.clipExtent,clipAuto;m.scale=function(){var v=scale.apply(m,arguments);return v===m?clipAuto?m.clipExtent(null):m:v};m.translate=function(){var v=translate.apply(m,arguments);return v===m?clipAuto?m.clipExtent(null):m:v};m.clipExtent=function(_){var v=clipExtent.apply(m,arguments);if(v===m){if(clipAuto=_==null){var k=π*scale(),t=translate();clipExtent([[t[0]-k,t[1]-k],[t[0]+k,t[1]+k]])}}else if(clipAuto){v=null}return v};return m.clipExtent(null)}(d3.geo.mercator=function(){return d3_geo_mercatorProjection(d3_geo_mercator)}).raw=d3_geo_mercator;var d3_geo_orthographic=d3_geo_azimuthal(function(){return 1},Math.asin);(d3.geo.orthographic=function(){return d3_geo_projection(d3_geo_orthographic)}).raw=d3_geo_orthographic;var d3_geo_stereographic=d3_geo_azimuthal(function(cosλcosφ){return 1/(1+cosλcosφ)},function(ρ){return 2*Math.atan(ρ)});(d3.geo.stereographic=function(){return d3_geo_projection(d3_geo_stereographic)}).raw=d3_geo_stereographic;function d3_geo_transverseMercator(λ,φ){return[Math.log(Math.tan(π/4+φ/2)),-λ]}d3_geo_transverseMercator.invert=function(x,y){return[-y,2*Math.atan(Math.exp(x))-halfπ]};(d3.geo.transverseMercator=function(){var projection=d3_geo_mercatorProjection(d3_geo_transverseMercator),center=projection.center,rotate=projection.rotate;projection.center=function(_){return _?center([-_[1],_[0]]):(_=center(),[-_[1],_[0]])};projection.rotate=function(_){return _?rotate([_[0],_[1],_.length>2?_[2]+90:90]):(_=rotate(),[_[0],_[1],_[2]-90])};return projection.rotate([0,0])}).raw=d3_geo_transverseMercator;d3.geom={};function d3_geom_pointX(d){return d[0]}function d3_geom_pointY(d){return d[1]}d3.geom.hull=function(vertices){var x=d3_geom_pointX,y=d3_geom_pointY;if(arguments.length)return hull(vertices);function hull(data){if(data.length<3)return[];var fx=d3_functor(x),fy=d3_functor(y),i,n=data.length,points=[],flippedPoints=[];for(i=0;i<n;i++){points.push([+fx.call(this,data[i],i),+fy.call(this,data[i],i),i])}points.sort(d3_geom_hullOrder);for(i=0;i<n;i++)flippedPoints.push([points[i][0],-points[i][1]]);var upper=d3_geom_hullUpper(points),lower=d3_geom_hullUpper(flippedPoints);var skipLeft=lower[0]===upper[0],skipRight=lower[lower.length-1]===upper[upper.length-1],polygon=[];for(i=upper.length-1;i>=0;--i)polygon.push(data[points[upper[i]][2]]);for(i=+skipLeft;i<lower.length-skipRight;++i)polygon.push(data[points[lower[i]][2]]);return polygon}hull.x=function(_){return arguments.length?(x=_,hull):x};hull.y=function(_){return arguments.length?(y=_,hull):y};return hull};function d3_geom_hullUpper(points){var n=points.length,hull=[0,1],hs=2;for(var i=2;i<n;i++){while(hs>1&&d3_cross2d(points[hull[hs-2]],points[hull[hs-1]],points[i])<=0)--hs;hull[hs++]=i}return hull.slice(0,hs)}function d3_geom_hullOrder(a,b){return a[0]-b[0]||a[1]-b[1]}d3.geom.polygon=function(coordinates){d3_subclass(coordinates,d3_geom_polygonPrototype);return coordinates};var d3_geom_polygonPrototype=d3.geom.polygon.prototype=[];d3_geom_polygonPrototype.area=function(){var i=-1,n=this.length,a,b=this[n-1],area=0;while(++i<n){a=b;b=this[i];area+=a[1]*b[0]-a[0]*b[1]}return area*.5};d3_geom_polygonPrototype.centroid=function(k){var i=-1,n=this.length,x=0,y=0,a,b=this[n-1],c;if(!arguments.length)k=-1/(6*this.area());while(++i<n){a=b;b=this[i];c=a[0]*b[1]-b[0]*a[1];x+=(a[0]+b[0])*c;y+=(a[1]+b[1])*c}return[x*k,y*k]};d3_geom_polygonPrototype.clip=function(subject){var input,closed=d3_geom_polygonClosed(subject),i=-1,n=this.length-d3_geom_polygonClosed(this),j,m,a=this[n-1],b,c,d;while(++i<n){input=subject.slice();subject.length=0;b=this[i];c=input[(m=input.length-closed)-1];j=-1;while(++j<m){d=input[j];if(d3_geom_polygonInside(d,a,b)){if(!d3_geom_polygonInside(c,a,b)){subject.push(d3_geom_polygonIntersect(c,d,a,b))}subject.push(d)}else if(d3_geom_polygonInside(c,a,b)){subject.push(d3_geom_polygonIntersect(c,d,a,b))}c=d}if(closed)subject.push(subject[0]);a=b}return subject};function d3_geom_polygonInside(p,a,b){return(b[0]-a[0])*(p[1]-a[1])<(b[1]-a[1])*(p[0]-a[0])}function d3_geom_polygonIntersect(c,d,a,b){var x1=c[0],x3=a[0],x21=d[0]-x1,x43=b[0]-x3,y1=c[1],y3=a[1],y21=d[1]-y1,y43=b[1]-y3,ua=(x43*(y1-y3)-y43*(x1-x3))/(y43*x21-x43*y21);return[x1+ua*x21,y1+ua*y21]}function d3_geom_polygonClosed(coordinates){var a=coordinates[0],b=coordinates[coordinates.length-1];return!(a[0]-b[0]||a[1]-b[1])}var d3_geom_voronoiEdges,d3_geom_voronoiCells,d3_geom_voronoiBeaches,d3_geom_voronoiBeachPool=[],d3_geom_voronoiFirstCircle,d3_geom_voronoiCircles,d3_geom_voronoiCirclePool=[];function d3_geom_voronoiBeach(){d3_geom_voronoiRedBlackNode(this);this.edge=this.site=this.circle=null}function d3_geom_voronoiCreateBeach(site){var beach=d3_geom_voronoiBeachPool.pop()||new d3_geom_voronoiBeach;beach.site=site;return beach}function d3_geom_voronoiDetachBeach(beach){d3_geom_voronoiDetachCircle(beach);d3_geom_voronoiBeaches.remove(beach);d3_geom_voronoiBeachPool.push(beach);d3_geom_voronoiRedBlackNode(beach)}function d3_geom_voronoiRemoveBeach(beach){var circle=beach.circle,x=circle.x,y=circle.cy,vertex={x:x,y:y},previous=beach.P,next=beach.N,disappearing=[beach];d3_geom_voronoiDetachBeach(beach);var lArc=previous;while(lArc.circle&&abs(x-lArc.circle.x)<ε&&abs(y-lArc.circle.cy)<ε){previous=lArc.P;disappearing.unshift(lArc);d3_geom_voronoiDetachBeach(lArc);lArc=previous}disappearing.unshift(lArc);d3_geom_voronoiDetachCircle(lArc);var rArc=next;while(rArc.circle&&abs(x-rArc.circle.x)<ε&&abs(y-rArc.circle.cy)<ε){next=rArc.N;disappearing.push(rArc);d3_geom_voronoiDetachBeach(rArc);rArc=next}disappearing.push(rArc);d3_geom_voronoiDetachCircle(rArc);var nArcs=disappearing.length,iArc;for(iArc=1;iArc<nArcs;++iArc){rArc=disappearing[iArc];lArc=disappearing[iArc-1];d3_geom_voronoiSetEdgeEnd(rArc.edge,lArc.site,rArc.site,vertex)}lArc=disappearing[0];rArc=disappearing[nArcs-1];rArc.edge=d3_geom_voronoiCreateEdge(lArc.site,rArc.site,null,vertex);d3_geom_voronoiAttachCircle(lArc);d3_geom_voronoiAttachCircle(rArc)}function d3_geom_voronoiAddBeach(site){var x=site.x,directrix=site.y,lArc,rArc,dxl,dxr,node=d3_geom_voronoiBeaches._;while(node){dxl=d3_geom_voronoiLeftBreakPoint(node,directrix)-x;if(dxl>ε)node=node.L;else{dxr=x-d3_geom_voronoiRightBreakPoint(node,directrix);if(dxr>ε){if(!node.R){lArc=node;break}node=node.R}else{if(dxl>-ε){lArc=node.P;rArc=node}else if(dxr>-ε){lArc=node;rArc=node.N}else{lArc=rArc=node}break}}}var newArc=d3_geom_voronoiCreateBeach(site);d3_geom_voronoiBeaches.insert(lArc,newArc);if(!lArc&&!rArc)return;if(lArc===rArc){d3_geom_voronoiDetachCircle(lArc);rArc=d3_geom_voronoiCreateBeach(lArc.site);d3_geom_voronoiBeaches.insert(newArc,rArc);newArc.edge=rArc.edge=d3_geom_voronoiCreateEdge(lArc.site,newArc.site);d3_geom_voronoiAttachCircle(lArc);d3_geom_voronoiAttachCircle(rArc);return}if(!rArc){newArc.edge=d3_geom_voronoiCreateEdge(lArc.site,newArc.site);return}d3_geom_voronoiDetachCircle(lArc);d3_geom_voronoiDetachCircle(rArc);var lSite=lArc.site,ax=lSite.x,ay=lSite.y,bx=site.x-ax,by=site.y-ay,rSite=rArc.site,cx=rSite.x-ax,cy=rSite.y-ay,d=2*(bx*cy-by*cx),hb=bx*bx+by*by,hc=cx*cx+cy*cy,vertex={x:(cy*hb-by*hc)/d+ax,y:(bx*hc-cx*hb)/d+ay};d3_geom_voronoiSetEdgeEnd(rArc.edge,lSite,rSite,vertex);newArc.edge=d3_geom_voronoiCreateEdge(lSite,site,null,vertex);rArc.edge=d3_geom_voronoiCreateEdge(site,rSite,null,vertex);d3_geom_voronoiAttachCircle(lArc);d3_geom_voronoiAttachCircle(rArc)}function d3_geom_voronoiLeftBreakPoint(arc,directrix){var site=arc.site,rfocx=site.x,rfocy=site.y,pby2=rfocy-directrix;if(!pby2)return rfocx;var lArc=arc.P;if(!lArc)return-Infinity;site=lArc.site;var lfocx=site.x,lfocy=site.y,plby2=lfocy-directrix;if(!plby2)return lfocx;var hl=lfocx-rfocx,aby2=1/pby2-1/plby2,b=hl/plby2;if(aby2)return(-b+Math.sqrt(b*b-2*aby2*(hl*hl/(-2*plby2)-lfocy+plby2/2+rfocy-pby2/2)))/aby2+rfocx;return(rfocx+lfocx)/2}function d3_geom_voronoiRightBreakPoint(arc,directrix){var rArc=arc.N;if(rArc)return d3_geom_voronoiLeftBreakPoint(rArc,directrix);var site=arc.site;return site.y===directrix?site.x:Infinity}function d3_geom_voronoiCell(site){this.site=site;this.edges=[]}d3_geom_voronoiCell.prototype.prepare=function(){var halfEdges=this.edges,iHalfEdge=halfEdges.length,edge;while(iHalfEdge--){edge=halfEdges[iHalfEdge].edge;if(!edge.b||!edge.a)halfEdges.splice(iHalfEdge,1)}halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);return halfEdges.length};function d3_geom_voronoiCloseCells(extent){var x0=extent[0][0],x1=extent[1][0],y0=extent[0][1],y1=extent[1][1],x2,y2,x3,y3,cells=d3_geom_voronoiCells,iCell=cells.length,cell,iHalfEdge,halfEdges,nHalfEdges,start,end;while(iCell--){cell=cells[iCell];if(!cell||!cell.prepare())continue;halfEdges=cell.edges;nHalfEdges=halfEdges.length;iHalfEdge=0;while(iHalfEdge<nHalfEdges){end=halfEdges[iHalfEdge].end(),x3=end.x,y3=end.y;start=halfEdges[++iHalfEdge%nHalfEdges].start(),x2=start.x,y2=start.y;if(abs(x3-x2)>ε||abs(y3-y2)>ε){halfEdges.splice(iHalfEdge,0,new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site,end,abs(x3-x0)<ε&&y1-y3>ε?{x:x0,y:abs(x2-x0)<ε?y2:y1}:abs(y3-y1)<ε&&x1-x3>ε?{x:abs(y2-y1)<ε?x2:x1,y:y1}:abs(x3-x1)<ε&&y3-y0>ε?{x:x1,y:abs(x2-x1)<ε?y2:y0}:abs(y3-y0)<ε&&x3-x0>ε?{x:abs(y2-y0)<ε?x2:x0,y:y0}:null),cell.site,null));
  ++nHalfEdges}}}}function d3_geom_voronoiHalfEdgeOrder(a,b){return b.angle-a.angle}function d3_geom_voronoiCircle(){d3_geom_voronoiRedBlackNode(this);this.x=this.y=this.arc=this.site=this.cy=null}function d3_geom_voronoiAttachCircle(arc){var lArc=arc.P,rArc=arc.N;if(!lArc||!rArc)return;var lSite=lArc.site,cSite=arc.site,rSite=rArc.site;if(lSite===rSite)return;var bx=cSite.x,by=cSite.y,ax=lSite.x-bx,ay=lSite.y-by,cx=rSite.x-bx,cy=rSite.y-by;var d=2*(ax*cy-ay*cx);if(d>=-ε2)return;var ha=ax*ax+ay*ay,hc=cx*cx+cy*cy,x=(cy*ha-ay*hc)/d,y=(ax*hc-cx*ha)/d,cy=y+by;var circle=d3_geom_voronoiCirclePool.pop()||new d3_geom_voronoiCircle;circle.arc=arc;circle.site=cSite;circle.x=x+bx;circle.y=cy+Math.sqrt(x*x+y*y);circle.cy=cy;arc.circle=circle;var before=null,node=d3_geom_voronoiCircles._;while(node){if(circle.y<node.y||circle.y===node.y&&circle.x<=node.x){if(node.L)node=node.L;else{before=node.P;break}}else{if(node.R)node=node.R;else{before=node;break}}}d3_geom_voronoiCircles.insert(before,circle);if(!before)d3_geom_voronoiFirstCircle=circle}function d3_geom_voronoiDetachCircle(arc){var circle=arc.circle;if(circle){if(!circle.P)d3_geom_voronoiFirstCircle=circle.N;d3_geom_voronoiCircles.remove(circle);d3_geom_voronoiCirclePool.push(circle);d3_geom_voronoiRedBlackNode(circle);arc.circle=null}}function d3_geom_voronoiClipEdges(extent){var edges=d3_geom_voronoiEdges,clip=d3_geom_clipLine(extent[0][0],extent[0][1],extent[1][0],extent[1][1]),i=edges.length,e;while(i--){e=edges[i];if(!d3_geom_voronoiConnectEdge(e,extent)||!clip(e)||abs(e.a.x-e.b.x)<ε&&abs(e.a.y-e.b.y)<ε){e.a=e.b=null;edges.splice(i,1)}}}function d3_geom_voronoiConnectEdge(edge,extent){var vb=edge.b;if(vb)return true;var va=edge.a,x0=extent[0][0],x1=extent[1][0],y0=extent[0][1],y1=extent[1][1],lSite=edge.l,rSite=edge.r,lx=lSite.x,ly=lSite.y,rx=rSite.x,ry=rSite.y,fx=(lx+rx)/2,fy=(ly+ry)/2,fm,fb;if(ry===ly){if(fx<x0||fx>=x1)return;if(lx>rx){if(!va)va={x:fx,y:y0};else if(va.y>=y1)return;vb={x:fx,y:y1}}else{if(!va)va={x:fx,y:y1};else if(va.y<y0)return;vb={x:fx,y:y0}}}else{fm=(lx-rx)/(ry-ly);fb=fy-fm*fx;if(fm<-1||fm>1){if(lx>rx){if(!va)va={x:(y0-fb)/fm,y:y0};else if(va.y>=y1)return;vb={x:(y1-fb)/fm,y:y1}}else{if(!va)va={x:(y1-fb)/fm,y:y1};else if(va.y<y0)return;vb={x:(y0-fb)/fm,y:y0}}}else{if(ly<ry){if(!va)va={x:x0,y:fm*x0+fb};else if(va.x>=x1)return;vb={x:x1,y:fm*x1+fb}}else{if(!va)va={x:x1,y:fm*x1+fb};else if(va.x<x0)return;vb={x:x0,y:fm*x0+fb}}}}edge.a=va;edge.b=vb;return true}function d3_geom_voronoiEdge(lSite,rSite){this.l=lSite;this.r=rSite;this.a=this.b=null}function d3_geom_voronoiCreateEdge(lSite,rSite,va,vb){var edge=new d3_geom_voronoiEdge(lSite,rSite);d3_geom_voronoiEdges.push(edge);if(va)d3_geom_voronoiSetEdgeEnd(edge,lSite,rSite,va);if(vb)d3_geom_voronoiSetEdgeEnd(edge,rSite,lSite,vb);d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge,lSite,rSite));d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge,rSite,lSite));return edge}function d3_geom_voronoiCreateBorderEdge(lSite,va,vb){var edge=new d3_geom_voronoiEdge(lSite,null);edge.a=va;edge.b=vb;d3_geom_voronoiEdges.push(edge);return edge}function d3_geom_voronoiSetEdgeEnd(edge,lSite,rSite,vertex){if(!edge.a&&!edge.b){edge.a=vertex;edge.l=lSite;edge.r=rSite}else if(edge.l===rSite){edge.b=vertex}else{edge.a=vertex}}function d3_geom_voronoiHalfEdge(edge,lSite,rSite){var va=edge.a,vb=edge.b;this.edge=edge;this.site=lSite;this.angle=rSite?Math.atan2(rSite.y-lSite.y,rSite.x-lSite.x):edge.l===lSite?Math.atan2(vb.x-va.x,va.y-vb.y):Math.atan2(va.x-vb.x,vb.y-va.y)}d3_geom_voronoiHalfEdge.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};function d3_geom_voronoiRedBlackTree(){this._=null}function d3_geom_voronoiRedBlackNode(node){node.U=node.C=node.L=node.R=node.P=node.N=null}d3_geom_voronoiRedBlackTree.prototype={insert:function(after,node){var parent,grandpa,uncle;if(after){node.P=after;node.N=after.N;if(after.N)after.N.P=node;after.N=node;if(after.R){after=after.R;while(after.L)after=after.L;after.L=node}else{after.R=node}parent=after}else if(this._){after=d3_geom_voronoiRedBlackFirst(this._);node.P=null;node.N=after;after.P=after.L=node;parent=after}else{node.P=node.N=null;this._=node;parent=null}node.L=node.R=null;node.U=parent;node.C=true;after=node;while(parent&&parent.C){grandpa=parent.U;if(parent===grandpa.L){uncle=grandpa.R;if(uncle&&uncle.C){parent.C=uncle.C=false;grandpa.C=true;after=grandpa}else{if(after===parent.R){d3_geom_voronoiRedBlackRotateLeft(this,parent);after=parent;parent=after.U}parent.C=false;grandpa.C=true;d3_geom_voronoiRedBlackRotateRight(this,grandpa)}}else{uncle=grandpa.L;if(uncle&&uncle.C){parent.C=uncle.C=false;grandpa.C=true;after=grandpa}else{if(after===parent.L){d3_geom_voronoiRedBlackRotateRight(this,parent);after=parent;parent=after.U}parent.C=false;grandpa.C=true;d3_geom_voronoiRedBlackRotateLeft(this,grandpa)}}parent=after.U}this._.C=false},remove:function(node){if(node.N)node.N.P=node.P;if(node.P)node.P.N=node.N;node.N=node.P=null;var parent=node.U,sibling,left=node.L,right=node.R,next,red;if(!left)next=right;else if(!right)next=left;else next=d3_geom_voronoiRedBlackFirst(right);if(parent){if(parent.L===node)parent.L=next;else parent.R=next}else{this._=next}if(left&&right){red=next.C;next.C=node.C;next.L=left;left.U=next;if(next!==right){parent=next.U;next.U=node.U;node=next.R;parent.L=node;next.R=right;right.U=next}else{next.U=parent;parent=next;node=next.R}}else{red=node.C;node=next}if(node)node.U=parent;if(red)return;if(node&&node.C){node.C=false;return}do{if(node===this._)break;if(node===parent.L){sibling=parent.R;if(sibling.C){sibling.C=false;parent.C=true;d3_geom_voronoiRedBlackRotateLeft(this,parent);sibling=parent.R}if(sibling.L&&sibling.L.C||sibling.R&&sibling.R.C){if(!sibling.R||!sibling.R.C){sibling.L.C=false;sibling.C=true;d3_geom_voronoiRedBlackRotateRight(this,sibling);sibling=parent.R}sibling.C=parent.C;parent.C=sibling.R.C=false;d3_geom_voronoiRedBlackRotateLeft(this,parent);node=this._;break}}else{sibling=parent.L;if(sibling.C){sibling.C=false;parent.C=true;d3_geom_voronoiRedBlackRotateRight(this,parent);sibling=parent.L}if(sibling.L&&sibling.L.C||sibling.R&&sibling.R.C){if(!sibling.L||!sibling.L.C){sibling.R.C=false;sibling.C=true;d3_geom_voronoiRedBlackRotateLeft(this,sibling);sibling=parent.L}sibling.C=parent.C;parent.C=sibling.L.C=false;d3_geom_voronoiRedBlackRotateRight(this,parent);node=this._;break}}sibling.C=true;node=parent;parent=parent.U}while(!node.C);if(node)node.C=false}};function d3_geom_voronoiRedBlackRotateLeft(tree,node){var p=node,q=node.R,parent=p.U;if(parent){if(parent.L===p)parent.L=q;else parent.R=q}else{tree._=q}q.U=parent;p.U=q;p.R=q.L;if(p.R)p.R.U=p;q.L=p}function d3_geom_voronoiRedBlackRotateRight(tree,node){var p=node,q=node.L,parent=p.U;if(parent){if(parent.L===p)parent.L=q;else parent.R=q}else{tree._=q}q.U=parent;p.U=q;p.L=q.R;if(p.L)p.L.U=p;q.R=p}function d3_geom_voronoiRedBlackFirst(node){while(node.L)node=node.L;return node}function d3_geom_voronoi(sites,bbox){var site=sites.sort(d3_geom_voronoiVertexOrder).pop(),x0,y0,circle;d3_geom_voronoiEdges=[];d3_geom_voronoiCells=new Array(sites.length);d3_geom_voronoiBeaches=new d3_geom_voronoiRedBlackTree;d3_geom_voronoiCircles=new d3_geom_voronoiRedBlackTree;while(true){circle=d3_geom_voronoiFirstCircle;if(site&&(!circle||site.y<circle.y||site.y===circle.y&&site.x<circle.x)){if(site.x!==x0||site.y!==y0){d3_geom_voronoiCells[site.i]=new d3_geom_voronoiCell(site);d3_geom_voronoiAddBeach(site);x0=site.x,y0=site.y}site=sites.pop()}else if(circle){d3_geom_voronoiRemoveBeach(circle.arc)}else{break}}if(bbox)d3_geom_voronoiClipEdges(bbox),d3_geom_voronoiCloseCells(bbox);var diagram={cells:d3_geom_voronoiCells,edges:d3_geom_voronoiEdges};d3_geom_voronoiBeaches=d3_geom_voronoiCircles=d3_geom_voronoiEdges=d3_geom_voronoiCells=null;return diagram}function d3_geom_voronoiVertexOrder(a,b){return b.y-a.y||b.x-a.x}d3.geom.voronoi=function(points){var x=d3_geom_pointX,y=d3_geom_pointY,fx=x,fy=y,clipExtent=d3_geom_voronoiClipExtent;if(points)return voronoi(points);function voronoi(data){var polygons=new Array(data.length),x0=clipExtent[0][0],y0=clipExtent[0][1],x1=clipExtent[1][0],y1=clipExtent[1][1];d3_geom_voronoi(sites(data),clipExtent).cells.forEach(function(cell,i){var edges=cell.edges,site=cell.site,polygon=polygons[i]=edges.length?edges.map(function(e){var s=e.start();return[s.x,s.y]}):site.x>=x0&&site.x<=x1&&site.y>=y0&&site.y<=y1?[[x0,y1],[x1,y1],[x1,y0],[x0,y0]]:[];polygon.point=data[i]});return polygons}function sites(data){return data.map(function(d,i){return{x:Math.round(fx(d,i)/ε)*ε,y:Math.round(fy(d,i)/ε)*ε,i:i}})}voronoi.links=function(data){return d3_geom_voronoi(sites(data)).edges.filter(function(edge){return edge.l&&edge.r}).map(function(edge){return{source:data[edge.l.i],target:data[edge.r.i]}})};voronoi.triangles=function(data){var triangles=[];d3_geom_voronoi(sites(data)).cells.forEach(function(cell,i){var site=cell.site,edges=cell.edges.sort(d3_geom_voronoiHalfEdgeOrder),j=-1,m=edges.length,e0,s0,e1=edges[m-1].edge,s1=e1.l===site?e1.r:e1.l;while(++j<m){e0=e1;s0=s1;e1=edges[j].edge;s1=e1.l===site?e1.r:e1.l;if(i<s0.i&&i<s1.i&&d3_geom_voronoiTriangleArea(site,s0,s1)<0){triangles.push([data[i],data[s0.i],data[s1.i]])}}});return triangles};voronoi.x=function(_){return arguments.length?(fx=d3_functor(x=_),voronoi):x};voronoi.y=function(_){return arguments.length?(fy=d3_functor(y=_),voronoi):y};voronoi.clipExtent=function(_){if(!arguments.length)return clipExtent===d3_geom_voronoiClipExtent?null:clipExtent;clipExtent=_==null?d3_geom_voronoiClipExtent:_;return voronoi};voronoi.size=function(_){if(!arguments.length)return clipExtent===d3_geom_voronoiClipExtent?null:clipExtent&&clipExtent[1];return voronoi.clipExtent(_&&[[0,0],_])};return voronoi};var d3_geom_voronoiClipExtent=[[-1e6,-1e6],[1e6,1e6]];function d3_geom_voronoiTriangleArea(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}d3.geom.delaunay=function(vertices){return d3.geom.voronoi().triangles(vertices)};d3.geom.quadtree=function(points,x1,y1,x2,y2){var x=d3_geom_pointX,y=d3_geom_pointY,compat;if(compat=arguments.length){x=d3_geom_quadtreeCompatX;y=d3_geom_quadtreeCompatY;if(compat===3){y2=y1;x2=x1;y1=x1=0}return quadtree(points)}function quadtree(data){var d,fx=d3_functor(x),fy=d3_functor(y),xs,ys,i,n,x1_,y1_,x2_,y2_;if(x1!=null){x1_=x1,y1_=y1,x2_=x2,y2_=y2}else{x2_=y2_=-(x1_=y1_=Infinity);xs=[],ys=[];n=data.length;if(compat)for(i=0;i<n;++i){d=data[i];if(d.x<x1_)x1_=d.x;if(d.y<y1_)y1_=d.y;if(d.x>x2_)x2_=d.x;if(d.y>y2_)y2_=d.y;xs.push(d.x);ys.push(d.y)}else for(i=0;i<n;++i){var x_=+fx(d=data[i],i),y_=+fy(d,i);if(x_<x1_)x1_=x_;if(y_<y1_)y1_=y_;if(x_>x2_)x2_=x_;if(y_>y2_)y2_=y_;xs.push(x_);ys.push(y_)}}var dx=x2_-x1_,dy=y2_-y1_;if(dx>dy)y2_=y1_+dx;else x2_=x1_+dy;function insert(n,d,x,y,x1,y1,x2,y2){if(isNaN(x)||isNaN(y))return;if(n.leaf){var nx=n.x,ny=n.y;if(nx!=null){if(abs(nx-x)+abs(ny-y)<.01){insertChild(n,d,x,y,x1,y1,x2,y2)}else{var nPoint=n.point;n.x=n.y=n.point=null;insertChild(n,nPoint,nx,ny,x1,y1,x2,y2);insertChild(n,d,x,y,x1,y1,x2,y2)}}else{n.x=x,n.y=y,n.point=d}}else{insertChild(n,d,x,y,x1,y1,x2,y2)}}function insertChild(n,d,x,y,x1,y1,x2,y2){var sx=(x1+x2)*.5,sy=(y1+y2)*.5,right=x>=sx,bottom=y>=sy,i=(bottom<<1)+right;n.leaf=false;n=n.nodes[i]||(n.nodes[i]=d3_geom_quadtreeNode());if(right)x1=sx;else x2=sx;if(bottom)y1=sy;else y2=sy;insert(n,d,x,y,x1,y1,x2,y2)}var root=d3_geom_quadtreeNode();root.add=function(d){insert(root,d,+fx(d,++i),+fy(d,i),x1_,y1_,x2_,y2_)};root.visit=function(f){d3_geom_quadtreeVisit(f,root,x1_,y1_,x2_,y2_)};i=-1;if(x1==null){while(++i<n){insert(root,data[i],xs[i],ys[i],x1_,y1_,x2_,y2_)}--i}else data.forEach(root.add);xs=ys=data=d=null;return root}quadtree.x=function(_){return arguments.length?(x=_,quadtree):x};quadtree.y=function(_){return arguments.length?(y=_,quadtree):y};quadtree.extent=function(_){if(!arguments.length)return x1==null?null:[[x1,y1],[x2,y2]];if(_==null)x1=y1=x2=y2=null;else x1=+_[0][0],y1=+_[0][1],x2=+_[1][0],y2=+_[1][1];return quadtree};quadtree.size=function(_){if(!arguments.length)return x1==null?null:[x2-x1,y2-y1];if(_==null)x1=y1=x2=y2=null;else x1=y1=0,x2=+_[0],y2=+_[1];return quadtree};return quadtree};function d3_geom_quadtreeCompatX(d){return d.x}function d3_geom_quadtreeCompatY(d){return d.y}function d3_geom_quadtreeNode(){return{leaf:true,nodes:[],point:null,x:null,y:null}}function d3_geom_quadtreeVisit(f,node,x1,y1,x2,y2){if(!f(node,x1,y1,x2,y2)){var sx=(x1+x2)*.5,sy=(y1+y2)*.5,children=node.nodes;if(children[0])d3_geom_quadtreeVisit(f,children[0],x1,y1,sx,sy);if(children[1])d3_geom_quadtreeVisit(f,children[1],sx,y1,x2,sy);if(children[2])d3_geom_quadtreeVisit(f,children[2],x1,sy,sx,y2);if(children[3])d3_geom_quadtreeVisit(f,children[3],sx,sy,x2,y2)}}d3.interpolateRgb=d3_interpolateRgb;function d3_interpolateRgb(a,b){a=d3.rgb(a);b=d3.rgb(b);var ar=a.r,ag=a.g,ab=a.b,br=b.r-ar,bg=b.g-ag,bb=b.b-ab;return function(t){return"#"+d3_rgb_hex(Math.round(ar+br*t))+d3_rgb_hex(Math.round(ag+bg*t))+d3_rgb_hex(Math.round(ab+bb*t))}}d3.interpolateObject=d3_interpolateObject;function d3_interpolateObject(a,b){var i={},c={},k;for(k in a){if(k in b){i[k]=d3_interpolate(a[k],b[k])}else{c[k]=a[k]}}for(k in b){if(!(k in a)){c[k]=b[k]}}return function(t){for(k in i)c[k]=i[k](t);return c}}d3.interpolateNumber=d3_interpolateNumber;function d3_interpolateNumber(a,b){b-=a=+a;return function(t){return a+b*t}}d3.interpolateString=d3_interpolateString;function d3_interpolateString(a,b){var bi=d3_interpolate_numberA.lastIndex=d3_interpolate_numberB.lastIndex=0,am,bm,bs,i=-1,s=[],q=[];a=a+"",b=b+"";while((am=d3_interpolate_numberA.exec(a))&&(bm=d3_interpolate_numberB.exec(b))){if((bs=bm.index)>bi){bs=b.substring(bi,bs);if(s[i])s[i]+=bs;else s[++i]=bs}if((am=am[0])===(bm=bm[0])){if(s[i])s[i]+=bm;else s[++i]=bm}else{s[++i]=null;q.push({i:i,x:d3_interpolateNumber(am,bm)})}bi=d3_interpolate_numberB.lastIndex}if(bi<b.length){bs=b.substring(bi);if(s[i])s[i]+=bs;else s[++i]=bs}return s.length<2?q[0]?(b=q[0].x,function(t){return b(t)+""}):function(){return b}:(b=q.length,function(t){for(var i=0,o;i<b;++i)s[(o=q[i]).i]=o.x(t);return s.join("")})}var d3_interpolate_numberA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,d3_interpolate_numberB=new RegExp(d3_interpolate_numberA.source,"g");d3.interpolate=d3_interpolate;function d3_interpolate(a,b){var i=d3.interpolators.length,f;while(--i>=0&&!(f=d3.interpolators[i](a,b)));return f}d3.interpolators=[function(a,b){var t=typeof b;return(t==="string"?d3_rgb_names.has(b)||/^(#|rgb\(|hsl\()/.test(b)?d3_interpolateRgb:d3_interpolateString:b instanceof d3_Color?d3_interpolateRgb:Array.isArray(b)?d3_interpolateArray:t==="object"&&isNaN(b)?d3_interpolateObject:d3_interpolateNumber)(a,b)}];d3.interpolateArray=d3_interpolateArray;function d3_interpolateArray(a,b){var x=[],c=[],na=a.length,nb=b.length,n0=Math.min(a.length,b.length),i;for(i=0;i<n0;++i)x.push(d3_interpolate(a[i],b[i]));for(;i<na;++i)c[i]=a[i];for(;i<nb;++i)c[i]=b[i];return function(t){for(i=0;i<n0;++i)c[i]=x[i](t);return c}}var d3_ease_default=function(){return d3_identity};var d3_ease=d3.map({linear:d3_ease_default,poly:d3_ease_poly,quad:function(){return d3_ease_quad},cubic:function(){return d3_ease_cubic},sin:function(){return d3_ease_sin},exp:function(){return d3_ease_exp},circle:function(){return d3_ease_circle},elastic:d3_ease_elastic,back:d3_ease_back,bounce:function(){return d3_ease_bounce}});var d3_ease_mode=d3.map({"in":d3_identity,out:d3_ease_reverse,"in-out":d3_ease_reflect,"out-in":function(f){return d3_ease_reflect(d3_ease_reverse(f))}});d3.ease=function(name){var i=name.indexOf("-"),t=i>=0?name.substring(0,i):name,m=i>=0?name.substring(i+1):"in";t=d3_ease.get(t)||d3_ease_default;m=d3_ease_mode.get(m)||d3_identity;return d3_ease_clamp(m(t.apply(null,d3_arraySlice.call(arguments,1))))};function d3_ease_clamp(f){return function(t){return t<=0?0:t>=1?1:f(t)}}function d3_ease_reverse(f){return function(t){return 1-f(1-t)}}function d3_ease_reflect(f){return function(t){return.5*(t<.5?f(2*t):2-f(2-2*t))}}function d3_ease_quad(t){return t*t}function d3_ease_cubic(t){return t*t*t}function d3_ease_cubicInOut(t){if(t<=0)return 0;if(t>=1)return 1;var t2=t*t,t3=t2*t;return 4*(t<.5?t3:3*(t-t2)+t3-.75)}function d3_ease_poly(e){return function(t){return Math.pow(t,e)}}function d3_ease_sin(t){return 1-Math.cos(t*halfπ)}function d3_ease_exp(t){return Math.pow(2,10*(t-1))}function d3_ease_circle(t){return 1-Math.sqrt(1-t*t)}function d3_ease_elastic(a,p){var s;if(arguments.length<2)p=.45;if(arguments.length)s=p/τ*Math.asin(1/a);else a=1,s=p/4;return function(t){return 1+a*Math.pow(2,-10*t)*Math.sin((t-s)*τ/p)}}function d3_ease_back(s){if(!s)s=1.70158;return function(t){return t*t*((s+1)*t-s)}}function d3_ease_bounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}d3.interpolateHcl=d3_interpolateHcl;function d3_interpolateHcl(a,b){a=d3.hcl(a);b=d3.hcl(b);var ah=a.h,ac=a.c,al=a.l,bh=b.h-ah,bc=b.c-ac,bl=b.l-al;if(isNaN(bc))bc=0,ac=isNaN(ac)?b.c:ac;if(isNaN(bh))bh=0,ah=isNaN(ah)?b.h:ah;else if(bh>180)bh-=360;else if(bh<-180)bh+=360;return function(t){return d3_hcl_lab(ah+bh*t,ac+bc*t,al+bl*t)+""}}d3.interpolateHsl=d3_interpolateHsl;function d3_interpolateHsl(a,b){a=d3.hsl(a);b=d3.hsl(b);var ah=a.h,as=a.s,al=a.l,bh=b.h-ah,bs=b.s-as,bl=b.l-al;if(isNaN(bs))bs=0,as=isNaN(as)?b.s:as;if(isNaN(bh))bh=0,ah=isNaN(ah)?b.h:ah;else if(bh>180)bh-=360;else if(bh<-180)bh+=360;return function(t){return d3_hsl_rgb(ah+bh*t,as+bs*t,al+bl*t)+""}}d3.interpolateLab=d3_interpolateLab;function d3_interpolateLab(a,b){a=d3.lab(a);b=d3.lab(b);var al=a.l,aa=a.a,ab=a.b,bl=b.l-al,ba=b.a-aa,bb=b.b-ab;return function(t){return d3_lab_rgb(al+bl*t,aa+ba*t,ab+bb*t)+""}}d3.interpolateRound=d3_interpolateRound;function d3_interpolateRound(a,b){b-=a;return function(t){return Math.round(a+b*t)}}d3.transform=function(string){var g=d3_document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(string){if(string!=null){g.setAttribute("transform",string);var t=g.transform.baseVal.consolidate()}return new d3_transform(t?t.matrix:d3_transformIdentity)})(string)};function d3_transform(m){var r0=[m.a,m.b],r1=[m.c,m.d],kx=d3_transformNormalize(r0),kz=d3_transformDot(r0,r1),ky=d3_transformNormalize(d3_transformCombine(r1,r0,-kz))||0;if(r0[0]*r1[1]<r1[0]*r0[1]){r0[0]*=-1;r0[1]*=-1;kx*=-1;kz*=-1}this.rotate=(kx?Math.atan2(r0[1],r0[0]):Math.atan2(-r1[0],r1[1]))*d3_degrees;this.translate=[m.e,m.f];this.scale=[kx,ky];this.skew=ky?Math.atan2(kz,ky)*d3_degrees:0}d3_transform.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function d3_transformDot(a,b){return a[0]*b[0]+a[1]*b[1]}function d3_transformNormalize(a){var k=Math.sqrt(d3_transformDot(a,a));if(k){a[0]/=k;a[1]/=k}return k}function d3_transformCombine(a,b,k){a[0]+=k*b[0];a[1]+=k*b[1];return a}var d3_transformIdentity={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolateTransform=d3_interpolateTransform;function d3_interpolateTransform(a,b){var s=[],q=[],n,A=d3.transform(a),B=d3.transform(b),ta=A.translate,tb=B.translate,ra=A.rotate,rb=B.rotate,wa=A.skew,wb=B.skew,ka=A.scale,kb=B.scale;if(ta[0]!=tb[0]||ta[1]!=tb[1]){s.push("translate(",null,",",null,")");q.push({i:1,x:d3_interpolateNumber(ta[0],tb[0])},{i:3,x:d3_interpolateNumber(ta[1],tb[1])})}else if(tb[0]||tb[1]){s.push("translate("+tb+")")}else{s.push("")}if(ra!=rb){if(ra-rb>180)rb+=360;else if(rb-ra>180)ra+=360;q.push({i:s.push(s.pop()+"rotate(",null,")")-2,x:d3_interpolateNumber(ra,rb)})}else if(rb){s.push(s.pop()+"rotate("+rb+")")}if(wa!=wb){q.push({i:s.push(s.pop()+"skewX(",null,")")-2,x:d3_interpolateNumber(wa,wb)})}else if(wb){s.push(s.pop()+"skewX("+wb+")")}if(ka[0]!=kb[0]||ka[1]!=kb[1]){n=s.push(s.pop()+"scale(",null,",",null,")");q.push({i:n-4,x:d3_interpolateNumber(ka[0],kb[0])},{i:n-2,x:d3_interpolateNumber(ka[1],kb[1])})}else if(kb[0]!=1||kb[1]!=1){s.push(s.pop()+"scale("+kb+")")}n=q.length;return function(t){var i=-1,o;while(++i<n)s[(o=q[i]).i]=o.x(t);return s.join("")}}function d3_uninterpolateNumber(a,b){b=b-(a=+a)?1/(b-a):0;return function(x){return(x-a)*b}}function d3_uninterpolateClamp(a,b){b=b-(a=+a)?1/(b-a):0;return function(x){return Math.max(0,Math.min(1,(x-a)*b))}}d3.layout={};d3.layout.bundle=function(){return function(links){var paths=[],i=-1,n=links.length;while(++i<n)paths.push(d3_layout_bundlePath(links[i]));return paths}};function d3_layout_bundlePath(link){var start=link.source,end=link.target,lca=d3_layout_bundleLeastCommonAncestor(start,end),points=[start];while(start!==lca){start=start.parent;points.push(start)}var k=points.length;while(end!==lca){points.splice(k,0,end);end=end.parent}return points}function d3_layout_bundleAncestors(node){var ancestors=[],parent=node.parent;while(parent!=null){ancestors.push(node);node=parent;parent=parent.parent}ancestors.push(node);return ancestors}function d3_layout_bundleLeastCommonAncestor(a,b){if(a===b)return a;var aNodes=d3_layout_bundleAncestors(a),bNodes=d3_layout_bundleAncestors(b),aNode=aNodes.pop(),bNode=bNodes.pop(),sharedNode=null;while(aNode===bNode){sharedNode=aNode;aNode=aNodes.pop();bNode=bNodes.pop()}return sharedNode}d3.layout.chord=function(){var chord={},chords,groups,matrix,n,padding=0,sortGroups,sortSubgroups,sortChords;function relayout(){var subgroups={},groupSums=[],groupIndex=d3.range(n),subgroupIndex=[],k,x,x0,i,j;chords=[];groups=[];k=0,i=-1;while(++i<n){x=0,j=-1;while(++j<n){x+=matrix[i][j]}groupSums.push(x);subgroupIndex.push(d3.range(n));k+=x}if(sortGroups){groupIndex.sort(function(a,b){return sortGroups(groupSums[a],groupSums[b])})}if(sortSubgroups){subgroupIndex.forEach(function(d,i){d.sort(function(a,b){return sortSubgroups(matrix[i][a],matrix[i][b])})})}k=(τ-padding*n)/k;x=0,i=-1;while(++i<n){x0=x,j=-1;while(++j<n){var di=groupIndex[i],dj=subgroupIndex[di][j],v=matrix[di][dj],a0=x,a1=x+=v*k;subgroups[di+"-"+dj]={index:di,subindex:dj,startAngle:a0,endAngle:a1,value:v}}groups[di]={index:di,startAngle:x0,endAngle:x,value:(x-x0)/k};x+=padding}i=-1;while(++i<n){j=i-1;while(++j<n){var source=subgroups[i+"-"+j],target=subgroups[j+"-"+i];if(source.value||target.value){chords.push(source.value<target.value?{source:target,target:source}:{source:source,target:target})}}}if(sortChords)resort()}function resort(){chords.sort(function(a,b){return sortChords((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}chord.matrix=function(x){if(!arguments.length)return matrix;n=(matrix=x)&&matrix.length;chords=groups=null;return chord};chord.padding=function(x){if(!arguments.length)return padding;padding=x;chords=groups=null;return chord};chord.sortGroups=function(x){if(!arguments.length)return sortGroups;sortGroups=x;chords=groups=null;return chord};chord.sortSubgroups=function(x){if(!arguments.length)return sortSubgroups;sortSubgroups=x;chords=null;return chord};chord.sortChords=function(x){if(!arguments.length)return sortChords;sortChords=x;if(chords)resort();return chord};chord.chords=function(){if(!chords)relayout();return chords};chord.groups=function(){if(!groups)relayout();return groups};return chord};d3.layout.force=function(){var force={},event=d3.dispatch("start","tick","end"),size=[1,1],drag,alpha,friction=.9,linkDistance=d3_layout_forceLinkDistance,linkStrength=d3_layout_forceLinkStrength,charge=-30,chargeDistance2=d3_layout_forceChargeDistance2,gravity=.1,theta2=.64,nodes=[],links=[],distances,strengths,charges;function repulse(node){return function(quad,x1,_,x2){if(quad.point!==node){var dx=quad.cx-node.x,dy=quad.cy-node.y,dw=x2-x1,dn=dx*dx+dy*dy;if(dw*dw/theta2<dn){if(dn<chargeDistance2){var k=quad.charge/dn;node.px-=dx*k;node.py-=dy*k}return true}if(quad.point&&dn&&dn<chargeDistance2){var k=quad.pointCharge/dn;node.px-=dx*k;node.py-=dy*k}}return!quad.charge}}force.tick=function(){if((alpha*=.99)<.005){event.end({type:"end",alpha:alpha=0});return true}var n=nodes.length,m=links.length,q,i,o,s,t,l,k,x,y;for(i=0;i<m;++i){o=links[i];s=o.source;t=o.target;x=t.x-s.x;y=t.y-s.y;if(l=x*x+y*y){l=alpha*strengths[i]*((l=Math.sqrt(l))-distances[i])/l;x*=l;y*=l;t.x-=x*(k=s.weight/(t.weight+s.weight));t.y-=y*k;s.x+=x*(k=1-k);s.y+=y*k}}if(k=alpha*gravity){x=size[0]/2;y=size[1]/2;i=-1;if(k)while(++i<n){o=nodes[i];o.x+=(x-o.x)*k;o.y+=(y-o.y)*k}}if(charge){d3_layout_forceAccumulate(q=d3.geom.quadtree(nodes),alpha,charges);i=-1;while(++i<n){if(!(o=nodes[i]).fixed){q.visit(repulse(o))}}}i=-1;while(++i<n){o=nodes[i];if(o.fixed){o.x=o.px;o.y=o.py}else{o.x-=(o.px-(o.px=o.x))*friction;o.y-=(o.py-(o.py=o.y))*friction}}event.tick({type:"tick",alpha:alpha})};force.nodes=function(x){if(!arguments.length)return nodes;nodes=x;return force};force.links=function(x){if(!arguments.length)return links;links=x;return force};force.size=function(x){if(!arguments.length)return size;size=x;return force};force.linkDistance=function(x){if(!arguments.length)return linkDistance;linkDistance=typeof x==="function"?x:+x;return force};force.distance=force.linkDistance;force.linkStrength=function(x){if(!arguments.length)return linkStrength;linkStrength=typeof x==="function"?x:+x;return force};force.friction=function(x){if(!arguments.length)return friction;friction=+x;return force};force.charge=function(x){if(!arguments.length)return charge;charge=typeof x==="function"?x:+x;return force};force.chargeDistance=function(x){if(!arguments.length)return Math.sqrt(chargeDistance2);chargeDistance2=x*x;return force};force.gravity=function(x){if(!arguments.length)return gravity;gravity=+x;return force};force.theta=function(x){if(!arguments.length)return Math.sqrt(theta2);theta2=x*x;return force};force.alpha=function(x){if(!arguments.length)return alpha;x=+x;if(alpha){if(x>0)alpha=x;else alpha=0}else if(x>0){event.start({type:"start",alpha:alpha=x});d3.timer(force.tick)}return force};force.start=function(){var i,n=nodes.length,m=links.length,w=size[0],h=size[1],neighbors,o;for(i=0;i<n;++i){(o=nodes[i]).index=i;o.weight=0}for(i=0;i<m;++i){o=links[i];if(typeof o.source=="number")o.source=nodes[o.source];if(typeof o.target=="number")o.target=nodes[o.target];++o.source.weight;++o.target.weight}for(i=0;i<n;++i){o=nodes[i];if(isNaN(o.x))o.x=position("x",w);if(isNaN(o.y))o.y=position("y",h);if(isNaN(o.px))o.px=o.x;if(isNaN(o.py))o.py=o.y}distances=[];if(typeof linkDistance==="function")for(i=0;i<m;++i)distances[i]=+linkDistance.call(this,links[i],i);else for(i=0;i<m;++i)distances[i]=linkDistance;strengths=[];if(typeof linkStrength==="function")for(i=0;i<m;++i)strengths[i]=+linkStrength.call(this,links[i],i);else for(i=0;i<m;++i)strengths[i]=linkStrength;charges=[];if(typeof charge==="function")for(i=0;i<n;++i)charges[i]=+charge.call(this,nodes[i],i);else for(i=0;i<n;++i)charges[i]=charge;function position(dimension,size){if(!neighbors){neighbors=new Array(n);for(j=0;j<n;++j){neighbors[j]=[]}for(j=0;j<m;++j){var o=links[j];neighbors[o.source.index].push(o.target);neighbors[o.target.index].push(o.source)}}var candidates=neighbors[i],j=-1,m=candidates.length,x;while(++j<m)if(!isNaN(x=candidates[j][dimension]))return x;return Math.random()*size}return force.resume()};force.resume=function(){return force.alpha(.1)};force.stop=function(){return force.alpha(0)};force.drag=function(){if(!drag)drag=d3.behavior.drag().origin(d3_identity).on("dragstart.force",d3_layout_forceDragstart).on("drag.force",dragmove).on("dragend.force",d3_layout_forceDragend);if(!arguments.length)return drag;this.on("mouseover.force",d3_layout_forceMouseover).on("mouseout.force",d3_layout_forceMouseout).call(drag)};function dragmove(d){d.px=d3.event.x,d.py=d3.event.y;force.resume()}return d3.rebind(force,event,"on")};function d3_layout_forceDragstart(d){d.fixed|=2}function d3_layout_forceDragend(d){d.fixed&=~6}function d3_layout_forceMouseover(d){d.fixed|=4;d.px=d.x,d.py=d.y}function d3_layout_forceMouseout(d){d.fixed&=~4}function d3_layout_forceAccumulate(quad,alpha,charges){var cx=0,cy=0;quad.charge=0;if(!quad.leaf){var nodes=quad.nodes,n=nodes.length,i=-1,c;while(++i<n){c=nodes[i];if(c==null)continue;d3_layout_forceAccumulate(c,alpha,charges);quad.charge+=c.charge;cx+=c.charge*c.cx;cy+=c.charge*c.cy}}if(quad.point){if(!quad.leaf){quad.point.x+=Math.random()-.5;quad.point.y+=Math.random()-.5}var k=alpha*charges[quad.point.index];quad.charge+=quad.pointCharge=k;cx+=k*quad.point.x;cy+=k*quad.point.y}quad.cx=cx/quad.charge;quad.cy=cy/quad.charge}var d3_layout_forceLinkDistance=20,d3_layout_forceLinkStrength=1,d3_layout_forceChargeDistance2=Infinity;d3.layout.hierarchy=function(){var sort=d3_layout_hierarchySort,children=d3_layout_hierarchyChildren,value=d3_layout_hierarchyValue;function hierarchy(root){var stack=[root],nodes=[],node;root.depth=0;while((node=stack.pop())!=null){nodes.push(node);if((childs=children.call(hierarchy,node,node.depth))&&(n=childs.length)){var n,childs,child;while(--n>=0){stack.push(child=childs[n]);child.parent=node;child.depth=node.depth+1}if(value)node.value=0;node.children=childs}else{if(value)node.value=+value.call(hierarchy,node,node.depth)||0;delete node.children}}d3_layout_hierarchyVisitAfter(root,function(node){var childs,parent;if(sort&&(childs=node.children))childs.sort(sort);if(value&&(parent=node.parent))parent.value+=node.value});return nodes}hierarchy.sort=function(x){if(!arguments.length)return sort;sort=x;return hierarchy};hierarchy.children=function(x){if(!arguments.length)return children;children=x;return hierarchy};hierarchy.value=function(x){if(!arguments.length)return value;value=x;return hierarchy};hierarchy.revalue=function(root){if(value){d3_layout_hierarchyVisitBefore(root,function(node){if(node.children)node.value=0});d3_layout_hierarchyVisitAfter(root,function(node){var parent;if(!node.children)node.value=+value.call(hierarchy,node,node.depth)||0;if(parent=node.parent)parent.value+=node.value})}return root};return hierarchy};function d3_layout_hierarchyRebind(object,hierarchy){d3.rebind(object,hierarchy,"sort","children","value");object.nodes=object;object.links=d3_layout_hierarchyLinks;return object}function d3_layout_hierarchyVisitBefore(node,callback){var nodes=[node];while((node=nodes.pop())!=null){callback(node);if((children=node.children)&&(n=children.length)){var n,children;while(--n>=0)nodes.push(children[n])}}}function d3_layout_hierarchyVisitAfter(node,callback){var nodes=[node],nodes2=[];while((node=nodes.pop())!=null){nodes2.push(node);if((children=node.children)&&(n=children.length)){var i=-1,n,children;while(++i<n)nodes.push(children[i])}}while((node=nodes2.pop())!=null){callback(node)}}function d3_layout_hierarchyChildren(d){return d.children}function d3_layout_hierarchyValue(d){return d.value}function d3_layout_hierarchySort(a,b){return b.value-a.value}function d3_layout_hierarchyLinks(nodes){return d3.merge(nodes.map(function(parent){return(parent.children||[]).map(function(child){return{source:parent,target:child}})}))}d3.layout.partition=function(){var hierarchy=d3.layout.hierarchy(),size=[1,1];function position(node,x,dx,dy){var children=node.children;node.x=x;node.y=node.depth*dy;node.dx=dx;node.dy=dy;if(children&&(n=children.length)){var i=-1,n,c,d;dx=node.value?dx/node.value:0;while(++i<n){position(c=children[i],x,d=c.value*dx,dy);x+=d}}}function depth(node){var children=node.children,d=0;if(children&&(n=children.length)){var i=-1,n;while(++i<n)d=Math.max(d,depth(children[i]))}return 1+d}function partition(d,i){var nodes=hierarchy.call(this,d,i);position(nodes[0],0,size[0],size[1]/depth(nodes[0]));return nodes}partition.size=function(x){if(!arguments.length)return size;size=x;return partition};return d3_layout_hierarchyRebind(partition,hierarchy)};d3.layout.pie=function(){var value=Number,sort=d3_layout_pieSortByValue,startAngle=0,endAngle=τ;function pie(data){var values=data.map(function(d,i){return+value.call(pie,d,i)});
  var a=+(typeof startAngle==="function"?startAngle.apply(this,arguments):startAngle);var k=((typeof endAngle==="function"?endAngle.apply(this,arguments):endAngle)-a)/d3.sum(values);var index=d3.range(data.length);if(sort!=null)index.sort(sort===d3_layout_pieSortByValue?function(i,j){return values[j]-values[i]}:function(i,j){return sort(data[i],data[j])});var arcs=[];index.forEach(function(i){var d;arcs[i]={data:data[i],value:d=values[i],startAngle:a,endAngle:a+=d*k}});return arcs}pie.value=function(x){if(!arguments.length)return value;value=x;return pie};pie.sort=function(x){if(!arguments.length)return sort;sort=x;return pie};pie.startAngle=function(x){if(!arguments.length)return startAngle;startAngle=x;return pie};pie.endAngle=function(x){if(!arguments.length)return endAngle;endAngle=x;return pie};return pie};var d3_layout_pieSortByValue={};d3.layout.stack=function(){var values=d3_identity,order=d3_layout_stackOrderDefault,offset=d3_layout_stackOffsetZero,out=d3_layout_stackOut,x=d3_layout_stackX,y=d3_layout_stackY;function stack(data,index){var series=data.map(function(d,i){return values.call(stack,d,i)});var points=series.map(function(d){return d.map(function(v,i){return[x.call(stack,v,i),y.call(stack,v,i)]})});var orders=order.call(stack,points,index);series=d3.permute(series,orders);points=d3.permute(points,orders);var offsets=offset.call(stack,points,index);var n=series.length,m=series[0].length,i,j,o;for(j=0;j<m;++j){out.call(stack,series[0][j],o=offsets[j],points[0][j][1]);for(i=1;i<n;++i){out.call(stack,series[i][j],o+=points[i-1][j][1],points[i][j][1])}}return data}stack.values=function(x){if(!arguments.length)return values;values=x;return stack};stack.order=function(x){if(!arguments.length)return order;order=typeof x==="function"?x:d3_layout_stackOrders.get(x)||d3_layout_stackOrderDefault;return stack};stack.offset=function(x){if(!arguments.length)return offset;offset=typeof x==="function"?x:d3_layout_stackOffsets.get(x)||d3_layout_stackOffsetZero;return stack};stack.x=function(z){if(!arguments.length)return x;x=z;return stack};stack.y=function(z){if(!arguments.length)return y;y=z;return stack};stack.out=function(z){if(!arguments.length)return out;out=z;return stack};return stack};function d3_layout_stackX(d){return d.x}function d3_layout_stackY(d){return d.y}function d3_layout_stackOut(d,y0,y){d.y0=y0;d.y=y}var d3_layout_stackOrders=d3.map({"inside-out":function(data){var n=data.length,i,j,max=data.map(d3_layout_stackMaxIndex),sums=data.map(d3_layout_stackReduceSum),index=d3.range(n).sort(function(a,b){return max[a]-max[b]}),top=0,bottom=0,tops=[],bottoms=[];for(i=0;i<n;++i){j=index[i];if(top<bottom){top+=sums[j];tops.push(j)}else{bottom+=sums[j];bottoms.push(j)}}return bottoms.reverse().concat(tops)},reverse:function(data){return d3.range(data.length).reverse()},"default":d3_layout_stackOrderDefault});var d3_layout_stackOffsets=d3.map({silhouette:function(data){var n=data.length,m=data[0].length,sums=[],max=0,i,j,o,y0=[];for(j=0;j<m;++j){for(i=0,o=0;i<n;i++)o+=data[i][j][1];if(o>max)max=o;sums.push(o)}for(j=0;j<m;++j){y0[j]=(max-sums[j])/2}return y0},wiggle:function(data){var n=data.length,x=data[0],m=x.length,i,j,k,s1,s2,s3,dx,o,o0,y0=[];y0[0]=o=o0=0;for(j=1;j<m;++j){for(i=0,s1=0;i<n;++i)s1+=data[i][j][1];for(i=0,s2=0,dx=x[j][0]-x[j-1][0];i<n;++i){for(k=0,s3=(data[i][j][1]-data[i][j-1][1])/(2*dx);k<i;++k){s3+=(data[k][j][1]-data[k][j-1][1])/dx}s2+=s3*data[i][j][1]}y0[j]=o-=s1?s2/s1*dx:0;if(o<o0)o0=o}for(j=0;j<m;++j)y0[j]-=o0;return y0},expand:function(data){var n=data.length,m=data[0].length,k=1/n,i,j,o,y0=[];for(j=0;j<m;++j){for(i=0,o=0;i<n;i++)o+=data[i][j][1];if(o)for(i=0;i<n;i++)data[i][j][1]/=o;else for(i=0;i<n;i++)data[i][j][1]=k}for(j=0;j<m;++j)y0[j]=0;return y0},zero:d3_layout_stackOffsetZero});function d3_layout_stackOrderDefault(data){return d3.range(data.length)}function d3_layout_stackOffsetZero(data){var j=-1,m=data[0].length,y0=[];while(++j<m)y0[j]=0;return y0}function d3_layout_stackMaxIndex(array){var i=1,j=0,v=array[0][1],k,n=array.length;for(;i<n;++i){if((k=array[i][1])>v){j=i;v=k}}return j}function d3_layout_stackReduceSum(d){return d.reduce(d3_layout_stackSum,0)}function d3_layout_stackSum(p,d){return p+d[1]}d3.layout.histogram=function(){var frequency=true,valuer=Number,ranger=d3_layout_histogramRange,binner=d3_layout_histogramBinSturges;function histogram(data,i){var bins=[],values=data.map(valuer,this),range=ranger.call(this,values,i),thresholds=binner.call(this,range,values,i),bin,i=-1,n=values.length,m=thresholds.length-1,k=frequency?1:1/n,x;while(++i<m){bin=bins[i]=[];bin.dx=thresholds[i+1]-(bin.x=thresholds[i]);bin.y=0}if(m>0){i=-1;while(++i<n){x=values[i];if(x>=range[0]&&x<=range[1]){bin=bins[d3.bisect(thresholds,x,1,m)-1];bin.y+=k;bin.push(data[i])}}}return bins}histogram.value=function(x){if(!arguments.length)return valuer;valuer=x;return histogram};histogram.range=function(x){if(!arguments.length)return ranger;ranger=d3_functor(x);return histogram};histogram.bins=function(x){if(!arguments.length)return binner;binner=typeof x==="number"?function(range){return d3_layout_histogramBinFixed(range,x)}:d3_functor(x);return histogram};histogram.frequency=function(x){if(!arguments.length)return frequency;frequency=!!x;return histogram};return histogram};function d3_layout_histogramBinSturges(range,values){return d3_layout_histogramBinFixed(range,Math.ceil(Math.log(values.length)/Math.LN2+1))}function d3_layout_histogramBinFixed(range,n){var x=-1,b=+range[0],m=(range[1]-b)/n,f=[];while(++x<=n)f[x]=m*x+b;return f}function d3_layout_histogramRange(values){return[d3.min(values),d3.max(values)]}d3.layout.pack=function(){var hierarchy=d3.layout.hierarchy().sort(d3_layout_packSort),padding=0,size=[1,1],radius;function pack(d,i){var nodes=hierarchy.call(this,d,i),root=nodes[0],w=size[0],h=size[1],r=radius==null?Math.sqrt:typeof radius==="function"?radius:function(){return radius};root.x=root.y=0;d3_layout_hierarchyVisitAfter(root,function(d){d.r=+r(d.value)});d3_layout_hierarchyVisitAfter(root,d3_layout_packSiblings);if(padding){var dr=padding*(radius?1:Math.max(2*root.r/w,2*root.r/h))/2;d3_layout_hierarchyVisitAfter(root,function(d){d.r+=dr});d3_layout_hierarchyVisitAfter(root,d3_layout_packSiblings);d3_layout_hierarchyVisitAfter(root,function(d){d.r-=dr})}d3_layout_packTransform(root,w/2,h/2,radius?1:1/Math.max(2*root.r/w,2*root.r/h));return nodes}pack.size=function(_){if(!arguments.length)return size;size=_;return pack};pack.radius=function(_){if(!arguments.length)return radius;radius=_==null||typeof _==="function"?_:+_;return pack};pack.padding=function(_){if(!arguments.length)return padding;padding=+_;return pack};return d3_layout_hierarchyRebind(pack,hierarchy)};function d3_layout_packSort(a,b){return a.value-b.value}function d3_layout_packInsert(a,b){var c=a._pack_next;a._pack_next=b;b._pack_prev=a;b._pack_next=c;c._pack_prev=b}function d3_layout_packSplice(a,b){a._pack_next=b;b._pack_prev=a}function d3_layout_packIntersects(a,b){var dx=b.x-a.x,dy=b.y-a.y,dr=a.r+b.r;return.999*dr*dr>dx*dx+dy*dy}function d3_layout_packSiblings(node){if(!(nodes=node.children)||!(n=nodes.length))return;var nodes,xMin=Infinity,xMax=-Infinity,yMin=Infinity,yMax=-Infinity,a,b,c,i,j,k,n;function bound(node){xMin=Math.min(node.x-node.r,xMin);xMax=Math.max(node.x+node.r,xMax);yMin=Math.min(node.y-node.r,yMin);yMax=Math.max(node.y+node.r,yMax)}nodes.forEach(d3_layout_packLink);a=nodes[0];a.x=-a.r;a.y=0;bound(a);if(n>1){b=nodes[1];b.x=b.r;b.y=0;bound(b);if(n>2){c=nodes[2];d3_layout_packPlace(a,b,c);bound(c);d3_layout_packInsert(a,c);a._pack_prev=c;d3_layout_packInsert(c,b);b=a._pack_next;for(i=3;i<n;i++){d3_layout_packPlace(a,b,c=nodes[i]);var isect=0,s1=1,s2=1;for(j=b._pack_next;j!==b;j=j._pack_next,s1++){if(d3_layout_packIntersects(j,c)){isect=1;break}}if(isect==1){for(k=a._pack_prev;k!==j._pack_prev;k=k._pack_prev,s2++){if(d3_layout_packIntersects(k,c)){break}}}if(isect){if(s1<s2||s1==s2&&b.r<a.r)d3_layout_packSplice(a,b=j);else d3_layout_packSplice(a=k,b);i--}else{d3_layout_packInsert(a,c);b=c;bound(c)}}}}var cx=(xMin+xMax)/2,cy=(yMin+yMax)/2,cr=0;for(i=0;i<n;i++){c=nodes[i];c.x-=cx;c.y-=cy;cr=Math.max(cr,c.r+Math.sqrt(c.x*c.x+c.y*c.y))}node.r=cr;nodes.forEach(d3_layout_packUnlink)}function d3_layout_packLink(node){node._pack_next=node._pack_prev=node}function d3_layout_packUnlink(node){delete node._pack_next;delete node._pack_prev}function d3_layout_packTransform(node,x,y,k){var children=node.children;node.x=x+=k*node.x;node.y=y+=k*node.y;node.r*=k;if(children){var i=-1,n=children.length;while(++i<n)d3_layout_packTransform(children[i],x,y,k)}}function d3_layout_packPlace(a,b,c){var db=a.r+c.r,dx=b.x-a.x,dy=b.y-a.y;if(db&&(dx||dy)){var da=b.r+c.r,dc=dx*dx+dy*dy;da*=da;db*=db;var x=.5+(db-da)/(2*dc),y=Math.sqrt(Math.max(0,2*da*(db+dc)-(db-=dc)*db-da*da))/(2*dc);c.x=a.x+x*dx+y*dy;c.y=a.y+x*dy-y*dx}else{c.x=a.x+db;c.y=a.y}}d3.layout.tree=function(){var hierarchy=d3.layout.hierarchy().sort(null).value(null),separation=d3_layout_treeSeparation,size=[1,1],nodeSize=null;function tree(d,i){var nodes=hierarchy.call(this,d,i),root0=nodes[0],root1=wrapTree(root0);d3_layout_hierarchyVisitAfter(root1,firstWalk),root1.parent.m=-root1.z;d3_layout_hierarchyVisitBefore(root1,secondWalk);if(nodeSize)d3_layout_hierarchyVisitBefore(root0,sizeNode);else{var left=root0,right=root0,bottom=root0;d3_layout_hierarchyVisitBefore(root0,function(node){if(node.x<left.x)left=node;if(node.x>right.x)right=node;if(node.depth>bottom.depth)bottom=node});var tx=separation(left,right)/2-left.x,kx=size[0]/(right.x+separation(right,left)/2+tx),ky=size[1]/(bottom.depth||1);d3_layout_hierarchyVisitBefore(root0,function(node){node.x=(node.x+tx)*kx;node.y=node.depth*ky})}return nodes}function wrapTree(root0){var root1={A:null,children:[root0]},queue=[root1],node1;while((node1=queue.pop())!=null){for(var children=node1.children,child,i=0,n=children.length;i<n;++i){queue.push((children[i]=child={_:children[i],parent:node1,children:(child=children[i].children)&&child.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:i}).a=child)}}return root1.children[0]}function firstWalk(v){var children=v.children,siblings=v.parent.children,w=v.i?siblings[v.i-1]:null;if(children.length){d3_layout_treeShift(v);var midpoint=(children[0].z+children[children.length-1].z)/2;if(w){v.z=w.z+separation(v._,w._);v.m=v.z-midpoint}else{v.z=midpoint}}else if(w){v.z=w.z+separation(v._,w._)}v.parent.A=apportion(v,w,v.parent.A||siblings[0])}function secondWalk(v){v._.x=v.z+v.parent.m;v.m+=v.parent.m}function apportion(v,w,ancestor){if(w){var vip=v,vop=v,vim=w,vom=vip.parent.children[0],sip=vip.m,sop=vop.m,sim=vim.m,som=vom.m,shift;while(vim=d3_layout_treeRight(vim),vip=d3_layout_treeLeft(vip),vim&&vip){vom=d3_layout_treeLeft(vom);vop=d3_layout_treeRight(vop);vop.a=v;shift=vim.z+sim-vip.z-sip+separation(vim._,vip._);if(shift>0){d3_layout_treeMove(d3_layout_treeAncestor(vim,v,ancestor),v,shift);sip+=shift;sop+=shift}sim+=vim.m;sip+=vip.m;som+=vom.m;sop+=vop.m}if(vim&&!d3_layout_treeRight(vop)){vop.t=vim;vop.m+=sim-sop}if(vip&&!d3_layout_treeLeft(vom)){vom.t=vip;vom.m+=sip-som;ancestor=v}}return ancestor}function sizeNode(node){node.x*=size[0];node.y=node.depth*size[1]}tree.separation=function(x){if(!arguments.length)return separation;separation=x;return tree};tree.size=function(x){if(!arguments.length)return nodeSize?null:size;nodeSize=(size=x)==null?sizeNode:null;return tree};tree.nodeSize=function(x){if(!arguments.length)return nodeSize?size:null;nodeSize=(size=x)==null?null:sizeNode;return tree};return d3_layout_hierarchyRebind(tree,hierarchy)};function d3_layout_treeSeparation(a,b){return a.parent==b.parent?1:2}function d3_layout_treeLeft(v){var children=v.children;return children.length?children[0]:v.t}function d3_layout_treeRight(v){var children=v.children,n;return(n=children.length)?children[n-1]:v.t}function d3_layout_treeMove(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift}function d3_layout_treeShift(v){var shift=0,change=0,children=v.children,i=children.length,w;while(--i>=0){w=children[i];w.z+=shift;w.m+=shift;shift+=w.s+(change+=w.c)}}function d3_layout_treeAncestor(vim,v,ancestor){return vim.a.parent===v.parent?vim.a:ancestor}d3.layout.cluster=function(){var hierarchy=d3.layout.hierarchy().sort(null).value(null),separation=d3_layout_treeSeparation,size=[1,1],nodeSize=false;function cluster(d,i){var nodes=hierarchy.call(this,d,i),root=nodes[0],previousNode,x=0;d3_layout_hierarchyVisitAfter(root,function(node){var children=node.children;if(children&&children.length){node.x=d3_layout_clusterX(children);node.y=d3_layout_clusterY(children)}else{node.x=previousNode?x+=separation(node,previousNode):0;node.y=0;previousNode=node}});var left=d3_layout_clusterLeft(root),right=d3_layout_clusterRight(root),x0=left.x-separation(left,right)/2,x1=right.x+separation(right,left)/2;d3_layout_hierarchyVisitAfter(root,nodeSize?function(node){node.x=(node.x-root.x)*size[0];node.y=(root.y-node.y)*size[1]}:function(node){node.x=(node.x-x0)/(x1-x0)*size[0];node.y=(1-(root.y?node.y/root.y:1))*size[1]});return nodes}cluster.separation=function(x){if(!arguments.length)return separation;separation=x;return cluster};cluster.size=function(x){if(!arguments.length)return nodeSize?null:size;nodeSize=(size=x)==null;return cluster};cluster.nodeSize=function(x){if(!arguments.length)return nodeSize?size:null;nodeSize=(size=x)!=null;return cluster};return d3_layout_hierarchyRebind(cluster,hierarchy)};function d3_layout_clusterY(children){return 1+d3.max(children,function(child){return child.y})}function d3_layout_clusterX(children){return children.reduce(function(x,child){return x+child.x},0)/children.length}function d3_layout_clusterLeft(node){var children=node.children;return children&&children.length?d3_layout_clusterLeft(children[0]):node}function d3_layout_clusterRight(node){var children=node.children,n;return children&&(n=children.length)?d3_layout_clusterRight(children[n-1]):node}d3.layout.treemap=function(){var hierarchy=d3.layout.hierarchy(),round=Math.round,size=[1,1],padding=null,pad=d3_layout_treemapPadNull,sticky=false,stickies,mode="squarify",ratio=.5*(1+Math.sqrt(5));function scale(children,k){var i=-1,n=children.length,child,area;while(++i<n){area=(child=children[i]).value*(k<0?0:k);child.area=isNaN(area)||area<=0?0:area}}function squarify(node){var children=node.children;if(children&&children.length){var rect=pad(node),row=[],remaining=children.slice(),child,best=Infinity,score,u=mode==="slice"?rect.dx:mode==="dice"?rect.dy:mode==="slice-dice"?node.depth&1?rect.dy:rect.dx:Math.min(rect.dx,rect.dy),n;scale(remaining,rect.dx*rect.dy/node.value);row.area=0;while((n=remaining.length)>0){row.push(child=remaining[n-1]);row.area+=child.area;if(mode!=="squarify"||(score=worst(row,u))<=best){remaining.pop();best=score}else{row.area-=row.pop().area;position(row,u,rect,false);u=Math.min(rect.dx,rect.dy);row.length=row.area=0;best=Infinity}}if(row.length){position(row,u,rect,true);row.length=row.area=0}children.forEach(squarify)}}function stickify(node){var children=node.children;if(children&&children.length){var rect=pad(node),remaining=children.slice(),child,row=[];scale(remaining,rect.dx*rect.dy/node.value);row.area=0;while(child=remaining.pop()){row.push(child);row.area+=child.area;if(child.z!=null){position(row,child.z?rect.dx:rect.dy,rect,!remaining.length);row.length=row.area=0}}children.forEach(stickify)}}function worst(row,u){var s=row.area,r,rmax=0,rmin=Infinity,i=-1,n=row.length;while(++i<n){if(!(r=row[i].area))continue;if(r<rmin)rmin=r;if(r>rmax)rmax=r}s*=s;u*=u;return s?Math.max(u*rmax*ratio/s,s/(u*rmin*ratio)):Infinity}function position(row,u,rect,flush){var i=-1,n=row.length,x=rect.x,y=rect.y,v=u?round(row.area/u):0,o;if(u==rect.dx){if(flush||v>rect.dy)v=rect.dy;while(++i<n){o=row[i];o.x=x;o.y=y;o.dy=v;x+=o.dx=Math.min(rect.x+rect.dx-x,v?round(o.area/v):0)}o.z=true;o.dx+=rect.x+rect.dx-x;rect.y+=v;rect.dy-=v}else{if(flush||v>rect.dx)v=rect.dx;while(++i<n){o=row[i];o.x=x;o.y=y;o.dx=v;y+=o.dy=Math.min(rect.y+rect.dy-y,v?round(o.area/v):0)}o.z=false;o.dy+=rect.y+rect.dy-y;rect.x+=v;rect.dx-=v}}function treemap(d){var nodes=stickies||hierarchy(d),root=nodes[0];root.x=0;root.y=0;root.dx=size[0];root.dy=size[1];if(stickies)hierarchy.revalue(root);scale([root],root.dx*root.dy/root.value);(stickies?stickify:squarify)(root);if(sticky)stickies=nodes;return nodes}treemap.size=function(x){if(!arguments.length)return size;size=x;return treemap};treemap.padding=function(x){if(!arguments.length)return padding;function padFunction(node){var p=x.call(treemap,node,node.depth);return p==null?d3_layout_treemapPadNull(node):d3_layout_treemapPad(node,typeof p==="number"?[p,p,p,p]:p)}function padConstant(node){return d3_layout_treemapPad(node,x)}var type;pad=(padding=x)==null?d3_layout_treemapPadNull:(type=typeof x)==="function"?padFunction:type==="number"?(x=[x,x,x,x],padConstant):padConstant;return treemap};treemap.round=function(x){if(!arguments.length)return round!=Number;round=x?Math.round:Number;return treemap};treemap.sticky=function(x){if(!arguments.length)return sticky;sticky=x;stickies=null;return treemap};treemap.ratio=function(x){if(!arguments.length)return ratio;ratio=x;return treemap};treemap.mode=function(x){if(!arguments.length)return mode;mode=x+"";return treemap};return d3_layout_hierarchyRebind(treemap,hierarchy)};function d3_layout_treemapPadNull(node){return{x:node.x,y:node.y,dx:node.dx,dy:node.dy}}function d3_layout_treemapPad(node,padding){var x=node.x+padding[3],y=node.y+padding[0],dx=node.dx-padding[1]-padding[3],dy=node.dy-padding[0]-padding[2];if(dx<0){x+=dx/2;dx=0}if(dy<0){y+=dy/2;dy=0}return{x:x,y:y,dx:dx,dy:dy}}d3.random={normal:function(µ,σ){var n=arguments.length;if(n<2)σ=1;if(n<1)µ=0;return function(){var x,y,r;do{x=Math.random()*2-1;y=Math.random()*2-1;r=x*x+y*y}while(!r||r>1);return µ+σ*x*Math.sqrt(-2*Math.log(r)/r)}},logNormal:function(){var random=d3.random.normal.apply(d3,arguments);return function(){return Math.exp(random())}},bates:function(m){var random=d3.random.irwinHall(m);return function(){return random()/m}},irwinHall:function(m){return function(){for(var s=0,j=0;j<m;j++)s+=Math.random();return s}}};d3.scale={};function d3_scaleExtent(domain){var start=domain[0],stop=domain[domain.length-1];return start<stop?[start,stop]:[stop,start]}function d3_scaleRange(scale){return scale.rangeExtent?scale.rangeExtent():d3_scaleExtent(scale.range())}function d3_scale_bilinear(domain,range,uninterpolate,interpolate){var u=uninterpolate(domain[0],domain[1]),i=interpolate(range[0],range[1]);return function(x){return i(u(x))}}function d3_scale_nice(domain,nice){var i0=0,i1=domain.length-1,x0=domain[i0],x1=domain[i1],dx;if(x1<x0){dx=i0,i0=i1,i1=dx;dx=x0,x0=x1,x1=dx}domain[i0]=nice.floor(x0);domain[i1]=nice.ceil(x1);return domain}function d3_scale_niceStep(step){return step?{floor:function(x){return Math.floor(x/step)*step},ceil:function(x){return Math.ceil(x/step)*step}}:d3_scale_niceIdentity}var d3_scale_niceIdentity={floor:d3_identity,ceil:d3_identity};function d3_scale_polylinear(domain,range,uninterpolate,interpolate){var u=[],i=[],j=0,k=Math.min(domain.length,range.length)-1;if(domain[k]<domain[0]){domain=domain.slice().reverse();range=range.slice().reverse()}while(++j<=k){u.push(uninterpolate(domain[j-1],domain[j]));i.push(interpolate(range[j-1],range[j]))}return function(x){var j=d3.bisect(domain,x,1,k)-1;return i[j](u[j](x))}}d3.scale.linear=function(){return d3_scale_linear([0,1],[0,1],d3_interpolate,false)};function d3_scale_linear(domain,range,interpolate,clamp){var output,input;function rescale(){var linear=Math.min(domain.length,range.length)>2?d3_scale_polylinear:d3_scale_bilinear,uninterpolate=clamp?d3_uninterpolateClamp:d3_uninterpolateNumber;output=linear(domain,range,uninterpolate,interpolate);input=linear(range,domain,uninterpolate,d3_interpolate);return scale}function scale(x){return output(x)}scale.invert=function(y){return input(y)};scale.domain=function(x){if(!arguments.length)return domain;domain=x.map(Number);return rescale()};scale.range=function(x){if(!arguments.length)return range;range=x;return rescale()};scale.rangeRound=function(x){return scale.range(x).interpolate(d3_interpolateRound)};scale.clamp=function(x){if(!arguments.length)return clamp;clamp=x;return rescale()};scale.interpolate=function(x){if(!arguments.length)return interpolate;interpolate=x;return rescale()};scale.ticks=function(m){return d3_scale_linearTicks(domain,m)};scale.tickFormat=function(m,format){return d3_scale_linearTickFormat(domain,m,format)};scale.nice=function(m){d3_scale_linearNice(domain,m);return rescale()};scale.copy=function(){return d3_scale_linear(domain,range,interpolate,clamp)};return rescale()}function d3_scale_linearRebind(scale,linear){return d3.rebind(scale,linear,"range","rangeRound","interpolate","clamp")}function d3_scale_linearNice(domain,m){return d3_scale_nice(domain,d3_scale_niceStep(d3_scale_linearTickRange(domain,m)[2]))}function d3_scale_linearTickRange(domain,m){if(m==null)m=10;var extent=d3_scaleExtent(domain),span=extent[1]-extent[0],step=Math.pow(10,Math.floor(Math.log(span/m)/Math.LN10)),err=m/span*step;if(err<=.15)step*=10;else if(err<=.35)step*=5;else if(err<=.75)step*=2;extent[0]=Math.ceil(extent[0]/step)*step;extent[1]=Math.floor(extent[1]/step)*step+step*.5;extent[2]=step;return extent}function d3_scale_linearTicks(domain,m){return d3.range.apply(d3,d3_scale_linearTickRange(domain,m))}function d3_scale_linearTickFormat(domain,m,format){var range=d3_scale_linearTickRange(domain,m);if(format){var match=d3_format_re.exec(format);match.shift();if(match[8]==="s"){var prefix=d3.formatPrefix(Math.max(abs(range[0]),abs(range[1])));if(!match[7])match[7]="."+d3_scale_linearPrecision(prefix.scale(range[2]));match[8]="f";format=d3.format(match.join(""));return function(d){return format(prefix.scale(d))+prefix.symbol}}if(!match[7])match[7]="."+d3_scale_linearFormatPrecision(match[8],range);format=match.join("")}else{format=",."+d3_scale_linearPrecision(range[2])+"f"}return d3.format(format)}var d3_scale_linearFormatSignificant={s:1,g:1,p:1,r:1,e:1};function d3_scale_linearPrecision(value){return-Math.floor(Math.log(value)/Math.LN10+.01)}function d3_scale_linearFormatPrecision(type,range){var p=d3_scale_linearPrecision(range[2]);return type in d3_scale_linearFormatSignificant?Math.abs(p-d3_scale_linearPrecision(Math.max(abs(range[0]),abs(range[1]))))+ +(type!=="e"):p-(type==="%")*2}d3.scale.log=function(){return d3_scale_log(d3.scale.linear().domain([0,1]),10,true,[1,10])};function d3_scale_log(linear,base,positive,domain){function log(x){return(positive?Math.log(x<0?0:x):-Math.log(x>0?0:-x))/Math.log(base)}function pow(x){return positive?Math.pow(base,x):-Math.pow(base,-x)}function scale(x){return linear(log(x))}scale.invert=function(x){return pow(linear.invert(x))};scale.domain=function(x){if(!arguments.length)return domain;positive=x[0]>=0;linear.domain((domain=x.map(Number)).map(log));return scale};scale.base=function(_){if(!arguments.length)return base;base=+_;linear.domain(domain.map(log));return scale};scale.nice=function(){var niced=d3_scale_nice(domain.map(log),positive?Math:d3_scale_logNiceNegative);linear.domain(niced);domain=niced.map(pow);return scale};scale.ticks=function(){var extent=d3_scaleExtent(domain),ticks=[],u=extent[0],v=extent[1],i=Math.floor(log(u)),j=Math.ceil(log(v)),n=base%1?2:base;if(isFinite(j-i)){if(positive){for(;i<j;i++)for(var k=1;k<n;k++)ticks.push(pow(i)*k);ticks.push(pow(i))}else{ticks.push(pow(i));for(;i++<j;)for(var k=n-1;k>0;k--)ticks.push(pow(i)*k)}for(i=0;ticks[i]<u;i++){}for(j=ticks.length;ticks[j-1]>v;j--){}ticks=ticks.slice(i,j)}return ticks};scale.tickFormat=function(n,format){if(!arguments.length)return d3_scale_logFormat;if(arguments.length<2)format=d3_scale_logFormat;else if(typeof format!=="function")format=d3.format(format);var k=Math.max(.1,n/scale.ticks().length),f=positive?(e=1e-12,Math.ceil):(e=-1e-12,Math.floor),e;return function(d){return d/pow(f(log(d)+e))<=k?format(d):""}};scale.copy=function(){return d3_scale_log(linear.copy(),base,positive,domain)};return d3_scale_linearRebind(scale,linear)}var d3_scale_logFormat=d3.format(".0e"),d3_scale_logNiceNegative={floor:function(x){return-Math.ceil(-x)},ceil:function(x){return-Math.floor(-x)}};d3.scale.pow=function(){return d3_scale_pow(d3.scale.linear(),1,[0,1])};function d3_scale_pow(linear,exponent,domain){var powp=d3_scale_powPow(exponent),powb=d3_scale_powPow(1/exponent);function scale(x){return linear(powp(x))}scale.invert=function(x){return powb(linear.invert(x))};scale.domain=function(x){if(!arguments.length)return domain;linear.domain((domain=x.map(Number)).map(powp));return scale};scale.ticks=function(m){return d3_scale_linearTicks(domain,m)};scale.tickFormat=function(m,format){return d3_scale_linearTickFormat(domain,m,format)};scale.nice=function(m){return scale.domain(d3_scale_linearNice(domain,m))};scale.exponent=function(x){if(!arguments.length)return exponent;powp=d3_scale_powPow(exponent=x);powb=d3_scale_powPow(1/exponent);linear.domain(domain.map(powp));return scale};scale.copy=function(){return d3_scale_pow(linear.copy(),exponent,domain)};return d3_scale_linearRebind(scale,linear)}function d3_scale_powPow(e){return function(x){return x<0?-Math.pow(-x,e):Math.pow(x,e)}}d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)};d3.scale.ordinal=function(){return d3_scale_ordinal([],{t:"range",a:[[]]})};function d3_scale_ordinal(domain,ranger){var index,range,rangeBand;function scale(x){return range[((index.get(x)||(ranger.t==="range"?index.set(x,domain.push(x)):NaN))-1)%range.length]}function steps(start,step){return d3.range(domain.length).map(function(i){return start+step*i})}scale.domain=function(x){if(!arguments.length)return domain;domain=[];index=new d3_Map;var i=-1,n=x.length,xi;while(++i<n)if(!index.has(xi=x[i]))index.set(xi,domain.push(xi));return scale[ranger.t].apply(scale,ranger.a)};scale.range=function(x){if(!arguments.length)return range;range=x;rangeBand=0;ranger={t:"range",a:arguments};return scale};scale.rangePoints=function(x,padding){if(arguments.length<2)padding=0;var start=x[0],stop=x[1],step=(stop-start)/(Math.max(1,domain.length-1)+padding);range=steps(domain.length<2?(start+stop)/2:start+step*padding/2,step);rangeBand=0;ranger={t:"rangePoints",a:arguments};return scale};scale.rangeBands=function(x,padding,outerPadding){if(arguments.length<2)padding=0;if(arguments.length<3)outerPadding=padding;var reverse=x[1]<x[0],start=x[reverse-0],stop=x[1-reverse],step=(stop-start)/(domain.length-padding+2*outerPadding);range=steps(start+step*outerPadding,step);if(reverse)range.reverse();rangeBand=step*(1-padding);ranger={t:"rangeBands",a:arguments};return scale};scale.rangeRoundBands=function(x,padding,outerPadding){if(arguments.length<2)padding=0;if(arguments.length<3)outerPadding=padding;var reverse=x[1]<x[0],start=x[reverse-0],stop=x[1-reverse],step=Math.floor((stop-start)/(domain.length-padding+2*outerPadding)),error=stop-start-(domain.length-padding)*step;range=steps(start+Math.round(error/2),step);if(reverse)range.reverse();rangeBand=Math.round(step*(1-padding));ranger={t:"rangeRoundBands",a:arguments};return scale};scale.rangeBand=function(){return rangeBand};scale.rangeExtent=function(){return d3_scaleExtent(ranger.a[0])};scale.copy=function(){return d3_scale_ordinal(domain,ranger)};return scale.domain(domain)}d3.scale.category10=function(){return d3.scale.ordinal().range(d3_category10)};d3.scale.category20=function(){return d3.scale.ordinal().range(d3_category20)};d3.scale.category20b=function(){return d3.scale.ordinal().range(d3_category20b)};d3.scale.category20c=function(){return d3.scale.ordinal().range(d3_category20c)};var d3_category10=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(d3_rgbString);var d3_category20=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(d3_rgbString);var d3_category20b=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(d3_rgbString);var d3_category20c=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(d3_rgbString);d3.scale.quantile=function(){return d3_scale_quantile([],[])};function d3_scale_quantile(domain,range){var thresholds;function rescale(){var k=0,q=range.length;thresholds=[];while(++k<q)thresholds[k-1]=d3.quantile(domain,k/q);return scale}function scale(x){if(!isNaN(x=+x))return range[d3.bisect(thresholds,x)]}scale.domain=function(x){if(!arguments.length)return domain;domain=x.filter(d3_number).sort(d3_ascending);return rescale()};scale.range=function(x){if(!arguments.length)return range;range=x;return rescale()};scale.quantiles=function(){return thresholds};scale.invertExtent=function(y){y=range.indexOf(y);return y<0?[NaN,NaN]:[y>0?thresholds[y-1]:domain[0],y<thresholds.length?thresholds[y]:domain[domain.length-1]]};scale.copy=function(){return d3_scale_quantile(domain,range)};return rescale()}d3.scale.quantize=function(){return d3_scale_quantize(0,1,[0,1])};function d3_scale_quantize(x0,x1,range){var kx,i;function scale(x){return range[Math.max(0,Math.min(i,Math.floor(kx*(x-x0))))]}function rescale(){kx=range.length/(x1-x0);i=range.length-1;return scale}scale.domain=function(x){if(!arguments.length)return[x0,x1];x0=+x[0];x1=+x[x.length-1];return rescale()};scale.range=function(x){if(!arguments.length)return range;range=x;return rescale()};scale.invertExtent=function(y){y=range.indexOf(y);y=y<0?NaN:y/kx+x0;return[y,y+1/kx]};scale.copy=function(){return d3_scale_quantize(x0,x1,range)};return rescale()}d3.scale.threshold=function(){return d3_scale_threshold([.5],[0,1])};function d3_scale_threshold(domain,range){function scale(x){if(x<=x)return range[d3.bisect(domain,x)]}scale.domain=function(_){if(!arguments.length)return domain;domain=_;return scale};scale.range=function(_){if(!arguments.length)return range;range=_;return scale};scale.invertExtent=function(y){y=range.indexOf(y);return[domain[y-1],domain[y]]};scale.copy=function(){return d3_scale_threshold(domain,range)};return scale}d3.scale.identity=function(){return d3_scale_identity([0,1])};function d3_scale_identity(domain){function identity(x){return+x}identity.invert=identity;identity.domain=identity.range=function(x){if(!arguments.length)return domain;domain=x.map(identity);return identity};identity.ticks=function(m){return d3_scale_linearTicks(domain,m)};identity.tickFormat=function(m,format){return d3_scale_linearTickFormat(domain,m,format)};identity.copy=function(){return d3_scale_identity(domain)};return identity}d3.svg={};d3.svg.arc=function(){var innerRadius=d3_svg_arcInnerRadius,outerRadius=d3_svg_arcOuterRadius,startAngle=d3_svg_arcStartAngle,endAngle=d3_svg_arcEndAngle;function arc(){var r0=innerRadius.apply(this,arguments),r1=outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)+d3_svg_arcOffset,a1=endAngle.apply(this,arguments)+d3_svg_arcOffset,da=(a1<a0&&(da=a0,a0=a1,a1=da),a1-a0),df=da<π?"0":"1",c0=Math.cos(a0),s0=Math.sin(a0),c1=Math.cos(a1),s1=Math.sin(a1);return da>=d3_svg_arcMax?r0?"M0,"+r1+"A"+r1+","+r1+" 0 1,1 0,"+-r1+"A"+r1+","+r1+" 0 1,1 0,"+r1+"M0,"+r0+"A"+r0+","+r0+" 0 1,0 0,"+-r0+"A"+r0+","+r0+" 0 1,0 0,"+r0+"Z":"M0,"+r1+"A"+r1+","+r1+" 0 1,1 0,"+-r1+"A"+r1+","+r1+" 0 1,1 0,"+r1+"Z":r0?"M"+r1*c0+","+r1*s0+"A"+r1+","+r1+" 0 "+df+",1 "+r1*c1+","+r1*s1+"L"+r0*c1+","+r0*s1+"A"+r0+","+r0+" 0 "+df+",0 "+r0*c0+","+r0*s0+"Z":"M"+r1*c0+","+r1*s0+"A"+r1+","+r1+" 0 "+df+",1 "+r1*c1+","+r1*s1+"L0,0"+"Z"}arc.innerRadius=function(v){if(!arguments.length)return innerRadius;innerRadius=d3_functor(v);
  return arc};arc.outerRadius=function(v){if(!arguments.length)return outerRadius;outerRadius=d3_functor(v);return arc};arc.startAngle=function(v){if(!arguments.length)return startAngle;startAngle=d3_functor(v);return arc};arc.endAngle=function(v){if(!arguments.length)return endAngle;endAngle=d3_functor(v);return arc};arc.centroid=function(){var r=(innerRadius.apply(this,arguments)+outerRadius.apply(this,arguments))/2,a=(startAngle.apply(this,arguments)+endAngle.apply(this,arguments))/2+d3_svg_arcOffset;return[Math.cos(a)*r,Math.sin(a)*r]};return arc};var d3_svg_arcOffset=-halfπ,d3_svg_arcMax=τ-ε;function d3_svg_arcInnerRadius(d){return d.innerRadius}function d3_svg_arcOuterRadius(d){return d.outerRadius}function d3_svg_arcStartAngle(d){return d.startAngle}function d3_svg_arcEndAngle(d){return d.endAngle}function d3_svg_line(projection){var x=d3_geom_pointX,y=d3_geom_pointY,defined=d3_true,interpolate=d3_svg_lineLinear,interpolateKey=interpolate.key,tension=.7;function line(data){var segments=[],points=[],i=-1,n=data.length,d,fx=d3_functor(x),fy=d3_functor(y);function segment(){segments.push("M",interpolate(projection(points),tension))}while(++i<n){if(defined.call(this,d=data[i],i)){points.push([+fx.call(this,d,i),+fy.call(this,d,i)])}else if(points.length){segment();points=[]}}if(points.length)segment();return segments.length?segments.join(""):null}line.x=function(_){if(!arguments.length)return x;x=_;return line};line.y=function(_){if(!arguments.length)return y;y=_;return line};line.defined=function(_){if(!arguments.length)return defined;defined=_;return line};line.interpolate=function(_){if(!arguments.length)return interpolateKey;if(typeof _==="function")interpolateKey=interpolate=_;else interpolateKey=(interpolate=d3_svg_lineInterpolators.get(_)||d3_svg_lineLinear).key;return line};line.tension=function(_){if(!arguments.length)return tension;tension=_;return line};return line}d3.svg.line=function(){return d3_svg_line(d3_identity)};var d3_svg_lineInterpolators=d3.map({linear:d3_svg_lineLinear,"linear-closed":d3_svg_lineLinearClosed,step:d3_svg_lineStep,"step-before":d3_svg_lineStepBefore,"step-after":d3_svg_lineStepAfter,basis:d3_svg_lineBasis,"basis-open":d3_svg_lineBasisOpen,"basis-closed":d3_svg_lineBasisClosed,bundle:d3_svg_lineBundle,cardinal:d3_svg_lineCardinal,"cardinal-open":d3_svg_lineCardinalOpen,"cardinal-closed":d3_svg_lineCardinalClosed,monotone:d3_svg_lineMonotone});d3_svg_lineInterpolators.forEach(function(key,value){value.key=key;value.closed=/-closed$/.test(key)});function d3_svg_lineLinear(points){return points.join("L")}function d3_svg_lineLinearClosed(points){return d3_svg_lineLinear(points)+"Z"}function d3_svg_lineStep(points){var i=0,n=points.length,p=points[0],path=[p[0],",",p[1]];while(++i<n)path.push("H",(p[0]+(p=points[i])[0])/2,"V",p[1]);if(n>1)path.push("H",p[0]);return path.join("")}function d3_svg_lineStepBefore(points){var i=0,n=points.length,p=points[0],path=[p[0],",",p[1]];while(++i<n)path.push("V",(p=points[i])[1],"H",p[0]);return path.join("")}function d3_svg_lineStepAfter(points){var i=0,n=points.length,p=points[0],path=[p[0],",",p[1]];while(++i<n)path.push("H",(p=points[i])[0],"V",p[1]);return path.join("")}function d3_svg_lineCardinalOpen(points,tension){return points.length<4?d3_svg_lineLinear(points):points[1]+d3_svg_lineHermite(points.slice(1,points.length-1),d3_svg_lineCardinalTangents(points,tension))}function d3_svg_lineCardinalClosed(points,tension){return points.length<3?d3_svg_lineLinear(points):points[0]+d3_svg_lineHermite((points.push(points[0]),points),d3_svg_lineCardinalTangents([points[points.length-2]].concat(points,[points[1]]),tension))}function d3_svg_lineCardinal(points,tension){return points.length<3?d3_svg_lineLinear(points):points[0]+d3_svg_lineHermite(points,d3_svg_lineCardinalTangents(points,tension))}function d3_svg_lineHermite(points,tangents){if(tangents.length<1||points.length!=tangents.length&&points.length!=tangents.length+2){return d3_svg_lineLinear(points)}var quad=points.length!=tangents.length,path="",p0=points[0],p=points[1],t0=tangents[0],t=t0,pi=1;if(quad){path+="Q"+(p[0]-t0[0]*2/3)+","+(p[1]-t0[1]*2/3)+","+p[0]+","+p[1];p0=points[1];pi=2}if(tangents.length>1){t=tangents[1];p=points[pi];pi++;path+="C"+(p0[0]+t0[0])+","+(p0[1]+t0[1])+","+(p[0]-t[0])+","+(p[1]-t[1])+","+p[0]+","+p[1];for(var i=2;i<tangents.length;i++,pi++){p=points[pi];t=tangents[i];path+="S"+(p[0]-t[0])+","+(p[1]-t[1])+","+p[0]+","+p[1]}}if(quad){var lp=points[pi];path+="Q"+(p[0]+t[0]*2/3)+","+(p[1]+t[1]*2/3)+","+lp[0]+","+lp[1]}return path}function d3_svg_lineCardinalTangents(points,tension){var tangents=[],a=(1-tension)/2,p0,p1=points[0],p2=points[1],i=1,n=points.length;while(++i<n){p0=p1;p1=p2;p2=points[i];tangents.push([a*(p2[0]-p0[0]),a*(p2[1]-p0[1])])}return tangents}function d3_svg_lineBasis(points){if(points.length<3)return d3_svg_lineLinear(points);var i=1,n=points.length,pi=points[0],x0=pi[0],y0=pi[1],px=[x0,x0,x0,(pi=points[1])[0]],py=[y0,y0,y0,pi[1]],path=[x0,",",y0,"L",d3_svg_lineDot4(d3_svg_lineBasisBezier3,px),",",d3_svg_lineDot4(d3_svg_lineBasisBezier3,py)];points.push(points[n-1]);while(++i<=n){pi=points[i];px.shift();px.push(pi[0]);py.shift();py.push(pi[1]);d3_svg_lineBasisBezier(path,px,py)}points.pop();path.push("L",pi);return path.join("")}function d3_svg_lineBasisOpen(points){if(points.length<4)return d3_svg_lineLinear(points);var path=[],i=-1,n=points.length,pi,px=[0],py=[0];while(++i<3){pi=points[i];px.push(pi[0]);py.push(pi[1])}path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3,px)+","+d3_svg_lineDot4(d3_svg_lineBasisBezier3,py));--i;while(++i<n){pi=points[i];px.shift();px.push(pi[0]);py.shift();py.push(pi[1]);d3_svg_lineBasisBezier(path,px,py)}return path.join("")}function d3_svg_lineBasisClosed(points){var path,i=-1,n=points.length,m=n+4,pi,px=[],py=[];while(++i<4){pi=points[i%n];px.push(pi[0]);py.push(pi[1])}path=[d3_svg_lineDot4(d3_svg_lineBasisBezier3,px),",",d3_svg_lineDot4(d3_svg_lineBasisBezier3,py)];--i;while(++i<m){pi=points[i%n];px.shift();px.push(pi[0]);py.shift();py.push(pi[1]);d3_svg_lineBasisBezier(path,px,py)}return path.join("")}function d3_svg_lineBundle(points,tension){var n=points.length-1;if(n){var x0=points[0][0],y0=points[0][1],dx=points[n][0]-x0,dy=points[n][1]-y0,i=-1,p,t;while(++i<=n){p=points[i];t=i/n;p[0]=tension*p[0]+(1-tension)*(x0+t*dx);p[1]=tension*p[1]+(1-tension)*(y0+t*dy)}}return d3_svg_lineBasis(points)}function d3_svg_lineDot4(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}var d3_svg_lineBasisBezier1=[0,2/3,1/3,0],d3_svg_lineBasisBezier2=[0,1/3,2/3,0],d3_svg_lineBasisBezier3=[0,1/6,2/3,1/6];function d3_svg_lineBasisBezier(path,x,y){path.push("C",d3_svg_lineDot4(d3_svg_lineBasisBezier1,x),",",d3_svg_lineDot4(d3_svg_lineBasisBezier1,y),",",d3_svg_lineDot4(d3_svg_lineBasisBezier2,x),",",d3_svg_lineDot4(d3_svg_lineBasisBezier2,y),",",d3_svg_lineDot4(d3_svg_lineBasisBezier3,x),",",d3_svg_lineDot4(d3_svg_lineBasisBezier3,y))}function d3_svg_lineSlope(p0,p1){return(p1[1]-p0[1])/(p1[0]-p0[0])}function d3_svg_lineFiniteDifferences(points){var i=0,j=points.length-1,m=[],p0=points[0],p1=points[1],d=m[0]=d3_svg_lineSlope(p0,p1);while(++i<j){m[i]=(d+(d=d3_svg_lineSlope(p0=p1,p1=points[i+1])))/2}m[i]=d;return m}function d3_svg_lineMonotoneTangents(points){var tangents=[],d,a,b,s,m=d3_svg_lineFiniteDifferences(points),i=-1,j=points.length-1;while(++i<j){d=d3_svg_lineSlope(points[i],points[i+1]);if(abs(d)<ε){m[i]=m[i+1]=0}else{a=m[i]/d;b=m[i+1]/d;s=a*a+b*b;if(s>9){s=d*3/Math.sqrt(s);m[i]=s*a;m[i+1]=s*b}}}i=-1;while(++i<=j){s=(points[Math.min(j,i+1)][0]-points[Math.max(0,i-1)][0])/(6*(1+m[i]*m[i]));tangents.push([s||0,m[i]*s||0])}return tangents}function d3_svg_lineMonotone(points){return points.length<3?d3_svg_lineLinear(points):points[0]+d3_svg_lineHermite(points,d3_svg_lineMonotoneTangents(points))}d3.svg.line.radial=function(){var line=d3_svg_line(d3_svg_lineRadial);line.radius=line.x,delete line.x;line.angle=line.y,delete line.y;return line};function d3_svg_lineRadial(points){var point,i=-1,n=points.length,r,a;while(++i<n){point=points[i];r=point[0];a=point[1]+d3_svg_arcOffset;point[0]=r*Math.cos(a);point[1]=r*Math.sin(a)}return points}function d3_svg_area(projection){var x0=d3_geom_pointX,x1=d3_geom_pointX,y0=0,y1=d3_geom_pointY,defined=d3_true,interpolate=d3_svg_lineLinear,interpolateKey=interpolate.key,interpolateReverse=interpolate,L="L",tension=.7;function area(data){var segments=[],points0=[],points1=[],i=-1,n=data.length,d,fx0=d3_functor(x0),fy0=d3_functor(y0),fx1=x0===x1?function(){return x}:d3_functor(x1),fy1=y0===y1?function(){return y}:d3_functor(y1),x,y;function segment(){segments.push("M",interpolate(projection(points1),tension),L,interpolateReverse(projection(points0.reverse()),tension),"Z")}while(++i<n){if(defined.call(this,d=data[i],i)){points0.push([x=+fx0.call(this,d,i),y=+fy0.call(this,d,i)]);points1.push([+fx1.call(this,d,i),+fy1.call(this,d,i)])}else if(points0.length){segment();points0=[];points1=[]}}if(points0.length)segment();return segments.length?segments.join(""):null}area.x=function(_){if(!arguments.length)return x1;x0=x1=_;return area};area.x0=function(_){if(!arguments.length)return x0;x0=_;return area};area.x1=function(_){if(!arguments.length)return x1;x1=_;return area};area.y=function(_){if(!arguments.length)return y1;y0=y1=_;return area};area.y0=function(_){if(!arguments.length)return y0;y0=_;return area};area.y1=function(_){if(!arguments.length)return y1;y1=_;return area};area.defined=function(_){if(!arguments.length)return defined;defined=_;return area};area.interpolate=function(_){if(!arguments.length)return interpolateKey;if(typeof _==="function")interpolateKey=interpolate=_;else interpolateKey=(interpolate=d3_svg_lineInterpolators.get(_)||d3_svg_lineLinear).key;interpolateReverse=interpolate.reverse||interpolate;L=interpolate.closed?"M":"L";return area};area.tension=function(_){if(!arguments.length)return tension;tension=_;return area};return area}d3_svg_lineStepBefore.reverse=d3_svg_lineStepAfter;d3_svg_lineStepAfter.reverse=d3_svg_lineStepBefore;d3.svg.area=function(){return d3_svg_area(d3_identity)};d3.svg.area.radial=function(){var area=d3_svg_area(d3_svg_lineRadial);area.radius=area.x,delete area.x;area.innerRadius=area.x0,delete area.x0;area.outerRadius=area.x1,delete area.x1;area.angle=area.y,delete area.y;area.startAngle=area.y0,delete area.y0;area.endAngle=area.y1,delete area.y1;return area};d3.svg.chord=function(){var source=d3_source,target=d3_target,radius=d3_svg_chordRadius,startAngle=d3_svg_arcStartAngle,endAngle=d3_svg_arcEndAngle;function chord(d,i){var s=subgroup(this,source,d,i),t=subgroup(this,target,d,i);return"M"+s.p0+arc(s.r,s.p1,s.a1-s.a0)+(equals(s,t)?curve(s.r,s.p1,s.r,s.p0):curve(s.r,s.p1,t.r,t.p0)+arc(t.r,t.p1,t.a1-t.a0)+curve(t.r,t.p1,s.r,s.p0))+"Z"}function subgroup(self,f,d,i){var subgroup=f.call(self,d,i),r=radius.call(self,subgroup,i),a0=startAngle.call(self,subgroup,i)+d3_svg_arcOffset,a1=endAngle.call(self,subgroup,i)+d3_svg_arcOffset;return{r:r,a0:a0,a1:a1,p0:[r*Math.cos(a0),r*Math.sin(a0)],p1:[r*Math.cos(a1),r*Math.sin(a1)]}}function equals(a,b){return a.a0==b.a0&&a.a1==b.a1}function arc(r,p,a){return"A"+r+","+r+" 0 "+ +(a>π)+",1 "+p}function curve(r0,p0,r1,p1){return"Q 0,0 "+p1}chord.radius=function(v){if(!arguments.length)return radius;radius=d3_functor(v);return chord};chord.source=function(v){if(!arguments.length)return source;source=d3_functor(v);return chord};chord.target=function(v){if(!arguments.length)return target;target=d3_functor(v);return chord};chord.startAngle=function(v){if(!arguments.length)return startAngle;startAngle=d3_functor(v);return chord};chord.endAngle=function(v){if(!arguments.length)return endAngle;endAngle=d3_functor(v);return chord};return chord};function d3_svg_chordRadius(d){return d.radius}d3.svg.diagonal=function(){var source=d3_source,target=d3_target,projection=d3_svg_diagonalProjection;function diagonal(d,i){var p0=source.call(this,d,i),p3=target.call(this,d,i),m=(p0.y+p3.y)/2,p=[p0,{x:p0.x,y:m},{x:p3.x,y:m},p3];p=p.map(projection);return"M"+p[0]+"C"+p[1]+" "+p[2]+" "+p[3]}diagonal.source=function(x){if(!arguments.length)return source;source=d3_functor(x);return diagonal};diagonal.target=function(x){if(!arguments.length)return target;target=d3_functor(x);return diagonal};diagonal.projection=function(x){if(!arguments.length)return projection;projection=x;return diagonal};return diagonal};function d3_svg_diagonalProjection(d){return[d.x,d.y]}d3.svg.diagonal.radial=function(){var diagonal=d3.svg.diagonal(),projection=d3_svg_diagonalProjection,projection_=diagonal.projection;diagonal.projection=function(x){return arguments.length?projection_(d3_svg_diagonalRadialProjection(projection=x)):projection};return diagonal};function d3_svg_diagonalRadialProjection(projection){return function(){var d=projection.apply(this,arguments),r=d[0],a=d[1]+d3_svg_arcOffset;return[r*Math.cos(a),r*Math.sin(a)]}}d3.svg.symbol=function(){var type=d3_svg_symbolType,size=d3_svg_symbolSize;function symbol(d,i){return(d3_svg_symbols.get(type.call(this,d,i))||d3_svg_symbolCircle)(size.call(this,d,i))}symbol.type=function(x){if(!arguments.length)return type;type=d3_functor(x);return symbol};symbol.size=function(x){if(!arguments.length)return size;size=d3_functor(x);return symbol};return symbol};function d3_svg_symbolSize(){return 64}function d3_svg_symbolType(){return"circle"}function d3_svg_symbolCircle(size){var r=Math.sqrt(size/π);return"M0,"+r+"A"+r+","+r+" 0 1,1 0,"+-r+"A"+r+","+r+" 0 1,1 0,"+r+"Z"}var d3_svg_symbols=d3.map({circle:d3_svg_symbolCircle,cross:function(size){var r=Math.sqrt(size/5)/2;return"M"+-3*r+","+-r+"H"+-r+"V"+-3*r+"H"+r+"V"+-r+"H"+3*r+"V"+r+"H"+r+"V"+3*r+"H"+-r+"V"+r+"H"+-3*r+"Z"},diamond:function(size){var ry=Math.sqrt(size/(2*d3_svg_symbolTan30)),rx=ry*d3_svg_symbolTan30;return"M0,"+-ry+"L"+rx+",0"+" 0,"+ry+" "+-rx+",0"+"Z"},square:function(size){var r=Math.sqrt(size)/2;return"M"+-r+","+-r+"L"+r+","+-r+" "+r+","+r+" "+-r+","+r+"Z"},"triangle-down":function(size){var rx=Math.sqrt(size/d3_svg_symbolSqrt3),ry=rx*d3_svg_symbolSqrt3/2;return"M0,"+ry+"L"+rx+","+-ry+" "+-rx+","+-ry+"Z"},"triangle-up":function(size){var rx=Math.sqrt(size/d3_svg_symbolSqrt3),ry=rx*d3_svg_symbolSqrt3/2;return"M0,"+-ry+"L"+rx+","+ry+" "+-rx+","+ry+"Z"}});d3.svg.symbolTypes=d3_svg_symbols.keys();var d3_svg_symbolSqrt3=Math.sqrt(3),d3_svg_symbolTan30=Math.tan(30*d3_radians);function d3_transition(groups,id){d3_subclass(groups,d3_transitionPrototype);groups.id=id;return groups}var d3_transitionPrototype=[],d3_transitionId=0,d3_transitionInheritId,d3_transitionInherit;d3_transitionPrototype.call=d3_selectionPrototype.call;d3_transitionPrototype.empty=d3_selectionPrototype.empty;d3_transitionPrototype.node=d3_selectionPrototype.node;d3_transitionPrototype.size=d3_selectionPrototype.size;d3.transition=function(selection){return arguments.length?d3_transitionInheritId?selection.transition():selection:d3_selectionRoot.transition()};d3.transition.prototype=d3_transitionPrototype;d3_transitionPrototype.select=function(selector){var id=this.id,subgroups=[],subgroup,subnode,node;selector=d3_selection_selector(selector);for(var j=-1,m=this.length;++j<m;){subgroups.push(subgroup=[]);for(var group=this[j],i=-1,n=group.length;++i<n;){if((node=group[i])&&(subnode=selector.call(node,node.__data__,i,j))){if("__data__"in node)subnode.__data__=node.__data__;d3_transitionNode(subnode,i,id,node.__transition__[id]);subgroup.push(subnode)}else{subgroup.push(null)}}}return d3_transition(subgroups,id)};d3_transitionPrototype.selectAll=function(selector){var id=this.id,subgroups=[],subgroup,subnodes,node,subnode,transition;selector=d3_selection_selectorAll(selector);for(var j=-1,m=this.length;++j<m;){for(var group=this[j],i=-1,n=group.length;++i<n;){if(node=group[i]){transition=node.__transition__[id];subnodes=selector.call(node,node.__data__,i,j);subgroups.push(subgroup=[]);for(var k=-1,o=subnodes.length;++k<o;){if(subnode=subnodes[k])d3_transitionNode(subnode,k,id,transition);subgroup.push(subnode)}}}}return d3_transition(subgroups,id)};d3_transitionPrototype.filter=function(filter){var subgroups=[],subgroup,group,node;if(typeof filter!=="function")filter=d3_selection_filter(filter);for(var j=0,m=this.length;j<m;j++){subgroups.push(subgroup=[]);for(var group=this[j],i=0,n=group.length;i<n;i++){if((node=group[i])&&filter.call(node,node.__data__,i,j)){subgroup.push(node)}}}return d3_transition(subgroups,this.id)};d3_transitionPrototype.tween=function(name,tween){var id=this.id;if(arguments.length<2)return this.node().__transition__[id].tween.get(name);return d3_selection_each(this,tween==null?function(node){node.__transition__[id].tween.remove(name)}:function(node){node.__transition__[id].tween.set(name,tween)})};function d3_transition_tween(groups,name,value,tween){var id=groups.id;return d3_selection_each(groups,typeof value==="function"?function(node,i,j){node.__transition__[id].tween.set(name,tween(value.call(node,node.__data__,i,j)))}:(value=tween(value),function(node){node.__transition__[id].tween.set(name,value)}))}d3_transitionPrototype.attr=function(nameNS,value){if(arguments.length<2){for(value in nameNS)this.attr(value,nameNS[value]);return this}var interpolate=nameNS=="transform"?d3_interpolateTransform:d3_interpolate,name=d3.ns.qualify(nameNS);function attrNull(){this.removeAttribute(name)}function attrNullNS(){this.removeAttributeNS(name.space,name.local)}function attrTween(b){return b==null?attrNull:(b+="",function(){var a=this.getAttribute(name),i;return a!==b&&(i=interpolate(a,b),function(t){this.setAttribute(name,i(t))})})}function attrTweenNS(b){return b==null?attrNullNS:(b+="",function(){var a=this.getAttributeNS(name.space,name.local),i;return a!==b&&(i=interpolate(a,b),function(t){this.setAttributeNS(name.space,name.local,i(t))})})}return d3_transition_tween(this,"attr."+nameNS,value,name.local?attrTweenNS:attrTween)};d3_transitionPrototype.attrTween=function(nameNS,tween){var name=d3.ns.qualify(nameNS);function attrTween(d,i){var f=tween.call(this,d,i,this.getAttribute(name));return f&&function(t){this.setAttribute(name,f(t))}}function attrTweenNS(d,i){var f=tween.call(this,d,i,this.getAttributeNS(name.space,name.local));return f&&function(t){this.setAttributeNS(name.space,name.local,f(t))}}return this.tween("attr."+nameNS,name.local?attrTweenNS:attrTween)};d3_transitionPrototype.style=function(name,value,priority){var n=arguments.length;if(n<3){if(typeof name!=="string"){if(n<2)value="";for(priority in name)this.style(priority,name[priority],value);return this}priority=""}function styleNull(){this.style.removeProperty(name)}function styleString(b){return b==null?styleNull:(b+="",function(){var a=d3_window.getComputedStyle(this,null).getPropertyValue(name),i;return a!==b&&(i=d3_interpolate(a,b),function(t){this.style.setProperty(name,i(t),priority)})})}return d3_transition_tween(this,"style."+name,value,styleString)};d3_transitionPrototype.styleTween=function(name,tween,priority){if(arguments.length<3)priority="";function styleTween(d,i){var f=tween.call(this,d,i,d3_window.getComputedStyle(this,null).getPropertyValue(name));return f&&function(t){this.style.setProperty(name,f(t),priority)}}return this.tween("style."+name,styleTween)};d3_transitionPrototype.text=function(value){return d3_transition_tween(this,"text",value,d3_transition_text)};function d3_transition_text(b){if(b==null)b="";return function(){this.textContent=b}}d3_transitionPrototype.remove=function(){return this.each("end.transition",function(){var p;if(this.__transition__.count<2&&(p=this.parentNode))p.removeChild(this)})};d3_transitionPrototype.ease=function(value){var id=this.id;if(arguments.length<1)return this.node().__transition__[id].ease;if(typeof value!=="function")value=d3.ease.apply(d3,arguments);return d3_selection_each(this,function(node){node.__transition__[id].ease=value})};d3_transitionPrototype.delay=function(value){var id=this.id;if(arguments.length<1)return this.node().__transition__[id].delay;return d3_selection_each(this,typeof value==="function"?function(node,i,j){node.__transition__[id].delay=+value.call(node,node.__data__,i,j)}:(value=+value,function(node){node.__transition__[id].delay=value}))};d3_transitionPrototype.duration=function(value){var id=this.id;if(arguments.length<1)return this.node().__transition__[id].duration;return d3_selection_each(this,typeof value==="function"?function(node,i,j){node.__transition__[id].duration=Math.max(1,value.call(node,node.__data__,i,j))}:(value=Math.max(1,value),function(node){node.__transition__[id].duration=value}))};d3_transitionPrototype.each=function(type,listener){var id=this.id;if(arguments.length<2){var inherit=d3_transitionInherit,inheritId=d3_transitionInheritId;d3_transitionInheritId=id;d3_selection_each(this,function(node,i,j){d3_transitionInherit=node.__transition__[id];type.call(node,node.__data__,i,j)});d3_transitionInherit=inherit;d3_transitionInheritId=inheritId}else{d3_selection_each(this,function(node){var transition=node.__transition__[id];(transition.event||(transition.event=d3.dispatch("start","end"))).on(type,listener)})}return this};d3_transitionPrototype.transition=function(){var id0=this.id,id1=++d3_transitionId,subgroups=[],subgroup,group,node,transition;for(var j=0,m=this.length;j<m;j++){subgroups.push(subgroup=[]);for(var group=this[j],i=0,n=group.length;i<n;i++){if(node=group[i]){transition=Object.create(node.__transition__[id0]);transition.delay+=transition.duration;d3_transitionNode(node,i,id1,transition)}subgroup.push(node)}}return d3_transition(subgroups,id1)};function d3_transitionNode(node,i,id,inherit){var lock=node.__transition__||(node.__transition__={active:0,count:0}),transition=lock[id];if(!transition){var time=inherit.time;transition=lock[id]={tween:new d3_Map,time:time,ease:inherit.ease,delay:inherit.delay,duration:inherit.duration};++lock.count;d3.timer(function(elapsed){var d=node.__data__,ease=transition.ease,delay=transition.delay,duration=transition.duration,timer=d3_timer_active,tweened=[];timer.t=delay+time;if(delay<=elapsed)return start(elapsed-delay);timer.c=start;function start(elapsed){if(lock.active>id)return stop();lock.active=id;transition.event&&transition.event.start.call(node,d,i);transition.tween.forEach(function(key,value){if(value=value.call(node,d,i)){tweened.push(value)}});d3.timer(function(){timer.c=tick(elapsed||1)?d3_true:tick;return 1},0,time)}function tick(elapsed){if(lock.active!==id)return stop();var t=elapsed/duration,e=ease(t),n=tweened.length;while(n>0){tweened[--n].call(node,e)}if(t>=1){transition.event&&transition.event.end.call(node,d,i);return stop()}}function stop(){if(--lock.count)delete lock[id];else delete node.__transition__;return 1}},0,time)}}d3.svg.axis=function(){var scale=d3.scale.linear(),orient=d3_svg_axisDefaultOrient,innerTickSize=6,outerTickSize=6,tickPadding=3,tickArguments_=[10],tickValues=null,tickFormat_;function axis(g){g.each(function(){var g=d3.select(this);var scale0=this.__chart__||scale,scale1=this.__chart__=scale.copy();var ticks=tickValues==null?scale1.ticks?scale1.ticks.apply(scale1,tickArguments_):scale1.domain():tickValues,tickFormat=tickFormat_==null?scale1.tickFormat?scale1.tickFormat.apply(scale1,tickArguments_):d3_identity:tickFormat_,tick=g.selectAll(".tick").data(ticks,scale1),tickEnter=tick.enter().insert("g",".domain").attr("class","tick").style("opacity",ε),tickExit=d3.transition(tick.exit()).style("opacity",ε).remove(),tickUpdate=d3.transition(tick.order()).style("opacity",1),tickTransform;var range=d3_scaleRange(scale1),path=g.selectAll(".domain").data([0]),pathUpdate=(path.enter().append("path").attr("class","domain"),d3.transition(path));tickEnter.append("line");tickEnter.append("text");var lineEnter=tickEnter.select("line"),lineUpdate=tickUpdate.select("line"),text=tick.select("text").text(tickFormat),textEnter=tickEnter.select("text"),textUpdate=tickUpdate.select("text");switch(orient){case"bottom":{tickTransform=d3_svg_axisX;lineEnter.attr("y2",innerTickSize);textEnter.attr("y",Math.max(innerTickSize,0)+tickPadding);lineUpdate.attr("x2",0).attr("y2",innerTickSize);textUpdate.attr("x",0).attr("y",Math.max(innerTickSize,0)+tickPadding);text.attr("dy",".71em").style("text-anchor","middle");pathUpdate.attr("d","M"+range[0]+","+outerTickSize+"V0H"+range[1]+"V"+outerTickSize);break}case"top":{tickTransform=d3_svg_axisX;lineEnter.attr("y2",-innerTickSize);textEnter.attr("y",-(Math.max(innerTickSize,0)+tickPadding));lineUpdate.attr("x2",0).attr("y2",-innerTickSize);textUpdate.attr("x",0).attr("y",-(Math.max(innerTickSize,0)+tickPadding));text.attr("dy","0em").style("text-anchor","middle");pathUpdate.attr("d","M"+range[0]+","+-outerTickSize+"V0H"+range[1]+"V"+-outerTickSize);break}case"left":{tickTransform=d3_svg_axisY;lineEnter.attr("x2",-innerTickSize);textEnter.attr("x",-(Math.max(innerTickSize,0)+tickPadding));lineUpdate.attr("x2",-innerTickSize).attr("y2",0);textUpdate.attr("x",-(Math.max(innerTickSize,0)+tickPadding)).attr("y",0);text.attr("dy",".32em").style("text-anchor","end");pathUpdate.attr("d","M"+-outerTickSize+","+range[0]+"H0V"+range[1]+"H"+-outerTickSize);break}case"right":{tickTransform=d3_svg_axisY;lineEnter.attr("x2",innerTickSize);textEnter.attr("x",Math.max(innerTickSize,0)+tickPadding);lineUpdate.attr("x2",innerTickSize).attr("y2",0);textUpdate.attr("x",Math.max(innerTickSize,0)+tickPadding).attr("y",0);text.attr("dy",".32em").style("text-anchor","start");pathUpdate.attr("d","M"+outerTickSize+","+range[0]+"H0V"+range[1]+"H"+outerTickSize);break}}if(scale1.rangeBand){var x=scale1,dx=x.rangeBand()/2;scale0=scale1=function(d){return x(d)+dx}}else if(scale0.rangeBand){scale0=scale1}else{tickExit.call(tickTransform,scale1)}tickEnter.call(tickTransform,scale0);tickUpdate.call(tickTransform,scale1)})}axis.scale=function(x){if(!arguments.length)return scale;scale=x;return axis};axis.orient=function(x){if(!arguments.length)return orient;orient=x in d3_svg_axisOrients?x+"":d3_svg_axisDefaultOrient;return axis};axis.ticks=function(){if(!arguments.length)return tickArguments_;tickArguments_=arguments;return axis};axis.tickValues=function(x){if(!arguments.length)return tickValues;tickValues=x;return axis};axis.tickFormat=function(x){if(!arguments.length)return tickFormat_;tickFormat_=x;return axis};axis.tickSize=function(x){var n=arguments.length;if(!n)return innerTickSize;innerTickSize=+x;outerTickSize=+arguments[n-1];return axis};axis.innerTickSize=function(x){if(!arguments.length)return innerTickSize;innerTickSize=+x;return axis};axis.outerTickSize=function(x){if(!arguments.length)return outerTickSize;outerTickSize=+x;return axis};axis.tickPadding=function(x){if(!arguments.length)return tickPadding;tickPadding=+x;return axis};axis.tickSubdivide=function(){return arguments.length&&axis};return axis};var d3_svg_axisDefaultOrient="bottom",d3_svg_axisOrients={top:1,right:1,bottom:1,left:1};function d3_svg_axisX(selection,x){selection.attr("transform",function(d){return"translate("+x(d)+",0)"})}function d3_svg_axisY(selection,y){selection.attr("transform",function(d){return"translate(0,"+y(d)+")"})}d3.svg.brush=function(){var event=d3_eventDispatch(brush,"brushstart","brush","brushend"),x=null,y=null,xExtent=[0,0],yExtent=[0,0],xExtentDomain,yExtentDomain,xClamp=true,yClamp=true,resizes=d3_svg_brushResizes[0];function brush(g){g.each(function(){var g=d3.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",brushstart).on("touchstart.brush",brushstart);var background=g.selectAll(".background").data([0]);background.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");g.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var resize=g.selectAll(".resize").data(resizes,d3_identity);resize.exit().remove();resize.enter().append("g").attr("class",function(d){return"resize "+d}).style("cursor",function(d){return d3_svg_brushCursor[d]}).append("rect").attr("x",function(d){return/[ew]$/.test(d)?-3:null}).attr("y",function(d){return/^[ns]/.test(d)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");resize.style("display",brush.empty()?"none":null);var gUpdate=d3.transition(g),backgroundUpdate=d3.transition(background),range;if(x){range=d3_scaleRange(x);backgroundUpdate.attr("x",range[0]).attr("width",range[1]-range[0]);redrawX(gUpdate)}if(y){range=d3_scaleRange(y);backgroundUpdate.attr("y",range[0]).attr("height",range[1]-range[0]);redrawY(gUpdate)}redraw(gUpdate)})}brush.event=function(g){g.each(function(){var event_=event.of(this,arguments),extent1={x:xExtent,y:yExtent,i:xExtentDomain,j:yExtentDomain},extent0=this.__chart__||extent1;this.__chart__=extent1;if(d3_transitionInheritId){d3.select(this).transition().each("start.brush",function(){xExtentDomain=extent0.i;yExtentDomain=extent0.j;xExtent=extent0.x;yExtent=extent0.y;event_({type:"brushstart"})}).tween("brush:brush",function(){var xi=d3_interpolateArray(xExtent,extent1.x),yi=d3_interpolateArray(yExtent,extent1.y);xExtentDomain=yExtentDomain=null;return function(t){xExtent=extent1.x=xi(t);yExtent=extent1.y=yi(t);event_({type:"brush",mode:"resize"})}}).each("end.brush",function(){xExtentDomain=extent1.i;yExtentDomain=extent1.j;event_({type:"brush",mode:"resize"});event_({type:"brushend"})})}else{event_({type:"brushstart"});event_({type:"brush",mode:"resize"});event_({type:"brushend"})}})};function redraw(g){g.selectAll(".resize").attr("transform",function(d){return"translate("+xExtent[+/e$/.test(d)]+","+yExtent[+/^s/.test(d)]+")"})}function redrawX(g){g.select(".extent").attr("x",xExtent[0]);g.selectAll(".extent,.n>rect,.s>rect").attr("width",xExtent[1]-xExtent[0])}function redrawY(g){g.select(".extent").attr("y",yExtent[0]);g.selectAll(".extent,.e>rect,.w>rect").attr("height",yExtent[1]-yExtent[0])}function brushstart(){var target=this,eventTarget=d3.select(d3.event.target),event_=event.of(target,arguments),g=d3.select(target),resizing=eventTarget.datum(),resizingX=!/^(n|s)$/.test(resizing)&&x,resizingY=!/^(e|w)$/.test(resizing)&&y,dragging=eventTarget.classed("extent"),dragRestore=d3_event_dragSuppress(),center,origin=d3.mouse(target),offset;var w=d3.select(d3_window).on("keydown.brush",keydown).on("keyup.brush",keyup);if(d3.event.changedTouches){w.on("touchmove.brush",brushmove).on("touchend.brush",brushend)}else{w.on("mousemove.brush",brushmove).on("mouseup.brush",brushend)}g.interrupt().selectAll("*").interrupt();if(dragging){origin[0]=xExtent[0]-origin[0];origin[1]=yExtent[0]-origin[1]}else if(resizing){var ex=+/w$/.test(resizing),ey=+/^n/.test(resizing);offset=[xExtent[1-ex]-origin[0],yExtent[1-ey]-origin[1]];origin[0]=xExtent[ex];origin[1]=yExtent[ey]}else if(d3.event.altKey)center=origin.slice();g.style("pointer-events","none").selectAll(".resize").style("display",null);d3.select("body").style("cursor",eventTarget.style("cursor"));event_({type:"brushstart"});brushmove();function keydown(){if(d3.event.keyCode==32){if(!dragging){center=null;origin[0]-=xExtent[1];origin[1]-=yExtent[1];dragging=2}d3_eventPreventDefault()}}function keyup(){if(d3.event.keyCode==32&&dragging==2){origin[0]+=xExtent[1];origin[1]+=yExtent[1];dragging=0;d3_eventPreventDefault()}}function brushmove(){var point=d3.mouse(target),moved=false;if(offset){point[0]+=offset[0];point[1]+=offset[1]}if(!dragging){if(d3.event.altKey){if(!center)center=[(xExtent[0]+xExtent[1])/2,(yExtent[0]+yExtent[1])/2];origin[0]=xExtent[+(point[0]<center[0])];origin[1]=yExtent[+(point[1]<center[1])]}else center=null}if(resizingX&&move1(point,x,0)){redrawX(g);moved=true}if(resizingY&&move1(point,y,1)){redrawY(g);moved=true}if(moved){redraw(g);event_({type:"brush",mode:dragging?"move":"resize"})}}function move1(point,scale,i){var range=d3_scaleRange(scale),r0=range[0],r1=range[1],position=origin[i],extent=i?yExtent:xExtent,size=extent[1]-extent[0],min,max;if(dragging){r0-=position;r1-=size+position
  }min=(i?yClamp:xClamp)?Math.max(r0,Math.min(r1,point[i])):point[i];if(dragging){max=(min+=position)+size}else{if(center)position=Math.max(r0,Math.min(r1,2*center[i]-min));if(position<min){max=min;min=position}else{max=position}}if(extent[0]!=min||extent[1]!=max){if(i)yExtentDomain=null;else xExtentDomain=null;extent[0]=min;extent[1]=max;return true}}function brushend(){brushmove();g.style("pointer-events","all").selectAll(".resize").style("display",brush.empty()?"none":null);d3.select("body").style("cursor",null);w.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);dragRestore();event_({type:"brushend"})}}brush.x=function(z){if(!arguments.length)return x;x=z;resizes=d3_svg_brushResizes[!x<<1|!y];return brush};brush.y=function(z){if(!arguments.length)return y;y=z;resizes=d3_svg_brushResizes[!x<<1|!y];return brush};brush.clamp=function(z){if(!arguments.length)return x&&y?[xClamp,yClamp]:x?xClamp:y?yClamp:null;if(x&&y)xClamp=!!z[0],yClamp=!!z[1];else if(x)xClamp=!!z;else if(y)yClamp=!!z;return brush};brush.extent=function(z){var x0,x1,y0,y1,t;if(!arguments.length){if(x){if(xExtentDomain){x0=xExtentDomain[0],x1=xExtentDomain[1]}else{x0=xExtent[0],x1=xExtent[1];if(x.invert)x0=x.invert(x0),x1=x.invert(x1);if(x1<x0)t=x0,x0=x1,x1=t}}if(y){if(yExtentDomain){y0=yExtentDomain[0],y1=yExtentDomain[1]}else{y0=yExtent[0],y1=yExtent[1];if(y.invert)y0=y.invert(y0),y1=y.invert(y1);if(y1<y0)t=y0,y0=y1,y1=t}}return x&&y?[[x0,y0],[x1,y1]]:x?[x0,x1]:y&&[y0,y1]}if(x){x0=z[0],x1=z[1];if(y)x0=x0[0],x1=x1[0];xExtentDomain=[x0,x1];if(x.invert)x0=x(x0),x1=x(x1);if(x1<x0)t=x0,x0=x1,x1=t;if(x0!=xExtent[0]||x1!=xExtent[1])xExtent=[x0,x1]}if(y){y0=z[0],y1=z[1];if(x)y0=y0[1],y1=y1[1];yExtentDomain=[y0,y1];if(y.invert)y0=y(y0),y1=y(y1);if(y1<y0)t=y0,y0=y1,y1=t;if(y0!=yExtent[0]||y1!=yExtent[1])yExtent=[y0,y1]}return brush};brush.clear=function(){if(!brush.empty()){xExtent=[0,0],yExtent=[0,0];xExtentDomain=yExtentDomain=null}return brush};brush.empty=function(){return!!x&&xExtent[0]==xExtent[1]||!!y&&yExtent[0]==yExtent[1]};return d3.rebind(brush,event,"on")};var d3_svg_brushCursor={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};var d3_svg_brushResizes=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];var d3_time_format=d3_time.format=d3_locale_enUS.timeFormat;var d3_time_formatUtc=d3_time_format.utc;var d3_time_formatIso=d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");d3_time_format.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?d3_time_formatIsoNative:d3_time_formatIso;function d3_time_formatIsoNative(date){return date.toISOString()}d3_time_formatIsoNative.parse=function(string){var date=new Date(string);return isNaN(date)?null:date};d3_time_formatIsoNative.toString=d3_time_formatIso.toString;d3_time.second=d3_time_interval(function(date){return new d3_date(Math.floor(date/1e3)*1e3)},function(date,offset){date.setTime(date.getTime()+Math.floor(offset)*1e3)},function(date){return date.getSeconds()});d3_time.seconds=d3_time.second.range;d3_time.seconds.utc=d3_time.second.utc.range;d3_time.minute=d3_time_interval(function(date){return new d3_date(Math.floor(date/6e4)*6e4)},function(date,offset){date.setTime(date.getTime()+Math.floor(offset)*6e4)},function(date){return date.getMinutes()});d3_time.minutes=d3_time.minute.range;d3_time.minutes.utc=d3_time.minute.utc.range;d3_time.hour=d3_time_interval(function(date){var timezone=date.getTimezoneOffset()/60;return new d3_date((Math.floor(date/36e5-timezone)+timezone)*36e5)},function(date,offset){date.setTime(date.getTime()+Math.floor(offset)*36e5)},function(date){return date.getHours()});d3_time.hours=d3_time.hour.range;d3_time.hours.utc=d3_time.hour.utc.range;d3_time.month=d3_time_interval(function(date){date=d3_time.day(date);date.setDate(1);return date},function(date,offset){date.setMonth(date.getMonth()+offset)},function(date){return date.getMonth()});d3_time.months=d3_time.month.range;d3_time.months.utc=d3_time.month.utc.range;function d3_time_scale(linear,methods,format){function scale(x){return linear(x)}scale.invert=function(x){return d3_time_scaleDate(linear.invert(x))};scale.domain=function(x){if(!arguments.length)return linear.domain().map(d3_time_scaleDate);linear.domain(x);return scale};function tickMethod(extent,count){var span=extent[1]-extent[0],target=span/count,i=d3.bisect(d3_time_scaleSteps,target);return i==d3_time_scaleSteps.length?[methods.year,d3_scale_linearTickRange(extent.map(function(d){return d/31536e6}),count)[2]]:!i?[d3_time_scaleMilliseconds,d3_scale_linearTickRange(extent,count)[2]]:methods[target/d3_time_scaleSteps[i-1]<d3_time_scaleSteps[i]/target?i-1:i]}scale.nice=function(interval,skip){var domain=scale.domain(),extent=d3_scaleExtent(domain),method=interval==null?tickMethod(extent,10):typeof interval==="number"&&tickMethod(extent,interval);if(method)interval=method[0],skip=method[1];function skipped(date){return!isNaN(date)&&!interval.range(date,d3_time_scaleDate(+date+1),skip).length}return scale.domain(d3_scale_nice(domain,skip>1?{floor:function(date){while(skipped(date=interval.floor(date)))date=d3_time_scaleDate(date-1);return date},ceil:function(date){while(skipped(date=interval.ceil(date)))date=d3_time_scaleDate(+date+1);return date}}:interval))};scale.ticks=function(interval,skip){var extent=d3_scaleExtent(scale.domain()),method=interval==null?tickMethod(extent,10):typeof interval==="number"?tickMethod(extent,interval):!interval.range&&[{range:interval},skip];if(method)interval=method[0],skip=method[1];return interval.range(extent[0],d3_time_scaleDate(+extent[1]+1),skip<1?1:skip)};scale.tickFormat=function(){return format};scale.copy=function(){return d3_time_scale(linear.copy(),methods,format)};return d3_scale_linearRebind(scale,linear)}function d3_time_scaleDate(t){return new Date(t)}var d3_time_scaleSteps=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6];var d3_time_scaleLocalMethods=[[d3_time.second,1],[d3_time.second,5],[d3_time.second,15],[d3_time.second,30],[d3_time.minute,1],[d3_time.minute,5],[d3_time.minute,15],[d3_time.minute,30],[d3_time.hour,1],[d3_time.hour,3],[d3_time.hour,6],[d3_time.hour,12],[d3_time.day,1],[d3_time.day,2],[d3_time.week,1],[d3_time.month,1],[d3_time.month,3],[d3_time.year,1]];var d3_time_scaleLocalFormat=d3_time_format.multi([[".%L",function(d){return d.getMilliseconds()}],[":%S",function(d){return d.getSeconds()}],["%I:%M",function(d){return d.getMinutes()}],["%I %p",function(d){return d.getHours()}],["%a %d",function(d){return d.getDay()&&d.getDate()!=1}],["%b %d",function(d){return d.getDate()!=1}],["%B",function(d){return d.getMonth()}],["%Y",d3_true]]);var d3_time_scaleMilliseconds={range:function(start,stop,step){return d3.range(Math.ceil(start/step)*step,+stop,step).map(d3_time_scaleDate)},floor:d3_identity,ceil:d3_identity};d3_time_scaleLocalMethods.year=d3_time.year;d3_time.scale=function(){return d3_time_scale(d3.scale.linear(),d3_time_scaleLocalMethods,d3_time_scaleLocalFormat)};var d3_time_scaleUtcMethods=d3_time_scaleLocalMethods.map(function(m){return[m[0].utc,m[1]]});var d3_time_scaleUtcFormat=d3_time_formatUtc.multi([[".%L",function(d){return d.getUTCMilliseconds()}],[":%S",function(d){return d.getUTCSeconds()}],["%I:%M",function(d){return d.getUTCMinutes()}],["%I %p",function(d){return d.getUTCHours()}],["%a %d",function(d){return d.getUTCDay()&&d.getUTCDate()!=1}],["%b %d",function(d){return d.getUTCDate()!=1}],["%B",function(d){return d.getUTCMonth()}],["%Y",d3_true]]);d3_time_scaleUtcMethods.year=d3_time.year.utc;d3_time.scale.utc=function(){return d3_time_scale(d3.scale.linear(),d3_time_scaleUtcMethods,d3_time_scaleUtcFormat)};d3.text=d3_xhrType(function(request){return request.responseText});d3.json=function(url,callback){return d3_xhr(url,"application/json",d3_json,callback)};function d3_json(request){return JSON.parse(request.responseText)}d3.html=function(url,callback){return d3_xhr(url,"text/html",d3_html,callback)};function d3_html(request){var range=d3_document.createRange();range.selectNode(d3_document.body);return range.createContextualFragment(request.responseText)}d3.xml=d3_xhrType(function(request){return request.responseXML});if(typeof define==="function"&&define.amd){define(d3)}else if(typeof module==="object"&&module.exports){module.exports=d3}else{this.d3=d3}}();(function(){var dataframe={cols:function(data){var result={access:function(column){if(!(column in data))throw"dataframe doesn't have column "+column.toString();var columnv=data[column];var f=function(i){return columnv[i]};f.attrs=columnv;return f},index:function(i){return i},num_rows:function(){for(var col in data)return data[col].length},has:function(k){return k in data},records:function(){return _.range(0,this.num_rows())}};return result},rows:function(data){var result={access:function(column){var f=function(i){return data[i][column]};if("attrs"in data&&_.isObject(data.attrs))f.attrs=data.attrs[column];return f},index:function(i){return i},num_rows:function(){return data.length},has:function(k){return k in data[0]},records:function(){return _.range(0,this.num_rows())}};return result}};if(typeof define==="function"&&define.amd){define(dataframe)}else if(typeof module==="object"&&module.exports){module.exports=dataframe}else{this.dataframe=dataframe}})();(function(){function _dcplot(dc,crossfilter){dcplot.group={identity:function(dim){return dim.group()},bin:function(binwidth){var f=function(dim){return dim.group(function(x){return Math.floor(x/binwidth)*binwidth})};f.binwidth=binwidth;return f}};dcplot.reduce={count:function(group){return group.reduceCount()},countFilter:function(access,level){return dcplot.reduce.sum(function(a){return access(a)===level?1:0})},filter:function(reduce,access,level){function wrapper(acc){return function(a){return access(a)===level?acc(a):0}}return{arg:reduce.arg,fun:function(acc){return reduce.fun(wrapper(acc))}}},sum:function(access,wacc){return{arg:access,fun:function(acc2){if(wacc===undefined)return function(group){return group.reduceSum(function(item){return acc2(item)})};else return function(group){return group.reduce(function(p,v){p.sum+=acc2(v)*wacc(v);return p},function(p,v){p.sum-=acc2(v)*wacc(v);return p},function(p,v){return{sum:0,valueOf:function(){return this.sum}}})}}}},any:function(access){return{arg:access,fun:function(acc2){return function(group){return group.reduce(function(p,v){return acc2(v)},function(p,v){return p},function(p,v){return 0})}}}},avg:function(access,wacc){return{arg:access,fun:function(acc2){if(wacc===undefined)return function(group){return group.reduce(function(p,v){++p.count;p.sum+=acc2(v);p.avg=p.sum/p.count;return p},function(p,v){--p.count;p.sum-=acc2(v);p.avg=p.count?p.sum/p.count:0;return p},function(p,v){return{count:0,sum:0,avg:0,valueOf:function(){return this.avg}}})};else return function(group){return group.reduce(function(p,v){p.count+=wacc(v);p.sum+=acc2(v)*wacc(v);p.avg=p.sum/p.count;return p},function(p,v){p.count-=wacc(v);p.sum-=acc2(v)*wacc(v);p.avg=p.count?p.sum/p.count:0;return p},function(p,v){return{count:0,sum:0,avg:0,valueOf:function(){return this.avg}}})}}}},value:function(field){return function(key,value){return value[field]}}};var chart_attrs={base:{supported:true,div:{required:true},title:{required:false},dimension:{required:true},group:{required:true},ordering:{required:false},width:{required:true,"default":300},height:{required:true,"default":300},"transition.duration":{required:false},label:{required:false},tips:{required:false},more:{required:false}},color:{supported:true,color:{required:false},"color.scale":{required:false},"color.domain":{required:false},"color.range":{required:false}},stackable:{supported:true,stack:{required:false},"stack.levels":{required:false}},coordinateGrid:{supported:true,parents:["base","color"],margins:{required:false},x:{required:false},y:{required:false},"x.ordinal":{required:false},"x.scale":{required:true},"x.domain":{required:false},"x.units":{required:false},"x.round":{required:false},"x.elastic":{required:false},"x.padding":{required:false},"y.scale":{required:false},"y.domain":{required:false},"y.elastic":{required:false},"y.padding":{required:false},gridLines:{required:false},brush:{required:false}},pie:{supported:true,concrete:true,parents:["base","color"],radius:{required:false},innerRadius:{required:false},wedge:{required:false},size:{required:false}},row:{supported:false,parents:["base","color"]},bar:{supported:true,concrete:true,parents:["coordinateGrid","stackable"],width:{"default":700},height:{"default":250},centerBar:{required:false},gap:{required:false},"color.x":{"default":true},"x.units":{required:true}},line:{supported:true,concrete:true,parents:["coordinateGrid","stackable"],width:{"default":800},height:{"default":250},area:{required:false},dotRadius:{required:false}},composite:{parents:["coordinateGrid"],supported:false},abstractBubble:{supported:true,parents:["color"],r:{"default":2},"r.scale":{required:false},"r.domain":{required:false}},bubble:{concrete:true,parents:["coordinateGrid","abstractBubble"],width:{"default":400},label:{"default":null},color:{"default":0},supported:true,"r.elastic":{required:false}},bubbleOverlay:{supported:false,parents:["base","abstractBubble"]},geoCloropleth:{supported:false},dataCount:{supported:false},dataTable:{supported:true,concrete:true,parents:["base"],columns:{required:true},size:{required:false},sortBy:{required:false}}};function skip_attr(a){return a==="supported"||a==="concrete"||a==="parents"}function parents_first_traversal(map,iter,callbacks){if(!(iter in map))throw"unknown chart type "+defn.type;var curr=map[iter];if("parents"in curr)for(var i=0;i<curr.parents.length;++i)parents_first_traversal(map,curr.parents[i],callbacks);callbacks[iter]()}function parents_last_traversal(map,iter,callbacks){if(!(iter in map))throw"unknown chart type "+defn.type;callbacks[iter]();var curr=map[iter];if("parents"in curr)for(var i=0;i<curr.parents.length;++i)parents_last_traversal(map,curr.parents[i],callbacks)}var _psv=dc.utils.printSingleValue;dc.utils.printSingleValue=function(filter){if(typeof filter==="number"){if(filter%1===0)return filter;else if(filter>1e4||filter<-1e4)return Math.round(filter);else return filter.toPrecision(4)}else return _psv(filter)};dcplot.format_error=function(e){var tab;if(_.isArray(e)){tab=$("<table/>");$.each(e,function(i){var err=e[i],formatted_errors=$("<td/>");if(_.isString(err.errors))formatted_errors.text(err.errors);else if(_.isArray(err.errors))$.each(err.errors,function(e){formatted_errors.append($("<p/>").text(err.errors[e]))});else formatted_errors.text(err.errors.message.toString());var name=err.name.replace(/_\d*_\d*$/,"");tab.append($("<tr valign=top/>").append($("<td/>").text(err.type)).append($("<td/>").text(name)).append(formatted_errors))})}else tab=$("<p/>").text(e.toString());var error_report=$("<div/>").append($("<p/>").text("dcplot errors!")).append(tab);return error_report};function dcplot(frame,groupname,definition){function mhas(obj){for(var i=1;i<arguments.length;++i)if(!_.has(obj,arguments[i])||obj[arguments[i]]===undefined)return false;else obj=obj[arguments[i]];return true}function default_definition(defn){if(!definition.defreduce)definition.defreduce=dcplot.reduce.count}function default_dimension(name,defn){}function default_group(name,defn,dims){var errors=[];if(!_.has(defn,"group"))defn.group=dcplot.group.identity;if(!_.has(defn,"reduce"))defn.reduce=definition.defreduce;if(errors.length)throw errors}function default_chart(name,defn,dims,groups){function do_defaults(defn,type){var cattrs=chart_attrs[type];if(!cattrs.supported)throw"chart type "+type+" not supported";for(var a in cattrs){if(skip_attr(a))continue;if(_.has(cattrs[a],"default")&&defn[a]===undefined)defn[a]=cattrs[a].default}if("parents"in cattrs)for(var i=0;i<cattrs.parents.length;++i)do_defaults(defn,cattrs.parents[i])}do_defaults(defn,defn.type)}function accessor(a){function constant_fn(v){return function(){return v}}if(_.isFunction(a))return a;else if(_.isString(a))return frame.has(a)?frame.access(a):constant_fn(a);else if(_.isObject(a)){if("fun"in a&&"arg"in a){var fun=a.fun,arg=a.arg;var resolve=accessor(arg);return fun(resolve)}else return constant_fn(a)}else if(_.isNumber(a))return constant_fn(a);else throw"illegal accessor "+a.toString()}function one_stack(defn){return!_.has(defn,"stack.levels")||_.has(defn,"stack.levels")&&defn["stack.levels"].length===1}function infer_dimension(name,defn){}function infer_group(name,defn,dims){}function infer_chart(name,defn,dims,groups){var errors=[];function find_unused(hash,base){if(!hash[base])return base;var n=1;while(hash[base+n])++n;return base+n}function get_levels(dim){var levels=null;if(_.isFunction(dim))levels=dim.attrs.r_attributes.levels;else if(_.has(dims,dim)&&mhas(accessor(dims[dim]),"attrs","r_attributes","levels"))levels=accessor(dims[dim]).attrs.r_attributes.levels;return levels}function looks_ordinal(dim){return _.has(dims,dim)&&_.isString(accessor(dims[dim])(0))}var callbacks={base:function(){if(!("div"in defn))defn.div="#"+name;if(defn.group){if(!groups[defn.group])errors.push('unknown group "'+defn.group+'"');else if(!defn.dimension)defn.dimension=groups[defn.group].dimension}else if(defn.dimension){if(!dims[defn.dimension])errors.push('unknown dimension "'+defn.dimension+'"');else{defn.group=find_unused(groups,defn.dimension);var g=groups[defn.group]={};g.dimension=defn.dimension;default_group(defn.group,g,dims);infer_group(defn.group,g,dims)}}if(!_.has(defn,"ordering")){var levels=get_levels(defn.dimension);if(levels!==null){var rmap=_.object(levels,_.range(levels.length));defn.ordering=function(p){return rmap[p.key]}}}},color:function(){if(!defn["color.scale"]){var levels=get_levels(defn.stack||defn.dimension);defn["color.scale"]=levels!==null&&levels.length>10?d3.scale.category20():d3.scale.category10()}if(!defn["color.domain"]){if(mhas(defn,"color","attrs","r_attributes","levels"))defn["color.domain"]=defn.color.attrs.r_attributes.levels}},stackable:function(){if(_.has(defn,"stack")){if(!_.has(defn,"stack.levels"))defn["stack.levels"]=get_levels(defn.stack);var levels=defn["stack.levels"];for(var s=0;s<defn["stack.levels"].length;s++){var newName=defn.group+defn["stack.levels"][s];var newGroupDefn=_.clone(groups[defn.group]);if(newGroupDefn.reduce===dcplot.reduce.count)newGroupDefn.reduce=dcplot.reduce.countFilter(defn.stack,defn["stack.levels"][s]);else newGroupDefn.reduce=dcplot.reduce.filter(newGroupDefn.reduce,defn.stack,defn["stack.levels"][s]);groups[newName]=newGroupDefn}}},coordinateGrid:function(){var levels=get_levels(defn.dimension);if(!("x.ordinal"in defn)){defn["x.ordinal"]="x.units"in defn&&defn["x.units"]===dc.units.ordinal||levels!==null||looks_ordinal(defn.dimension)}if(!("x.scale"in defn)&&defn["x.ordinal"])defn["x.scale"]=d3.scale.ordinal();if(!("x.units"in defn)&&defn["x.ordinal"])defn["x.units"]=dc.units.ordinal;if(!("x.domain"in defn)&&levels)defn["x.domain"]=levels;if(!("x.scale"in defn))defn["x.scale"]=levels?d3.scale.ordinal():d3.scale.linear();if(!("y.scale"in defn))defn["y.scale"]=d3.scale.linear();if(!("x.domain"in defn)&&!("x.elastic"in defn))defn["x.elastic"]=true;if(!("y.domain"in defn)&&!("y.elastic"in defn))defn["y.elastic"]=true},pie:function(){},bar:function(){if(!("x.units"in defn)&&defn.group){var group=groups[defn.group];if(mhas(group,"group","binwidth"))defn["x.units"]=dc.units.fp.precision(group.group.binwidth)}if(!_.has(defn,"color.domain")){var levels;if(one_stack(defn)){if(defn["color.x"]){levels=get_levels(defn.dimension);if(levels)defn["color.domain"]=levels}}else{levels=get_levels(defn.stack);if(levels)defn["color.domain"]=levels}}},line:function(){},abstractBubble:function(){},bubble:function(){},dataTable:function(){var bad=_.find(defn.columns,function(col){return!frame.has(col)});if(bad)throw bad+" not a valid column!"}};parents_first_traversal(chart_attrs,defn.type,callbacks);if(errors.length)throw errors}function check_dimension_attrs(name,defn){}function check_group_attrs(name,defn){var expected=["dimension","group","reduce"];var k=_.keys(defn),missing=_.difference(expected,k),unknown=_.difference(k,expected),errors=[];if(missing.length)errors.push("definition is missing required attrs: "+missing.join(", "));if(unknown.length)errors.push("definition has unknown attrs: "+unknown.join(", "));if(errors.length)throw errors}function check_chart_attrs(name,defn){function find_discreps(defn,type,missing,found){var cattrs=chart_attrs[type];if(!cattrs.supported)throw'type "'+type+'" not supported';if("parents"in cattrs)for(var i=0;i<cattrs.parents.length;++i)find_discreps(defn,cattrs.parents[i],missing,found);for(var a in cattrs){if(skip_attr(a))continue;if(cattrs[a].required&&defn[a]===undefined)missing.push(a);if(_.has(found,a))found[a]=true}}function empty_found_map(defn){var k=_.without(_.keys(defn),"type"),n=k.length,v=[];while(n--)v.push(false);return _.object(k,v)}var missing=[],found=empty_found_map(defn);find_discreps(defn,defn.type,missing,found);var errors=[];if(missing.length)errors.push("definition is missing required attrs: "+missing.join(", "));var unknown=_.map(_.reject(_.pairs(found),function(p){return p[1]}),function(p){return p[0]});if(unknown.length)errors.push("definition has unknown attrs: "+unknown.join(", "));if(errors.length)throw errors}function check_dimension_logic(name,defn){}function check_group_logic(name,defn,dims){var errors=[];if(!_.has(dims,defn.dimension))errors.push('unknown dimension "'+defn.dimension+'"');if(errors.length)throw errors}function check_chart_logic(name,defn,dims,groups){var errors=[];var callbacks={base:function(){if(defn.dimension&&defn.dimension!==groups[defn.group].dimension)errors.push('group "'+defn.group+'" dimension "'+groups[defn.group].dimension+'" does not match chart dimension "'+defn.dimension+'"')},color:function(){},stackable:function(){},coordinateGrid:function(){if(!defn["x.elastic"]&&!("x.domain"in defn))throw"need x.domain unless x.elastic";if(!defn["y.elastic"]&&!("y.domain"in defn))throw"need y.domain unless y.elastic"},pie:function(){},bar:function(){},line:function(){},abstractBubble:function(){},bubble:function(){},dataTable:function(){}};parents_first_traversal(chart_attrs,defn.type,callbacks);if(errors.length)throw errors}function create_group(defn,dimensions){return accessor(defn.reduce)(defn.group(dimensions[defn.dimension]))}function create_chart(groupname,defn,dimensions,groups){var ctor,chart;function key_value(f){return function(kv){return f(kv.key,kv.value)}}var callbacks={base:function(){chart=ctor(defn.div,groupname);chart.dimension(dimensions[defn.dimension]).group(groups[defn.group]).width(defn.width).height(defn.height);if(_.has(defn,"ordering"))chart.ordering(defn.ordering);if(_.has(defn,"transition.duration"))chart.transitionDuration(defn["transition.duration"]);if(_.has(defn,"label")){if(defn.label)chart.label(key_value(defn.label));else chart.renderLabel(false)}if(_.has(defn,"tips")){if(defn.tips)chart.title(key_value(defn.tips));else chart.renderTitle(false)}},color:function(){if(_.has(defn,"color"))chart.colorAccessor(key_value(accessor(defn.color)));var scale=defn["color.scale"];if(_.has(defn,"color.domain"))scale.domain(defn["color.domain"]);if(_.has(defn,"color.range"))scale.range(defn["color.range"]);chart.colors(scale);chart.colorCalculator(function(x){return chart.colors()(x)})},stackable:function(){if(_.has(defn,"stack")&&_.has(defn,"stack.levels")){for(var s=0;s<defn["stack.levels"].length;s++){var stackGroup=groups[defn.group+defn["stack.levels"][s]];if(s===0)chart.group(stackGroup);else chart.stack(stackGroup)}}},coordinateGrid:function(){if(_.has(defn,"margins"))chart.margins(defn.margins);else chart.margins({top:10,right:50,bottom:30,left:60});if(_.has(defn,"x"))chart.keyAccessor(key_value(accessor(defn.x)));if(_.has(defn,"y"))chart.valueAccessor(key_value(accessor(defn.y)));var xtrans=defn["x.scale"];if(_.has(defn,"x.domain"))xtrans.domain(defn["x.domain"]);chart.x(xtrans).xUnits(defn["x.units"]);if(_.has(defn,"x.round"))chart.round(defn["x.round"]);if(_.has(defn,"x.elastic"))chart.elasticX(defn["x.elastic"]);if(_.has(defn,"x.padding"))chart.xAxisPadding(defn["x.padding"]);if(_.has(defn,"y.scale")){var ytrans=defn["y.scale"];if(_.has(defn,"y.domain"))ytrans.domain(defn["y.domain"]);chart.y(ytrans)}if(_.has(defn,"y.elastic"))chart.elasticY(defn["y.elastic"]);if(_.has(defn,"y.padding"))chart.yAxisPadding(defn["y.padding"]);if(_.has(defn,"gridLines")){var lines=defn.gridLines;if("horizontal"in lines)chart.renderVerticalGridLines(lines.horizontal);if("vertical"in lines)chart.renderVerticalGridLines(lines.vertical)}if(_.has(defn,"brush"))chart.brushOn(defn.brush)},pie:function(){if(_.has(defn,"wedge"))chart.keyAccessor(key_value(defn.wedge));if(_.has(defn,"size"))chart.keyAccessor(key_value(defn.size));if(_.has(defn,"radius"))chart.radius(defn.radius);if(_.has(defn,"innerRadius"))chart.innerRadius(defn.innerRadius)},bar:function(){if(_.has(defn,"centerBar"))chart.centerBar(defn.centerBar);if(_.has(defn,"gap"))chart.gap(defn.gap);if(_.has(defn,"x.ordinal")&&defn["x.ordinal"]&&defn["color.x"]&&one_stack(defn)){chart.renderlet(function(chart){chart.selectAll("rect.bar").style("fill",function(d,i){if(d3.select(this).classed(dc.constants.DESELECTED_CLASS))return null;else return chart.colors()(d.x)})})}else if(!one_stack(defn)){chart.renderlet(function(chart){chart.selectAll("g."+dc.constants.STACK_CLASS).each(function(d,i){var stack=defn["stack.levels"][i];d3.select(this).selectAll("rect.bar").style("fill",function(d,i){if(d3.select(this).classed(dc.constants.DESELECTED_CLASS))return null;else return chart.colors()(stack)}).select("title").text(function(d,i){return stack+", "+d3.select(this).text()})})})}},line:function(){if(_.has(defn,"area"))chart.renderArea(defn.area);if(_.has(defn,"dotRadius"))chart.dotRadius(defn.dotRadius)},abstractBubble:function(){},bubble:function(){if(_.has(defn,"r"))chart.radiusValueAccessor(key_value(accessor(defn.r)));if(_.has(defn,"r.scale")||_.has(defn,"r.domain")){var rtrans=defn["r.scale"]||d3.scale.linear();rtrans.domain(defn["r.domain"]||[0,100]);chart.r(rtrans)}},dataTable:function(){chart.group(accessor(defn.dimension));chart.columns(defn.columns.map(accessor));chart.size(defn.size||frame.records().length);if(_.has(defn,"sortBy"))chart.sortBy(accessor(defn.sortBy))}};ctor={pie:dc.pieChart,bar:dc.barChart,line:dc.lineChart,bubble:dc.bubbleChart,dataTable:dc.dataTable}[defn.type];parents_first_traversal(chart_attrs,defn.type,callbacks);if(_.has(defn,"more"))defn.more(chart);return chart}function aggregate_errors(dimension_fn,group_fn,chart_fn){var errors=[];for(var d in definition.dimensions){defn=definition.dimensions[d];try{dimension_fn(d,defn)}catch(e){errors.push({type:"dimension",name:d,errors:e})}}if(!_.has(definition,"groups"))definition.groups={};for(var g in definition.groups){defn=definition.groups[g];try{group_fn(g,defn,definition.dimensions)}catch(e){errors.push({type:"group",name:g,errors:e})}}for(var c in definition.charts){defn=definition.charts[c];try{chart_fn(c,defn,definition.dimensions,definition.groups)}catch(e){errors.push({type:"chart",name:c,errors:e})}}return errors}var errors=[];var defn;for(var c in definition.charts){defn=definition.charts[c];if(!(defn.type in chart_attrs))throw'unknown chart type "'+defn.type+'"';if(!chart_attrs[defn.type].supported)throw'unsupported chart type "'+defn.type+'"';if(!chart_attrs[defn.type].concrete)throw"can't create abstract chart type \""+defn.type+'"'}default_definition(definition);errors=aggregate_errors(default_dimension,default_group,default_chart);if(errors.length)throw errors;errors=aggregate_errors(infer_dimension,infer_group,infer_chart);if(errors.length)throw errors;errors=aggregate_errors(check_dimension_attrs,check_group_attrs,check_chart_attrs);if(errors.length)throw errors;errors=aggregate_errors(check_dimension_logic,check_group_logic,check_chart_logic);if(errors.length)throw errors;console.log("dcplot charts definition:");console.log(definition);var dimensions={};var groups={};var charts={};var ndx=crossfilter(frame.records());for(var d in definition.dimensions){defn=definition.dimensions[d];dimensions[d]=ndx.dimension(accessor(defn))}for(var g in definition.groups){defn=definition.groups[g];groups[g]=create_group(defn,dimensions)}for(c in definition.charts){defn=definition.charts[c];charts[c]=create_chart(groupname,defn,dimensions,groups)}dc.renderAll(groupname);return charts}return dcplot}if(typeof define==="function"&&define.amd){define(["dc","crossfilter"],_dcplot)}else if(typeof module==="object"&&module.exports){module.exports=_dcplot(dc,crossfilter)}else{this.dcplot=_dcplot(dc,crossfilter)}})();var hljs=new function(){function k(v){return v.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function t(v){return v.nodeName.toLowerCase()}function i(w,x){var v=w&&w.exec(x);return v&&v.index==0}function d(v){return Array.prototype.map.call(v.childNodes,function(w){if(w.nodeType==3){return b.useBR?w.nodeValue.replace(/\n/g,""):w.nodeValue}if(t(w)=="br"){return"\n"}return d(w)}).join("")}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^language-/,"")});return v.filter(function(x){return j(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return w[0].offset<y[0].offset?w:y}return y[0].event=="start"?w:y}function A(H){function G(I){return" "+I.nodeName+'="'+k(I.value)+'"'}F+="<"+t(H)+Array.prototype.map.call(H.attributes,G).join("")+">"}function E(G){F+="</"+t(G)+">"}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=k(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+k(C.substr(x))}function m(y){function v(z){return z&&z.source||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};function E(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})}if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b=D.bK.split(" ").join("|")}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?\\b("+F.b+")\\b\\.?":F.b}).concat([D.tE]).concat([D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T<V.c.length;T++){if(i(V.c[T].bR,U)){return V.c[T]}}}function z(U,T){if(i(U.eR,T)){return U}if(U.eW){return z(U.parent,T)}}function A(T,U){return!J&&i(U.iR,T)}function E(V,T){var U=M.cI?T[0].toLowerCase():T[0];
  return V.k.hasOwnProperty(U)&&V.k[U]}function w(Z,X,W,V){var T=V?"":b.classPrefix,U='<span class="'+T,Y=W?"":"</span>";U+=Z+'">';return U+X+Y}function N(){var U=k(C);if(!I.k){return U}var T="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(U);while(V){T+=U.substr(X,V.index-X);var W=E(I,V);if(W){H+=W[1];T+=w(W[0],V[0])}else{T+=V[0]}X=I.lR.lastIndex;V=I.lR.exec(U)}return T+U.substr(X)}function F(){if(I.sL&&!f[I.sL]){return k(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):g(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=k(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+="</span>"}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=k(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"<unnamed>")+'"')}C+=X;return X.length||1}var M=j(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+="</span>"}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:k(L)}}else{throw O}}}function g(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:k(y)};var w=v;x.forEach(function(z){if(!j(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function h(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"<br>")}return v}function p(z){var y=d(z);var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):g(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=h(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function e(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function j(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=g;this.fixMarkup=h;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=e;this.getLanguage=j;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}};hljs.registerLanguage("python",function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var b={cN:"string",c:[a.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},a.ASM,a.QSM]};var d={cN:"number",r:0,v:[{b:a.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:a.CNR+"[lLjJ]?"}]};var e={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,b]};var c={e:/:/,i:/[${=;\n]/,c:[a.UTM,e]};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,b,a.HCM,a.inherit(c,{cN:"function",bK:"def",r:10}),a.inherit(c,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("r",function(a){var b="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[a.HCM,{b:b,l:b,k:{keyword:"function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[a.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}});(function(global,factory){if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document")}return factory(w)}}else{factory(global)}})(typeof window!=="undefined"?window:this,function(window,noGlobal){var arr=[];var slice=arr.slice;var concat=arr.concat;var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var support={};var document=window.document,version="2.1.1",jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,selector:"",length:0,toArray:function(){return slice.call(this)},get:function(num){return num!=null?num<0?this[num+this.length]:this[num]:slice.call(this)},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret},each:function(callback,args){return jQuery.each(this,callback,args)},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}}if(i===length){target=this;i--}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&jQuery.isArray(src)?src:[]}else{clone=src&&jQuery.isPlainObject(src)?src:{}}target[name]=jQuery.extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}return target};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function(msg){throw new Error(msg)},noop:function(){},isFunction:function(obj){return jQuery.type(obj)==="function"},isArray:Array.isArray,isWindow:function(obj){return obj!=null&&obj===obj.window},isNumeric:function(obj){return!jQuery.isArray(obj)&&obj-parseFloat(obj)>=0},isPlainObject:function(obj){if(jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false}if(obj.constructor&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false}return true},isEmptyObject:function(obj){var name;for(name in obj){return false}return true},type:function(obj){if(obj==null){return obj+""}return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj},globalEval:function(code){var script,indirect=eval;code=jQuery.trim(code);if(code){if(code.indexOf("use strict")===1){script=document.createElement("script");script.text=code;document.head.appendChild(script).parentNode.removeChild(script)}else{indirect(code)}}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray){for(;i<length;i++){value=callback.apply(obj[i],args);if(value===false){break}}}else{for(i in obj){value=callback.apply(obj[i],args);if(value===false){break}}}}else{if(isArray){for(;i<length;i++){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}else{for(i in obj){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}}return obj},trim:function(text){return text==null?"":(text+"").replace(rtrim,"")},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArraylike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr)}else{push.call(ret,arr)}}return ret},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i)},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j]}first.length=i;return first},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i])}}return matches},map:function(elems,callback,arg){var value,i=0,length=elems.length,isArray=isArraylike(elems),ret=[];if(isArray){for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}return concat.apply([],ret)},guid:1,proxy:function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp}if(!jQuery.isFunction(fn)){return undefined}args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy},now:Date.now,support:support});jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});function isArraylike(obj){var length=obj.length,type=jQuery.type(obj);if(type==="function"||jQuery.isWindow(obj)){return false}if(obj.nodeType===1&&length){return true}return type==="array"||length===0||typeof length==="number"&&length>0&&length-1 in obj}var Sizzle=function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+-new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true}return 0},strundefined=typeof undefined,MAX_NEGATIVE=1<<31,hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){var i=0,len=this.length;for(;i<len;i++){if(this[i]===elem){return i}}return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",characterEncoding="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",identifier=characterEncoding.replace("w","w#"),attributes="\\["+whitespace+"*("+characterEncoding+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+characterEncoding+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,high&1023|56320)};try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){var j=target.length,i=0;while(target[j++]=els[i++]){}target.length=j-1}}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context)}context=context||document;results=results||[];if(!selector||typeof selector!=="string"){return results}if((nodeType=context.nodeType)!==1&&nodeType!==9){return[]}if(documentIsHTML&&!seed){if(match=rquickExpr.exec(selector)){if(m=match[1]){if(nodeType===9){elem=context.getElementById(m);if(elem&&elem.parentNode){if(elem.id===m){results.push(elem);return results}}else{return results}}else{if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results}}if(support.qsa&&(!rbuggyQSA||!rbuggyQSA.test(selector))){nid=old=expando;newContext=context;newSelector=nodeType===9&&selector;if(nodeType===1&&context.nodeName.toLowerCase()!=="object"){groups=tokenize(selector);if(old=context.getAttribute("id")){nid=old.replace(rescape,"\\$&")}else{context.setAttribute("id",nid)}nid="[id='"+nid+"'] ";i=groups.length;while(i--){groups[i]=nid+toSelector(groups[i])}newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;newSelector=groups.join(",")}if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results}catch(qsaError){}finally{if(!old){context.removeAttribute("id")}}}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()]}return cache[key+" "]=value}return cache}function markFunction(fn){fn[expando]=true;return fn}function assert(fn){var div=document.createElement("div");try{return!!fn(div)}catch(e){return false}finally{if(div.parentNode){div.parentNode.removeChild(div)}div=null}}function addHandle(attrs,handler){var arr=attrs.split("|"),i=attrs.length;while(i--){Expr.attrHandle[arr[i]]=handler}}function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff}if(cur){while(cur=cur.nextSibling){if(cur===b){return-1}}}return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[j=matchIndexes[i]]){seed[j]=!(matches[j]=seed[j])}}})})}function testContext(context){return context&&typeof context.getElementsByTagName!==strundefined&&context}support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};setDocument=Sizzle.setDocument=function(node){var hasCompare,doc=node?node.ownerDocument||node:preferredDoc,parent=doc.defaultView;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document}document=doc;docElem=doc.documentElement;documentIsHTML=!isXML(doc);if(parent&&parent!==parent.top){if(parent.addEventListener){parent.addEventListener("unload",function(){setDocument()},false)}else if(parent.attachEvent){parent.attachEvent("onunload",function(){setDocument()})}}support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className")});support.getElementsByTagName=assert(function(div){div.appendChild(doc.createComment(""));return!div.getElementsByTagName("*").length});support.getElementsByClassName=rnative.test(doc.getElementsByClassName)&&assert(function(div){div.innerHTML="<div class='a'></div><div class='a i'></div>";div.firstChild.className="i";return div.getElementsByClassName("i").length===2});support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!doc.getElementsByName||!doc.getElementsByName(expando).length});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!==strundefined&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}}Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!==strundefined){return context.getElementsByTagName(tag)}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while(elem=results[i++]){if(elem.nodeType===1){tmp.push(elem)}}return tmp}return results};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&documentIsHTML){return context.getElementsByClassName(className)}};rbuggyMatches=[];rbuggyQSA=[];if(support.qsa=rnative.test(doc.querySelectorAll)){assert(function(div){div.innerHTML="<select msallowclip=''><option selected=''></option></select>";if(div.querySelectorAll("[msallowclip^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")")}if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")")}if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked")}});assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("name","D");if(div.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=")}if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled")}div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:")})}if(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos)})}rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16))}:function(a,b){if(b){while(b=b.parentNode){if(b===a){return true}}}return false};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0}var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare}compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||!support.sortDetached&&b.compareDocumentPosition(a)===compare){if(a===doc||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)){return-1}if(b===doc||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)){return 1}return sortInput?indexOf.call(sortInput,a)-indexOf.call(sortInput,b):0}return compare&4?-1:1}:function(a,b){if(a===b){hasDuplicate=true;return 0}var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?indexOf.call(sortInput,a)-indexOf.call(sortInput,b):0}else if(aup===bup){return siblingCheck(a,b)}cur=a;while(cur=cur.parentNode){ap.unshift(cur)}cur=b;while(cur=cur.parentNode){bp.unshift(cur)}while(ap[i]===bp[i]){i++}return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0};return doc};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem)}expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret}}catch(e){}}return Sizzle(expr,document,null,[elem]).length>0};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context)}return contains(context,elem)};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem)}var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while(elem=results[i++]){if(elem===results[i]){j=duplicates.push(i)}}while(j--){results.splice(duplicates[j],1)}}sortInput=null;return results};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while(node=elem[i++]){ret+=getText(node)}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem)}}}else if(nodeType===3||nodeType===4){return elem.nodeValue}return ret};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" "}return match.slice(0,4)},CHILD:function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0])}match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+(match[7]+match[8]||match[3]==="odd")}else if(match[3]){Sizzle.error(match[0])}return match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null}if(match[3]){match[2]=match[4]||match[5]||""}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess)}return match.slice(0,3)}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!="}if(!operator){return true}result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false}},CHILD:function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){while(dir){node=elem;while(node=node[dir]){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false}}start=dir=type==="only"&&!start&&"nextSibling"}return true}start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=cache[0]===dirruns&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop()){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns){diff=cache[1]}else{while(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop()){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){(node[expando]||(node[expando]={}))[type]=[dirruns,diff]}if(node===elem){break}}}}diff-=last;return diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument)}if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf.call(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i])}}):function(elem){return fn(elem,0,args)}}return fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if(elem=unmatched[i]){seed[i]=!(matches[i]=elem)}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);return!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang)}lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang")){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0}}while((elem=elem.parentNode)&&elem.nodeType===1);return false}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===false},disabled:function(elem){return elem.disabled===true},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return nodeName==="input"&&!!elem.checked||nodeName==="option"&&!!elem.selected},selected:function(elem){if(elem.parentNode){elem.parentNode.selectedIndex}return elem.selected===true},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false}}return true},parent:function(elem){return!Expr.pseudos["empty"](elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button"},text:function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text")},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}),odd:createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i)
  }return matchIndexes}),lt:createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;--i>=0;){matchIndexes.push(i)}return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i)}return matchIndexes})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i)}for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i)}function setFilters(){}setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters;tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0)}soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar}groups.push(tokens=[])}matched=false;if(match=rcombinators.exec(soFar)){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length)}for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length)}}if(!matched){break}}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)};function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value}return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,checkNonElements=base&&dir==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml)}}}:function(elem,context,xml){var oldCache,outerCache,newCache=[dirruns,doneName];if(xml){while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true}}}}else{while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});if((oldCache=outerCache[dir])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return newCache[2]=oldCache[2]}else{outerCache[dir]=newCache;if(newCache[2]=matcher(elem,context,xml)){return true}}}}}}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false}}return true}:matchers[0]}function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results)}return results}function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if(elem=unmatched[i]){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i)}}}}return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter)}if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector)}return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml)}if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if(elem=temp[i]){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem)}}}if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if(elem=matcherOut[i]){temp.push(matcherIn[i]=elem)}}postFinder(null,matcherOut=[],temp,xml)}i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf.call(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem)}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml)}else{push.apply(results,matcherOut)}}})}function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,true),matchers=[function(elem,context,xml){return!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];for(;i<len;i++){if(matcher=Expr.relative[tokens[i].type]){matchers=[addCombinator(elementMatcher(matchers),matcher)]}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break}}return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens(tokens=tokens.slice(j)),j<len&&toSelector(tokens))}matchers.push(matcher)}}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=dirruns+=contextBackup==null?1:Math.random()||.1,len=elems.length;if(outermost){outermostContext=context!==document&&context}for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;while(matcher=elementMatchers[j++]){if(matcher(elem,context,xml)){results.push(elem);break}}if(outermost){dirruns=dirrunsUnique}}if(bySet){if(elem=!matcher&&elem){matchedCount--}if(seed){unmatched.push(elem)}}}matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while(matcher=setMatchers[j++]){matcher(unmatched,setMatched,context,xml)}if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results)}}}setMatched=condense(setMatched)}push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1){Sizzle.uniqueSort(results)}}if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup}return unmatched};return bySet?markFunction(superMatcher):superMatcher}compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector)}i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached)}else{elementMatchers.push(cached)}}cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector}return cached};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results}else if(compiled){context=context.parentNode}selector=selector.slice(tokens.shift().value.length)}i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[type=token.type]){break}if(find=Expr.find[type]){if(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context)){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results}break}}}}(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,rsibling.test(selector)&&testContext(context.parentNode)||context);return results};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1});if(!assert(function(div){div.innerHTML="<a href='#'></a>";return div.firstChild.getAttribute("href")==="#"})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2)}})}if(!support.attributes||!assert(function(div){div.innerHTML="<input/>";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")===""})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue}})}if(!assert(function(div){return div.getAttribute("disabled")==null})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}})}return Sizzle}(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;var rneedsContext=jQuery.expr.match.needsContext;var rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/;var risSimple=/^.[^:#\[\.,]*$/;function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not})}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not})}if(typeof qualifier==="string"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not)}qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>=0!==not})}jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")"}return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1}))};jQuery.fn.extend({find:function(selector){var i,len=this.length,ret=[],self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true}}}))}for(i=0;i<len;i++){jQuery.find(selector,self[i],ret)}ret=this.pushStack(len>1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],false))},not:function(selector){return this.pushStack(winnow(this,selector||[],true))},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(selector,context){var match,elem;if(!selector){return this}if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null]}else{match=rquickExpr.exec(selector)}if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match])}else{this.attr(match,context[match])}}}return this}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){this.length=1;this[0]=elem}this.context=document;this.selector=selector;return this}}else if(!context||context.jquery){return(context||rootjQuery).find(selector)}else{return this.constructor(context).find(selector)}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}else if(jQuery.isFunction(selector)){return typeof rootjQuery.ready!=="undefined"?rootjQuery.ready(selector):selector(jQuery)}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.makeArray(selector,this)};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.extend({dir:function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break}matched.push(elem)}}return matched},sibling:function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n)}}return matched}});jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return true}}})},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],pos=rneedsContext.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(pos?pos.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}}}return this.pushStack(matched.length>1?jQuery.unique(matched):matched)},index:function(elem){if(!elem){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0])}return indexOf.call(this,elem.jquery?elem[0]:elem)},add:function(selector,context){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector))}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}return cur}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return elem.contentDocument||jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until}if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched)}if(this.length>1){if(!guaranteedUnique[name]){jQuery.unique(matched)}if(rparentsprev.test(name)){matched.reverse()}}return this.pushStack(matched)}});var rnotwhite=/\S+/g;var optionsCache={};function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=true});return object}jQuery.Callbacks=function(options){options=typeof options==="string"?optionsCache[options]||createOptions(options):jQuery.extend({},options);var memory,fired,firing,firingStart,firingLength,firingIndex,list=[],stack=!options.once&&[],fire=function(data){memory=options.memory&&data;fired=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;firing=true;for(;list&&firingIndex<firingLength;firingIndex++){if(list[firingIndex].apply(data[0],data[1])===false&&options.stopOnFalse){memory=false;break}}firing=false;if(list){if(stack){if(stack.length){fire(stack.shift())}}else if(memory){list=[]}else{self.disable()}}},self={add:function(){if(list){var start=list.length;(function add(args){jQuery.each(args,function(_,arg){var type=jQuery.type(arg);if(type==="function"){if(!options.unique||!self.has(arg)){list.push(arg)}}else if(arg&&arg.length&&type!=="string"){add(arg)}})})(arguments);if(firing){firingLength=list.length}else if(memory){firingStart=start;fire(memory)}}return this},remove:function(){if(list){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(firing){if(index<=firingLength){firingLength--}if(index<=firingIndex){firingIndex--}}}})}return this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!!(list&&list.length)},empty:function(){list=[];firingLength=0;return this},disable:function(){list=stack=memory=undefined;return this},disabled:function(){return!list},lock:function(){stack=undefined;if(!memory){self.disable()}return this},locked:function(){return!stack},fireWith:function(context,args){if(list&&(!fired||stack)){args=args||[];args=[context,args.slice?args.slice():args];if(firing){stack.push(args)}else{fire(args)}}return this},fire:function(){self.fireWith(this,arguments);return this},fired:function(){return!!fired}};return self};jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){deferred.done(arguments).fail(arguments);return this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify)}else{newDefer[tuple[0]+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)}})});fns=null}).promise()},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise}},deferred={};promise.pipe=promise.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString},tuples[i^1][2].disable,tuples[2][2].lock)}deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?promise:this,arguments);return this};deferred[tuple[0]+"With"]=list.fireWith});promise.promise(deferred);if(func){func.call(deferred,deferred)}return deferred},when:function(subordinate){var i=0,resolveValues=slice.call(arguments),length=resolveValues.length,remaining=length!==1||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values)}else if(!--remaining){deferred.resolveWith(contexts,values)}}},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i<length;i++){if(resolveValues[i]&&jQuery.isFunction(resolveValues[i].promise)){resolveValues[i].promise().done(updateFunc(i,resolveContexts,resolveValues)).fail(deferred.reject).progress(updateFunc(i,progressContexts,progressValues))}else{--remaining}}}if(!remaining){deferred.resolveWith(resolveContexts,resolveValues)}return deferred.promise()}});var readyList;jQuery.fn.ready=function(fn){jQuery.ready.promise().done(fn);return this};jQuery.extend({isReady:false,readyWait:1,holdReady:function(hold){if(hold){jQuery.readyWait++}else{jQuery.ready(true)}},ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return}jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return}readyList.resolveWith(document,[jQuery]);if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");jQuery(document).off("ready")}}});function completed(){document.removeEventListener("DOMContentLoaded",completed,false);window.removeEventListener("load",completed,false);jQuery.ready()}jQuery.ready.promise=function(obj){if(!readyList){readyList=jQuery.Deferred();if(document.readyState==="complete"){setTimeout(jQuery.ready)}else{document.addEventListener("DOMContentLoaded",completed,false);window.addEventListener("load",completed,false)}}return readyList.promise(obj)};jQuery.ready.promise();var access=jQuery.access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){jQuery.access(elems,fn,i,key[i],true,emptyGet,raw)}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true}if(bulk){if(raw){fn.call(elems,value);fn=null}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value)}}}if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)))}}}return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet};jQuery.acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!+owner.nodeType};function Data(){Object.defineProperty(this.cache={},0,{get:function(){return{}}});this.expando=jQuery.expando+Math.random()}Data.uid=1;Data.accepts=jQuery.acceptData;Data.prototype={key:function(owner){if(!Data.accepts(owner)){return 0}var descriptor={},unlock=owner[this.expando];if(!unlock){unlock=Data.uid++;try{descriptor[this.expando]={value:unlock};Object.defineProperties(owner,descriptor)}catch(e){descriptor[this.expando]=unlock;jQuery.extend(owner,descriptor)}}if(!this.cache[unlock]){this.cache[unlock]={}}return unlock},set:function(owner,data,value){var prop,unlock=this.key(owner),cache=this.cache[unlock];if(typeof data==="string"){cache[data]=value}else{if(jQuery.isEmptyObject(cache)){jQuery.extend(this.cache[unlock],data)}else{for(prop in data){cache[prop]=data[prop]}}}return cache},get:function(owner,key){var cache=this.cache[this.key(owner)];return key===undefined?cache:cache[key]},access:function(owner,key,value){var stored;if(key===undefined||key&&typeof key==="string"&&value===undefined){stored=this.get(owner,key);return stored!==undefined?stored:this.get(owner,jQuery.camelCase(key))}this.set(owner,key,value);return value!==undefined?value:key},remove:function(owner,key){var i,name,camel,unlock=this.key(owner),cache=this.cache[unlock];if(key===undefined){this.cache[unlock]={}}else{if(jQuery.isArray(key)){name=key.concat(key.map(jQuery.camelCase))}else{camel=jQuery.camelCase(key);if(key in cache){name=[key,camel]}else{name=camel;name=name in cache?[name]:name.match(rnotwhite)||[]}}i=name.length;while(i--){delete cache[name[i]]}}},hasData:function(owner){return!jQuery.isEmptyObject(this.cache[owner[this.expando]]||{})},discard:function(owner){if(owner[this.expando]){delete this.cache[owner[this.expando]]}}};var data_priv=new Data;var data_user=new Data;var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/([A-Z])/g;function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}data_user.set(elem,key,data)}else{data=undefined}}return data}jQuery.extend({hasData:function(elem){return data_user.hasData(elem)||data_priv.hasData(elem)},data:function(elem,name,data){return data_user.access(elem,name,data)},removeData:function(elem,name){data_user.remove(elem,name)},_data:function(elem,name,data){return data_priv.access(elem,name,data)},_removeData:function(elem,name){data_priv.remove(elem,name)}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=data_user.get(elem);if(elem.nodeType===1&&!data_priv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.slice(5));dataAttr(elem,name,data[name])}}}data_priv.set(elem,"hasDataAttrs",true)}}return data}if(typeof key==="object"){return this.each(function(){data_user.set(this,key)})}return access(this,function(value){var data,camelKey=jQuery.camelCase(key);if(elem&&value===undefined){data=data_user.get(elem,key);if(data!==undefined){return data}data=data_user.get(elem,camelKey);if(data!==undefined){return data}data=dataAttr(elem,camelKey,undefined);if(data!==undefined){return data}return}this.each(function(){var data=data_user.get(this,camelKey);data_user.set(this,camelKey,value);if(key.indexOf("-")!==-1&&data!==undefined){data_user.set(this,key,value)}})},null,value,arguments.length>1,null,true)},removeData:function(key){return this.each(function(){data_user.remove(this,key)})}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=data_priv.get(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=data_priv.access(elem,type,jQuery.makeArray(data))}else{queue.push(data)}}return queue||[]}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};if(fn==="inprogress"){fn=queue.shift();startLength--}if(fn){if(type==="fx"){queue.unshift("inprogress")}delete hooks.stop;fn.call(elem,next,hooks)}if(!startLength&&hooks){hooks.empty.fire()}},_queueHooks:function(elem,type){var key=type+"queueHooks";return data_priv.get(elem,key)||data_priv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){data_priv.remove(elem,[type+"queue",key])})})}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--}if(arguments.length<setter){return jQuery.queue(this[0],type)}return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!--count){defer.resolveWith(elements,[elements])}};if(typeof type!=="string"){obj=type;type=undefined}type=type||"fx";while(i--){tmp=data_priv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve)}}resolve();return defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;var cssExpand=["Top","Right","Bottom","Left"];var isHidden=function(elem,el){elem=el||elem;return jQuery.css(elem,"display")==="none"||!jQuery.contains(elem.ownerDocument,elem)};var rcheckableType=/^(?:checkbox|radio)$/i;(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue})();var strundefined=typeof undefined;support.focusinBubbles="onfocusin"in window;var rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;function returnTrue(){return true}function returnFalse(){return false}function safeActiveElement(){try{return document.activeElement}catch(err){}}jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=data_priv.get(elem);if(!elemData){return}if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector}if(!handler.guid){handler.guid=jQuery.guid++}if(!(events=elemData.events)){events=elemData.events={}}if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!==strundefined&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined}}types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false)}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}if(selector){handlers.splice(handlers.delegateCount++,0,handleObj)}else{handlers.push(handleObj)}jQuery.event.global[type]=true}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=data_priv.hasData(elem)&&data_priv.get(elem);if(!elemData||!(events=elemData.events)){return}types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true)}continue}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--}if(special.remove){special.remove.call(elem,handleObj)}}}if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle)}delete events[type]}}if(jQuery.isEmptyObject(events)){delete elemData.handle;data_priv.remove(elem,"events")}},trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return}if(rfocusMorph.test(type+jQuery.event.triggered)){return}if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();
  namespaces.sort()}ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem}data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return}if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode}for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur}if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window)}}i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(data_priv.get(cur,"events")||{})[event.type]&&data_priv.get(cur,"handle");if(handle){handle.apply(cur,data)}handle=ontype&&cur[ontype];if(handle&&handle.apply&&jQuery.acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault()}}}event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&jQuery.acceptData(elem)){if(ontype&&jQuery.isFunction(elem[type])&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null}jQuery.event.triggered=type;elem[type]();jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp}}}}return event.result},dispatch:function(event){event=jQuery.event.fix(event);var i,j,ret,matched,handleObj,handlerQueue=[],args=slice.call(arguments),handlers=(data_priv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return}handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation()}}}}}if(special.postDispatch){special.postDispatch.call(this,event)}return event.result},handlers:function(event,handlers){var i,matches,sel,handleObj,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||event.type!=="click")){for(;cur!==this;cur=cur.parentNode||this){if(cur.disabled!==true||event.type!=="click"){matches=[];for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matches[sel]===undefined){matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>=0:jQuery.find(sel,this,null,[cur]).length}if(matches[sel]){matches.push(handleObj)}}if(matches.length){handlerQueue.push({elem:cur,handlers:matches})}}}}if(delegateCount<handlers.length){handlerQueue.push({elem:this,handlers:handlers.slice(delegateCount)})}return handlerQueue},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(event,original){if(event.which==null){event.which=original.charCode!=null?original.charCode:original.keyCode}return event}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(event,original){var eventDoc,doc,body,button=original.button;if(event.pageX==null&&original.clientX!=null){eventDoc=event.target.ownerDocument||document;doc=eventDoc.documentElement;body=eventDoc.body;event.pageX=original.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=original.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}if(!event.which&&button!==undefined){event.which=button&1?1:button&2?3:button&4?2:0}return event}},fix:function(event){if(event[jQuery.expando]){return event}var i,prop,copy,type=event.type,originalEvent=event,fixHook=this.fixHooks[type];if(!fixHook){this.fixHooks[type]=fixHook=rmouseEvent.test(type)?this.mouseHooks:rkeyEvent.test(type)?this.keyHooks:{}}copy=fixHook.props?this.props.concat(fixHook.props):this.props;event=new jQuery.Event(originalEvent);i=copy.length;while(i--){prop=copy[i];event[prop]=originalEvent[prop]}if(!event.target){event.target=document}if(event.target.nodeType===3){event.target=event.target.parentNode}return fixHook.filter?fixHook.filter(event,originalEvent):event},special:{load:{noBubble:true},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus){this.focus();return false}},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur){this.blur();return false}},delegateType:"focusout"},click:{trigger:function(){if(this.type==="checkbox"&&this.click&&jQuery.nodeName(this,"input")){this.click();return false}},_default:function(event){return jQuery.nodeName(event.target,"a")}},beforeunload:{postDispatch:function(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result}}}},simulate:function(type,elem,event,bubble){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:true,originalEvent:{}});if(bubble){jQuery.event.trigger(e,null,elem)}else{jQuery.event.dispatch.call(elem,e)}if(e.isDefaultPrevented()){event.preventDefault()}}};jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle,false)}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props)}if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse}else{this.type=src}if(props){jQuery.extend(this,props)}this.timeStamp=src&&src.timeStamp||jQuery.now();this[jQuery.expando]=true};jQuery.Event.prototype={isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e&&e.preventDefault){e.preventDefault()}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e&&e.stopPropagation){e.stopPropagation()}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e&&e.stopImmediatePropagation){e.stopImmediatePropagation()}this.stopPropagation()}};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||related!==target&&!jQuery.contains(target,related)){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix}return ret}}});if(!support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event),true)};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=data_priv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true)}data_priv.access(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this,attaches=data_priv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);data_priv.remove(doc,fix)}else{data_priv.access(doc,fix,attaches)}}}})}jQuery.fn.extend({on:function(types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined}for(type in types){this.on(type,selector,data,types[type],one)}return this}if(data==null&&fn==null){fn=selector;data=selector=undefined}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined}else{fn=data;data=selector;selector=undefined}}if(fn===false){fn=returnFalse}else if(!fn){return this}if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments)};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)}return this.each(function(){jQuery.event.add(this,types,fn,data,selector)})},one:function(types,selector,data,fn){return this.on(types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this}if(typeof types==="object"){for(type in types){this.off(type,selector,types[type])}return this}if(selector===false||typeof selector==="function"){fn=selector;selector=undefined}if(fn===false){fn=returnFalse}return this.each(function(){jQuery.event.remove(this,types,fn,selector)})},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true)}}});var rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style|link)/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/^$|\/(?:java|ecma)script/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1]}else{elem.removeAttribute("type")}return elem}function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){data_priv.set(elems[i],"globalEval",!refElements||data_priv.get(refElements[i],"globalEval"))}}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(dest.nodeType!==1){return}if(data_priv.hasData(src)){pdataOld=data_priv.access(src);pdataCur=data_priv.set(dest,pdataOld);events=pdataOld.events;if(events){delete pdataCur.handle;pdataCur.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i])}}}}if(data_user.hasData(src)){udataOld=data_user.access(src);udataCur=jQuery.extend({},udataOld);data_user.set(dest,udataCur)}}function getAll(context,tag){var ret=context.getElementsByTagName?context.getElementsByTagName(tag||"*"):context.querySelectorAll?context.querySelectorAll(tag||"*"):[];return tag===undefined||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue}}jQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=jQuery.contains(elem.ownerDocument,elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i])}}if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i])}}else{cloneCopyEvent(elem,clone)}}destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"))}return clone},buildFragment:function(elems,context,scripts,selection){var elem,tmp,tag,wrap,contains,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(jQuery.type(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem)}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem))}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+elem.replace(rxhtmlTag,"<$1></$2>")+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild}jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent=""}}}fragment.textContent="";i=0;while(elem=nodes[i++]){if(selection&&jQuery.inArray(elem,selection)!==-1){continue}contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(fragment.appendChild(elem),"script");if(contains){setGlobalEval(tmp)}if(scripts){j=0;while(elem=tmp[j++]){if(rscriptType.test(elem.type||"")){scripts.push(elem)}}}}return fragment},cleanData:function(elems){var data,elem,type,key,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(jQuery.acceptData(elem)){key=elem[data_priv.expando];if(key&&(data=data_priv.cache[key])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type)}else{jQuery.removeEvent(elem,type,data.handle)}}}if(data_priv.cache[key]){delete data_priv.cache[key]}}}delete data_user.cache[elem[data_user.expando]]}}});jQuery.fn.extend({text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value}})},null,value,arguments.length)},append:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this)}})},after:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling)}})},remove:function(selector,keepData){var elem,elems=selector?jQuery.filter(selector,this):this,i=0;for(;(elem=elems[i])!=null;i++){if(!keepData&&elem.nodeType===1){jQuery.cleanData(getAll(elem))}if(elem.parentNode){if(keepData&&jQuery.contains(elem.ownerDocument,elem)){setGlobalEval(getAll(elem,"script"))}elem.parentNode.removeChild(elem)}}return this},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent=""}}return this},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML}if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value}}elem=0}catch(e){}}if(elem){this.empty().append(value)}},null,value,arguments.length)},replaceWith:function(){var arg=arguments[0];this.domManip(arguments,function(elem){arg=this.parentNode;jQuery.cleanData(getAll(this));if(arg){arg.replaceChild(elem,this)}});return arg&&(arg.length||arg.nodeType)?this:this.remove()},detach:function(selector){return this.remove(selector,true)},domManip:function(args,callback){args=concat.apply([],args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=this.length,set=this,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value)){return this.each(function(index){var self=set.eq(index);if(isFunction){args[0]=value.call(this,index,self.html())}self.domManip(args,callback)})}if(l){fragment=jQuery.buildFragment(args,this[0].ownerDocument,false,this);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first}if(first){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"))}}callback.call(this[i],node,i)}if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!data_priv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src){if(jQuery._evalUrl){jQuery._evalUrl(node.src)}}else{jQuery.globalEval(node.textContent.replace(rcleanScript,""))}}}}}}return this}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);push.apply(ret,elems.get())}return this.pushStack(ret)}});var iframe,elemdisplay={};function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");elem.detach();return display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];if(!display){display=actualDisplay(nodeName,doc);if(display==="none"||!display){iframe=(iframe||jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);doc=iframe[0].contentDocument;doc.write();doc.close();display=actualDisplay(nodeName,doc);iframe.detach()}elemdisplay[nodeName]=display}return display}var rmargin=/^margin/;var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function(elem){return elem.ownerDocument.defaultView.getComputedStyle(elem,null)};function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name]}if(computed){if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name)}if(rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth}}return ret!==undefined?ret+"":ret}function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return}return(this.get=hookFn).apply(this,arguments)}}}(function(){var pixelPositionVal,boxSizingReliableVal,docElem=document.documentElement,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return}div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";container.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;"+"position:absolute";container.appendChild(div);function computePixelPositionAndBoxSizingReliable(){div.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;"+"box-sizing:border-box;display:block;margin-top:1%;top:1%;"+"border:1px;padding:1px;width:4px;position:absolute";div.innerHTML="";docElem.appendChild(container);var divStyle=window.getComputedStyle(div,null);pixelPositionVal=divStyle.top!=="1%";boxSizingReliableVal=divStyle.width==="4px";docElem.removeChild(container)}if(window.getComputedStyle){jQuery.extend(support,{pixelPosition:function(){computePixelPositionAndBoxSizingReliable();return pixelPositionVal},boxSizingReliable:function(){if(boxSizingReliableVal==null){computePixelPositionAndBoxSizingReliable()}return boxSizingReliableVal},reliableMarginRight:function(){var ret,marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;"+"box-sizing:content-box;display:block;margin:0;border:0;padding:0";marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";docElem.appendChild(container);ret=!parseFloat(window.getComputedStyle(marginDiv,null).marginRight);docElem.removeChild(container);return ret}})}})();jQuery.swap=function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name]}ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name]}return ret};var rdisplayswap=/^(none|table(?!-c[ea]).+)/,rnumsplit=new RegExp("^("+pnum+")(.*)$","i"),rrelNum=new RegExp("^([+-])=("+pnum+")","i"),cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","O","Moz","ms"];function vendorPropName(style,name){if(name in style){return name}var capName=name[0].toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name}}return origName}function setPositiveNumber(elem,value,subtract){var matches=rnumsplit.exec(value);return matches?Math.max(0,matches[1]-(subtract||0))+(matches[2]||"px"):value}function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,styles)}if(isBorderBox){if(extra==="content"){val-=jQuery.css(elem,"padding"+cssExpand[i],true,styles)}if(extra!=="margin"){val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}}else{val+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(extra!=="padding"){val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}}}return val}function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=true,val=name==="width"?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";if(val<=0||val==null){val=curCSS(elem,name,styles);if(val<0||val==null){val=elem.style[name]}if(rnumnonpx.test(val)){return val}valueIsBorderBox=isBorderBox&&(support.boxSizingReliable()||val===elem.style[name]);val=parseFloat(val)||0}return val+augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles)+"px"}function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue}values[index]=data_priv.get(elem,"olddisplay");display=elem.style.display;if(show){if(!values[index]&&display==="none"){elem.style.display=""}if(elem.style.display===""&&isHidden(elem)){values[index]=data_priv.access(elem,"olddisplay",defaultDisplay(elem.nodeName))}}else{hidden=isHidden(elem);if(display!=="none"||!hidden){data_priv.set(elem,"olddisplay",hidden?display:jQuery.css(elem,"display"))}}}for(index=0;index<length;index++){elem=elements[index];if(!elem.style){continue}if(!show||elem.style.display==="none"||elem.style.display===""){elem.style.display=show?values[index]||"":"none"}}return elements}jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret}}}},cssNumber:{columnCount:true,fillOpacity:true,flexGrow:true,flexShrink:true,fontWeight:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":"cssFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return}var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rrelNum.exec(value))){value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name));type="number"}if(value==null||value!==value){return}if(type==="number"&&!jQuery.cssNumber[origName]){value+="px"}if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit"}if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){style[name]=value}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret}return style[name]}},css:function(elem,name,extra,styles){var val,num,hooks,origName=jQuery.camelCase(name);name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra)}if(val===undefined){val=curCSS(elem,name,styles)}if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name]}if(extra===""||extra){num=parseFloat(val);return extra===true||jQuery.isNumeric(num)?num||0:val}return val}});jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&elem.offsetWidth===0?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)}},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles):0)}}});jQuery.cssHooks.marginRight=addGetHookIf(support.reliableMarginRight,function(elem,computed){if(computed){return jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"])}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0]}return expanded}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(jQuery.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles)}return map}return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)},show:function(){return showHide(this,true)},hide:function(){return showHide(this)},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide()}return this.each(function(){if(isHidden(this)){jQuery(this).show()}else{jQuery(this).hide()}})}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||"swing";this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration)}else{this.pos=eased=percent}this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(hooks&&hooks.set){hooks.set(this)}else{Tween.propHooks._default.set(this)}return this}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem[tween.prop]!=null&&(!tween.elem.style||tween.elem.style[tween.prop]==null)){return tween.elem[tween.prop]}result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween)}else if(tween.elem.style&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}else{tween.elem[tween.prop]=tween.now}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now}}};jQuery.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2}};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var tween=this.createTween(prop,value),target=tween.cur(),parts=rfxnum.exec(value),unit=parts&&parts[3]||(jQuery.cssNumber[prop]?"":"px"),start=(jQuery.cssNumber[prop]||unit!=="px"&&+target)&&rfxnum.exec(jQuery.css(tween.elem,prop)),scale=1,maxIterations=20;if(start&&start[3]!==unit){unit=unit||start[3];parts=parts||[];start=+target||1;do{scale=scale||".5";start=start/scale;jQuery.style(tween.elem,prop,start+unit)}while(scale!==(scale=tween.cur()/target)&&scale!==1&&--maxIterations)}if(parts){start=tween.start=+start||+target||0;tween.unit=unit;tween.end=parts[1]?start+(parts[1]+1)*parts[2]:+parts[2]}return tween}]};function createFxNow(){setTimeout(function(){fxNow=undefined});return fxNow=jQuery.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type}if(includeWidth){attrs.opacity=attrs.width=type}return attrs}function createTween(value,prop,animation){var tween,collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if(tween=collection[index].call(animation,prop,value)){return tween}}}function defaultPrefilter(elem,props,opts){var prop,value,toggle,tween,hooks,oldfire,display,checkDisplay,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHidden(elem),dataShow=data_priv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire()}}}hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire()}})})}if(elem.nodeType===1&&("height"in props||"width"in props)){opts.overflow=[style.overflow,style.overflowX,style.overflowY];
  display=jQuery.css(elem,"display");checkDisplay=display==="none"?data_priv.get(elem,"olddisplay")||defaultDisplay(elem.nodeName):display;if(checkDisplay==="inline"&&jQuery.css(elem,"float")==="none"){style.display="inline-block"}}if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2]})}for(prop in props){value=props[prop];if(rfxtypes.exec(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true}else{continue}}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}else{display=undefined}}if(!jQuery.isEmptyObject(orig)){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden}}else{dataShow=data_priv.access(elem,"fxshow",{})}if(toggle){dataShow.hidden=!hidden}if(hidden){jQuery(elem).show()}else{anim.done(function(){jQuery(elem).hide()})}anim.done(function(){var prop;data_priv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop])}});for(prop in orig){tween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=tween.start;if(hidden){tween.end=tween.start;tween.start=prop==="width"||prop==="height"?1:0}}}}else if((display==="none"?defaultDisplay(elem.nodeName):display)==="inline"){style.display=display}}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=jQuery.camelCase(index);easing=specialEasing[name];value=props[index];if(jQuery.isArray(value)){easing=value[1];value=props[index]=value[0]}if(index!==name){props[name]=value;delete props[index]}hooks=jQuery.cssHooks[name];if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing}}}else{specialEasing[name]=easing}}}function Animation(elem,properties,options){var result,stopped,index=0,length=animationPrefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function(){if(stopped){return false}var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent)}deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining}else{deferred.resolveWith(elem,[animation]);return false}},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{}},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this}stopped=true;for(;index<length;index++){animation.tweens[index].run(1)}if(gotoEnd){deferred.resolveWith(elem,[animation,gotoEnd])}else{deferred.rejectWith(elem,[animation,gotoEnd])}return this}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=animationPrefilters[index].call(animation,elem,props,animation.opts);if(result){return result}}jQuery.map(props,createTween,animation);if(jQuery.isFunction(animation.opts.start)){animation.opts.start.call(elem,animation)}jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)}jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){if(jQuery.isFunction(props)){callback=props;props=["*"]}else{props=props.split(" ")}var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];tweeners[prop]=tweeners[prop]||[];tweeners[prop].unshift(callback)}},prefilter:function(callback,prepend){if(prepend){animationPrefilters.unshift(callback)}else{animationPrefilters.push(callback)}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default;if(opt.queue==null||opt.queue===true){opt.queue="fx"}opt.old=opt.complete;opt.complete=function(){if(jQuery.isFunction(opt.old)){opt.old.call(this)}if(opt.queue){jQuery.dequeue(this,opt.queue)}};return opt};jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHidden).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||data_priv.get(this,"finish")){anim.stop(true)}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd)};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined}if(clearQueue&&type!==false){this.queue(type||"fx",[])}return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=data_priv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index])}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index])}}}for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1)}}if(dequeue||!gotoEnd){jQuery.dequeue(this,type)}})},finish:function(type){if(type!==false){type=type||"fx"}return this.each(function(){var index,data=data_priv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true)}for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1)}}for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this)}}delete data.finish})}});jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback)}});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=jQuery.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}fxNow=undefined};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);if(timer()){jQuery.fx.start()}else{jQuery.timers.pop()}};jQuery.fx.interval=13;jQuery.fx.start=function(){if(!timerId){timerId=setInterval(jQuery.fx.tick,jQuery.fx.interval)}};jQuery.fx.stop=function(){clearInterval(timerId);timerId=null};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=setTimeout(next,time);hooks.stop=function(){clearTimeout(timeout)}})};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;select.disabled=true;support.optDisabled=!opt.disabled;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t"})();var nodeHook,boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})}});jQuery.extend({attr:function(elem,name,value){var hooks,ret,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return}if(typeof elem.getAttribute===strundefined){return jQuery.prop(elem,name,value)}if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:nodeHook)}if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name)}else if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret}else{elem.setAttribute(name,value+"");return value}}else if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret}else{ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret}},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(rnotwhite);if(attrNames&&elem.nodeType===1){while(name=attrNames[i++]){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){elem[propName]=false}elem.removeAttribute(name)}}},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val}return value}}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name)}else{elem.setAttribute(name,name)}return name}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle;if(!isXML){handle=attrHandle[name];attrHandle[name]=ret;ret=getter(elem,name,isXML)!=null?name.toLowerCase():null;attrHandle[name]=handle}return ret}});var rfocusable=/^(?:input|select|textarea|button)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name]})}});jQuery.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return}notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name]}if(value!==undefined){return hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value}else{return hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null?ret:elem[name]}},propHooks:{tabIndex:{get:function(elem){return elem.hasAttribute("tabindex")||rfocusable.test(elem.nodeName)||elem.href?elem.tabIndex:-1}}}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex}return null}}}jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function(value){var classes,elem,cur,clazz,j,finalValue,proceed=typeof value==="string"&&value,i=0,len=this.length;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))})}if(proceed){classes=(value||"").match(rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):" ");if(cur){j=0;while(clazz=classes[j++]){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" "}}finalValue=jQuery.trim(cur);if(elem.className!==finalValue){elem.className=finalValue}}}}return this},removeClass:function(value){var classes,elem,cur,clazz,j,finalValue,proceed=arguments.length===0||typeof value==="string"&&value,i=0,len=this.length;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,this.className))})}if(proceed){classes=(value||"").match(rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):"");if(cur){j=0;while(clazz=classes[j++]){while(cur.indexOf(" "+clazz+" ")>=0){cur=cur.replace(" "+clazz+" "," ")}}finalValue=value?jQuery.trim(cur):"";if(elem.className!==finalValue){elem.className=finalValue}}}}return this},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value)}if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)})}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),classNames=value.match(rnotwhite)||[];while(className=classNames[i++]){if(self.hasClass(className)){self.removeClass(className)}else{self.addClass(className)}}}else if(type===strundefined||type==="boolean"){if(this.className){data_priv.set(this,"__className__",this.className)}this.className=this.className||value===false?"":data_priv.get(this,"__className__")||""}})},hasClass:function(selector){var className=" "+selector+" ",i=0,l=this.length;for(;i<l;i++){if(this[i].nodeType===1&&(" "+this[i].className+" ").replace(rclass," ").indexOf(className)>=0){return true}}return false}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret}ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret}return}isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return}if(isFunction){val=value.call(this,i,jQuery(this).val())}else{val=value}if(val==null){val=""}else if(typeof val==="number"){val+=""}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+""})}hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val}})}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:jQuery.trim(jQuery.text(elem))}},select:{get:function(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i<max;i++){option=options[i];if((option.selected||i===index)&&(support.optDisabled?!option.disabled:option.getAttribute("disabled")===null)&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value}values.push(value)}}return values},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(option.value,values)>=0){optionSet=true}}if(!optionSet){elem.selectedIndex=-1}return values}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value)){return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value}}});jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)},bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn)}});var nonce=jQuery.now();var rquery=/\?/;jQuery.parseJSON=function(data){return JSON.parse(data+"")};jQuery.parseXML=function(data){var xml,tmp;if(!data||typeof data!=="string"){return null}try{tmp=new DOMParser;xml=tmp.parseFromString(data,"text/xml")}catch(e){xml=undefined}if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data)}return xml};var ajaxLocParts,ajaxLocation,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*"}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){while(dataType=dataTypes[i++]){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func)}else{(structure[dataType]=structure[dataType]||[]).push(func)}}}}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=structure===transports;function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false}else if(seekingTransport){return!(selected=dataTypeOrTransport)}});return selected}return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key]}}if(deep){jQuery.extend(true,target,deep)}return target}function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type")}}if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}}}if(dataTypes[0]in responses){finalDataType=dataTypes[0]}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}if(!firstDataType){firstDataType=type}}finalDataType=finalDataType||firstDataType}if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType)}return responses[finalDataType]}}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv]}}current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response}if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType)}prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2]}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1])}break}}}}if(conv!==true){if(conv&&s["throws"]){response=conv(response)}else{try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}}}}}return{state:"success",data:response}}jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined}options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,parts,fireGlobals,i,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while(match=rheaders.exec(responseHeadersString)){responseHeaders[match[1].toLowerCase()]=match[2]}}match=responseHeaders[key.toLowerCase()]}return match==null?null:match},getAllResponseHeaders:function(){return state===2?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value}return this},overrideMimeType:function(type){if(!state){s.mimeType=type}return this},statusCode:function(map){var code;if(map){if(state<2){for(code in map){statusCode[code]=[statusCode[code],map[code]]}}else{jqXHR.always(map[jqXHR.status])}}return this},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText)}done(0,finalText);return this}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(rnotwhite)||[""];if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!==ajaxLocParts[1]||parts[2]!==ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?"80":"443"))!==(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?"80":"443"))))}if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR}fireGlobals=s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart")}s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=s.url+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data}if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+nonce++):cacheURL+(rquery.test(cacheURL)?"&":"?")+"_="+nonce++}}if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL])}if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])}}if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType)}jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i])}if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort()}strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i])}transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport")}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s])}if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout)}try{state=1;transport.send(requestHeaders,done)}catch(e){if(state<2){done(-1,e)}else{throw e}}}function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return}state=2;if(timeoutTimer){clearTimeout(timeoutTimer)}transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses)}response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified}modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified}}if(status===204||s.type==="HEAD"){statusText="nocontent"}else if(status===304){statusText="notmodified"}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0}}}jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR])}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error])}jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error])}completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!--jQuery.active){jQuery.event.trigger("ajaxStop")}}}return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined}return jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}});jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}});jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true})};jQuery.fn.extend({wrapAll:function(html){var wrap;if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}if(this[0]){wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild}return elem}).append(this)}return this},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()}});jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"?i:"")+"]",v,traditional,add)}})}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add)}}else{add(prefix,obj)}}jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():value==null?"":value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional}if(jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a)){jQuery.each(a,function(){add(this.name,this.value)})}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add)}}return s.join("&").replace(r20,"+")};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});jQuery.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var xhrId=0,xhrCallbacks={},xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();if(window.ActiveXObject){jQuery(window).on("unload",function(){for(var key in xhrCallbacks){xhrCallbacks[key]()}})}support.cors=!!xhrSupported&&"withCredentials"in xhrSupported;support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr(),id=++xhrId;xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i]}}if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType)}if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest"}for(i in headers){xhr.setRequestHeader(i,headers[i])}callback=function(type){return function(){if(callback){delete xhrCallbacks[id];callback=xhr.onload=xhr.onerror=null;if(type==="abort"){xhr.abort()}else if(type==="error"){complete(xhr.status,xhr.statusText)
  }else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,typeof xhr.responseText==="string"?{text:xhr.responseText}:undefined,xhr.getAllResponseHeaders())}}}};xhr.onload=callback();xhr.onerror=callback("error");callback=xhrCallbacks[id]=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback){throw e}}},abort:function(){if(callback){callback()}}}}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){jQuery.globalEval(text);return text}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false}if(s.crossDomain){s.type="GET"}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery("<script>").prop({async:true,charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type)}});document.head.appendChild(script[0])},abort:function(){if(callback){callback()}}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce++;this[callback]=true;return callback}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName)}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName}s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called")}return responseContainer[0]};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments};jqXHR.always(function(){window[callbackName]=overwritten;if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName)}if(responseContainer&&jQuery.isFunction(overwritten)){overwritten(responseContainer[0])}responseContainer=overwritten=undefined});return"script"}});jQuery.parseHTML=function(data,context,keepScripts){if(!data||typeof data!=="string"){return null}if(typeof context==="boolean"){keepScripts=context;context=false}context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])]}parsed=jQuery.buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove()}return jQuery.merge([],parsed.childNodes)};var _load=jQuery.fn.load;jQuery.fn.load=function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments)}var selector,type,response,self=this,off=url.indexOf(" ");if(off>=0){selector=jQuery.trim(url.slice(off));url=url.slice(0,off)}if(jQuery.isFunction(params)){callback=params;params=undefined}else if(params&&typeof params==="object"){type="POST"}if(self.length>0){jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])})}return this};jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length};var docElem=window.document.documentElement;function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView}jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative"}curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0}if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset)}if(options.top!=null){props.top=options.top-curOffset.top+curTop}if(options.left!=null){props.left=options.left-curOffset.left+curLeft}if("using"in options){options.using.call(elem,props)}else{curElem.css(props)}}};jQuery.fn.extend({offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)})}var docElem,win,elem=this[0],box={top:0,left:0},doc=elem&&elem.ownerDocument;if(!doc){return}docElem=doc.documentElement;if(!jQuery.contains(docElem,elem)){return box}if(typeof elem.getBoundingClientRect!==strundefined){box=elem.getBoundingClientRect()}win=getWindow(doc);return{top:box.top+win.pageYOffset-docElem.clientTop,left:box.left+win.pageXOffset-docElem.clientLeft}},position:function(){if(!this[0]){return}var offsetParent,offset,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect()}else{offsetParent=this.offsetParent();offset=this.offset();if(!jQuery.nodeName(offsetParent[0],"html")){parentOffset=offsetParent.offset()}parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",true)}return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||docElem;while(offsetParent&&!jQuery.nodeName(offsetParent,"html")&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent}return offsetParent||docElem})}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win=getWindow(elem);if(val===undefined){return win?win[prop]:elem[method]}if(win){win.scrollTo(!top?val:window.pageXOffset,top?val:window.pageYOffset)}else{elem[method]=val}},method,val,arguments.length,null)}});jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}})});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;if(jQuery.isWindow(elem)){return elem.document.documentElement["client"+name]}if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])}return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})});jQuery.fn.size=function(){return this.length};jQuery.fn.andSelf=jQuery.fn.addBack;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery})}var _jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$}if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery}return jQuery};if(typeof noGlobal===strundefined){window.jQuery=window.$=jQuery}return jQuery});if(!jQuery){throw new Error("Bootstrap requires jQuery")}+function($){"use strict";function transitionEnd(){var el=document.createElement("bootstrap");var transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}}$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this;$(this).one($.support.transition.end,function(){called=true});var callback=function(){if(!called)$($el).trigger($.support.transition.end)};setTimeout(callback,duration);return this};$(function(){$.support.transition=transitionEnd()})}(window.jQuery);+function($){"use strict";var dismiss='[data-dismiss="alert"]';var Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){var $this=$(this);var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")}var $parent=$(selector);if(e)e.preventDefault();if(!$parent.length){$parent=$this.hasClass("alert")?$this:$this.parent()}$parent.trigger(e=$.Event("close.bs.alert"));if(e.isDefaultPrevented())return;$parent.removeClass("in");function removeElement(){$parent.trigger("closed.bs.alert").remove()}$.support.transition&&$parent.hasClass("fade")?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.alert");if(!data)$this.data("bs.alert",data=new Alert(this));if(typeof option=="string")data[option].call($this)})};$.fn.alert.Constructor=Alert;$.fn.alert.noConflict=function(){$.fn.alert=old;return this};$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery);+function($){"use strict";var Button=function(element,options){this.$element=$(element);this.options=$.extend({},Button.DEFAULTS,options)};Button.DEFAULTS={loadingText:"loading..."};Button.prototype.setState=function(state){var d="disabled";var $el=this.$element;var val=$el.is("input")?"val":"html";var data=$el.data();state=state+"Text";if(!data.resetText)$el.data("resetText",$el[val]());$el[val](data[state]||this.options[state]);setTimeout(function(){state=="loadingText"?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)};Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");if($input.prop("type")==="radio")$parent.find(".active").removeClass("active")}this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.button");var options=typeof option=="object"&&option;if(!data)$this.data("bs.button",data=new Button(this,options));if(option=="toggle")data.toggle();else if(option)data.setState(option)})};$.fn.button.Constructor=Button;$.fn.button.noConflict=function(){$.fn.button=old;return this};$(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);if(!$btn.hasClass("btn"))$btn=$btn.closest(".btn");$btn.button("toggle");e.preventDefault()})}(window.jQuery);+function($){"use strict";var Carousel=function(element,options){this.$element=$(element);this.$indicators=this.$element.find(".carousel-indicators");this.options=options;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.DEFAULTS={interval:5e3,pause:"hover",wrap:true};Carousel.prototype.cycle=function(e){e||(this.paused=false);this.interval&&clearInterval(this.interval);this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval));return this};Carousel.prototype.getActiveIndex=function(){this.$active=this.$element.find(".item.active");this.$items=this.$active.parent().children();return this.$items.index(this.$active)};Carousel.prototype.to=function(pos){var that=this;var activeIndex=this.getActiveIndex();if(pos>this.$items.length-1||pos<0)return;if(this.sliding)return this.$element.one("slid",function(){that.to(pos)});if(activeIndex==pos)return this.pause().cycle();return this.slide(pos>activeIndex?"next":"prev",$(this.$items[pos]))};Carousel.prototype.pause=function(e){e||(this.paused=true);if(this.$element.find(".next, .prev").length&&$.support.transition.end){this.$element.trigger($.support.transition.end);this.cycle(true)}this.interval=clearInterval(this.interval);return this};Carousel.prototype.next=function(){if(this.sliding)return;return this.slide("next")};Carousel.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")};Carousel.prototype.slide=function(type,next){var $active=this.$element.find(".item.active");var $next=next||$active[type]();var isCycling=this.interval;var direction=type=="next"?"left":"right";var fallback=type=="next"?"first":"last";var that=this;if(!$next.length){if(!this.options.wrap)return;$next=this.$element.find(".item")[fallback]()}this.sliding=true;isCycling&&this.pause();var e=$.Event("slide.bs.carousel",{relatedTarget:$next[0],direction:direction});if($next.hasClass("active"))return;if(this.$indicators.length){this.$indicators.find(".active").removeClass("active");this.$element.one("slid",function(){var $nextIndicator=$(that.$indicators.children()[that.getActiveIndex()]);$nextIndicator&&$nextIndicator.addClass("active")})}if($.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(e);if(e.isDefaultPrevented())return;$next.addClass(type);$next[0].offsetWidth;$active.addClass(direction);$next.addClass(direction);$active.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active");$active.removeClass(["active",direction].join(" "));that.sliding=false;setTimeout(function(){that.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{this.$element.trigger(e);if(e.isDefaultPrevented())return;$active.removeClass("active");$next.addClass("active");this.sliding=false;this.$element.trigger("slid")}isCycling&&this.cycle();return this};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.carousel");var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=="object"&&option);var action=typeof option=="string"?option:options.slide;if(!data)$this.data("bs.carousel",data=new Carousel(this,options));if(typeof option=="number")data.to(option);else if(action)data[action]();else if(options.interval)data.pause().cycle()})};$.fn.carousel.Constructor=Carousel;$.fn.carousel.noConflict=function(){$.fn.carousel=old;return this};$(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(e){var $this=$(this),href;var $target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""));var options=$.extend({},$target.data(),$this.data());var slideIndex=$this.attr("data-slide-to");if(slideIndex)options.interval=false;$target.carousel(options);if(slideIndex=$this.attr("data-slide-to")){$target.data("bs.carousel").to(slideIndex)}e.preventDefault()});$(window).on("load",function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this);$carousel.carousel($carousel.data())})})}(window.jQuery);+function($){"use strict";var Collapse=function(element,options){this.$element=$(element);this.options=$.extend({},Collapse.DEFAULTS,options);this.transitioning=null;if(this.options.parent)this.$parent=$(this.options.parent);if(this.options.toggle)this.toggle()};Collapse.DEFAULTS={toggle:true};Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"};Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass("in"))return;var startEvent=$.Event("show.bs.collapse");this.$element.trigger(startEvent);if(startEvent.isDefaultPrevented())return;var actives=this.$parent&&this.$parent.find("> .panel > .in");if(actives&&actives.length){var hasData=actives.data("bs.collapse");if(hasData&&hasData.transitioning)return;actives.collapse("hide");hasData||actives.data("bs.collapse",null)}var dimension=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[dimension](0);this.transitioning=1;var complete=function(){this.$element.removeClass("collapsing").addClass("in")[dimension]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")};if(!$.support.transition)return complete.call(this);var scrollSize=$.camelCase(["scroll",dimension].join("-"));this.$element.one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])};Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("in"))return;var startEvent=$.Event("hide.bs.collapse");this.$element.trigger(startEvent);if(startEvent.isDefaultPrevented())return;var dimension=this.dimension();this.$element[dimension](this.$element[dimension]())[0].offsetHeight;this.$element.addClass("collapsing").removeClass("collapse").removeClass("in");this.transitioning=1;var complete=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};if(!$.support.transition)return complete.call(this);this.$element[dimension](0).one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)};Collapse.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.collapse");var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=="object"&&option);if(!data)$this.data("bs.collapse",data=new Collapse(this,options));if(typeof option=="string")data[option]()})};$.fn.collapse.Constructor=Collapse;$.fn.collapse.noConflict=function(){$.fn.collapse=old;return this};$(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(e){var $this=$(this),href;var target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"");var $target=$(target);var data=$target.data("bs.collapse");var option=data?"toggle":$this.data();var parent=$this.attr("data-parent");var $parent=parent&&$(parent);if(!data||!data.transitioning){if($parent)$parent.find('[data-toggle=collapse][data-parent="'+parent+'"]').not($this).addClass("collapsed");$this[$target.hasClass("in")?"addClass":"removeClass"]("collapsed")}$target.collapse(option)})}(window.jQuery);+function($){"use strict";var backdrop=".dropdown-backdrop";var toggle="[data-toggle=dropdown]";var Dropdown=function(element){var $el=$(element).on("click.bs.dropdown",this.toggle)};Dropdown.prototype.toggle=function(e){var $this=$(this);if($this.is(".disabled, :disabled"))return;var $parent=getParent($this);var isActive=$parent.hasClass("open");clearMenus();if(!isActive){if("ontouchstart"in document.documentElement&&!$parent.closest(".navbar-nav").length){$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on("click",clearMenus)}$parent.trigger(e=$.Event("show.bs.dropdown"));if(e.isDefaultPrevented())return;$parent.toggleClass("open").trigger("shown.bs.dropdown");$this.focus()}return false};Dropdown.prototype.keydown=function(e){if(!/(38|40|27)/.test(e.keyCode))return;var $this=$(this);e.preventDefault();e.stopPropagation();if($this.is(".disabled, :disabled"))return;var $parent=getParent($this);var isActive=$parent.hasClass("open");if(!isActive||isActive&&e.keyCode==27){if(e.which==27)$parent.find(toggle).focus();return $this.click()}var $items=$("[role=menu] li:not(.divider):visible a",$parent);if(!$items.length)return;var index=$items.index($items.filter(":focus"));if(e.keyCode==38&&index>0)index--;if(e.keyCode==40&&index<$items.length-1)index++;if(!~index)index=0;$items.eq(index).focus()};function clearMenus(){$(backdrop).remove();$(toggle).each(function(e){var $parent=getParent($(this));if(!$parent.hasClass("open"))return;$parent.trigger(e=$.Event("hide.bs.dropdown"));if(e.isDefaultPrevented())return;$parent.removeClass("open").trigger("hidden.bs.dropdown")})}function getParent($this){var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")}var $parent=selector&&$(selector);return $parent&&$parent.length?$parent:$this.parent()}var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this);var data=$this.data("dropdown");if(!data)$this.data("dropdown",data=new Dropdown(this));if(typeof option=="string")data[option].call($this)})};$.fn.dropdown.Constructor=Dropdown;$.fn.dropdown.noConflict=function(){$.fn.dropdown=old;return this};$(document).on("click.bs.dropdown.data-api",clearMenus).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.bs.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery);+function($){"use strict";var Modal=function(element,options){this.options=options;this.$element=$(element);this.$backdrop=this.isShown=null;if(this.options.remote)this.$element.load(this.options.remote)};Modal.DEFAULTS={backdrop:true,keyboard:true,show:true};Modal.prototype.toggle=function(_relatedTarget){return this[!this.isShown?"show":"hide"](_relatedTarget)};Modal.prototype.show=function(_relatedTarget){var that=this;var e=$.Event("show.bs.modal",{relatedTarget:_relatedTarget});this.$element.trigger(e);if(this.isShown||e.isDefaultPrevented())return;this.isShown=true;this.escape();this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',$.proxy(this.hide,this));this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");if(!that.$element.parent().length){that.$element.appendTo(document.body)}that.$element.show();if(transition){that.$element[0].offsetWidth}that.$element.addClass("in").attr("aria-hidden",false);that.enforceFocus();var e=$.Event("shown.bs.modal",{relatedTarget:_relatedTarget});transition?that.$element.find(".modal-dialog").one($.support.transition.end,function(){that.$element.focus().trigger(e)}).emulateTransitionEnd(300):that.$element.focus().trigger(e)})};Modal.prototype.hide=function(e){if(e)e.preventDefault();e=$.Event("hide.bs.modal");this.$element.trigger(e);if(!this.isShown||e.isDefaultPrevented())return;this.isShown=false;this.escape();$(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",true).off("click.dismiss.modal");$.support.transition&&this.$element.hasClass("fade")?this.$element.one($.support.transition.end,$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()};Modal.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.focus()}},this))};Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on("keyup.dismiss.bs.modal",$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off("keyup.dismiss.bs.modal")}};Modal.prototype.hideModal=function(){var that=this;this.$element.hide();this.backdrop(function(){that.removeBackdrop();that.$element.trigger("hidden.bs.modal")})};Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};Modal.prototype.backdrop=function(callback){var that=this;var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').appendTo(document.body);this.$element.on("click.dismiss.modal",$.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this));if(doAnimate)this.$backdrop[0].offsetWidth;this.$backdrop.addClass("in");if(!callback)return;doAnimate?this.$backdrop.one($.support.transition.end,callback).emulateTransitionEnd(150):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");$.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one($.support.transition.end,callback).emulateTransitionEnd(150):callback()}else if(callback){callback()}};var old=$.fn.modal;$.fn.modal=function(option,_relatedTarget){return this.each(function(){var $this=$(this);var data=$this.data("bs.modal");var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=="object"&&option);if(!data)$this.data("bs.modal",data=new Modal(this,options));if(typeof option=="string")data[option](_relatedTarget);else if(options.show)data.show(_relatedTarget)})};$.fn.modal.Constructor=Modal;$.fn.modal.noConflict=function(){$.fn.modal=old;return this};$(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var $this=$(this);var href=$this.attr("href");var $target=$($this.attr("data-target")||href&&href.replace(/.*(?=#[^\s]+$)/,""));var option=$target.data("modal")?"toggle":$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data());e.preventDefault();$target.modal(option,this).one("hide",function(){$this.is(":visible")&&$this.focus()})});$(document).on("show.bs.modal",".modal",function(){$(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){$(document.body).removeClass("modal-open")})}(window.jQuery);+function($){"use strict";var Tooltip=function(element,options){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",element,options)};Tooltip.DEFAULTS={animation:true,placement:"top",selector:false,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:false,container:false};Tooltip.prototype.init=function(type,element,options){this.enabled=true;this.type=type;this.$element=$(element);this.options=this.getOptions(options);var triggers=this.options.trigger.split(" ");for(var i=triggers.length;i--;){var trigger=triggers[i];if(trigger=="click"){this.$element.on("click."+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!="manual"){var eventIn=trigger=="hover"?"mouseenter":"focus";var eventOut=trigger=="hover"?"mouseleave":"blur";this.$element.on(eventIn+"."+this.type,this.options.selector,$.proxy(this.enter,this));this.$element.on(eventOut+"."+this.type,this.options.selector,$.proxy(this.leave,this))}}this.options.selector?this._options=$.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS};Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options);if(options.delay&&typeof options.delay=="number"){options.delay={show:options.delay,hide:options.delay}}return options};Tooltip.prototype.getDelegateOptions=function(){var options={};var defaults=this.getDefaults();this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value});return options};Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(self.timeout);self.hoverState="in";if(!self.options.delay||!self.options.delay.show)return self.show();self.timeout=setTimeout(function(){if(self.hoverState=="in")self.show()},self.options.delay.show)};Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(self.timeout);self.hoverState="out";if(!self.options.delay||!self.options.delay.hide)return self.hide();self.timeout=setTimeout(function(){if(self.hoverState=="out")self.hide()},self.options.delay.hide)};Tooltip.prototype.show=function(){var e=$.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);if(e.isDefaultPrevented())return;var $tip=this.tip();this.setContent();if(this.options.animation)$tip.addClass("fade");var placement=typeof this.options.placement=="function"?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement;var autoToken=/\s?auto?\s?/i;var autoPlace=autoToken.test(placement);if(autoPlace)placement=placement.replace(autoToken,"")||"top";$tip.detach().css({top:0,left:0,display:"block"}).addClass(placement);this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element);var pos=this.getPosition();var actualWidth=$tip[0].offsetWidth;var actualHeight=$tip[0].offsetHeight;if(autoPlace){var $parent=this.$element.parent();var orgPlacement=placement;var docScroll=document.documentElement.scrollTop||document.body.scrollTop;var parentWidth=this.options.container=="body"?window.innerWidth:$parent.outerWidth();var parentHeight=this.options.container=="body"?window.innerHeight:$parent.outerHeight();var parentLeft=this.options.container=="body"?0:$parent.offset().left;placement=placement=="bottom"&&pos.top+pos.height+actualHeight-docScroll>parentHeight?"top":placement=="top"&&pos.top-docScroll-actualHeight<0?"bottom":placement=="right"&&pos.right+actualWidth>parentWidth?"left":placement=="left"&&pos.left-actualWidth<parentLeft?"right":placement;$tip.removeClass(orgPlacement).addClass(placement)}var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight);this.applyPlacement(calculatedOffset,placement);this.$element.trigger("shown.bs."+this.type)}};Tooltip.prototype.applyPlacement=function(offset,placement){var replace;var $tip=this.tip();var width=$tip[0].offsetWidth;var height=$tip[0].offsetHeight;var marginTop=parseInt($tip.css("margin-top"),10);var marginLeft=parseInt($tip.css("margin-left"),10);if(isNaN(marginTop))marginTop=0;if(isNaN(marginLeft))marginLeft=0;offset.top=offset.top+marginTop;offset.left=offset.left+marginLeft;$tip.offset(offset).addClass("in");var actualWidth=$tip[0].offsetWidth;var actualHeight=$tip[0].offsetHeight;if(placement=="top"&&actualHeight!=height){replace=true;offset.top=offset.top+height-actualHeight}if(/bottom|top/.test(placement)){var delta=0;if(offset.left<0){delta=offset.left*-2;offset.left=0;$tip.offset(offset);actualWidth=$tip[0].offsetWidth;actualHeight=$tip[0].offsetHeight}this.replaceArrow(delta-width+actualWidth,actualWidth,"left")}else{this.replaceArrow(actualHeight-height,actualHeight,"top")}if(replace)$tip.offset(offset)};Tooltip.prototype.replaceArrow=function(delta,dimension,position){this.arrow().css(position,delta?50*(1-delta/dimension)+"%":"")};Tooltip.prototype.setContent=function(){var $tip=this.tip();var title=this.getTitle();$tip.find(".tooltip-inner")[this.options.html?"html":"text"](title);$tip.removeClass("fade in top bottom left right")};Tooltip.prototype.hide=function(){var that=this;var $tip=this.tip();var e=$.Event("hide.bs."+this.type);function complete(){if(that.hoverState!="in")$tip.detach()}this.$element.trigger(e);if(e.isDefaultPrevented())return;$tip.removeClass("in");$.support.transition&&this.$tip.hasClass("fade")?$tip.one($.support.transition.end,complete).emulateTransitionEnd(150):complete();this.$element.trigger("hidden.bs."+this.type);return this};Tooltip.prototype.fixTitle=function(){var $e=this.$element;if($e.attr("title")||typeof $e.attr("data-original-title")!="string"){$e.attr("data-original-title",$e.attr("title")||"").attr("title","")
  }};Tooltip.prototype.hasContent=function(){return this.getTitle()};Tooltip.prototype.getPosition=function(){var el=this.$element[0];return $.extend({},typeof el.getBoundingClientRect=="function"?el.getBoundingClientRect():{width:el.offsetWidth,height:el.offsetHeight},this.$element.offset())};Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=="bottom"?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=="top"?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=="left"?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}};Tooltip.prototype.getTitle=function(){var title;var $e=this.$element;var o=this.options;title=$e.attr("data-original-title")||(typeof o.title=="function"?o.title.call($e[0]):o.title);return title};Tooltip.prototype.tip=function(){return this.$tip=this.$tip||$(this.options.template)};Tooltip.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};Tooltip.prototype.validate=function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}};Tooltip.prototype.enable=function(){this.enabled=true};Tooltip.prototype.disable=function(){this.enabled=false};Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled};Tooltip.prototype.toggle=function(e){var self=e?$(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;self.tip().hasClass("in")?self.leave(self):self.enter(self)};Tooltip.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var old=$.fn.tooltip;$.fn.tooltip=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.tooltip");var options=typeof option=="object"&&option;if(!data)$this.data("bs.tooltip",data=new Tooltip(this,options));if(typeof option=="string")data[option]()})};$.fn.tooltip.Constructor=Tooltip;$.fn.tooltip.noConflict=function(){$.fn.tooltip=old;return this}}(window.jQuery);+function($){"use strict";var Popover=function(element,options){this.init("popover",element,options)};if(!$.fn.tooltip)throw new Error("Popover requires tooltip.js");Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'});Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype);Popover.prototype.constructor=Popover;Popover.prototype.getDefaults=function(){return Popover.DEFAULTS};Popover.prototype.setContent=function(){var $tip=this.tip();var title=this.getTitle();var content=this.getContent();$tip.find(".popover-title")[this.options.html?"html":"text"](title);$tip.find(".popover-content")[this.options.html?"html":"text"](content);$tip.removeClass("fade top bottom left right in");if(!$tip.find(".popover-title").html())$tip.find(".popover-title").hide()};Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()};Popover.prototype.getContent=function(){var $e=this.$element;var o=this.options;return $e.attr("data-content")||(typeof o.content=="function"?o.content.call($e[0]):o.content)};Popover.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};Popover.prototype.tip=function(){if(!this.$tip)this.$tip=$(this.options.template);return this.$tip};var old=$.fn.popover;$.fn.popover=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.popover");var options=typeof option=="object"&&option;if(!data)$this.data("bs.popover",data=new Popover(this,options));if(typeof option=="string")data[option]()})};$.fn.popover.Constructor=Popover;$.fn.popover.noConflict=function(){$.fn.popover=old;return this}}(window.jQuery);+function($){"use strict";function ScrollSpy(element,options){var href;var process=$.proxy(this.process,this);this.$element=$(element).is("body")?$(window):$(element);this.$body=$("body");this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",process);this.options=$.extend({},ScrollSpy.DEFAULTS,options);this.selector=(this.options.target||(href=$(element).attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.offsets=$([]);this.targets=$([]);this.activeTarget=null;this.refresh();this.process()}ScrollSpy.DEFAULTS={offset:10};ScrollSpy.prototype.refresh=function(){var offsetMethod=this.$element[0]==window?"offset":"position";this.offsets=$([]);this.targets=$([]);var self=this;var $targets=this.$body.find(this.selector).map(function(){var $el=$(this);var href=$el.data("target")||$el.attr("href");var $href=/^#\w/.test(href)&&$(href);return $href&&$href.length&&[[$href[offsetMethod]().top+(!$.isWindow(self.$scrollElement.get(0))&&self.$scrollElement.scrollTop()),href]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){self.offsets.push(this[0]);self.targets.push(this[1])})};ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset;var scrollHeight=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight;var maxScroll=scrollHeight-this.$scrollElement.height();var offsets=this.offsets;var targets=this.targets;var activeTarget=this.activeTarget;var i;if(scrollTop>=maxScroll){return activeTarget!=(i=targets.last()[0])&&this.activate(i)}for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(!offsets[i+1]||scrollTop<=offsets[i+1])&&this.activate(targets[i])}};ScrollSpy.prototype.activate=function(target){this.activeTarget=target;$(this.selector).parents(".active").removeClass("active");var selector=this.selector+'[data-target="'+target+'"],'+this.selector+'[href="'+target+'"]';var active=$(selector).parents("li").addClass("active");if(active.parent(".dropdown-menu").length){active=active.closest("li.dropdown").addClass("active")}active.trigger("activate")};var old=$.fn.scrollspy;$.fn.scrollspy=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.scrollspy");var options=typeof option=="object"&&option;if(!data)$this.data("bs.scrollspy",data=new ScrollSpy(this,options));if(typeof option=="string")data[option]()})};$.fn.scrollspy.Constructor=ScrollSpy;$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old;return this};$(window).on("load",function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this);$spy.scrollspy($spy.data())})})}(window.jQuery);+function($){"use strict";var Tab=function(element){this.element=$(element)};Tab.prototype.show=function(){var $this=this.element;var $ul=$this.closest("ul:not(.dropdown-menu)");var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")}if($this.parent("li").hasClass("active"))return;var previous=$ul.find(".active:last a")[0];var e=$.Event("show.bs.tab",{relatedTarget:previous});$this.trigger(e);if(e.isDefaultPrevented())return;var $target=$(selector);this.activate($this.parent("li"),$ul);this.activate($target,$target.parent(),function(){$this.trigger({type:"shown.bs.tab",relatedTarget:previous})})};Tab.prototype.activate=function(element,container,callback){var $active=container.find("> .active");var transition=callback&&$.support.transition&&$active.hasClass("fade");function next(){$active.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");element.addClass("active");if(transition){element[0].offsetWidth;element.addClass("in")}else{element.removeClass("fade")}if(element.parent(".dropdown-menu")){element.closest("li.dropdown").addClass("active")}callback&&callback()}transition?$active.one($.support.transition.end,next).emulateTransitionEnd(150):next();$active.removeClass("in")};var old=$.fn.tab;$.fn.tab=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.tab");if(!data)$this.data("bs.tab",data=new Tab(this));if(typeof option=="string")data[option]()})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(window.jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(window.jQuery);(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var a,n,o,r=t.nodeName.toLowerCase();return"area"===r?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(o=e("img[usemap=#"+n+"]")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.0",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(){var t=this.css("position"),i="absolute"===t,s=this.parents().filter(function(){var t=e(this);return i&&"static"===t.css("position")?!1:/(auto|scroll)/.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==t&&s.length?s:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),a=isNaN(s);return(a||s>=0)&&t(i,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,n){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),n&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===i?["Left","Right"]:["Top","Bottom"],n=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(n,s(this,t)+"px")})},e.fn["outer"+i]=function(t,a){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(n,s(this,t,!0,a)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,a=e(this[0]);a.length&&a[0]!==document;){if(i=a.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i,s){var a,n=e.plugins[t];if(n&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(a=0;n.length>a;a++)e.options[n[a][0]]&&n[a][1].apply(e.element,i)}};var s=0,a=Array.prototype.slice;e.cleanData=function(t){return function(i){for(var s,a=0;null!=(s=i[a]);a++)try{e(s).triggerHandler("remove")}catch(n){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var a,n,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],a=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[l]=e[l]||{},n=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,n,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},a=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,n=this._superApply;return this._super=e,this._superApply=a,t=s.apply(this,arguments),this._super=i,this._superApply=n,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:n?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(e.each(n._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=a.call(arguments,1),o=0,r=n.length;r>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var o="string"==typeof n,r=a.call(arguments,1),h=this;return n=!o&&r.length?e.widget.extend.apply(null,[n].concat(r)):n,o?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(h=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,r),i!==a&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))}),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,a,n,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(a=o[t]=e.widget.extend({},this.options[t]),n=0;s.length-1>n;n++)a[s[n]]=a[s[n]]||{},a=a[s[n]];if(t=s.pop(),1===arguments.length)return void 0===a[t]?null:a[t];a[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var a,n=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=a=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,a=this.widget()),e.each(s,function(s,o){function r(){return t||n.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?n[o]:o).apply(n,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+n.eventNamespace,u=h[2];u?a.delegate(u,l,r):i.bind(l,r)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var a,n,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,a,n){"string"==typeof a&&(a={effect:a});var o,r=a?a===!0||"number"==typeof a?i:a.effect||i:t;a=a||{},"number"==typeof a&&(a={duration:a}),o=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),o&&e.effects&&e.effects.effect[r]?s[t](a):r!==t&&s[r]?s[r](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}}),e.widget;var n=!1;e(document).mouseup(function(){n=!1}),e.widget("ui.mouse",{version:"1.11.0",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!n){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,a="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!a&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):t.which?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),n=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var a,n,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==a)return a;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),n=s.children()[0];return e("body").append(s),t=n.offsetWidth,s.css("overflow","scroll"),i=n.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),a=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),a="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,n="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:n?e.position.scrollbarWidth():0,height:a?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),a=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:a,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},e.fn.position=function(a){if(!a||!a.of)return f.apply(this,arguments);a=e.extend({},a);var p,m,g,v,y,b,_=e(a.of),x=e.position.getWithinInfo(a.within),w=e.position.getScrollInfo(x),k=(a.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(a.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(a[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],a[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===a.at[0]?y.left+=m:"center"===a.at[0]&&(y.left+=m/2),"bottom"===a.at[1]?y.top+=g:"center"===a.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,N=e.extend({},y),M=t(T.my,u.outerWidth(),u.outerHeight());"right"===a.my[0]?N.left-=d:"center"===a.my[0]&&(N.left-=d/2),"bottom"===a.my[1]?N.top-=c:"center"===a.my[1]&&(N.top-=c/2),N.left+=M[0],N.top+=M[1],n||(N.left=h(N.left),N.top=h(N.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](N,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+M[0],p[1]+M[1]],my:a.my,at:a.at,within:x,elem:u})}),a.using&&(l=function(e){var t=v.left-N.left,i=t+m-d,s=v.top-N.top,n=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:N.left,top:N.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>n?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+n)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(n))?"horizontal":"vertical",a.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,r=e.left-t.collisionPosition.marginLeft,h=a-r,l=r+t.collisionWidth-n-a;t.collisionWidth>n?h>0&&0>=l?(i=e.left+h+t.collisionWidth-n-a,e.left+=h-i):e.left=l>0&&0>=h?a:h>l?a+n-t.collisionWidth:a:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollTop:s.offset.top,n=t.within.height,r=e.top-t.collisionPosition.marginTop,h=a-r,l=r+t.collisionHeight-n-a;t.collisionHeight>n?h>0&&0>=l?(i=e.top+h+t.collisionHeight-n-a,e.top+=h-i):e.top=l>0&&0>=h?a:h>l?a+n-t.collisionHeight:a:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,a=t.within,n=a.offset.left+a.scrollLeft,o=a.width,h=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-n,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,a=t.within,n=a.offset.top+a.scrollTop,o=a.height,h=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-n,e.top+p+f+m>u&&(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>d&&(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,a,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",a=e(h).offset().left,n=a>10&&11>a,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.document[0],s=this.options;try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(a){}return this.helper||s.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(s.iframeFix===!0?"iframe":s.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)
  },_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this._removeHandleClassName(),e(this.options.handle||this.element).addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.element.find(".ui-draggable-handle").addBack().removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,a=this.options,n=this.document[0];return this.relative_container=null,a.containment?"window"===a.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===a.containment?(this.containment=[0,0,e(n).width()-this.helperProportions.width-this.margins.left,(e(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):a.containment.constructor===Array?(this.containment=a.containment,void 0):("parent"===a.containment&&(a.containment=this.helper[0].parentNode),i=e(a.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,a,n,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(a=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?a-this.offset.click.top>=i[1]||a-this.offset.click.top>i[3]?a:a-this.offset.click.top>=i[1]?a-o.grid[1]:a+o.grid[1]:a,n=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-o.grid[0]:n+o.grid[0]:n),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var a=s.options,n=e.extend({},i,{item:s.element});s.sortables=[],e(a.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var a=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,a))})},drag:function(t,i,s){var a=this;e.each(s.sortables,function(){var n=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(n=!1),n})),n?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(a).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var a=e("body"),n=s.options;a.css("cursor")&&(n._cursor=a.css("cursor")),a.css("cursor",n.cursor)},stop:function(t,i,s){var a=s.options;a._cursor&&e("body").css("cursor",a._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var a=e(i.helper),n=s.options;a.css("opacity")&&(n._opacity=a.css("opacity")),a.css("opacity",n.opacity)},stop:function(t,i,s){var a=s.options;a._opacity&&e(i.helper).css("opacity",a._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParent[0]!==i.document[0]&&"HTML"!==i.scrollParent[0].tagName&&(i.overflowOffset=i.scrollParent.offset())},drag:function(t,i,s){var a=s.options,n=!1,o=s.document[0];s.scrollParent[0]!==o&&"HTML"!==s.scrollParent[0].tagName?(a.axis&&"x"===a.axis||(s.overflowOffset.top+s.scrollParent[0].offsetHeight-t.pageY<a.scrollSensitivity?s.scrollParent[0].scrollTop=n=s.scrollParent[0].scrollTop+a.scrollSpeed:t.pageY-s.overflowOffset.top<a.scrollSensitivity&&(s.scrollParent[0].scrollTop=n=s.scrollParent[0].scrollTop-a.scrollSpeed)),a.axis&&"y"===a.axis||(s.overflowOffset.left+s.scrollParent[0].offsetWidth-t.pageX<a.scrollSensitivity?s.scrollParent[0].scrollLeft=n=s.scrollParent[0].scrollLeft+a.scrollSpeed:t.pageX-s.overflowOffset.left<a.scrollSensitivity&&(s.scrollParent[0].scrollLeft=n=s.scrollParent[0].scrollLeft-a.scrollSpeed))):(a.axis&&"x"===a.axis||(t.pageY-e(o).scrollTop()<a.scrollSensitivity?n=e(o).scrollTop(e(o).scrollTop()-a.scrollSpeed):e(window).height()-(t.pageY-e(o).scrollTop())<a.scrollSensitivity&&(n=e(o).scrollTop(e(o).scrollTop()+a.scrollSpeed))),a.axis&&"y"===a.axis||(t.pageX-e(o).scrollLeft()<a.scrollSensitivity?n=e(o).scrollLeft(e(o).scrollLeft()-a.scrollSpeed):e(window).width()-(t.pageX-e(o).scrollLeft())<a.scrollSensitivity&&(n=e(o).scrollLeft(e(o).scrollLeft()+a.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!a.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var a=s.options;s.snapElements=[],e(a.snap.constructor!==String?a.snap.items||":data(ui-draggable)":a.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var a,n,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left,l=h+s.snapElements[c].width,u=s.snapElements[c].top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(a=m>=Math.abs(u-b),n=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),a&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top-s.margins.top),n&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left-s.margins.left)),p=a||n||o||r,"outer"!==f.snapMode&&(a=m>=Math.abs(u-y),n=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),a&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top-s.margins.top),n&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left-s.margins.left)),!s.snapElements[c].snapping&&(a||n||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=a||n||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var a,n=s.options,o=e.makeArray(e(n.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(a=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",a+t)}),this.css("zIndex",a+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var a=e(i.helper),n=s.options;a.css("zIndex")&&(n._zIndex=a.css("zIndex")),a.css("zIndex",n.zIndex)},stop:function(t,i,s){var a=s.options;a._zIndex&&e(i.helper).css("zIndex",a._zIndex)}}),e.ui.draggable,e.widget("ui.sortable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||this._isFloating(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,a=!1,n=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,n.widgetName+"-item")===n?(s=e(this),!1):void 0}),e.data(t.target,n.widgetName+"-item")===n&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(a=!0)}),a)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var a,n,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(a=this.containers.length-1;a>=0;a--)this.containers[a]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,a,n,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],a=s.item[0],n=this._intersectsWithPointer(s),n&&s.instance===this.currentContainer&&a!==this.currentItem[0]&&this.placeholder[1===n?"next":"prev"]()[0]!==a&&!e.contains(this.placeholder[0],a)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],a):!0)){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,a=this.placeholder.offset(),n=this.options.axis,o={};n&&"x"!==n||(o.left=a.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=a.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,a=s+this.helperProportions.height,n=e.left,o=n+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>n&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>n&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>a-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,a=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return s?this.floating?n&&"right"===n||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&i||"left"===a&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,a,n,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(n=e(l[s]),a=n.length-1;a>=0;a--)o=e.data(n[a],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,a,n,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(a=e(c[i]),s=a.length-1;s>=0;s--)n=e.data(a[s],this.widgetFullName),n&&n!==this&&!n.options.disabled&&(d.push([e.isFunction(n.options.items)?n.options.items.call(n.element[0],t,{item:this.currentItem}):e(n.options.items,n.element),n]),this.containers.push(n));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,a,n;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(a=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=a.outerWidth(),s.height=a.outerHeight()),n=a.offset(),s.left=n.left,s.top=n.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)n=this.containers[i].element.offset(),this.containers[i].containerCache.left=n.left,this.containers[i].containerCache.top=n.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),a=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(a)}):"img"===s&&a.attr("src",t.currentItem.attr("src")),i||a.css("visibility","hidden"),a},update:function(e,a){(!i||s.forcePlaceholderSize)&&(a.height()||a.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),a.width()||a.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,a,n,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(a=1e4,n=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),a>Math.abs(t[d]-h)&&(a=Math.abs(t[d]-h),n=this.items[s],this.direction=l?"up":"down"));if(!n&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return;n?this._rearrange(t,n,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)
  },_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,a=this.options;"parent"===a.containment&&(a.containment=this.helper[0].parentNode),("document"===a.containment||"window"===a.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===a.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===a.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(a.containment)||(t=e(a.containment)[0],i=e(a.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,a="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(a[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():n?0:a.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():n?0:a.scrollLeft())*s}},_generatePosition:function(t){var i,s,a=this.options,n=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(n=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(n=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),a.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/a.grid[1])*a.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-a.grid[1]:i+a.grid[1]:i,s=this.originalPageX+Math.round((n-this.originalPageX)/a.grid[0])*a.grid[0],n=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-a.grid[0]:s+a.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var a=this.counter;this._delay(function(){a===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,a=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&a.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||a.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(a.push(function(e){this._trigger("remove",e,this._uiHash())}),a.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),a.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||a.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(a.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),s=0;a.length>s;s++)a[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(s=0;a.length>s;s++)a[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}});var o="ui-effects-";e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),a=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,n){var o,r=n.re.exec(i),h=r&&n.parse(r),l=n.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],a=s._rgba=o._rgba,!1):t}),a.length?("0,0,0,0"===a.join()&&e.extend(a,n.transparent),s):n[i]}function a(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var n,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,a){return new e.Color.fn.parse(t,i,s,a)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(a,o,r,h){if(a===t)return this._rgba=[null,null,null,null],this;(a.jquery||a.nodeType)&&(a=e(a).css(o),o=t);var d=this,c=e.type(a),p=this._rgba=[];return o!==t&&(a=[a,o,r,h],c="array"),"string"===c?this.parse(s(a)||n._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(a[t.idx],t)}),this):"object"===c?(a instanceof l?f(u,function(e,t){a[t.cache]&&(d[t.cache]=a[t.cache].slice())}):f(u,function(t,s){var n=s.cache;f(s.props,function(e,t){if(!d[n]&&s.to){if("alpha"===e||null==a[e])return;d[n]=s.to(d._rgba)}d[n][t.idx]=i(a[e],t,!0)}),d[n]&&0>e.inArray(null,d[n].slice(0,3))&&(d[n][3]=1,s.from&&(d._rgba=s.from(d[n])))}),this):t},is:function(e){var i=l(e),s=!0,a=this;return f(u,function(e,n){var o,r=i[n.cache];return r&&(o=a[n.cache]||n.to&&n.to(a._rgba)||[],f(n.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),a=s._space(),n=u[a],o=0===this.alpha()?l("transparent"):this,r=o[n.cache]||n.to(o._rgba),h=r.slice();return s=s[n.cache],f(n.props,function(e,a){var n=a.idx,o=r[n],l=s[n],u=d[a.type]||{};null!==l&&(null===o?h[n]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[n]=i((l-o)*t+o,a)))}),this[a](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),a=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*a[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,a=e[1]/255,n=e[2]/255,o=e[3],r=Math.max(s,a,n),h=Math.min(s,a,n),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(a-n)/l+360:a===r?60*(n-s)/l+120:60*(s-a)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],n=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*a(r,o,t+1/3)),Math.round(255*a(r,o,t)),Math.round(255*a(r,o,t-1/3)),n]},f(u,function(s,a){var n=a.props,o=a.cache,h=a.to,u=a.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var a,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(n,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(a=l(u(c)),a[o]=c,a):l(c)},f(n,function(t,i){l.fn[t]||(l.fn[t]=function(a){var n,o=e.type(a),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(a=a.call(this,u),o=e.type(a)),null==a&&i.empty?this:("string"===o&&(n=r.exec(a),n&&(a=u+parseFloat(n[2])*("+"===n[1]?1:-1))),l[i.idx]=a,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,a){var n,o,r="";if("transparent"!==a&&("string"!==e.type(a)||(n=s(a)))){if(a=l(n||a),!c.rgba&&1!==a._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}a=a.blend(r&&"transparent"!==r?r:"_default")}a=a.toRgbaString()}try{t.style[i]=a}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},n=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function t(t){var i,s,a=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(a&&a.length&&a[0]&&a[a[0]])for(s=a.length;s--;)i=a[s],"string"==typeof a[i]&&(n[e.camelCase(i)]=a[i]);else for(i in a)"string"==typeof a[i]&&(n[i]=a[i]);return n}function i(t,i){var s,n,o={};for(s in i)n=i[s],t[s]!==n&&(a[s]||(e.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var s=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(jQuery.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(a,n,o,r){var h=e.speed(n,o,r);return this.queue(function(){var n,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),n=function(){e.each(s,function(e,t){a[t]&&o[t+"Class"](a[t])})},n(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){n(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,a,n){return s?e.effects.animateClass.call(this,{add:i},s,a,n):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,a,n){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,a,n):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,a,n,o){return"boolean"==typeof s||void 0===s?a?e.effects.animateClass.call(this,s?{add:i}:{remove:i},a,n,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,a,n)}}(e.fn.toggleClass),switchClass:function(t,i,s,a,n){return e.effects.animateClass.call(this,{add:i,remove:t},s,a,n)}})}(),function(){function t(t,i,s,a){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(a=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(a=s,s=i,i={}),e.isFunction(s)&&(a=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=a||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.0",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(o+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(o+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),a={width:t.width(),height:t.height()},n=document.activeElement;try{n.id}catch(o){n=document.body}return t.wrap(s),(t[0]===n||e.contains(t[0],n))&&e(n).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(a),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,a){return a=a||{},e.each(i,function(e,i){var n=t.cssUnit(i);n[0]>0&&(a[i]=n[0]*s+n[1])}),a}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(n)&&n.call(a[0]),e.isFunction(t)&&t()}var a=e(this),n=s.complete,r=s.mode;(a.is(":hidden")?"hide"===r:"show"===r)?(a[r](),i()):o.call(a[0],s,i)}var s=t.apply(this,arguments),a=s.mode,n=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?a?this[a](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):n===!1?this.each(i):this.queue(n||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var a=t.apply(this,arguments);return a.mode="show",this.effect.call(this,a)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var a=t.apply(this,arguments);return a.mode="hide",this.effect.call(this,a)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var a=t.apply(this,arguments);return a.mode="toggle",this.effect.call(this,a)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,a,n,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),a=s[p](),n=parseFloat(s.css(f))||0,g[p]=v?a:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?n:a+n),v&&(s.css(p,0),m||s.css(f,n+a)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,a,n,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(n={opacity:1},n[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(n,m,g)),l&&(c/=Math.pow(2,p-1)),n={},n[v]=0,s=0;p>s;s++)a={},a[v]=(y?"-=":"+=")+c,o.animate(a,m,g).animate(n,m,g),c=l?2*c:c/2;l&&(a={opacity:0},a[v]=(y?"-=":"+=")+c,o.animate(a,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,a,n,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),a="IMG"===o[0].tagName?s:o,n=a[c](),l&&(a.css(c,0),a.css(p,n/2)),f[c]=l?n:0,f[p]=l?0:n/2,a.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,a=e(this),n=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(a,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(a,n),a.show(),e.effects.createWrapper(a),s=t.distance||a["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&a.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,a.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&a.hide(),e.effects.restore(a,n),e.effects.removeWrapper(a),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&a()}function a(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var n,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(n=0;d>n;n++)for(h=g.top+n*y,u=n-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-n*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),a=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:a},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,a,n=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(n,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(n,o),n.show(),s=e.effects.createWrapper(n).css({overflow:"hidden"}),a=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*a[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?a[0]:u,v[f[1]]=h?a[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&n.hide(),e.effects.restore(n,o),e.effects.removeWrapper(n),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),a=["backgroundImage","backgroundColor","opacity"],n=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===n&&(o.opacity=0),e.effects.save(s,a),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===n&&s.hide(),e.effects.restore(s,a),i()}})},e.effects.effect.size=function(t,i){var s,a,n,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),n={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(n.from.y!==n.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,n.from.y,o.from),o.to=e.effects.setTransition(o,d,n.to.y,o.to)),n.from.x!==n.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,n.from.x,o.from),o.to=e.effects.setTransition(o,c,n.to.x,o.to))),("content"===m||"both"===m)&&n.from.y!==n.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,n.from.y,o.from),o.to=e.effects.setTransition(o,u,n.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(a=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*a.y,o.from.left=(s.outerWidth-o.outerWidth())*a.x,o.to.top=(s.outerHeight-o.to.outerHeight)*a.y,o.to.left=(s.outerWidth-o.to.outerWidth)*a.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,l),i.from={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},i.to={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x},n.from.y!==n.to.y&&(i.from=e.effects.setTransition(i,d,n.from.y,i.from),i.to=e.effects.setTransition(i,d,n.to.y,i.to)),n.from.x!==n.to.x&&(i.from=e.effects.setTransition(i,c,n.from.x,i.from),i.to=e.effects.setTransition(i,c,n.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),a=e?o.to.left:o.to.top;return"auto"===i?a+"px":s+a+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),a=e.extend(!0,{},t),n=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===n?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};a.effect="size",a.queue=!1,a.complete=i,"effect"!==n&&(a.origin=h||["middle","center"],a.restore=!0),a.from=t.from||("show"===n?{height:0,width:0,outerHeight:0,outerWidth:0}:l),a.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},a.fade&&("show"===n&&(a.from.opacity=0,a.to.opacity=1),"hide"===n&&(a.from.opacity=1,a.to.opacity=0)),s.effect(a)},e.effects.effect.puff=function(t,i){var s=e(this),a=e.effects.setMode(s,t.mode||"hide"),n="hide"===a,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:a,complete:i,percent:n?o:100,from:n?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,a=e(this),n=e.effects.setMode(a,t.mode||"show"),o="show"===n,r="hide"===n,h=o||"hide"===n,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=a.queue(),p=c.length;for((o||!a.is(":visible"))&&(a.css("opacity",0).show(),d=1),s=1;l>s;s++)a.animate({opacity:d},u,t.easing),d=1-d;a.animate({opacity:d},u,t.easing),a.queue(function(){r&&a.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),a.dequeue()},e.effects.effect.shake=function(t,i){var s,a=e(this),n=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(a,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=a.queue(),y=v.length;for(e.effects.save(a,n),a.show(),e.effects.createWrapper(a),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,a.animate(f,d,t.easing),s=1;l>s;s++)a.animate(m,d,t.easing).animate(g,d,t.easing);a.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&a.hide(),e.effects.restore(a,n),e.effects.removeWrapper(a),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),a.dequeue()},e.effects.effect.slide=function(t,i){var s,a=e(this),n=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(a,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(a,n),a.show(),s=t.distance||a["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(a).css({overflow:"hidden"}),r&&a.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,a.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&a.hide(),e.effects.restore(a,n),e.effects.removeWrapper(a),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),a=e(t.to),n="fixed"===a.css("position"),o=e("body"),r=n?o.scrollTop():0,h=n?o.scrollLeft():0,l=a.offset(),u={top:l.top-r,left:l.left-h,height:a.innerHeight(),width:a.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:n?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})}});var jaaulde=window.jaaulde||{};jaaulde.utils=jaaulde.utils||{};
  jaaulde.utils.cookies=function(){var resolveOptions,assembleOptionsString,parseCookies,constructor,defaultOptions={expiresAt:null,path:"/",domain:null,secure:false};resolveOptions=function(options){var returnValue,expireDate;if(typeof options!=="object"||options===null){returnValue=defaultOptions}else{returnValue={expiresAt:defaultOptions.expiresAt,path:defaultOptions.path,domain:defaultOptions.domain,secure:defaultOptions.secure};if(typeof options.expiresAt==="object"&&options.expiresAt instanceof Date){returnValue.expiresAt=options.expiresAt}else if(typeof options.hoursToLive==="number"&&options.hoursToLive!==0){expireDate=new Date;expireDate.setTime(expireDate.getTime()+options.hoursToLive*60*60*1e3);returnValue.expiresAt=expireDate}if(typeof options.path==="string"&&options.path!==""){returnValue.path=options.path}if(typeof options.domain==="string"&&options.domain!==""){returnValue.domain=options.domain}if(options.secure===true){returnValue.secure=options.secure}}return returnValue};assembleOptionsString=function(options){options=resolveOptions(options);return(typeof options.expiresAt==="object"&&options.expiresAt instanceof Date?"; expires="+options.expiresAt.toGMTString():"")+"; path="+options.path+(typeof options.domain==="string"?"; domain="+options.domain:"")+(options.secure===true?"; secure":"")};parseCookies=function(){var cookies={},i,pair,name,value,separated=document.cookie.split(";"),unparsedValue;for(i=0;i<separated.length;i=i+1){pair=separated[i].split("=");name=pair[0].replace(/^\s*/,"").replace(/\s*$/,"");try{value=decodeURIComponent(pair[1])}catch(e1){value=pair[1]}if(typeof JSON==="object"&&JSON!==null&&typeof JSON.parse==="function"){try{unparsedValue=value;value=JSON.parse(value)}catch(e2){value=unparsedValue}}cookies[name]=value}return cookies};constructor=function(){};constructor.prototype.get=function(cookieName){var returnValue,item,cookies=parseCookies();if(typeof cookieName==="string"){returnValue=typeof cookies[cookieName]!=="undefined"?cookies[cookieName]:null}else if(typeof cookieName==="object"&&cookieName!==null){returnValue={};for(item in cookieName){if(typeof cookies[cookieName[item]]!=="undefined"){returnValue[cookieName[item]]=cookies[cookieName[item]]}else{returnValue[cookieName[item]]=null}}}else{returnValue=cookies}return returnValue};constructor.prototype.filter=function(cookieNameRegExp){var cookieName,returnValue={},cookies=parseCookies();if(typeof cookieNameRegExp==="string"){cookieNameRegExp=new RegExp(cookieNameRegExp)}for(cookieName in cookies){if(cookieName.match(cookieNameRegExp)){returnValue[cookieName]=cookies[cookieName]}}return returnValue};constructor.prototype.set=function(cookieName,value,options){if(typeof options!=="object"||options===null){options={}}if(typeof value==="undefined"||value===null){value="";options.hoursToLive=-8760}else if(typeof value!=="string"){if(typeof JSON==="object"&&JSON!==null&&typeof JSON.stringify==="function"){value=JSON.stringify(value)}else{throw new Error("cookies.set() received non-string value and could not serialize.")}}var optionsString=assembleOptionsString(options);document.cookie=cookieName+"="+encodeURIComponent(value)+optionsString};constructor.prototype.del=function(cookieName,options){var allCookies={},name;if(typeof options!=="object"||options===null){options={}}if(typeof cookieName==="boolean"&&cookieName===true){allCookies=this.get()}else if(typeof cookieName==="string"){allCookies[cookieName]=true}for(name in allCookies){if(typeof name==="string"&&name!==""){this.set(name,null,options)}}};constructor.prototype.test=function(){var returnValue=false,testName="cT",testValue="data";this.set(testName,testValue);if(this.get(testName)===testValue){this.del(testName);returnValue=true}return returnValue};constructor.prototype.setOptions=function(options){if(typeof options!=="object"){options=null}defaultOptions=resolveOptions(options)};return new constructor}();(function(){if(window.jQuery){(function($){$.cookies=jaaulde.utils.cookies;var extensions={cookify:function(options){return this.each(function(){var i,nameAttrs=["name","id"],name,$this=$(this),value;for(i in nameAttrs){if(!isNaN(i)){name=$this.attr(nameAttrs[i]);if(typeof name==="string"&&name!==""){if($this.is(":checkbox, :radio")){if($this.attr("checked")){value=$this.val()}}else if($this.is(":input")){value=$this.val()}else{value=$this.html()}if(typeof value!=="string"||value===""){value=null}$.cookies.set(name,value,options);break}}}})},cookieFill:function(){return this.each(function(){var n,getN,nameAttrs=["name","id"],name,$this=$(this),value;getN=function(){n=nameAttrs.pop();return!!n};while(getN()){name=$this.attr(n);if(typeof name==="string"&&name!==""){value=$.cookies.get(name);if(value!==null){if($this.is(":checkbox, :radio")){if($this.val()===value){$this.attr("checked","checked")}else{$this.removeAttr("checked")}}else if($this.is(":input")){$this.val(value)}else{$this.html(value)}}break}}})},cookieBind:function(options){return this.each(function(){var $this=$(this);$this.cookieFill().change(function(){$this.cookify(options)})})}};$.each(extensions,function(i){$.fn[i]=this})})(window.jQuery)}})();(function($){$.scrollTo=$.fn.scrollTo=function(x,y,options){if(!(this instanceof $))return $.fn.scrollTo.apply($("html, body"),arguments);options=$.extend({},{gap:{x:0,y:0},animation:{easing:"swing",duration:600,complete:$.noop,step:$.noop}},options);return this.each(function(){var elem=$(this);elem.stop().animate({scrollLeft:!isNaN(Number(x))?x:$(x).offset().left+options.gap.x,scrollTop:!isNaN(Number(y))?y:$(y).offset().top+options.gap.y},options.animation)})}})(jQuery);(function(context){var attributeMap={acceptcharset:"acceptCharset",accesskey:"accessKey",allowtransparency:"allowTransparency",bgcolor:"bgColor",cellpadding:"cellPadding",cellspacing:"cellSpacing","class":"className",classname:"className",colspan:"colSpan",csstext:"style",defaultchecked:"defaultChecked",defaultselected:"defaultSelected",defaultvalue:"defaultValue","for":"htmlFor",frameborder:"frameBorder",hspace:"hSpace",htmlfor:"htmlFor",longdesc:"longDesc",maxlength:"maxLength",marginwidth:"marginWidth",marginheight:"marginHeight",noresize:"noResize",noshade:"noShade",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",valign:"vAlign",vspace:"vSpace"};function laconic(){var el=document.createElement(arguments[0]);for(var i=1;i<arguments.length;i++){var arg=arguments[i];if(arg===null||arg===undefined)continue;if(arg.nodeType===1){el.appendChild(arg)}else if(!!(arg===""||arg&&arg.charCodeAt&&arg.substr)||!!(arg===0||arg&&arg.toExponential&&arg.toFixed)){el.appendChild(document.createTextNode(arg))}else if(i===1&&typeof arg==="object"){for(var key in arg){if(arg.hasOwnProperty(key)){var value=arg[key];if(value!==null&&value!==undefined){key=key.toLowerCase();key=attributeMap[key]||key;var isEvent=key.charAt(0)==="o"&&key.charAt(1)==="n";if(isEvent){if(arg.href===undefined&&key==="onclick"){el.setAttribute("href","#")}el[key]=value}else if(key==="style"&&el.style.setAttribute){el.style.setAttribute("cssText",value)}else if(key==="className"||key==="htmlFor"){el[key]=value}else{el.setAttribute(key,value)}}}}}else if(Object.prototype.toString.call(arg)==="[object Array]"){for(var j=0;j<arg.length;j++){var child=arg[j];if(child.nodeType===1){el.appendChild(child)}}}}el.appendTo=function(parentNode){if(parentNode.nodeType===1&&this.nodeType===1){parentNode.appendChild(this)}return el};return el}laconic.registerElement=function(name,renderer){if(!laconic[name]){laconic[name]=function(){var el=laconic("div",{"class":name});renderer.apply(el,Array.prototype.slice.call(arguments));return el}}};var deprecatedTags=["acronym","applet","basefont","big","center","dir","font","frame","frameset","noframes","strike","tt","u","xmp"];var tags=["a","abbr","address","area","article","aside","audio","b","base","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","ul","var","video","wbr"].concat(deprecatedTags);var makeApply=function(tagName){return function(){return laconic.apply(this,[tagName].concat(Array.prototype.slice.call(arguments)))}};for(var i=0;i<tags.length;i++){laconic[tags[i]]=makeApply(tags[i])}if(typeof module!=="undefined"&&module.exports){module.exports=laconic}else{var dollar=context.$||{};dollar.el=laconic;context.$=dollar}})(this);(function(){var root=this;var previousUnderscore=root._;var breaker={};var ArrayProto=Array.prototype,ObjProto=Object.prototype,FuncProto=Function.prototype;var push=ArrayProto.push,slice=ArrayProto.slice,concat=ArrayProto.concat,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var nativeForEach=ArrayProto.forEach,nativeMap=ArrayProto.map,nativeReduce=ArrayProto.reduce,nativeReduceRight=ArrayProto.reduceRight,nativeFilter=ArrayProto.filter,nativeEvery=ArrayProto.every,nativeSome=ArrayProto.some,nativeIndexOf=ArrayProto.indexOf,nativeLastIndexOf=ArrayProto.lastIndexOf,nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeBind=FuncProto.bind;var _=function(obj){if(obj instanceof _)return obj;if(!(this instanceof _))return new _(obj);this._wrapped=obj};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=_}exports._=_}else{root._=_}_.VERSION="1.6.0";var each=_.each=_.forEach=function(obj,iterator,context){if(obj==null)return obj;if(nativeForEach&&obj.forEach===nativeForEach){obj.forEach(iterator,context)}else if(obj.length===+obj.length){for(var i=0,length=obj.length;i<length;i++){if(iterator.call(context,obj[i],i,obj)===breaker)return}}else{var keys=_.keys(obj);for(var i=0,length=keys.length;i<length;i++){if(iterator.call(context,obj[keys[i]],keys[i],obj)===breaker)return}}return obj};_.map=_.collect=function(obj,iterator,context){var results=[];if(obj==null)return results;if(nativeMap&&obj.map===nativeMap)return obj.map(iterator,context);each(obj,function(value,index,list){results.push(iterator.call(context,value,index,list))});return results};var reduceError="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(obj,iterator,memo,context){var initial=arguments.length>2;if(obj==null)obj=[];if(nativeReduce&&obj.reduce===nativeReduce){if(context)iterator=_.bind(iterator,context);return initial?obj.reduce(iterator,memo):obj.reduce(iterator)}each(obj,function(value,index,list){if(!initial){memo=value;initial=true}else{memo=iterator.call(context,memo,value,index,list)}});if(!initial)throw new TypeError(reduceError);return memo};_.reduceRight=_.foldr=function(obj,iterator,memo,context){var initial=arguments.length>2;if(obj==null)obj=[];if(nativeReduceRight&&obj.reduceRight===nativeReduceRight){if(context)iterator=_.bind(iterator,context);return initial?obj.reduceRight(iterator,memo):obj.reduceRight(iterator)}var length=obj.length;if(length!==+length){var keys=_.keys(obj);length=keys.length}each(obj,function(value,index,list){index=keys?keys[--length]:--length;if(!initial){memo=obj[index];initial=true}else{memo=iterator.call(context,memo,obj[index],index,list)}});if(!initial)throw new TypeError(reduceError);return memo};_.find=_.detect=function(obj,predicate,context){var result;any(obj,function(value,index,list){if(predicate.call(context,value,index,list)){result=value;return true}});return result};_.filter=_.select=function(obj,predicate,context){var results=[];if(obj==null)return results;if(nativeFilter&&obj.filter===nativeFilter)return obj.filter(predicate,context);each(obj,function(value,index,list){if(predicate.call(context,value,index,list))results.push(value)});return results};_.reject=function(obj,predicate,context){return _.filter(obj,function(value,index,list){return!predicate.call(context,value,index,list)},context)};_.every=_.all=function(obj,predicate,context){predicate||(predicate=_.identity);var result=true;if(obj==null)return result;if(nativeEvery&&obj.every===nativeEvery)return obj.every(predicate,context);each(obj,function(value,index,list){if(!(result=result&&predicate.call(context,value,index,list)))return breaker});return!!result};var any=_.some=_.any=function(obj,predicate,context){predicate||(predicate=_.identity);var result=false;if(obj==null)return result;if(nativeSome&&obj.some===nativeSome)return obj.some(predicate,context);each(obj,function(value,index,list){if(result||(result=predicate.call(context,value,index,list)))return breaker});return!!result};_.contains=_.include=function(obj,target){if(obj==null)return false;if(nativeIndexOf&&obj.indexOf===nativeIndexOf)return obj.indexOf(target)!=-1;return any(obj,function(value){return value===target})};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){return(isFunc?method:value[method]).apply(value,args)})};_.pluck=function(obj,key){return _.map(obj,_.property(key))};_.where=function(obj,attrs){return _.filter(obj,_.matches(attrs))};_.findWhere=function(obj,attrs){return _.find(obj,_.matches(attrs))};_.max=function(obj,iterator,context){if(!iterator&&_.isArray(obj)&&obj[0]===+obj[0]&&obj.length<65535){return Math.max.apply(Math,obj)}var result=-Infinity,lastComputed=-Infinity;each(obj,function(value,index,list){var computed=iterator?iterator.call(context,value,index,list):value;if(computed>lastComputed){result=value;lastComputed=computed}});return result};_.min=function(obj,iterator,context){if(!iterator&&_.isArray(obj)&&obj[0]===+obj[0]&&obj.length<65535){return Math.min.apply(Math,obj)}var result=Infinity,lastComputed=Infinity;each(obj,function(value,index,list){var computed=iterator?iterator.call(context,value,index,list):value;if(computed<lastComputed){result=value;lastComputed=computed}});return result};_.shuffle=function(obj){var rand;var index=0;var shuffled=[];each(obj,function(value){rand=_.random(index++);shuffled[index-1]=shuffled[rand];shuffled[rand]=value});return shuffled};_.sample=function(obj,n,guard){if(n==null||guard){if(obj.length!==+obj.length)obj=_.values(obj);return obj[_.random(obj.length-1)]}return _.shuffle(obj).slice(0,Math.max(0,n))};var lookupIterator=function(value){if(value==null)return _.identity;if(_.isFunction(value))return value;return _.property(value)};_.sortBy=function(obj,iterator,context){iterator=lookupIterator(iterator);return _.pluck(_.map(obj,function(value,index,list){return{value:value,index:index,criteria:iterator.call(context,value,index,list)}}).sort(function(left,right){var a=left.criteria;var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)return-1}return left.index-right.index}),"value")};var group=function(behavior){return function(obj,iterator,context){var result={};iterator=lookupIterator(iterator);each(obj,function(value,index){var key=iterator.call(context,value,index,obj);behavior(result,key,value)});return result}};_.groupBy=group(function(result,key,value){_.has(result,key)?result[key].push(value):result[key]=[value]});_.indexBy=group(function(result,key,value){result[key]=value});_.countBy=group(function(result,key){_.has(result,key)?result[key]++:result[key]=1});_.sortedIndex=function(array,obj,iterator,context){iterator=lookupIterator(iterator);var value=iterator.call(context,obj);var low=0,high=array.length;while(low<high){var mid=low+high>>>1;iterator.call(context,array[mid])<value?low=mid+1:high=mid}return low};_.toArray=function(obj){if(!obj)return[];if(_.isArray(obj))return slice.call(obj);if(obj.length===+obj.length)return _.map(obj,_.identity);return _.values(obj)};_.size=function(obj){if(obj==null)return 0;return obj.length===+obj.length?obj.length:_.keys(obj).length};_.first=_.head=_.take=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[0];if(n<0)return[];return slice.call(array,0,n)};_.initial=function(array,n,guard){return slice.call(array,0,array.length-(n==null||guard?1:n))};_.last=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[array.length-1];return slice.call(array,Math.max(array.length-n,0))};_.rest=_.tail=_.drop=function(array,n,guard){return slice.call(array,n==null||guard?1:n)};_.compact=function(array){return _.filter(array,_.identity)};var flatten=function(input,shallow,output){if(shallow&&_.every(input,_.isArray)){return concat.apply(output,input)}each(input,function(value){if(_.isArray(value)||_.isArguments(value)){shallow?push.apply(output,value):flatten(value,shallow,output)}else{output.push(value)}});return output};_.flatten=function(array,shallow){return flatten(array,shallow,[])};_.without=function(array){return _.difference(array,slice.call(arguments,1))};_.partition=function(array,predicate,context){predicate=lookupIterator(predicate);var pass=[],fail=[];each(array,function(elem){(predicate.call(context,elem)?pass:fail).push(elem)});return[pass,fail]};_.uniq=_.unique=function(array,isSorted,iterator,context){if(_.isFunction(isSorted)){context=iterator;iterator=isSorted;isSorted=false}var initial=iterator?_.map(array,iterator,context):array;var results=[];var seen=[];each(initial,function(value,index){if(isSorted?!index||seen[seen.length-1]!==value:!_.contains(seen,value)){seen.push(value);results.push(array[index])}});return results};_.union=function(){return _.uniq(_.flatten(arguments,true))};_.intersection=function(array){var rest=slice.call(arguments,1);return _.filter(_.uniq(array),function(item){return _.every(rest,function(other){return _.contains(other,item)})})};_.difference=function(array){var rest=concat.apply(ArrayProto,slice.call(arguments,1));return _.filter(array,function(value){return!_.contains(rest,value)})};_.zip=function(){var length=_.max(_.pluck(arguments,"length").concat(0));var results=new Array(length);for(var i=0;i<length;i++){results[i]=_.pluck(arguments,""+i)}return results};_.object=function(list,values){if(list==null)return{};var result={};for(var i=0,length=list.length;i<length;i++){if(values){result[list[i]]=values[i]}else{result[list[i][0]]=list[i][1]}}return result};_.indexOf=function(array,item,isSorted){if(array==null)return-1;var i=0,length=array.length;if(isSorted){if(typeof isSorted=="number"){i=isSorted<0?Math.max(0,length+isSorted):isSorted}else{i=_.sortedIndex(array,item);return array[i]===item?i:-1}}if(nativeIndexOf&&array.indexOf===nativeIndexOf)return array.indexOf(item,isSorted);for(;i<length;i++)if(array[i]===item)return i;return-1};_.lastIndexOf=function(array,item,from){if(array==null)return-1;var hasIndex=from!=null;if(nativeLastIndexOf&&array.lastIndexOf===nativeLastIndexOf){return hasIndex?array.lastIndexOf(item,from):array.lastIndexOf(item)}var i=hasIndex?from:array.length;while(i--)if(array[i]===item)return i;return-1};_.range=function(start,stop,step){if(arguments.length<=1){stop=start||0;start=0}step=arguments[2]||1;var length=Math.max(Math.ceil((stop-start)/step),0);var idx=0;var range=new Array(length);while(idx<length){range[idx++]=start;start+=step}return range};var ctor=function(){};_.bind=function(func,context){var args,bound;if(nativeBind&&func.bind===nativeBind)return nativeBind.apply(func,slice.call(arguments,1));if(!_.isFunction(func))throw new TypeError;args=slice.call(arguments,2);return bound=function(){if(!(this instanceof bound))return func.apply(context,args.concat(slice.call(arguments)));ctor.prototype=func.prototype;var self=new ctor;ctor.prototype=null;var result=func.apply(self,args.concat(slice.call(arguments)));if(Object(result)===result)return result;return self}};_.partial=function(func){var boundArgs=slice.call(arguments,1);return function(){var position=0;var args=boundArgs.slice();for(var i=0,length=args.length;i<length;i++){if(args[i]===_)args[i]=arguments[position++]}while(position<arguments.length)args.push(arguments[position++]);return func.apply(this,args)}};_.bindAll=function(obj){var funcs=slice.call(arguments,1);if(funcs.length===0)throw new Error("bindAll must be passed function names");each(funcs,function(f){obj[f]=_.bind(obj[f],obj)});return obj};_.memoize=function(func,hasher){var memo={};hasher||(hasher=_.identity);return function(){var key=hasher.apply(this,arguments);return _.has(memo,key)?memo[key]:memo[key]=func.apply(this,arguments)}};_.delay=function(func,wait){var args=slice.call(arguments,2);return setTimeout(function(){return func.apply(null,args)},wait)};_.defer=function(func){return _.delay.apply(_,[func,1].concat(slice.call(arguments,1)))};_.throttle=function(func,wait,options){var context,args,result;var timeout=null;var previous=0;options||(options={});var later=function(){previous=options.leading===false?0:_.now();timeout=null;result=func.apply(context,args);context=args=null};return function(){var now=_.now();if(!previous&&options.leading===false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args);context=args=null}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining)}return result}};_.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;var later=function(){var last=_.now()-timestamp;if(last<wait){timeout=setTimeout(later,wait-last)}else{timeout=null;if(!immediate){result=func.apply(context,args);context=args=null}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout){timeout=setTimeout(later,wait)}if(callNow){result=func.apply(context,args);context=args=null}return result}};_.once=function(func){var ran=false,memo;return function(){if(ran)return memo;ran=true;memo=func.apply(this,arguments);func=null;return memo}};_.wrap=function(func,wrapper){return _.partial(wrapper,func)};_.compose=function(){var funcs=arguments;return function(){var args=arguments;for(var i=funcs.length-1;i>=0;i--){args=[funcs[i].apply(this,args)]}return args[0]}};_.after=function(times,func){return function(){if(--times<1){return func.apply(this,arguments)}}};_.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);return keys};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=new Array(length);for(var i=0;i<length;i++){values[i]=obj[keys[i]]}return values};_.pairs=function(obj){var keys=_.keys(obj);var length=keys.length;var pairs=new Array(length);for(var i=0;i<length;i++){pairs[i]=[keys[i],obj[keys[i]]]}return pairs};_.invert=function(obj){var result={};var keys=_.keys(obj);for(var i=0,length=keys.length;i<length;i++){result[obj[keys[i]]]=keys[i]}return result};_.functions=_.methods=function(obj){var names=[];for(var key in obj){if(_.isFunction(obj[key]))names.push(key)}return names.sort()};_.extend=function(obj){each(slice.call(arguments,1),function(source){if(source){for(var prop in source){obj[prop]=source[prop]}}});return obj};_.pick=function(obj){var copy={};var keys=concat.apply(ArrayProto,slice.call(arguments,1));each(keys,function(key){if(key in obj)copy[key]=obj[key]});return copy};_.omit=function(obj){var copy={};var keys=concat.apply(ArrayProto,slice.call(arguments,1));for(var key in obj){if(!_.contains(keys,key))copy[key]=obj[key]}return copy};_.defaults=function(obj){each(slice.call(arguments,1),function(source){if(source){for(var prop in source){if(obj[prop]===void 0)obj[prop]=source[prop]}}});return obj};_.clone=function(obj){if(!_.isObject(obj))return obj;return _.isArray(obj)?obj.slice():_.extend({},obj)};_.tap=function(obj,interceptor){interceptor(obj);return obj};var eq=function(a,b,aStack,bStack){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;if(a instanceof _)a=a._wrapped;if(b instanceof _)b=b._wrapped;var className=toString.call(a);if(className!=toString.call(b))return false;switch(className){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return false;var length=aStack.length;while(length--){if(aStack[length]==a)return bStack[length]==b}var aCtor=a.constructor,bCtor=b.constructor;if(aCtor!==bCtor&&!(_.isFunction(aCtor)&&aCtor instanceof aCtor&&_.isFunction(bCtor)&&bCtor instanceof bCtor)&&"constructor"in a&&"constructor"in b){return false}aStack.push(a);bStack.push(b);var size=0,result=true;if(className=="[object Array]"){size=a.length;result=size==b.length;if(result){while(size--){if(!(result=eq(a[size],b[size],aStack,bStack)))break}}}else{for(var key in a){if(_.has(a,key)){size++;if(!(result=_.has(b,key)&&eq(a[key],b[key],aStack,bStack)))break}}if(result){for(key in b){if(_.has(b,key)&&!size--)break}result=!size}}aStack.pop();bStack.pop();return result};_.isEqual=function(a,b){return eq(a,b,[],[])};_.isEmpty=function(obj){if(obj==null)return true;if(_.isArray(obj)||_.isString(obj))return obj.length===0;for(var key in obj)if(_.has(obj,key))return false;return true};_.isElement=function(obj){return!!(obj&&obj.nodeType===1)};_.isArray=nativeIsArray||function(obj){return toString.call(obj)=="[object Array]"};_.isObject=function(obj){return obj===Object(obj)};each(["Arguments","Function","String","Number","Date","RegExp"],function(name){_["is"+name]=function(obj){return toString.call(obj)=="[object "+name+"]"}});if(!_.isArguments(arguments)){_.isArguments=function(obj){return!!(obj&&_.has(obj,"callee"))}}if(typeof/./!=="function"){_.isFunction=function(obj){return typeof obj==="function"}}_.isFinite=function(obj){return isFinite(obj)&&!isNaN(parseFloat(obj))};_.isNaN=function(obj){return _.isNumber(obj)&&obj!=+obj};_.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)=="[object Boolean]"};_.isNull=function(obj){return obj===null};_.isUndefined=function(obj){return obj===void 0};_.has=function(obj,key){return hasOwnProperty.call(obj,key)};_.noConflict=function(){root._=previousUnderscore;return this};_.identity=function(value){return value};_.constant=function(value){return function(){return value}};_.property=function(key){return function(obj){return obj[key]}};_.matches=function(attrs){return function(obj){if(obj===attrs)return true;for(var key in attrs){if(attrs[key]!==obj[key])return false}return true}};_.times=function(n,iterator,context){var accum=Array(Math.max(0,n));for(var i=0;i<n;i++)accum[i]=iterator.call(context,i);return accum};_.random=function(min,max){if(max==null){max=min;min=0}return min+Math.floor(Math.random()*(max-min+1))};_.now=Date.now||function(){return(new Date).getTime()};var entityMap={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};entityMap.unescape=_.invert(entityMap.escape);var entityRegexes={escape:new RegExp("["+_.keys(entityMap.escape).join("")+"]","g"),unescape:new RegExp("("+_.keys(entityMap.unescape).join("|")+")","g")};_.each(["escape","unescape"],function(method){_[method]=function(string){if(string==null)return"";return(""+string).replace(entityRegexes[method],function(match){return entityMap[method][match]})}});_.result=function(object,property){if(object==null)return void 0;var value=object[property];return _.isFunction(value)?value.call(object):value};_.mixin=function(obj){each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return result.call(this,func.apply(_,args))}})};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"};var escaper=/\\|'|\r|\n|\t|\u2028|\u2029/g;_.template=function(text,data,settings){var render;settings=_.defaults({},settings,_.templateSettings);var matcher=new RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g");var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,function(match){return"\\"+escapes[match]});if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'"}if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'"}if(evaluate){source+="';\n"+evaluate+"\n__p+='"}index=offset+match.length;return match});source+="';\n";if(!settings.variable)source="with(obj||{}){\n"+source+"}\n";source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{render=new Function(settings.variable||"obj","_",source)}catch(e){e.source=source;throw e}if(data)return render(data,_);var template=function(data){return render.call(this,data,_)};template.source="function("+(settings.variable||"obj")+"){\n"+source+"}";return template};_.chain=function(obj){return _(obj).chain()};var result=function(obj){return this._chain?_(obj).chain():obj};_.mixin(_);each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name=="shift"||name=="splice")&&obj.length===0)delete obj[0];return result.call(this,obj)}});each(["concat","join","slice"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result.call(this,method.apply(this._wrapped,arguments))}});_.extend(_.prototype,{chain:function(){this._chain=true;return this},value:function(){return this._wrapped}});if(typeof define==="function"&&define.amd){define("underscore",[],function(){return _})}}).call(this);(function(){var Rserve={};(function(){function make_basic(type,proto){proto=proto||{json:function(){throw"json() unsupported for type "+this.type}};var wrapped_proto={json:function(resolver){var result=proto.json.call(this,resolver);result.r_type=type;if(!_.isUndefined(this.attributes))result.r_attributes=_.object(_.map(this.attributes.value,function(v){return[v.name,v.value.json(resolver)]}));return result}};return function(v,attrs){function r_object(){this.type=type;this.value=v;this.attributes=attrs}r_object.prototype=wrapped_proto;var result=new r_object;return result}}Rserve.Robj={"null":function(attributes){return{type:"null",value:null,attributes:attributes,json:function(){return null}}},clos:function(formals,body,attributes){return{type:"clos",value:{formals:formals,body:body},attributes:attributes,json:function(){throw"json() unsupported for type clos"}}},vector:make_basic("vector",{json:function(resolver){var values=_.map(this.value,function(x){return x.json(resolver)});if(_.isUndefined(this.attributes)){return values}else{if(this.attributes.value[0].name=="names"){var keys=this.attributes.value[0].value.value;var result={};_.each(keys,function(key,i){result[key]=values[i]});return result}return values}}}),symbol:make_basic("symbol",{json:function(){return this.value}}),list:make_basic("list"),lang:make_basic("lang",{json:function(resolver){var values=_.map(this.value,function(x){return x.json(resolver)});if(_.isUndefined(this.attributes)){return values}else{if(this.attributes.value[0].name!="names")throw"expected names here";var keys=this.attributes.value[0].value.value;var result={};_.each(keys,function(key,i){result[key]=values[i]});return result
  }}}),tagged_list:make_basic("tagged_list",{json:function(resolver){function classify_list(list){if(_.all(list,function(elt){return elt.name===null})){return"plain_list"}else if(_.all(list,function(elt){return elt.name!==null})){return"plain_object"}else return"mixed_list"}var list=this.value.slice(1);switch(classify_list(list)){case"plain_list":return _.map(list,function(elt){return elt.value.json(resolver)});case"plain_object":return _.object(_.map(list,function(elt){return[elt.name,elt.value.json(resolver)]}));case"mixed_list":return list;default:throw"Internal Error"}}}),tagged_lang:make_basic("tagged_lang",{json:function(resolver){var pair_vec=_.map(this.value,function(elt){return[elt.name,elt.value.json(resolver)]});return pair_vec}}),vector_exp:make_basic("vector_exp"),int_array:make_basic("int_array",{json:function(){if(this.attributes&&this.attributes.type==="tagged_list"&&this.attributes.value[0].name==="levels"&&this.attributes.value[0].value.type==="string_array"){var levels=this.attributes.value[0].value.value;var arr=_.map(this.value,function(factor){return levels[factor-1]});arr.levels=levels;return arr}else{if(this.value.length===1)return this.value[0];else return this.value}}}),double_array:make_basic("double_array",{json:function(){if(this.value.length===1&&_.isUndefined(this.attributes))return this.value[0];else return this.value}}),string_array:make_basic("string_array",{json:function(resolver){if(this.value.length===1){if(_.isUndefined(this.attributes))return this.value[0];if(this.attributes.value[0].name==="class"&&this.attributes.value[0].value.value.indexOf("javascript_function")!==-1)return resolver(this.value[0]);return this.value}else return this.value}}),bool_array:make_basic("bool_array",{json:function(){if(this.value.length===1&&_.isUndefined(this.attributes))return this.value[0];else return this.value}}),raw:make_basic("raw",{json:function(){if(this.value.length===1&&_.isUndefined(this.attributes))return this.value[0];else return this.value}}),string:make_basic("string",{json:function(){return this.value}})}})();Rserve.Rsrv={PAR_TYPE:function(x){return x&255},PAR_LEN:function(x){return x>>8},PAR_LENGTH:function(x){return x>>8},par_parse:function(x){return[Rserve.Rsrv.PAR_TYPE(x),Rserve.Rsrv.PAR_LEN(x)]},SET_PAR:function(ty,len){return(len&16777215)<<8|ty&255},CMD_STAT:function(x){return x>>24&127},SET_STAT:function(x,s){return x|(s&127)<<24},CMD_RESP:65536,RESP_OK:65536|1,RESP_ERR:65536|2,OOB_SEND:131072|4096,OOB_MSG:131072|8192,ERR_auth_failed:65,ERR_conn_broken:66,ERR_inv_cmd:67,ERR_inv_par:68,ERR_Rerror:69,ERR_IOerror:70,ERR_notOpen:71,ERR_accessDenied:72,ERR_unsupportedCmd:73,ERR_unknownCmd:74,ERR_data_overflow:75,ERR_object_too_big:76,ERR_out_of_mem:77,ERR_ctrl_closed:78,ERR_session_busy:80,ERR_detach_failed:81,ERR_disabled:97,ERR_unavailable:98,ERR_cryptError:99,ERR_securityClose:100,CMD_login:1,CMD_voidEval:2,CMD_eval:3,CMD_shutdown:4,CMD_switch:5,CMD_keyReq:6,CMD_secLogin:7,CMD_OCcall:15,CMD_openFile:16,CMD_createFile:17,CMD_closeFile:18,CMD_readFile:19,CMD_writeFile:20,CMD_removeFile:21,CMD_setSEXP:32,CMD_assignSEXP:33,CMD_detachSession:48,CMD_detachedVoidEval:49,CMD_attachSession:50,CMD_ctrl:64,CMD_ctrlEval:66,CMD_ctrlSource:69,CMD_ctrlShutdown:68,CMD_setBufferSize:129,CMD_setEncoding:130,CMD_SPECIAL_MASK:240,CMD_serEval:245,CMD_serAssign:246,CMD_serEEval:247,DT_INT:1,DT_CHAR:2,DT_DOUBLE:3,DT_STRING:4,DT_BYTESTREAM:5,DT_SEXP:10,DT_ARRAY:11,DT_LARGE:64,XT_NULL:0,XT_INT:1,XT_DOUBLE:2,XT_STR:3,XT_LANG:4,XT_SYM:5,XT_BOOL:6,XT_S4:7,XT_VECTOR:16,XT_LIST:17,XT_CLOS:18,XT_SYMNAME:19,XT_LIST_NOTAG:20,XT_LIST_TAG:21,XT_LANG_NOTAG:22,XT_LANG_TAG:23,XT_VECTOR_EXP:26,XT_VECTOR_STR:27,XT_ARRAY_INT:32,XT_ARRAY_DOUBLE:33,XT_ARRAY_STR:34,XT_ARRAY_BOOL_UA:35,XT_ARRAY_BOOL:36,XT_RAW:37,XT_ARRAY_CPLX:38,XT_UNKNOWN:48,XT_LARGE:64,XT_HAS_ATTR:128,BOOL_TRUE:1,BOOL_FALSE:0,BOOL_NA:2,GET_XT:function(x){return x&63},GET_DT:function(x){return x&63},HAS_ATTR:function(x){return(x&Rserve.Rsrv.XT_HAS_ATTR)>0},IS_LARGE:function(x){return(x&Rserve.Rsrv.XT_LARGE)>0},status_codes:{65:"ERR_auth_failed",66:"ERR_conn_broken",67:"ERR_inv_cmd",68:"ERR_inv_par",69:"ERR_Rerror",70:"ERR_IOerror",71:"ERR_notOpen",72:"ERR_accessDenied",73:"ERR_unsupportedCmd",74:"ERR_unknownCmd",75:"ERR_data_overflow",76:"ERR_object_too_big",77:"ERR_out_of_mem",78:"ERR_ctrl_closed",80:"ERR_session_busy",81:"ERR_detach_failed",97:"ERR_disabled",98:"ERR_unavailable",99:"ERR_cryptError",100:"ERR_securityClose"}};(function(){function read(m){var handlers={};function lift(f,amount){return function(attributes,length){return[f.call(that,attributes,length),amount||length]}}function bind(m,f){return function(attributes,length){var t=m.call(that,attributes,length);var t2=f(t[0])(attributes,length-t[1]);return[t2[0],t[1]+t2[1]]}}function unfold(f){return function(attributes,length){var result=[];var old_length=length;while(length>0){var t=f.call(that,attributes,length);result.push(t[0]);length-=t[1]}return[result,old_length]}}var that={offset:0,data_view:m.make(Rserve.EndianAwareDataView),msg:m,read_int:function(){var old_offset=this.offset;this.offset+=4;return this.data_view.getInt32(old_offset)},read_string:function(length){var result="";while(length--){var c=this.data_view.getInt8(this.offset++);if(c)result=result+String.fromCharCode(c)}return decodeURIComponent(escape(result))},read_stream:function(length){var old_offset=this.offset;this.offset+=length;return this.msg.view(old_offset,length)},read_int_vector:function(length){var old_offset=this.offset;this.offset+=length;return this.msg.make(Int32Array,old_offset,length)},read_double_vector:function(length){var old_offset=this.offset;this.offset+=length;return this.msg.make(Float64Array,old_offset,length)},read_null:lift(function(a,l){return Rserve.Robj.null(a)}),read_unknown:lift(function(a,l){this.offset+=l;return Rserve.Robj.null(a)}),read_string_array:function(attributes,length){var a=this.read_stream(length).make(Uint8Array);var result=[];var current_str="";for(var i=0;i<a.length;++i)if(a[i]===0){current_str=decodeURIComponent(escape(current_str));result.push(current_str);current_str=""}else{current_str=current_str+String.fromCharCode(a[i])}return[Rserve.Robj.string_array(result,attributes),length]},read_bool_array:function(attributes,length){var l2=this.read_int();var s=this.read_stream(length-4);var a=_.map(s.make(Uint8Array).subarray(0,l2),function(v){return v?true:false});return[Rserve.Robj.bool_array(a,attributes),length]},read_raw:function(attributes,length){var l2=this.read_int();var s=this.read_stream(length-4);var a=s.make(Uint8Array).subarray(0,l2).buffer;return[Rserve.Robj.raw(a,attributes),length]},read_sexp:function(){var d=this.read_int();var _=Rserve.Rsrv.par_parse(d);var t=_[0],l=_[1];var total_read=4;var attributes=undefined;if(Rserve.Rsrv.IS_LARGE(t)){var extra_length=this.read_int();total_read+=4;l+=extra_length*Math.pow(2,24);t&=~64}if(t&Rserve.Rsrv.XT_HAS_ATTR){t=t&~Rserve.Rsrv.XT_HAS_ATTR;var attr_result=this.read_sexp();attributes=attr_result[0];total_read+=attr_result[1];l-=attr_result[1]}if(handlers[t]===undefined){throw new Rserve.RserveError("Unimplemented "+t,-1)}else{var result=handlers[t].call(this,attributes,l);return[result[0],total_read+result[1]]}}};that.read_clos=bind(that.read_sexp,function(formals){return bind(that.read_sexp,function(body){return lift(function(a,l){return Rserve.Robj.clos(formals,body,a)},0)})});that.read_list=unfold(that.read_sexp);function read_symbol_value_pairs(lst){var result=[];for(var i=0;i<lst.length;i+=2){var value=lst[i],tag=lst[i+1];if(tag.type==="symbol"){result.push({name:tag.value,value:value})}else{result.push({name:null,value:value})}}return result}that.read_list_tag=bind(that.read_list,function(lst){return lift(function(attributes,length){var result=read_symbol_value_pairs(lst);return Rserve.Robj.tagged_list(result,attributes)},0)});that.read_lang_tag=bind(that.read_list,function(lst){return lift(function(attributes,length){var result=read_symbol_value_pairs(lst);return Rserve.Robj.tagged_lang(result,attributes)},0)});function xf(f,g){return bind(f,function(t){return lift(function(a,l){return g(t,a)},0)})}that.read_vector=xf(that.read_list,Rserve.Robj.vector);that.read_list_no_tag=xf(that.read_list,Rserve.Robj.list);that.read_lang_no_tag=xf(that.read_list,Rserve.Robj.lang);that.read_vector_exp=xf(that.read_list,Rserve.Robj.vector_exp);function sl(f,g){return lift(function(a,l){return g(f.call(that,l),a)})}that.read_symname=sl(that.read_string,Rserve.Robj.symbol);that.read_int_array=sl(that.read_int_vector,Rserve.Robj.int_array);that.read_double_array=sl(that.read_double_vector,Rserve.Robj.double_array);handlers[Rserve.Rsrv.XT_NULL]=that.read_null;handlers[Rserve.Rsrv.XT_UNKNOWN]=that.read_unknown;handlers[Rserve.Rsrv.XT_VECTOR]=that.read_vector;handlers[Rserve.Rsrv.XT_CLOS]=that.read_clos;handlers[Rserve.Rsrv.XT_SYMNAME]=that.read_symname;handlers[Rserve.Rsrv.XT_LIST_NOTAG]=that.read_list_no_tag;handlers[Rserve.Rsrv.XT_LIST_TAG]=that.read_list_tag;handlers[Rserve.Rsrv.XT_LANG_NOTAG]=that.read_lang_no_tag;handlers[Rserve.Rsrv.XT_LANG_TAG]=that.read_lang_tag;handlers[Rserve.Rsrv.XT_VECTOR_EXP]=that.read_vector_exp;handlers[Rserve.Rsrv.XT_ARRAY_INT]=that.read_int_array;handlers[Rserve.Rsrv.XT_ARRAY_DOUBLE]=that.read_double_array;handlers[Rserve.Rsrv.XT_ARRAY_STR]=that.read_string_array;handlers[Rserve.Rsrv.XT_ARRAY_BOOL]=that.read_bool_array;handlers[Rserve.Rsrv.XT_RAW]=that.read_raw;handlers[Rserve.Rsrv.XT_STR]=sl(that.read_string,Rserve.Robj.string);return that}function parse(msg){var result={};var header=new Int32Array(msg,0,4);var resp=header[0]&16777215,status_code=header[0]>>24;result.header=[resp,status_code];if(result.header[0]===Rserve.Rsrv.RESP_ERR){result.ok=false;result.status_code=status_code;result.message="ERROR FROM R SERVER: "+(Rserve.Rsrv.status_codes[status_code]||status_code)+" "+result.header[0]+" "+result.header[1]+" "+msg.byteLength+" "+msg;return result}if(!_.contains([Rserve.Rsrv.RESP_OK,Rserve.Rsrv.OOB_SEND,Rserve.Rsrv.OOB_MSG],result.header[0])){result.ok=false;result.message="Unexpected response from RServe: "+result.header[0]+" status: "+Rserve.Rsrv.status_codes[status_code];return result}try{result.payload=parse_payload(msg);result.ok=true}catch(e){result.ok=false;result.message=e.message}return result}function parse_payload(msg){var payload=Rserve.my_ArrayBufferView(msg,16,msg.byteLength-16);if(payload.length===0)return null;var reader=read(payload);var d=reader.read_int();var _=Rserve.Rsrv.par_parse(d);var t=_[0],l=_[1];if(Rserve.Rsrv.IS_LARGE(t)){var more_length=reader.read_int();l+=more_length*Math.pow(2,24);if(l>Math.pow(2,32)){throw new Error("Payload too large: "+l+" bytes")}t&=~64}if(t===Rserve.Rsrv.DT_INT){return{type:"int",value:reader.read_int()}}else if(t===Rserve.Rsrv.DT_STRING){return{type:"string",value:reader.read_string(l)}}else if(t===Rserve.Rsrv.DT_BYTESTREAM){return{type:"stream",value:reader.read_stream(l)}}else if(t===Rserve.Rsrv.DT_SEXP){_=reader.read_sexp();var sexp=_[0],l2=_[1];return{type:"sexp",value:sexp}}else throw new Rserve.RserveError("Bad type for parse? "+t+" "+l,-1)}Rserve.parse_websocket_frame=parse;Rserve.parse_payload=parse_payload})();(function(){var _is_little_endian;(function(){var x=new ArrayBuffer(4);var bytes=new Uint8Array(x),words=new Uint32Array(x);bytes[0]=1;if(words[0]===1){_is_little_endian=true}else if(words[0]===16777216){_is_little_endian=false}else{throw"we're bizarro endian, refusing to continue"}})();Rserve.EndianAwareDataView=function(){var proto={setInt8:function(i,v){return this.view.setInt8(i,v)},setUint8:function(i,v){return this.view.setUint8(i,v)},getInt8:function(i){return this.view.getInt8(i)},getUint8:function(i){return this.view.getUint8(i)}};var setters=["setInt32","setInt16","setUint32","setUint16","setFloat32","setFloat64"];var getters=["getInt32","getInt16","getUint32","getUint16","getFloat32","getFloat64"];for(var i=0;i<setters.length;++i){var name=setters[i];proto[name]=function(name){return function(byteOffset,value){return this.view[name](byteOffset,value,_is_little_endian)}}(name)}for(i=0;i<getters.length;++i){var name=getters[i];proto[name]=function(name){return function(byteOffset){return this.view[name](byteOffset,_is_little_endian)}}(name)}function my_dataView(buffer,byteOffset,byteLength){if(byteOffset===undefined){if(buffer.byteLength===0){this.view={byteLength:0,byteOffset:0}}else this.view=new DataView(buffer)}else{this.view=new DataView(buffer,byteOffset,byteLength)}}my_dataView.prototype=proto;return my_dataView}();Rserve.my_ArrayBufferView=function(b,o,l){o=_.isUndefined(o)?0:o;l=_.isUndefined(l)?b.byteLength:l;return{buffer:b,offset:o,length:l,data_view:function(){return new Rserve.EndianAwareDataView(this.buffer,this.offset,this.buffer.byteLength-this.offset)},make:function(ctor,new_offset,new_length){new_offset=_.isUndefined(new_offset)?0:new_offset;new_length=_.isUndefined(new_length)?this.length:new_length;var element_size=ctor.BYTES_PER_ELEMENT||1;var n_els=new_length/element_size;if((this.offset+new_offset)%element_size!=0){var view=new DataView(this.buffer,this.offset+new_offset,new_length);var output_buffer=new ArrayBuffer(new_length);var out_view=new DataView(output_buffer);for(var i=0;i<new_length;++i){out_view.setUint8(i,view.getUint8(i))}return new ctor(output_buffer)}else{return new ctor(this.buffer,this.offset+new_offset,n_els)}},skip:function(offset){return Rserve.my_ArrayBufferView(this.buffer,this.offset+offset,this.buffer.byteLength)},view:function(new_offset,new_length){return Rserve.my_ArrayBufferView(this.buffer,this.offset+new_offset,new_length)}}}})(this);(function(){function _encode_command(command,buffer){if(!_.isArray(buffer))buffer=[buffer];var length=_.reduce(buffer,function(memo,val){return memo+val.byteLength},0),big_buffer=new ArrayBuffer(16+length),view=new Rserve.EndianAwareDataView(big_buffer);view.setInt32(0,command);view.setInt32(4,length);view.setInt32(8,0);view.setInt32(12,0);var offset=16;_.each(buffer,function(b){var source_array=new Uint8Array(b);for(var i=0;i<source_array.byteLength;++i)view.setUint8(offset+i,source_array[i]);offset+=b.byteLength});return big_buffer}function _encode_string(str){var strl=str.length+1+3&~3;var payload_length=strl+4;var result=new ArrayBuffer(payload_length);var view=new Rserve.EndianAwareDataView(result);view.setInt32(0,Rserve.Rsrv.DT_STRING+(strl<<8));for(var i=0;i<str.length;++i)view.setInt8(4+i,str.charCodeAt(i));return result}function _encode_bytes(bytes){var payload_length=bytes.length;var header_length=4;var result=new ArrayBuffer(payload_length+header_length);var view=new Rserve.EndianAwareDataView(result);view.setInt32(0,Rserve.Rsrv.DT_BYTESTREAM+(payload_length<<8));for(var i=0;i<bytes.length;++i)view.setInt8(4+i,bytes[i]);return result}Rserve.create=function(opts){opts=_.defaults(opts||{},{host:"http://127.0.0.1:8081",on_connect:function(){}});var host=opts.host;var onconnect=opts.on_connect;var socket=new WebSocket(host);socket.binaryType="arraybuffer";var handle_error=opts.on_error||function(error){throw new Rserve.RserveError(error,-1)};var received_handshake=false;var result;var command_counter=0;var captured_functions={};var fresh_hash=function(){var k;do{k=String(Math.random()).slice(2,12)}while(k in captured_functions);if(k.length!==10)throw new Error("Bad rng, no cookie");return k};function convert_to_hash(value){var hash=fresh_hash();captured_functions[hash]=value;return hash}function _encode_value(value,forced_type){var sz=Rserve.determine_size(value,forced_type);if(sz>16777215){var buffer=new ArrayBuffer(sz+8);var view=Rserve.my_ArrayBufferView(buffer);view.data_view().setInt32(0,Rserve.Rsrv.DT_SEXP+(sz&16777215)*Math.pow(2,8)+Rserve.Rsrv.DT_LARGE);view.data_view().setInt32(4,sz>>24);Rserve.write_into_view(value,view.skip(8),forced_type,convert_to_hash);return buffer}else{var buffer=new ArrayBuffer(sz+4);var view=Rserve.my_ArrayBufferView(buffer);view.data_view().setInt32(0,Rserve.Rsrv.DT_SEXP+(sz<<8));Rserve.write_into_view(value,view.skip(4),forced_type,convert_to_hash);return buffer}}function hand_shake(msg){msg=msg.data;if(typeof msg==="string"){if(msg.substr(0,4)!=="Rsrv"){handle_error("server is not an RServe instance",-1)}else if(msg.substr(4,4)!=="0103"){handle_error("sorry, rserve only speaks the 0103 version of the R server protocol",-1)}else if(msg.substr(8,4)!=="QAP1"){handle_error("sorry, rserve only speaks QAP1",-1)}else{received_handshake=true;if(opts.login)result.login(opts.login);result.running=true;onconnect&&onconnect.call(result)}}else{var view=new DataView(msg);var header=String.fromCharCode(view.getUint8(0))+String.fromCharCode(view.getUint8(1))+String.fromCharCode(view.getUint8(2))+String.fromCharCode(view.getUint8(3));if(header==="RsOC"){received_handshake=true;result.ocap_mode=true;result.bare_ocap=Rserve.parse_payload(msg).value;result.ocap=Rserve.wrap_ocap(result,result.bare_ocap);result.running=true;onconnect&&onconnect.call(result)}else handle_error("Unrecognized server answer: "+header,-1)}}socket.onclose=function(msg){result.running=false;result.closed=true;opts.on_close&&opts.on_close(msg)};socket.onmessage=function(msg){if(msg.data.constructor.name==="Buffer")msg.data=new Uint8Array(msg.data).buffer;if(opts.debug)opts.debug.message_in&&opts.debug.message_in(msg);if(!received_handshake){hand_shake(msg);return}if(typeof msg.data==="string"){opts.on_raw_string&&opts.on_raw_string(msg.data);return}var v=Rserve.parse_websocket_frame(msg.data);if(!v.ok){result_callback([v.message,v.status_code],undefined)}else if(v.header[0]===Rserve.Rsrv.RESP_OK){result_callback(null,v.payload)}else if(v.header[0]===Rserve.Rsrv.OOB_SEND){opts.on_data&&opts.on_data(v.payload)}else if(v.header[0]===Rserve.Rsrv.OOB_MSG){if(result.ocap_mode){var p;try{p=Rserve.wrap_all_ocaps(result,v.payload)}catch(e){_send_cmd_now(Rserve.Rsrv.RESP_ERR|Rserve.Rsrv.OOB_MSG,_encode_string(String(e)));return}if(!_.isFunction(p[0])){_send_cmd_now(Rserve.Rsrv.RESP_ERR|Rserve.Rsrv.OOB_MSG,_encode_string("OOB Messages on ocap-mode must be javascript function calls"));return}var captured_function=p[0],params=p.slice(1);params.push(function(err,result){if(err){_send_cmd_now(Rserve.Rsrv.RESP_ERR|Rserve.Rsrv.OOB_MSG,_encode_value(err))}else{_send_cmd_now(Rserve.Rsrv.OOB_MSG,_encode_value(result))}});captured_function.apply(undefined,params)}else{if(_.isUndefined(opts.on_oob_message)){_send_cmd_now(Rserve.Rsrv.RESP_ERR|Rserve.Rsrv.OOB_MSG,_encode_string("No handler installed"))}else{in_oob_message=true;opts.on_oob_message(v.payload,function(message,error){if(!in_oob_message){handle_error("Don't call oob_message_handler more than once.");return}in_oob_message=false;var header=Rserve.Rsrv.OOB_MSG|(error?Rserve.Rsrv.RESP_ERR:Rserve.Rsrv.RESP_OK);_send_cmd_now(header,_encode_string(message));bump_queue()})}}}else{handle_error("Internal Error, parse returned unexpected type "+v.header[0],-1)}};function _send_cmd_now(command,buffer){var big_buffer=_encode_command(command,buffer);if(opts.debug)opts.debug.message_out&&opts.debug.message_out(big_buffer[0],command);socket.send(big_buffer);return big_buffer}var queue=[];var in_oob_message=false;var awaiting_result=false;var result_callback;function bump_queue(){if(result.closed&&queue.length){handle_error("Cannot send messages on a closed socket!",-1)}else if(!awaiting_result&&!in_oob_message&&queue.length){var lst=queue.shift();result_callback=lst[1];awaiting_result=true;if(opts.debug)opts.debug.message_out&&opts.debug.message_out(lst[0],lst[2]);socket.send(lst[0])}}function enqueue(buffer,k,command){queue.push([buffer,function(error,result){awaiting_result=false;bump_queue();k(error,result)},command]);bump_queue()}function _cmd(command,buffer,k,string){k=k||function(){};var big_buffer=_encode_command(command,buffer);return enqueue(big_buffer,k,string)}result={ocap_mode:false,running:false,closed:false,close:function(){socket.close()},login:function(command,k){_cmd(Rserve.Rsrv.CMD_login,_encode_string(command),k,command)},eval:function(command,k){_cmd(Rserve.Rsrv.CMD_eval,_encode_string(command),k,command)},createFile:function(command,k){_cmd(Rserve.Rsrv.CMD_createFile,_encode_string(command),k,command)},writeFile:function(chunk,k){_cmd(Rserve.Rsrv.CMD_writeFile,_encode_bytes(chunk),k,"")},closeFile:function(k){_cmd(Rserve.Rsrv.CMD_closeFile,new ArrayBuffer(0),k,"")},set:function(key,value,k){_cmd(Rserve.Rsrv.CMD_setSEXP,[_encode_string(key),_encode_value(value)],k,"")},OCcall:function(ocap,values,k){var is_ocap=false,str;try{is_ocap|=ocap.r_attributes["class"]==="OCref";str=ocap[0]}catch(e){}if(!is_ocap){try{is_ocap|=ocap.attributes.value[0].value.value[0]==="OCref";str=ocap.value[0]}catch(e){}}if(!is_ocap){k(new Error("Expected an ocap, instead got "+ocap),undefined);return}var params=[str];params.push.apply(params,values);_cmd(Rserve.Rsrv.CMD_OCcall,_encode_value(params,Rserve.Rsrv.XT_LANG_NOTAG),k,"")},wrap_ocap:function(ocap){return Rserve.wrap_ocap(this,ocap)},resolve_hash:function(hash){if(!(hash in captured_functions))throw new Error("hash "+hash+" not found.");return captured_functions[hash]}};return result};Rserve.wrap_all_ocaps=function(s,v){v=v.value.json(s.resolve_hash);function replace(obj){var result=obj;if(_.isArray(obj)&&obj.r_attributes&&obj.r_attributes["class"]=="OCref"){return Rserve.wrap_ocap(s,obj)}else if(_.isArray(obj)){result=_.map(obj,replace);result.r_type=obj.r_type;result.r_attributes=obj.r_attributes}else if(_.isTypedArray(obj)){return obj}else if(_.isFunction(obj)){return obj}else if(_.isObject(obj)){result=_.object(_.map(obj,function(v,k){return[k,replace(v)]}))}return result}return replace(v)};Rserve.wrap_ocap=function(s,ocap){var wrapped_ocap=function(){var values=_.toArray(arguments);if(!values.length||!_.isFunction(values[values.length-1]))throw new Error("forgot to pass continuation to ocap");var k=values.pop();s.OCcall(ocap,values,function(err,v){if(!_.isUndefined(v))v=Rserve.wrap_all_ocaps(s,v);k(err,v)})};wrapped_ocap.bare_ocap=ocap;return wrapped_ocap}})();Rserve.RserveError=function(message,status_code){this.name="RserveError";this.message=message;this.status_code=status_code};Rserve.RserveError.prototype=Object.create(Error);Rserve.RserveError.prototype.constructor=Rserve.RserveError;(function(){_.mixin({isTypedArray:function(v){if(!_.isObject(v))return false;return!_.isUndefined(v.byteLength)&&!_.isUndefined(v.BYTES_PER_ELEMENT)}});Rserve.type_id=function(value){if(_.isNull(value)||_.isUndefined(value))return Rserve.Rsrv.XT_NULL;var type_dispatch={"boolean":Rserve.Rsrv.XT_ARRAY_BOOL,number:Rserve.Rsrv.XT_ARRAY_DOUBLE,string:Rserve.Rsrv.XT_ARRAY_STR};if(!_.isUndefined(type_dispatch[typeof value]))return type_dispatch[typeof value];if(_.isTypedArray(value))return Rserve.Rsrv.XT_ARRAY_DOUBLE;if(!_.isUndefined(value.byteLength)&&!_.isUndefined(value.slice))return Rserve.Rsrv.XT_RAW;if(_.isArray(value)&&_.all(value,function(el){return typeof el==="string"}))return Rserve.Rsrv.XT_ARRAY_STR;if(_.isArray(value)&&_.all(value,function(el){return typeof el==="boolean"}))return Rserve.Rsrv.XT_ARRAY_BOOL;if(_.isArray(value))return Rserve.Rsrv.XT_VECTOR;if(_.isFunction(value))return Rserve.Rsrv.XT_ARRAY_STR|Rserve.Rsrv.XT_HAS_ATTR;if(_.isObject(value))return Rserve.Rsrv.XT_VECTOR|Rserve.Rsrv.XT_HAS_ATTR;throw new Rserve.RServeError("Value type unrecognized by Rserve: "+value)};Rserve.determine_size=function(value,forced_type){function list_size(lst){return _.reduce(lst,function(memo,el){return memo+Rserve.determine_size(el)},0)}function final_size(payload_size){if(payload_size>1<<24)return payload_size+8;else return payload_size+4}var header_size=4,t=forced_type||Rserve.type_id(value);switch(t&~Rserve.Rsrv.XT_LARGE){case Rserve.Rsrv.XT_NULL:return final_size(0);case Rserve.Rsrv.XT_ARRAY_BOOL:if(_.isBoolean(value))return final_size(8);else return final_size(value.length+7&~3);case Rserve.Rsrv.XT_ARRAY_STR:if(_.isArray(value))return final_size(_.reduce(value,function(memo,str){var utf8=unescape(encodeURIComponent(str));return memo+utf8.length+1},0));else{var utf8=unescape(encodeURIComponent(value));return final_size(utf8.length+1)}case Rserve.Rsrv.XT_ARRAY_DOUBLE:if(_.isNumber(value))return final_size(8);else return final_size(8*value.length);case Rserve.Rsrv.XT_RAW:return final_size(4+value.byteLength);case Rserve.Rsrv.XT_VECTOR:case Rserve.Rsrv.XT_LANG_NOTAG:return final_size(list_size(value));case Rserve.Rsrv.XT_VECTOR|Rserve.Rsrv.XT_HAS_ATTR:var names_size_1=final_size("names".length+3);var names_size_2=Rserve.determine_size(_.keys(value));var names_size=final_size(names_size_1+names_size_2);return final_size(names_size+list_size(_.values(value)));case Rserve.Rsrv.XT_ARRAY_STR|Rserve.Rsrv.XT_HAS_ATTR:return Rserve.determine_size("0403556553")+header_size+header_size+"class".length+3+Rserve.determine_size(["javascript_function"]);default:throw new Rserve.RserveError("Internal error, can't handle type "+t)}};Rserve.write_into_view=function(value,array_buffer_view,forced_type,convert){var size=Rserve.determine_size(value,forced_type);var is_large=size>16777215;var t=forced_type||Rserve.type_id(value),i,current_offset,lbl;if(is_large)t=t|Rserve.Rsrv.XT_LARGE;var read_view;var write_view=array_buffer_view.data_view();var payload_start;if(is_large){payload_start=8;write_view.setInt32(0,t+(size-8<<8));write_view.setInt32(4,size-8>>24)}else{payload_start=4;write_view.setInt32(0,t+(size-4<<8))}switch(t&~Rserve.Rsrv.XT_LARGE){case Rserve.Rsrv.XT_NULL:break;case Rserve.Rsrv.XT_ARRAY_BOOL:if(_.isBoolean(value)){write_view.setInt32(payload_start,1);write_view.setInt8(payload_start+4,value?1:0)}else{write_view.setInt32(payload_start,value.length);for(i=0;i<value.length;++i)write_view.setInt8(payload_start+4+i,value[i]?1:0)}break;case Rserve.Rsrv.XT_ARRAY_STR:if(_.isArray(value)){var offset=payload_start;_.each(value,function(el){var utf8=unescape(encodeURIComponent(el));for(var i=0;i<utf8.length;++i,++offset)write_view.setUint8(offset,utf8.charCodeAt(i));write_view.setUint8(offset++,0)})}else{var utf8=unescape(encodeURIComponent(value));for(i=0;i<utf8.length;++i)write_view.setUint8(payload_start+i,utf8.charCodeAt(i));write_view.setUint8(payload_start+utf8.length,0)}break;case Rserve.Rsrv.XT_ARRAY_DOUBLE:if(_.isNumber(value))write_view.setFloat64(payload_start,value);else{for(i=0;i<value.length;++i)write_view.setFloat64(payload_start+8*i,value[i])}break;case Rserve.Rsrv.XT_RAW:read_view=new Rserve.EndianAwareDataView(value);write_view.setUint32(payload_start,value.byteLength);for(i=0;i<value.byteLength;++i){write_view.setUint8(payload_start+4+i,read_view.getUint8(i))}break;case Rserve.Rsrv.XT_VECTOR:case Rserve.Rsrv.XT_LANG_NOTAG:current_offset=payload_start;_.each(value,function(el){var sz=Rserve.determine_size(el);Rserve.write_into_view(el,array_buffer_view.skip(current_offset),undefined,convert);current_offset+=sz});break;case Rserve.Rsrv.XT_VECTOR|Rserve.Rsrv.XT_HAS_ATTR:current_offset=payload_start+8;_.each(_.keys(value),function(el){for(var i=0;i<el.length;++i,++current_offset)write_view.setUint8(current_offset,el.charCodeAt(i));write_view.setUint8(current_offset++,0)});write_view.setUint32(payload_start+4,Rserve.Rsrv.XT_ARRAY_STR+(current_offset-(payload_start+8)<<8));write_view.setUint32(current_offset,Rserve.Rsrv.XT_SYMNAME+(8<<8));current_offset+=4;lbl="names";for(i=0;i<lbl.length;++i,++current_offset)write_view.setUint8(current_offset,lbl.charCodeAt(i));current_offset+=3;write_view.setUint32(payload_start,Rserve.Rsrv.XT_LIST_TAG+(current_offset-(payload_start+4)<<8));_.each(_.values(value),function(el){var sz=Rserve.determine_size(el);Rserve.write_into_view(el,array_buffer_view.skip(current_offset),undefined,convert);current_offset+=sz});break;case Rserve.Rsrv.XT_ARRAY_STR|Rserve.Rsrv.XT_HAS_ATTR:var converted_function=convert(value);current_offset=payload_start+8;var class_name="javascript_function";for(i=0;i<class_name.length;++i,++current_offset)write_view.setUint8(current_offset,class_name.charCodeAt(i));write_view.setUint8(current_offset++,0);write_view.setUint32(8,Rserve.Rsrv.XT_ARRAY_STR+(current_offset-(payload_start+8)<<8));write_view.setUint32(current_offset,Rserve.Rsrv.XT_SYMNAME+(8<<8));current_offset+=4;lbl="class";for(i=0;i<lbl.length;++i,++current_offset)write_view.setUint8(current_offset,lbl.charCodeAt(i));current_offset+=3;write_view.setUint32(4,Rserve.Rsrv.XT_LIST_TAG+(current_offset-(payload_start+4)<<8));for(i=0;i<converted_function.length;++i)write_view.setUint8(current_offset+i,converted_function.charCodeAt(i));write_view.setUint8(current_offset+converted_function.length,0);break;default:throw new Rserve.RserveError("Internal error, can't handle type "+t)}}})();this.Rserve=Rserve})();(function(){var $,BorderDropHint,DragAndDropHandler,DragElement,ElementsRenderer,FolderElement,GhostDropHint,HitAreasGenerator,JqTreeWidget,KeyHandler,MouseWidget,Node,NodeElement,Position,SaveStateHandler,ScrollHandler,SelectNodeHandler,SimpleWidget,VisibleNodeIterator,html_escape,indexOf,json_escapable,json_meta,json_quote,json_str,_indexOf,__slice=[].slice,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};$=this.jQuery;SimpleWidget=function(){SimpleWidget.prototype.defaults={};function SimpleWidget(el,options){this.$el=$(el);this.options=$.extend({},this.defaults,options)}SimpleWidget.prototype.destroy=function(){return this._deinit()};SimpleWidget.prototype._init=function(){return null};SimpleWidget.prototype._deinit=function(){return null};SimpleWidget.register=function(widget_class,widget_name){var callFunction,createWidget,destroyWidget,getDataKey,getWidgetData;getDataKey=function(){return"simple_widget_"+widget_name};getWidgetData=function(el,data_key){var widget;widget=$.data(el,data_key);if(widget&&widget instanceof SimpleWidget){return widget}else{return null}};createWidget=function($el,options){var data_key,el,existing_widget,widget,_i,_len;data_key=getDataKey();for(_i=0,_len=$el.length;_i<_len;_i++){el=$el[_i];existing_widget=getWidgetData(el,data_key);if(!existing_widget){widget=new widget_class(el,options);if(!$.data(el,data_key)){$.data(el,data_key,widget)}widget._init()}}return $el};destroyWidget=function($el){var data_key,el,widget,_i,_len,_results;data_key=getDataKey();_results=[];for(_i=0,_len=$el.length;_i<_len;_i++){el=$el[_i];widget=getWidgetData(el,data_key);if(widget){widget.destroy()}_results.push($.removeData(el,data_key))}return _results};callFunction=function($el,function_name,args){var el,result,widget,widget_function,_i,_len;result=null;for(_i=0,_len=$el.length;_i<_len;_i++){el=$el[_i];widget=$.data(el,getDataKey());if(widget&&widget instanceof SimpleWidget){widget_function=widget[function_name];if(widget_function&&typeof widget_function==="function"){result=widget_function.apply(widget,args)}}}return result};return $.fn[widget_name]=function(){var $el,args,argument1,function_name,options;argument1=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];$el=this;if(argument1===void 0||typeof argument1==="object"){options=argument1;return createWidget($el,options)}else if(typeof argument1==="string"&&argument1[0]!=="_"){function_name=argument1;if(function_name==="destroy"){return destroyWidget($el)}else{return callFunction($el,function_name,args)}}}};return SimpleWidget}();this.SimpleWidget=SimpleWidget;MouseWidget=function(_super){__extends(MouseWidget,_super);function MouseWidget(){return MouseWidget.__super__.constructor.apply(this,arguments)}MouseWidget.is_mouse_handled=false;MouseWidget.prototype._init=function(){this.$el.bind("mousedown.mousewidget",$.proxy(this._mouseDown,this));this.$el.bind("touchstart.mousewidget",$.proxy(this._touchStart,this));this.is_mouse_started=false;this.mouse_delay=0;this._mouse_delay_timer=null;this._is_mouse_delay_met=true;return this.mouse_down_info=null
  };MouseWidget.prototype._deinit=function(){var $document;this.$el.unbind("mousedown.mousewidget");this.$el.unbind("touchstart.mousewidget");$document=$(document);$document.unbind("mousemove.mousewidget");return $document.unbind("mouseup.mousewidget")};MouseWidget.prototype._mouseDown=function(e){var result;if(e.which!==1){return}result=this._handleMouseDown(e,this._getPositionInfo(e));if(result){e.preventDefault()}return result};MouseWidget.prototype._handleMouseDown=function(e,position_info){if(MouseWidget.is_mouse_handled){return}if(this.is_mouse_started){this._handleMouseUp(position_info)}this.mouse_down_info=position_info;if(!this._mouseCapture(position_info)){return}this._handleStartMouse();this.is_mouse_handled=true;return true};MouseWidget.prototype._handleStartMouse=function(){var $document;$document=$(document);$document.bind("mousemove.mousewidget",$.proxy(this._mouseMove,this));$document.bind("touchmove.mousewidget",$.proxy(this._touchMove,this));$document.bind("mouseup.mousewidget",$.proxy(this._mouseUp,this));$document.bind("touchend.mousewidget",$.proxy(this._touchEnd,this));if(this.mouse_delay){return this._startMouseDelayTimer()}};MouseWidget.prototype._startMouseDelayTimer=function(){if(this._mouse_delay_timer){clearTimeout(this._mouse_delay_timer)}this._mouse_delay_timer=setTimeout(function(_this){return function(){return _this._is_mouse_delay_met=true}}(this),this.mouse_delay);return this._is_mouse_delay_met=false};MouseWidget.prototype._mouseMove=function(e){return this._handleMouseMove(e,this._getPositionInfo(e))};MouseWidget.prototype._handleMouseMove=function(e,position_info){if(this.is_mouse_started){this._mouseDrag(position_info);return e.preventDefault()}if(this.mouse_delay&&!this._is_mouse_delay_met){return true}this.is_mouse_started=this._mouseStart(this.mouse_down_info)!==false;if(this.is_mouse_started){this._mouseDrag(position_info)}else{this._handleMouseUp(position_info)}return!this.is_mouse_started};MouseWidget.prototype._getPositionInfo=function(e){return{page_x:e.pageX,page_y:e.pageY,target:e.target,original_event:e}};MouseWidget.prototype._mouseUp=function(e){return this._handleMouseUp(this._getPositionInfo(e))};MouseWidget.prototype._handleMouseUp=function(position_info){var $document;$document=$(document);$document.unbind("mousemove.mousewidget");$document.unbind("touchmove.mousewidget");$document.unbind("mouseup.mousewidget");$document.unbind("touchend.mousewidget");if(this.is_mouse_started){this.is_mouse_started=false;this._mouseStop(position_info)}};MouseWidget.prototype._mouseCapture=function(position_info){return true};MouseWidget.prototype._mouseStart=function(position_info){return null};MouseWidget.prototype._mouseDrag=function(position_info){return null};MouseWidget.prototype._mouseStop=function(position_info){return null};MouseWidget.prototype.setMouseDelay=function(mouse_delay){return this.mouse_delay=mouse_delay};MouseWidget.prototype._touchStart=function(e){var touch;if(e.originalEvent.touches.length>1){return}touch=e.originalEvent.changedTouches[0];return this._handleMouseDown(e,this._getPositionInfo(touch))};MouseWidget.prototype._touchMove=function(e){var touch;if(e.originalEvent.touches.length>1){return}touch=e.originalEvent.changedTouches[0];return this._handleMouseMove(e,this._getPositionInfo(touch))};MouseWidget.prototype._touchEnd=function(e){var touch;if(e.originalEvent.touches.length>1){return}touch=e.originalEvent.changedTouches[0];return this._handleMouseUp(this._getPositionInfo(touch))};return MouseWidget}(SimpleWidget);this.Tree={};$=this.jQuery;Position={getName:function(position){return Position.strings[position-1]},nameToIndex:function(name){var i,_i,_ref;for(i=_i=1,_ref=Position.strings.length;1<=_ref?_i<=_ref:_i>=_ref;i=1<=_ref?++_i:--_i){if(Position.strings[i-1]===name){return i}}return 0}};Position.BEFORE=1;Position.AFTER=2;Position.INSIDE=3;Position.NONE=4;Position.strings=["before","after","inside","none"];this.Tree.Position=Position;Node=function(){function Node(o,is_root,node_class){if(is_root==null){is_root=false}if(node_class==null){node_class=Node}this.setData(o);this.children=[];this.parent=null;if(is_root){this.id_mapping={};this.tree=this;this.node_class=node_class}}Node.prototype.setData=function(o){var key,value,_results;if(typeof o!=="object"){return this.name=o}else{_results=[];for(key in o){value=o[key];if(key==="label"){_results.push(this.name=value)}else{_results.push(this[key]=value)}}return _results}};Node.prototype.initFromData=function(data){var addChildren,addNode;addNode=function(_this){return function(node_data){_this.setData(node_data);if(node_data.children){return addChildren(node_data.children)}}}(this);addChildren=function(_this){return function(children_data){var child,node,_i,_len;for(_i=0,_len=children_data.length;_i<_len;_i++){child=children_data[_i];node=new _this.tree.node_class("");node.initFromData(child);_this.addChild(node)}return null}}(this);addNode(data);return null};Node.prototype.loadFromData=function(data){var node,o,_i,_len;this.removeChildren();for(_i=0,_len=data.length;_i<_len;_i++){o=data[_i];node=new this.tree.node_class(o);this.addChild(node);if(typeof o==="object"&&o.children){node.loadFromData(o.children)}}return null};Node.prototype.addChild=function(node){this.children.push(node);return node._setParent(this)};Node.prototype.addChildAtPosition=function(node,index){this.children.splice(index,0,node);return node._setParent(this)};Node.prototype._setParent=function(parent){this.parent=parent;this.tree=parent.tree;return this.tree.addNodeToIndex(this)};Node.prototype.removeChild=function(node){node.removeChildren();return this._removeChild(node)};Node.prototype._removeChild=function(node){this.children.splice(this.getChildIndex(node),1);return this.tree.removeNodeFromIndex(node)};Node.prototype.getChildIndex=function(node){return $.inArray(node,this.children)};Node.prototype.hasChildren=function(){return this.children.length!==0};Node.prototype.isFolder=function(){return this.hasChildren()||this.load_on_demand};Node.prototype.iterate=function(callback){var _iterate;_iterate=function(_this){return function(node,level){var child,result,_i,_len,_ref;if(node.children){_ref=node.children;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];result=callback(child,level);if(_this.hasChildren()&&result){_iterate(child,level+1)}}return null}}}(this);_iterate(this,0);return null};Node.prototype.moveNode=function(moved_node,target_node,position){if(moved_node.isParentOf(target_node)){return}moved_node.parent._removeChild(moved_node);if(position===Position.AFTER){return target_node.parent.addChildAtPosition(moved_node,target_node.parent.getChildIndex(target_node)+1)}else if(position===Position.BEFORE){return target_node.parent.addChildAtPosition(moved_node,target_node.parent.getChildIndex(target_node))}else if(position===Position.INSIDE){return target_node.addChildAtPosition(moved_node,0)}};Node.prototype.getData=function(){var getDataFromNodes;getDataFromNodes=function(_this){return function(nodes){var data,k,node,tmp_node,v,_i,_len;data=[];for(_i=0,_len=nodes.length;_i<_len;_i++){node=nodes[_i];tmp_node={};for(k in node){v=node[k];if(k!=="parent"&&k!=="children"&&k!=="element"&&k!=="tree"&&Object.prototype.hasOwnProperty.call(node,k)){tmp_node[k]=v}}if(node.hasChildren()){tmp_node.children=getDataFromNodes(node.children)}data.push(tmp_node)}return data}}(this);return getDataFromNodes(this.children)};Node.prototype.getNodeByName=function(name){var result;result=null;this.iterate(function(node){if(node.name===name){result=node;return false}else{return true}});return result};Node.prototype.addAfter=function(node_info){var child_index,node;if(!this.parent){return null}else{node=new this.tree.node_class(node_info);child_index=this.parent.getChildIndex(this);this.parent.addChildAtPosition(node,child_index+1);return node}};Node.prototype.addBefore=function(node_info){var child_index,node;if(!this.parent){return null}else{node=new this.tree.node_class(node_info);child_index=this.parent.getChildIndex(this);this.parent.addChildAtPosition(node,child_index);return node}};Node.prototype.addParent=function(node_info){var child,new_parent,original_parent,_i,_len,_ref;if(!this.parent){return null}else{new_parent=new this.tree.node_class(node_info);new_parent._setParent(this.tree);original_parent=this.parent;_ref=original_parent.children;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];new_parent.addChild(child)}original_parent.children=[];original_parent.addChild(new_parent);return new_parent}};Node.prototype.remove=function(){if(this.parent){this.parent.removeChild(this);return this.parent=null}};Node.prototype.append=function(node_info){var node;node=new this.tree.node_class(node_info);this.addChild(node);return node};Node.prototype.prepend=function(node_info){var node;node=new this.tree.node_class(node_info);this.addChildAtPosition(node,0);return node};Node.prototype.isParentOf=function(node){var parent;parent=node.parent;while(parent){if(parent===this){return true}parent=parent.parent}return false};Node.prototype.getLevel=function(){var level,node;level=0;node=this;while(node.parent){level+=1;node=node.parent}return level};Node.prototype.getNodeById=function(node_id){return this.id_mapping[node_id]};Node.prototype.addNodeToIndex=function(node){if(node.id!=null){return this.id_mapping[node.id]=node}};Node.prototype.removeNodeFromIndex=function(node){if(node.id!=null){return delete this.id_mapping[node.id]}};Node.prototype.removeChildren=function(){this.iterate(function(_this){return function(child){_this.tree.removeNodeFromIndex(child);return true}}(this));return this.children=[]};Node.prototype.getPreviousSibling=function(){var previous_index;if(!this.parent){return null}else{previous_index=this.parent.getChildIndex(this)-1;if(previous_index>=0){return this.parent.children[previous_index]}else{return null}}};Node.prototype.getNextSibling=function(){var next_index;if(!this.parent){return null}else{next_index=this.parent.getChildIndex(this)+1;if(next_index<this.parent.children.length){return this.parent.children[next_index]}else{return null}}};return Node}();this.Tree.Node=Node;ElementsRenderer=function(){function ElementsRenderer(tree_widget){this.tree_widget=tree_widget;this.opened_icon_text=this.getHtmlText(tree_widget.options.openedIcon);this.closed_icon_text=this.getHtmlText(tree_widget.options.closedIcon)}ElementsRenderer.prototype.render=function(from_node){if(from_node&&from_node.parent){return this.renderFromNode(from_node)}else{return this.renderFromRoot()}};ElementsRenderer.prototype.renderNode=function(node){var $li,$parent_ul,parent_node_element,previous_node;$(node.element).remove();parent_node_element=new NodeElement(node.parent,this.tree_widget);$parent_ul=parent_node_element.getUl();$li=this.createLi(node);this.attachNodeData(node,$li);previous_node=node.getPreviousSibling();if(previous_node){$(previous_node.element).after($li)}else{parent_node_element.getUl().prepend($li)}if(node.children){return this.renderFromNode(node)}};ElementsRenderer.prototype.renderFromRoot=function(){var $element;$element=this.tree_widget.element;$element.empty();return this.createDomElements($element[0],this.tree_widget.tree.children,true,true)};ElementsRenderer.prototype.renderFromNode=function(from_node){var node_element;node_element=this.tree_widget._getNodeElementForNode(from_node);node_element.getUl().remove();return this.createDomElements(node_element.$element[0],from_node.children,false,false)};ElementsRenderer.prototype.createDomElements=function(element,children,is_root_node,is_open){var child,li,ul,_i,_len;ul=this.createUl(is_root_node);element.appendChild(ul);for(_i=0,_len=children.length;_i<_len;_i++){child=children[_i];li=this.createLi(child);ul.appendChild(li);this.attachNodeData(child,li);if(child.hasChildren()){this.createDomElements(li,child.children,false,child.is_open)}}return null};ElementsRenderer.prototype.attachNodeData=function(node,li){node.element=li;return $(li).data("node",node)};ElementsRenderer.prototype.createUl=function(is_root_node){var class_string,ul;if(is_root_node){class_string="jqtree-tree"}else{class_string=""}ul=document.createElement("ul");ul.className="jqtree_common "+class_string;return ul};ElementsRenderer.prototype.createLi=function(node){var li;if(node.isFolder()){li=this.createFolderLi(node)}else{li=this.createNodeLi(node)}if(this.tree_widget.options.onCreateLi){this.tree_widget.options.onCreateLi(node,$(li))}return li};ElementsRenderer.prototype.createFolderLi=function(node){var button_char,button_classes,button_link,div,escaped_name,folder_classes,li,title_span;button_classes=this.getButtonClasses(node);folder_classes=this.getFolderClasses(node);escaped_name=this.escapeIfNecessary(node.name);if(node.is_open){button_char=this.opened_icon_text}else{button_char=this.closed_icon_text}li=document.createElement("li");li.className="jqtree_common "+folder_classes;div=document.createElement("div");div.className="jqtree-element jqtree_common";li.appendChild(div);button_link=document.createElement("a");button_link.className="jqtree_common "+button_classes;button_link.appendChild(document.createTextNode(button_char));div.appendChild(button_link);title_span=document.createElement("span");title_span.className="jqtree_common jqtree-title";div.appendChild(title_span);title_span.innerHTML=escaped_name;return li};ElementsRenderer.prototype.createNodeLi=function(node){var class_string,div,escaped_name,li,li_classes,title_span;li_classes=["jqtree_common"];if(this.tree_widget.select_node_handler&&this.tree_widget.select_node_handler.isNodeSelected(node)){li_classes.push("jqtree-selected")}class_string=li_classes.join(" ");escaped_name=this.escapeIfNecessary(node.name);li=document.createElement("li");li.className=class_string;div=document.createElement("div");div.className="jqtree-element jqtree_common";li.appendChild(div);title_span=document.createElement("span");title_span.className="jqtree-title jqtree_common";title_span.innerHTML=escaped_name;div.appendChild(title_span);return li};ElementsRenderer.prototype.getButtonClasses=function(node){var classes;classes=["jqtree-toggler"];if(!node.is_open){classes.push("jqtree-closed")}return classes.join(" ")};ElementsRenderer.prototype.getFolderClasses=function(node){var classes;classes=["jqtree-folder"];if(!node.is_open){classes.push("jqtree-closed")}if(this.tree_widget.select_node_handler&&this.tree_widget.select_node_handler.isNodeSelected(node)){classes.push("jqtree-selected")}return classes.join(" ")};ElementsRenderer.prototype.escapeIfNecessary=function(value){if(this.tree_widget.options.autoEscape){return html_escape(value)}else{return value}};ElementsRenderer.prototype.getHtmlText=function(entity_text){return $(document.createElement("div")).html(entity_text).text()};return ElementsRenderer}();JqTreeWidget=function(_super){__extends(JqTreeWidget,_super);function JqTreeWidget(){return JqTreeWidget.__super__.constructor.apply(this,arguments)}JqTreeWidget.prototype.defaults={autoOpen:false,saveState:false,dragAndDrop:false,selectable:true,useContextMenu:true,onCanSelectNode:null,onSetStateFromStorage:null,onGetStateFromStorage:null,onCreateLi:null,onIsMoveHandle:null,onCanMove:null,onCanMoveTo:null,onLoadFailed:null,autoEscape:true,dataUrl:null,closedIcon:"&#x25ba;",openedIcon:"&#x25bc;",slide:true,nodeClass:Node,dataFilter:null,keyboardSupport:true,openFolderDelay:500};JqTreeWidget.prototype.toggle=function(node,slide){if(slide==null){slide=true}if(node.is_open){return this.closeNode(node,slide)}else{return this.openNode(node,slide)}};JqTreeWidget.prototype.getTree=function(){return this.tree};JqTreeWidget.prototype.selectNode=function(node){return this._selectNode(node,false)};JqTreeWidget.prototype._selectNode=function(node,must_toggle){var canSelect,deselected_node,openParents,saveState;if(must_toggle==null){must_toggle=false}if(!this.select_node_handler){return}canSelect=function(_this){return function(){if(_this.options.onCanSelectNode){return _this.options.selectable&&_this.options.onCanSelectNode(node)}else{return _this.options.selectable}}}(this);openParents=function(_this){return function(){var parent;parent=node.parent;if(parent&&parent.parent&&!parent.is_open){return _this.openNode(parent,false)}}}(this);saveState=function(_this){return function(){if(_this.options.saveState){return _this.save_state_handler.saveState()}}}(this);if(!node){this._deselectCurrentNode();saveState();return}if(!canSelect()){return}if(this.select_node_handler.isNodeSelected(node)){if(must_toggle){this._deselectCurrentNode();this._triggerEvent("tree.select",{node:null,previous_node:node})}}else{deselected_node=this.getSelectedNode();this._deselectCurrentNode();this.addToSelection(node);this._triggerEvent("tree.select",{node:node,deselected_node:deselected_node});openParents()}return saveState()};JqTreeWidget.prototype.getSelectedNode=function(){return this.select_node_handler.getSelectedNode()};JqTreeWidget.prototype.toJson=function(){return JSON.stringify(this.tree.getData())};JqTreeWidget.prototype.loadData=function(data,parent_node){return this._loadData(data,parent_node)};JqTreeWidget.prototype.loadDataFromUrl=function(url,parent_node,on_finished){if($.type(url)!=="string"){on_finished=parent_node;parent_node=url;url=null}return this._loadDataFromUrl(url,parent_node,on_finished)};JqTreeWidget.prototype.reload=function(){return this.loadDataFromUrl()};JqTreeWidget.prototype._loadDataFromUrl=function(url_info,parent_node,on_finished){var $el,addLoadingClass,parseUrlInfo,removeLoadingClass;$el=null;addLoadingClass=function(_this){return function(){var folder_element;if(!parent_node){$el=_this.element}else{folder_element=new FolderElement(parent_node,_this);$el=folder_element.getLi()}return $el.addClass("jqtree-loading")}}(this);removeLoadingClass=function(_this){return function(){if($el){return $el.removeClass("jqtree-loading")}}}(this);parseUrlInfo=function(_this){return function(){if($.type(url_info)==="string"){url_info={url:url_info}}if(!url_info.method){return url_info.method="get"}}}(this);addLoadingClass();if(!url_info){url_info=this._getDataUrlInfo(parent_node)}parseUrlInfo();return $.ajax({url:url_info.url,data:url_info.data,type:url_info.method.toUpperCase(),cache:false,dataType:"json",success:function(_this){return function(response){var data;if($.isArray(response)||typeof response==="object"){data=response}else{data=$.parseJSON(response)}if(_this.options.dataFilter){data=_this.options.dataFilter(data)}removeLoadingClass();_this._loadData(data,parent_node);if(on_finished&&$.isFunction(on_finished)){return on_finished()}}}(this),error:function(_this){return function(response){removeLoadingClass();if(_this.options.onLoadFailed){return _this.options.onLoadFailed(response)}}}(this)})};JqTreeWidget.prototype._loadData=function(data,parent_node){var n,selected_nodes_under_parent,_i,_len;if(!data){return}this._triggerEvent("tree.load_data",{tree_data:data});if(!parent_node){this._initTree(data)}else{selected_nodes_under_parent=this.select_node_handler.getSelectedNodesUnder(parent_node);for(_i=0,_len=selected_nodes_under_parent.length;_i<_len;_i++){n=selected_nodes_under_parent[_i];this.select_node_handler.removeFromSelection(n)}parent_node.loadFromData(data);parent_node.load_on_demand=false;this._refreshElements(parent_node.parent)}if(this.is_dragging){return this.dnd_handler.refreshHitAreas()}};JqTreeWidget.prototype.getNodeById=function(node_id){return this.tree.getNodeById(node_id)};JqTreeWidget.prototype.getNodeByName=function(name){return this.tree.getNodeByName(name)};JqTreeWidget.prototype.openNode=function(node,slide){if(slide==null){slide=true}return this._openNode(node,slide)};JqTreeWidget.prototype._openNode=function(node,slide,on_finished){var doOpenNode,parent;if(slide==null){slide=true}doOpenNode=function(_this){return function(_node,_slide,_on_finished){var folder_element;folder_element=new FolderElement(_node,_this);return folder_element.open(_on_finished,_slide)}}(this);if(node.isFolder()){if(node.load_on_demand){return this._loadFolderOnDemand(node,slide,on_finished)}else{parent=node.parent;while(parent&&!parent.is_open){if(parent.parent){doOpenNode(parent,false,null)}parent=parent.parent}doOpenNode(node,slide,on_finished);return this._saveState()}}};JqTreeWidget.prototype._loadFolderOnDemand=function(node,slide,on_finished){if(slide==null){slide=true}return this._loadDataFromUrl(null,node,function(_this){return function(){return _this._openNode(node,slide,on_finished)}}(this))};JqTreeWidget.prototype.closeNode=function(node,slide){if(slide==null){slide=true}if(node.isFolder()){new FolderElement(node,this).close(slide);return this._saveState()}};JqTreeWidget.prototype.isDragging=function(){return this.is_dragging};JqTreeWidget.prototype.refreshHitAreas=function(){return this.dnd_handler.refreshHitAreas()};JqTreeWidget.prototype.addNodeAfter=function(new_node_info,existing_node){var new_node;new_node=existing_node.addAfter(new_node_info);this._refreshElements(existing_node.parent);return new_node};JqTreeWidget.prototype.addNodeBefore=function(new_node_info,existing_node){var new_node;new_node=existing_node.addBefore(new_node_info);this._refreshElements(existing_node.parent);return new_node};JqTreeWidget.prototype.addParentNode=function(new_node_info,existing_node){var new_node;new_node=existing_node.addParent(new_node_info);this._refreshElements(new_node.parent);return new_node};JqTreeWidget.prototype.removeNode=function(node){var parent;parent=node.parent;if(parent){this.select_node_handler.removeFromSelection(node,true);node.remove();return this._refreshElements(parent.parent)}};JqTreeWidget.prototype.appendNode=function(new_node_info,parent_node){var is_already_folder_node,node;if(!parent_node){parent_node=this.tree}is_already_folder_node=parent_node.isFolder();node=parent_node.append(new_node_info);if(is_already_folder_node){this._refreshElements(parent_node)}else{this._refreshElements(parent_node.parent)}return node};JqTreeWidget.prototype.prependNode=function(new_node_info,parent_node){var node;if(!parent_node){parent_node=this.tree}node=parent_node.prepend(new_node_info);this._refreshElements(parent_node);return node};JqTreeWidget.prototype.updateNode=function(node,data){var id_is_changed;id_is_changed=data.id&&data.id!==node.id;if(id_is_changed){this.tree.removeNodeFromIndex(node)}node.setData(data);if(id_is_changed){this.tree.addNodeToIndex(node)}this.renderer.renderNode(node);return this._selectCurrentNode()};JqTreeWidget.prototype.moveNode=function(node,target_node,position){var position_index;position_index=Position.nameToIndex(position);this.tree.moveNode(node,target_node,position_index);return this._refreshElements()};JqTreeWidget.prototype.getStateFromStorage=function(){return this.save_state_handler.getStateFromStorage()};JqTreeWidget.prototype.addToSelection=function(node){this.select_node_handler.addToSelection(node);return this._getNodeElementForNode(node).select()};JqTreeWidget.prototype.getSelectedNodes=function(){return this.select_node_handler.getSelectedNodes()};JqTreeWidget.prototype.isNodeSelected=function(node){return this.select_node_handler.isNodeSelected(node)};JqTreeWidget.prototype.removeFromSelection=function(node){this.select_node_handler.removeFromSelection(node);return this._getNodeElementForNode(node).deselect()};JqTreeWidget.prototype.scrollToNode=function(node){var $element,top;$element=$(node.element);top=$element.offset().top-this.$el.offset().top;return this.scroll_handler.scrollTo(top)};JqTreeWidget.prototype.getState=function(){return this.save_state_handler.getState()};JqTreeWidget.prototype.setState=function(state){this.save_state_handler.setState(state);return this._refreshElements()};JqTreeWidget.prototype.setOption=function(option,value){return this.options[option]=value};JqTreeWidget.prototype._init=function(){JqTreeWidget.__super__._init.call(this);this.element=this.$el;this.mouse_delay=300;this.is_initialized=false;this.renderer=new ElementsRenderer(this);if(typeof SaveStateHandler!=="undefined"&&SaveStateHandler!==null){this.save_state_handler=new SaveStateHandler(this)}else{this.options.saveState=false}if(typeof SelectNodeHandler!=="undefined"&&SelectNodeHandler!==null){this.select_node_handler=new SelectNodeHandler(this)}if(typeof DragAndDropHandler!=="undefined"&&DragAndDropHandler!==null){this.dnd_handler=new DragAndDropHandler(this)}else{this.options.dragAndDrop=false}if(typeof ScrollHandler!=="undefined"&&ScrollHandler!==null){this.scroll_handler=new ScrollHandler(this)}if(typeof KeyHandler!=="undefined"&&KeyHandler!==null&&typeof SelectNodeHandler!=="undefined"&&SelectNodeHandler!==null){this.key_handler=new KeyHandler(this)}this._initData();this.element.click($.proxy(this._click,this));this.element.dblclick($.proxy(this._dblclick,this));if(this.options.useContextMenu){return this.element.bind("contextmenu",$.proxy(this._contextmenu,this))}};JqTreeWidget.prototype._deinit=function(){this.element.empty();this.element.unbind();this.key_handler.deinit();this.tree=null;return JqTreeWidget.__super__._deinit.call(this)};JqTreeWidget.prototype._initData=function(){if(this.options.data){return this._loadData(this.options.data)}else{return this._loadDataFromUrl(this._getDataUrlInfo())}};JqTreeWidget.prototype._getDataUrlInfo=function(node){var data_url,getUrlFromString;data_url=this.options.dataUrl||this.element.data("url");getUrlFromString=function(_this){return function(){var data,selected_node_id,url_info;url_info={url:data_url};if(node&&node.id){data={node:node.id};url_info["data"]=data}else{selected_node_id=_this._getNodeIdToBeSelected();if(selected_node_id){data={selected_node:selected_node_id};url_info["data"]=data}}return url_info}}(this);if($.isFunction(data_url)){return data_url(node)}else if($.type(data_url)==="string"){return getUrlFromString()}else{return data_url}};JqTreeWidget.prototype._getNodeIdToBeSelected=function(){if(this.options.saveState){return this.save_state_handler.getNodeIdToBeSelected()}else{return null}};JqTreeWidget.prototype._initTree=function(data){this.tree=new this.options.nodeClass(null,true,this.options.nodeClass);if(this.select_node_handler){this.select_node_handler.clear()}this.tree.loadFromData(data);this._openNodes();this._refreshElements();if(!this.is_initialized){this.is_initialized=true;return this._triggerEvent("tree.init")}};JqTreeWidget.prototype._openNodes=function(){var max_level;if(this.options.saveState){if(this.save_state_handler.restoreState()){return}}if(this.options.autoOpen===false){return}else if(this.options.autoOpen===true){max_level=-1}else{max_level=parseInt(this.options.autoOpen)}return this.tree.iterate(function(node,level){if(node.hasChildren()){node.is_open=true}return level!==max_level})};JqTreeWidget.prototype._refreshElements=function(from_node){if(from_node==null){from_node=null}this.renderer.render(from_node);return this._triggerEvent("tree.refresh")};JqTreeWidget.prototype._click=function(e){var click_target,event,node;click_target=this._getClickTarget(e.target);if(click_target){if(click_target.type==="button"){this.toggle(click_target.node,this.options.slide);e.preventDefault();return e.stopPropagation()}else if(click_target.type==="label"){node=click_target.node;event=this._triggerEvent("tree.click",{node:node,click_event:e});if(!event.isDefaultPrevented()){return this._selectNode(node,true)}}}};JqTreeWidget.prototype._dblclick=function(e){var click_target;click_target=this._getClickTarget(e.target);if(click_target&&click_target.type==="label"){return this._triggerEvent("tree.dblclick",{node:click_target.node,click_event:e})}};JqTreeWidget.prototype._getClickTarget=function(element){var $button,$el,$target,node;$target=$(element);$button=$target.closest(".jqtree-toggler");if($button.length){node=this._getNode($button);if(node){return{type:"button",node:node}}}else{$el=$target.closest(".jqtree-element");if($el.length){node=this._getNode($el);if(node){return{type:"label",node:node}}}}return null};JqTreeWidget.prototype._getNode=function($element){var $li;$li=$element.closest("li");if($li.length===0){return null}else{return $li.data("node")}};JqTreeWidget.prototype._getNodeElementForNode=function(node){if(node.isFolder()){return new FolderElement(node,this)}else{return new NodeElement(node,this)}};JqTreeWidget.prototype._getNodeElement=function($element){var node;node=this._getNode($element);if(node){return this._getNodeElementForNode(node)}else{return null}};JqTreeWidget.prototype._contextmenu=function(e){var $div,node;$div=$(e.target).closest("ul.jqtree-tree .jqtree-element");if($div.length){node=this._getNode($div);if(node){e.preventDefault();e.stopPropagation();this._triggerEvent("tree.contextmenu",{node:node,click_event:e});return false}}};JqTreeWidget.prototype._saveState=function(){if(this.options.saveState){return this.save_state_handler.saveState()}};JqTreeWidget.prototype._mouseCapture=function(position_info){if(this.options.dragAndDrop){return this.dnd_handler.mouseCapture(position_info)}else{return false}};JqTreeWidget.prototype._mouseStart=function(position_info){if(this.options.dragAndDrop){return this.dnd_handler.mouseStart(position_info)}else{return false}};JqTreeWidget.prototype._mouseDrag=function(position_info){var result;if(this.options.dragAndDrop){result=this.dnd_handler.mouseDrag(position_info);if(this.scroll_handler){this.scroll_handler.checkScrolling()}return result}else{return false}};JqTreeWidget.prototype._mouseStop=function(position_info){if(this.options.dragAndDrop){return this.dnd_handler.mouseStop(position_info)}else{return false}};JqTreeWidget.prototype._triggerEvent=function(event_name,values){var event;event=$.Event(event_name);$.extend(event,values);this.element.trigger(event);return event};JqTreeWidget.prototype.testGenerateHitAreas=function(moving_node){this.dnd_handler.current_item=this._getNodeElementForNode(moving_node);this.dnd_handler.generateHitAreas();return this.dnd_handler.hit_areas};JqTreeWidget.prototype._selectCurrentNode=function(){var node,node_element;node=this.getSelectedNode();if(node){node_element=this._getNodeElementForNode(node);if(node_element){return node_element.select()}}};JqTreeWidget.prototype._deselectCurrentNode=function(){var node;node=this.getSelectedNode();if(node){return this.removeFromSelection(node)}};return JqTreeWidget}(MouseWidget);SimpleWidget.register(JqTreeWidget,"tree");NodeElement=function(){function NodeElement(node,tree_widget){this.init(node,tree_widget)}NodeElement.prototype.init=function(node,tree_widget){this.node=node;this.tree_widget=tree_widget;return this.$element=$(node.element)};NodeElement.prototype.getUl=function(){return this.$element.children("ul:first")};NodeElement.prototype.getSpan=function(){return this.$element.children(".jqtree-element").find("span.jqtree-title")};NodeElement.prototype.getLi=function(){return this.$element};NodeElement.prototype.addDropHint=function(position){if(position===Position.INSIDE){return new BorderDropHint(this.$element)}else{return new GhostDropHint(this.node,this.$element,position)}};NodeElement.prototype.select=function(){return this.getLi().addClass("jqtree-selected")};NodeElement.prototype.deselect=function(){return this.getLi().removeClass("jqtree-selected")};return NodeElement}();FolderElement=function(_super){__extends(FolderElement,_super);function FolderElement(){return FolderElement.__super__.constructor.apply(this,arguments)}FolderElement.prototype.open=function(on_finished,slide){var $button,doOpen;if(slide==null){slide=true}if(!this.node.is_open){this.node.is_open=true;$button=this.getButton();$button.removeClass("jqtree-closed");$button.html(this.tree_widget.options.openedIcon);doOpen=function(_this){return function(){_this.getLi().removeClass("jqtree-closed");if(on_finished){on_finished()}return _this.tree_widget._triggerEvent("tree.open",{node:_this.node})}}(this);if(slide){return this.getUl().slideDown("fast",doOpen)}else{this.getUl().show();
  return doOpen()}}};FolderElement.prototype.close=function(slide){var $button,doClose;if(slide==null){slide=true}if(this.node.is_open){this.node.is_open=false;$button=this.getButton();$button.addClass("jqtree-closed");$button.html(this.tree_widget.options.closedIcon);doClose=function(_this){return function(){_this.getLi().addClass("jqtree-closed");return _this.tree_widget._triggerEvent("tree.close",{node:_this.node})}}(this);if(slide){return this.getUl().slideUp("fast",doClose)}else{this.getUl().hide();return doClose()}}};FolderElement.prototype.getButton=function(){return this.$element.children(".jqtree-element").find("a.jqtree-toggler")};FolderElement.prototype.addDropHint=function(position){if(!this.node.is_open&&position===Position.INSIDE){return new BorderDropHint(this.$element)}else{return new GhostDropHint(this.node,this.$element,position)}};return FolderElement}(NodeElement);html_escape=function(string){return(""+string).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};_indexOf=function(array,item){var i,value,_i,_len;for(i=_i=0,_len=array.length;_i<_len;i=++_i){value=array[i];if(value===item){return i}}return-1};indexOf=function(array,item){if(array.indexOf){return array.indexOf(item)}else{return _indexOf(array,item)}};this.Tree.indexOf=indexOf;this.Tree._indexOf=_indexOf;if(!(this.JSON!=null&&this.JSON.stringify!=null&&typeof this.JSON.stringify==="function")){json_escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;json_meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};json_quote=function(string){json_escapable.lastIndex=0;if(json_escapable.test(string)){return'"'+string.replace(json_escapable,function(a){var c;c=json_meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"'}else{return'"'+string+'"'}};json_str=function(key,holder){var i,k,partial,v,value,_i,_len;value=holder[key];switch(typeof value){case"string":return json_quote(value);case"number":if(isFinite(value)){return String(value)}else{return"null"}case"boolean":case"null":return String(value);case"object":if(!value){return"null"}partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){for(i=_i=0,_len=value.length;_i<_len;i=++_i){v=value[i];partial[i]=json_str(i,value)||"null"}return partial.length===0?"[]":"["+partial.join(",")+"]"}for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=json_str(k,value);if(v){partial.push(json_quote(k)+":"+v)}}}return partial.length===0?"{}":"{"+partial.join(",")+"}"}};if(this.JSON==null){this.JSON={}}this.JSON.stringify=function(value){return json_str("",{"":value})}}SaveStateHandler=function(){function SaveStateHandler(tree_widget){this.tree_widget=tree_widget}SaveStateHandler.prototype.saveState=function(){var state;state=JSON.stringify(this.getState());if(this.tree_widget.options.onSetStateFromStorage){return this.tree_widget.options.onSetStateFromStorage(state)}else if(this.supportsLocalStorage()){return localStorage.setItem(this.getCookieName(),state)}else if($.cookie){$.cookie.raw=true;return $.cookie(this.getCookieName(),state,{path:"/"})}};SaveStateHandler.prototype.restoreState=function(){var state;state=this.getStateFromStorage();if(state){this.setState($.parseJSON(state));return true}else{return false}};SaveStateHandler.prototype.getStateFromStorage=function(){if(this.tree_widget.options.onGetStateFromStorage){return this.tree_widget.options.onGetStateFromStorage()}else if(this.supportsLocalStorage()){return localStorage.getItem(this.getCookieName())}else if($.cookie){$.cookie.raw=true;return $.cookie(this.getCookieName())}else{return null}};SaveStateHandler.prototype.getState=function(){var open_nodes,selected_node,selected_node_id;open_nodes=[];this.tree_widget.tree.iterate(function(_this){return function(node){if(node.is_open&&node.id&&node.hasChildren()){open_nodes.push(node.id)}return true}}(this));selected_node=this.tree_widget.getSelectedNode();if(selected_node){selected_node_id=selected_node.id}else{selected_node_id=""}return{open_nodes:open_nodes,selected_node:selected_node_id}};SaveStateHandler.prototype.setState=function(state){var open_nodes,selected_node,selected_node_id;if(state){open_nodes=state.open_nodes;selected_node_id=state.selected_node;this.tree_widget.tree.iterate(function(_this){return function(node){node.is_open=node.id&&node.hasChildren()&&indexOf(open_nodes,node.id)>=0;return true}}(this));if(selected_node_id&&this.tree_widget.select_node_handler){this.tree_widget.select_node_handler.clear();selected_node=this.tree_widget.getNodeById(selected_node_id);if(selected_node){return this.tree_widget.select_node_handler.addToSelection(selected_node)}}}};SaveStateHandler.prototype.getCookieName=function(){if(typeof this.tree_widget.options.saveState==="string"){return this.tree_widget.options.saveState}else{return"tree"}};SaveStateHandler.prototype.supportsLocalStorage=function(){var testSupport;testSupport=function(){var error,key;if(typeof localStorage==="undefined"||localStorage===null){return false}else{try{key="_storage_test";sessionStorage.setItem(key,true);sessionStorage.removeItem(key)}catch(_error){error=_error;return false}return true}};if(this._supportsLocalStorage==null){this._supportsLocalStorage=testSupport()}return this._supportsLocalStorage};SaveStateHandler.prototype.getNodeIdToBeSelected=function(){var state,state_json;state_json=this.getStateFromStorage();if(state_json){state=$.parseJSON(state_json);return state.selected_node}else{return null}};return SaveStateHandler}();SelectNodeHandler=function(){function SelectNodeHandler(tree_widget){this.tree_widget=tree_widget;this.clear()}SelectNodeHandler.prototype.getSelectedNode=function(){var selected_nodes;selected_nodes=this.getSelectedNodes();if(selected_nodes.length){return selected_nodes[0]}else{return false}};SelectNodeHandler.prototype.getSelectedNodes=function(){var id,node,selected_nodes;if(this.selected_single_node){return[this.selected_single_node]}else{selected_nodes=[];for(id in this.selected_nodes){node=this.tree_widget.getNodeById(id);if(node){selected_nodes.push(node)}}return selected_nodes}};SelectNodeHandler.prototype.getSelectedNodesUnder=function(parent){var id,node,selected_nodes;if(this.selected_single_node){if(parent.isParentOf(selected_single_node)){return this.selected_single_node}else{return null}}else{selected_nodes=[];for(id in this.selected_nodes){node=this.tree_widget.getNodeById(id);if(node&&parent.isParentOf(node)){selected_nodes.push(node)}}return selected_nodes}};SelectNodeHandler.prototype.isNodeSelected=function(node){if(node.id){return this.selected_nodes[node.id]}else if(this.selected_single_node){return this.selected_single_node.element===node.element}else{return false}};SelectNodeHandler.prototype.clear=function(){this.selected_nodes={};return this.selected_single_node=null};SelectNodeHandler.prototype.removeFromSelection=function(node,include_children){if(include_children==null){include_children=false}if(!node.id){if(this.selected_single_node&&node.element===this.selected_single_node.element){return this.selected_single_node=null}}else{delete this.selected_nodes[node.id];if(include_children){return node.iterate(function(_this){return function(n){delete _this.selected_nodes[node.id];return true}}(this))}}};SelectNodeHandler.prototype.addToSelection=function(node){if(node.id){return this.selected_nodes[node.id]=true}else{return this.selected_single_node=node}};return SelectNodeHandler}();DragAndDropHandler=function(){function DragAndDropHandler(tree_widget){this.tree_widget=tree_widget;this.hovered_area=null;this.$ghost=null;this.hit_areas=[];this.is_dragging=false}DragAndDropHandler.prototype.mouseCapture=function(position_info){var $element,node_element;$element=$(position_info.target);if(this.tree_widget.options.onIsMoveHandle&&!this.tree_widget.options.onIsMoveHandle($element)){return null}node_element=this.tree_widget._getNodeElement($element);if(node_element&&this.tree_widget.options.onCanMove){if(!this.tree_widget.options.onCanMove(node_element.node)){node_element=null}}this.current_item=node_element;return this.current_item!==null};DragAndDropHandler.prototype.mouseStart=function(position_info){var offset;this.refreshHitAreas();offset=$(position_info.target).offset();this.drag_element=new DragElement(this.current_item.node,position_info.page_x-offset.left,position_info.page_y-offset.top,this.tree_widget.element);this.is_dragging=true;this.current_item.$element.addClass("jqtree-moving");return true};DragAndDropHandler.prototype.mouseDrag=function(position_info){var area,can_move_to;this.drag_element.move(position_info.page_x,position_info.page_y);area=this.findHoveredArea(position_info.page_x,position_info.page_y);can_move_to=this.canMoveToArea(area);if(can_move_to&&area){if(this.hovered_area!==area){this.hovered_area=area;if(this.mustOpenFolderTimer(area)){this.startOpenFolderTimer(area.node)}this.updateDropHint()}}else{this.removeHover();this.removeDropHint();this.stopOpenFolderTimer()}return true};DragAndDropHandler.prototype.canMoveToArea=function(area){var position_name;if(!area){return false}else if(this.tree_widget.options.onCanMoveTo){position_name=Position.getName(area.position);return this.tree_widget.options.onCanMoveTo(this.current_item.node,area.node,position_name)}else{return true}};DragAndDropHandler.prototype.mouseStop=function(position_info){this.moveItem(position_info);this.clear();this.removeHover();this.removeDropHint();this.removeHitAreas();if(this.current_item){this.current_item.$element.removeClass("jqtree-moving")}this.is_dragging=false;return false};DragAndDropHandler.prototype.refreshHitAreas=function(){this.removeHitAreas();return this.generateHitAreas()};DragAndDropHandler.prototype.removeHitAreas=function(){return this.hit_areas=[]};DragAndDropHandler.prototype.clear=function(){this.drag_element.remove();return this.drag_element=null};DragAndDropHandler.prototype.removeDropHint=function(){if(this.previous_ghost){return this.previous_ghost.remove()}};DragAndDropHandler.prototype.removeHover=function(){return this.hovered_area=null};DragAndDropHandler.prototype.generateHitAreas=function(){var hit_areas_generator;hit_areas_generator=new HitAreasGenerator(this.tree_widget.tree,this.current_item.node,this.getTreeDimensions().bottom);return this.hit_areas=hit_areas_generator.generate()};DragAndDropHandler.prototype.findHoveredArea=function(x,y){var area,dimensions,high,low,mid;dimensions=this.getTreeDimensions();if(x<dimensions.left||y<dimensions.top||x>dimensions.right||y>dimensions.bottom){return null}low=0;high=this.hit_areas.length;while(low<high){mid=low+high>>1;area=this.hit_areas[mid];if(y<area.top){high=mid}else if(y>area.bottom){low=mid+1}else{return area}}return null};DragAndDropHandler.prototype.mustOpenFolderTimer=function(area){var node;node=area.node;return node.isFolder()&&!node.is_open&&area.position===Position.INSIDE};DragAndDropHandler.prototype.updateDropHint=function(){var node_element;if(!this.hovered_area){return}this.removeDropHint();node_element=this.tree_widget._getNodeElementForNode(this.hovered_area.node);return this.previous_ghost=node_element.addDropHint(this.hovered_area.position)};DragAndDropHandler.prototype.startOpenFolderTimer=function(folder){var openFolder;openFolder=function(_this){return function(){return _this.tree_widget._openNode(folder,_this.tree_widget.options.slide,function(){_this.refreshHitAreas();return _this.updateDropHint()})}}(this);this.stopOpenFolderTimer();return this.open_folder_timer=setTimeout(openFolder,this.tree_widget.options.openFolderDelay)};DragAndDropHandler.prototype.stopOpenFolderTimer=function(){if(this.open_folder_timer){clearTimeout(this.open_folder_timer);return this.open_folder_timer=null}};DragAndDropHandler.prototype.moveItem=function(position_info){var doMove,event,moved_node,position,previous_parent,target_node;if(this.hovered_area&&this.hovered_area.position!==Position.NONE&&this.canMoveToArea(this.hovered_area)){moved_node=this.current_item.node;target_node=this.hovered_area.node;position=this.hovered_area.position;previous_parent=moved_node.parent;if(position===Position.INSIDE){this.hovered_area.node.is_open=true}doMove=function(_this){return function(){_this.tree_widget.tree.moveNode(moved_node,target_node,position);_this.tree_widget.element.empty();return _this.tree_widget._refreshElements()}}(this);event=this.tree_widget._triggerEvent("tree.move",{move_info:{moved_node:moved_node,target_node:target_node,position:Position.getName(position),previous_parent:previous_parent,do_move:doMove,original_event:position_info.original_event}});if(!event.isDefaultPrevented()){return doMove()}}};DragAndDropHandler.prototype.getTreeDimensions=function(){var offset;offset=this.tree_widget.element.offset();return{left:offset.left,top:offset.top,right:offset.left+this.tree_widget.element.width(),bottom:offset.top+this.tree_widget.element.height()+16}};return DragAndDropHandler}();VisibleNodeIterator=function(){function VisibleNodeIterator(tree){this.tree=tree}VisibleNodeIterator.prototype.iterate=function(){var is_first_node,_iterateNode;is_first_node=true;_iterateNode=function(_this){return function(node,next_node){var $element,child,children_length,i,must_iterate_inside,_i,_len,_ref;must_iterate_inside=(node.is_open||!node.element)&&node.hasChildren();if(node.element){$element=$(node.element);if(!$element.is(":visible")){return}if(is_first_node){_this.handleFirstNode(node,$element);is_first_node=false}if(!node.hasChildren()){_this.handleNode(node,next_node,$element)}else if(node.is_open){if(!_this.handleOpenFolder(node,$element)){must_iterate_inside=false}}else{_this.handleClosedFolder(node,next_node,$element)}}if(must_iterate_inside){children_length=node.children.length;_ref=node.children;for(i=_i=0,_len=_ref.length;_i<_len;i=++_i){child=_ref[i];if(i===children_length-1){_iterateNode(node.children[i],null)}else{_iterateNode(node.children[i],node.children[i+1])}}if(node.is_open){return _this.handleAfterOpenFolder(node,next_node,$element)}}}}(this);return _iterateNode(this.tree,null)};VisibleNodeIterator.prototype.handleNode=function(node,next_node,$element){};VisibleNodeIterator.prototype.handleOpenFolder=function(node,$element){};VisibleNodeIterator.prototype.handleClosedFolder=function(node,next_node,$element){};VisibleNodeIterator.prototype.handleAfterOpenFolder=function(node,next_node,$element){};VisibleNodeIterator.prototype.handleFirstNode=function(node,$element){};return VisibleNodeIterator}();HitAreasGenerator=function(_super){__extends(HitAreasGenerator,_super);function HitAreasGenerator(tree,current_node,tree_bottom){HitAreasGenerator.__super__.constructor.call(this,tree);this.current_node=current_node;this.tree_bottom=tree_bottom}HitAreasGenerator.prototype.generate=function(){this.positions=[];this.last_top=0;this.iterate();return this.generateHitAreas(this.positions)};HitAreasGenerator.prototype.getTop=function($element){return $element.offset().top};HitAreasGenerator.prototype.addPosition=function(node,position,top){var area;area={top:top,node:node,position:position};this.positions.push(area);return this.last_top=top};HitAreasGenerator.prototype.handleNode=function(node,next_node,$element){var top;top=this.getTop($element);if(node===this.current_node){this.addPosition(node,Position.NONE,top)}else{this.addPosition(node,Position.INSIDE,top)}if(next_node===this.current_node||node===this.current_node){return this.addPosition(node,Position.NONE,top)}else{return this.addPosition(node,Position.AFTER,top)}};HitAreasGenerator.prototype.handleOpenFolder=function(node,$element){if(node===this.current_node){return false}if(node.children[0]!==this.current_node){this.addPosition(node,Position.INSIDE,this.getTop($element))}return true};HitAreasGenerator.prototype.handleClosedFolder=function(node,next_node,$element){var top;top=this.getTop($element);if(node===this.current_node){return this.addPosition(node,Position.NONE,top)}else{this.addPosition(node,Position.INSIDE,top);if(next_node!==this.current_node){return this.addPosition(node,Position.AFTER,top)}}};HitAreasGenerator.prototype.handleFirstNode=function(node,$element){if(node!==this.current_node){return this.addPosition(node,Position.BEFORE,this.getTop($(node.element)))}};HitAreasGenerator.prototype.handleAfterOpenFolder=function(node,next_node,$element){if(node===this.current_node.node||next_node===this.current_node.node){return this.addPosition(node,Position.NONE,this.last_top)}else{return this.addPosition(node,Position.AFTER,this.last_top)}};HitAreasGenerator.prototype.generateHitAreas=function(positions){var group,hit_areas,position,previous_top,_i,_len;previous_top=-1;group=[];hit_areas=[];for(_i=0,_len=positions.length;_i<_len;_i++){position=positions[_i];if(position.top!==previous_top&&group.length){if(group.length){this.generateHitAreasForGroup(hit_areas,group,previous_top,position.top)}previous_top=position.top;group=[]}group.push(position)}this.generateHitAreasForGroup(hit_areas,group,previous_top,this.tree_bottom);return hit_areas};HitAreasGenerator.prototype.generateHitAreasForGroup=function(hit_areas,positions_in_group,top,bottom){var area_height,area_top,i,position,position_count;position_count=Math.min(positions_in_group.length,4);area_height=Math.round((bottom-top)/position_count);area_top=top;i=0;while(i<position_count){position=positions_in_group[i];hit_areas.push({top:area_top,bottom:area_top+area_height,node:position.node,position:position.position});area_top+=area_height;i+=1}return null};return HitAreasGenerator}(VisibleNodeIterator);DragElement=function(){function DragElement(node,offset_x,offset_y,$tree){this.offset_x=offset_x;this.offset_y=offset_y;this.$element=$('<span class="jqtree-title jqtree-dragging">'+node.name+"</span>");this.$element.css("position","absolute");$tree.append(this.$element)}DragElement.prototype.move=function(page_x,page_y){return this.$element.offset({left:page_x-this.offset_x,top:page_y-this.offset_y})};DragElement.prototype.remove=function(){return this.$element.remove()};return DragElement}();GhostDropHint=function(){function GhostDropHint(node,$element,position){this.$element=$element;this.node=node;this.$ghost=$('<li class="jqtree_common jqtree-ghost"><span class="jqtree_common jqtree-circle"></span><span class="jqtree_common jqtree-line"></span></li>');if(position===Position.AFTER){this.moveAfter()}else if(position===Position.BEFORE){this.moveBefore()}else if(position===Position.INSIDE){if(node.isFolder()&&node.is_open){this.moveInsideOpenFolder()}else{this.moveInside()}}}GhostDropHint.prototype.remove=function(){return this.$ghost.remove()};GhostDropHint.prototype.moveAfter=function(){return this.$element.after(this.$ghost)};GhostDropHint.prototype.moveBefore=function(){return this.$element.before(this.$ghost)};GhostDropHint.prototype.moveInsideOpenFolder=function(){return $(this.node.children[0].element).before(this.$ghost)};GhostDropHint.prototype.moveInside=function(){this.$element.after(this.$ghost);return this.$ghost.addClass("jqtree-inside")};return GhostDropHint}();BorderDropHint=function(){function BorderDropHint($element){var $div,width;$div=$element.children(".jqtree-element");width=$element.width()-4;this.$hint=$('<span class="jqtree-border"></span>');$div.append(this.$hint);this.$hint.css({width:width,height:$div.height()-4})}BorderDropHint.prototype.remove=function(){return this.$hint.remove()};return BorderDropHint}();ScrollHandler=function(){function ScrollHandler(tree_widget){this.tree_widget=tree_widget;this.previous_top=-1;this._initScrollParent()}ScrollHandler.prototype._initScrollParent=function(){var $scroll_parent,getParentWithOverflow,setDocumentAsScrollParent;getParentWithOverflow=function(_this){return function(){var css_values,el,hasOverFlow,_i,_len,_ref;css_values=["overflow","overflow-y"];hasOverFlow=function(el){var css_value,_i,_len,_ref;for(_i=0,_len=css_values.length;_i<_len;_i++){css_value=css_values[_i];if((_ref=$.css(el,css_value))==="auto"||_ref==="scroll"){return true}}return false};if(hasOverFlow(_this.tree_widget.$el[0])){return _this.tree_widget.$el}_ref=_this.tree_widget.$el.parents();for(_i=0,_len=_ref.length;_i<_len;_i++){el=_ref[_i];if(hasOverFlow(el)){return $(el)}}return null}}(this);setDocumentAsScrollParent=function(_this){return function(){_this.scroll_parent_top=0;return _this.$scroll_parent=null}}(this);if(this.tree_widget.$el.css("position")==="fixed"){setDocumentAsScrollParent()}$scroll_parent=getParentWithOverflow();if($scroll_parent&&$scroll_parent.length&&$scroll_parent[0].tagName!=="HTML"){this.$scroll_parent=$scroll_parent;return this.scroll_parent_top=this.$scroll_parent.offset().top}else{return setDocumentAsScrollParent()}};ScrollHandler.prototype.checkScrolling=function(){var hovered_area;hovered_area=this.tree_widget.dnd_handler.hovered_area;if(hovered_area&&hovered_area.top!==this.previous_top){this.previous_top=hovered_area.top;if(this.$scroll_parent){return this._handleScrollingWithScrollParent(hovered_area)}else{return this._handleScrollingWithDocument(hovered_area)}}};ScrollHandler.prototype._handleScrollingWithScrollParent=function(area){var distance_bottom;distance_bottom=this.scroll_parent_top+this.$scroll_parent[0].offsetHeight-area.bottom;if(distance_bottom<20){this.$scroll_parent[0].scrollTop+=20;this.tree_widget.refreshHitAreas();return this.previous_top=-1}else if(area.top-this.scroll_parent_top<20){this.$scroll_parent[0].scrollTop-=20;this.tree_widget.refreshHitAreas();return this.previous_top=-1}};ScrollHandler.prototype._handleScrollingWithDocument=function(area){var distance_top;distance_top=area.top-$(document).scrollTop();if(distance_top<20){return $(document).scrollTop($(document).scrollTop()-20)}else if($(window).height()-(area.bottom-$(document).scrollTop())<20){return $(document).scrollTop($(document).scrollTop()+20)}};ScrollHandler.prototype.scrollTo=function(top){var tree_top;if(this.$scroll_parent){return this.$scroll_parent[0].scrollTop=top}else{tree_top=this.tree_widget.$el.offset().top;return $(document).scrollTop(top+tree_top)}};ScrollHandler.prototype.isScrolledIntoView=function(element){var $element,element_bottom,element_top,view_bottom,view_top;$element=$(element);if(this.$scroll_parent){view_top=0;view_bottom=this.$scroll_parent.height();element_top=$element.offset().top-this.scroll_parent_top;element_bottom=element_top+$element.height()}else{view_top=$(window).scrollTop();view_bottom=view_top+$(window).height();element_top=$element.offset().top;element_bottom=element_top+$element.height()}return element_bottom<=view_bottom&&element_top>=view_top};return ScrollHandler}();KeyHandler=function(){var DOWN,LEFT,RIGHT,UP;LEFT=37;UP=38;RIGHT=39;DOWN=40;function KeyHandler(tree_widget){this.tree_widget=tree_widget;if(tree_widget.options.keyboardSupport){$(document).bind("keydown.jqtree",$.proxy(this.handleKeyDown,this))}}KeyHandler.prototype.deinit=function(){return $(document).unbind("keydown.jqtree")};KeyHandler.prototype.handleKeyDown=function(e){var current_node,key,moveDown,moveLeft,moveRight,moveUp,selectNode;if(!this.tree_widget.options.keyboardSupport){return}if($(document.activeElement).is("textarea,input")){return true}current_node=this.tree_widget.getSelectedNode();selectNode=function(_this){return function(node){if(node){_this.tree_widget.selectNode(node);if(_this.tree_widget.scroll_handler&&!_this.tree_widget.scroll_handler.isScrolledIntoView($(node.element).find(".jqtree-element"))){_this.tree_widget.scrollToNode(node)}return false}else{return true}}}(this);moveDown=function(_this){return function(){return selectNode(_this.getNextNode(current_node))}}(this);moveUp=function(_this){return function(){return selectNode(_this.getPreviousNode(current_node))}}(this);moveRight=function(_this){return function(){if(current_node.isFolder()&&!current_node.is_open){_this.tree_widget.openNode(current_node);return false}else{return true}}}(this);moveLeft=function(_this){return function(){if(current_node.isFolder()&&current_node.is_open){_this.tree_widget.closeNode(current_node);return false}else{return true}}}(this);if(!current_node){return true}else{key=e.which;switch(key){case DOWN:return moveDown();case UP:return moveUp();case RIGHT:return moveRight();case LEFT:return moveLeft()}}};KeyHandler.prototype.getNextNode=function(node,include_children){var next_sibling;if(include_children==null){include_children=true}if(include_children&&node.hasChildren()&&node.is_open){return node.children[0]}else{if(!node.parent){return null}else{next_sibling=node.getNextSibling();if(next_sibling){return next_sibling}else{return this.getNextNode(node.parent,false)}}}};KeyHandler.prototype.getPreviousNode=function(node){var previous_sibling;if(!node.parent){return null}else{previous_sibling=node.getPreviousSibling();if(previous_sibling){if(!previous_sibling.hasChildren()||!previous_sibling.is_open){return previous_sibling}else{return this.getLastChild(previous_sibling)}}else{if(node.parent.parent){return node.parent}else{return null}}}};KeyHandler.prototype.getLastChild=function(node){var last_child;if(!node.hasChildren()){return null}else{last_child=node.children[node.children.length-1];if(!last_child.hasChildren()||!last_child.is_open){return last_child}else{return this.getLastChild(last_child)}}};return KeyHandler}()}).call(this);