1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
var requirejs,require,define;(function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.2.0",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,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 commentReplace(A,_,$,B){return B||""}function isFunction($){return ostring.call($)==="[object Function]"}function isArray($){return ostring.call($)==="[object Array]"}function each(_,$){if(_){var A;for(A=0;A<_.length;A+=1)if(_[A]&&$(_[A],A,_))break}}function eachReverse(_,$){if(_){var A;for(A=_.length-1;A>-1;A-=1)if(_[A]&&$(_[A],A,_))break}}function hasProp(_,$){return hasOwn.call(_,$)}function getOwn(_,$){return hasProp(_,$)&&_[$]}function eachProp(A,_){var $;for($ in A)if(hasProp(A,$))if(_(A[$],$))break}function mixin(_,$,A,B){if($)eachProp($,function(C,$){if(A||!hasProp(_,$))if(B&&typeof C==="object"&&C&&!isArray(C)&&!isFunction(C)&&!(C instanceof RegExp)){if(!_[$])_[$]={};mixin(_[$],C,A,B)}else _[$]=C});return _}function bind($,_){return function(){return _.apply($,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError($){throw $}function getGlobal(_){if(!_)return _;var $=global;each(_.split("."),function(_){$=$[_]});return $}function makeError($,C,B,A){var _=new Error(C+"\nhttp://requirejs.org/docs/errors.html#"+$);_.requireType=$;_.requireModules=A;if(B)_.originalError=B;return _}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(O){var H,D,b,E,R,M={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},c={},N={},L={},J=[],Q={},Y={},S={},X=1,G=1;function B(_){var A,$;for(A=0;A<_.length;A++){$=_[A];if($==="."){_.splice(A,1);A-=1}else if($==="..")if(A===0||(A===1&&_[2]==="..")||_[A-1]==="..")continue;else if(A>0){_.splice(A-1,2);A-=2}}}function F(K,O,I){var P,E,J,F,D,R,G,$,N,H,_,Q,C=(O&&O.split("/")),L=M.map,A=L&&L["*"];if(K){K=K.split("/");G=K.length-1;if(M.nodeIdCompat&&jsSuffixRegExp.test(K[G]))K[G]=K[G].replace(jsSuffixRegExp,"");if(K[0].charAt(0)==="."&&C){Q=C.slice(0,C.length-1);K=Q.concat(K)}B(K);K=K.join("/")}if(I&&L&&(C||A)){J=K.split("/");$:for(F=J.length;F>0;F-=1){R=J.slice(0,F).join("/");if(C)for(D=C.length;D>0;D-=1){E=getOwn(L,C.slice(0,D).join("/"));if(E){E=getOwn(E,R);if(E){$=E;N=F;break $}}}if(!H&&A&&getOwn(A,R)){H=getOwn(A,R);_=F}}if(!$&&H){$=H;N=_}if($){J.splice(0,N,$);K=J.join("/")}}P=getOwn(M.pkgs,K);return P?P:K}function C($){if(isBrowser)each(scripts(),function(_){if(_.getAttribute("data-requiremodule")===$&&_.getAttribute("data-requirecontext")===b.contextName){_.parentNode.removeChild(_);return true}})}function V($){var _=getOwn(M.paths,$);if(_&&isArray(_)&&_.length>1){_.shift();b.require.undef($);b.makeRequire(null,{skipMap:true})([$]);return true}}function P(A){var _,$=A?A.indexOf("!"):-1;if($>-1){_=A.substring(0,$);A=A.substring($+1,A.length)}return[_,A]}function W(J,$,E,D){var C,I,A,H,K=null,M=$?$.name:null,_=J,B=true,L="";if(!J){B=false;J="_@r"+(X+=1)}H=P(J);K=H[0];J=H[1];if(K){K=F(K,M,D);I=getOwn(Q,K)}if(J)if(K){if(I&&I.normalize)L=I.normalize(J,function($){return F($,M,D)});else L=J.indexOf("!")===-1?F(J,M,D):J}else{L=F(J,M,D);H=P(L);K=H[0];L=H[1];E=true;C=b.nameToUrl(L)}A=K&&!I&&!E?"_unnormalized"+(G+=1):"";return{prefix:K,name:L,parentMap:$,unnormalized:!!A,url:C,originalName:_,isDefine:B,id:(K?K+"!"+L:L)+A}}function Z(_){var $=_.id,A=getOwn(c,$);if(!A)A=c[$]=new b.Module(_);return A}function K(_,B,C){var $=_.id,A=getOwn(c,$);if(hasProp(Q,$)&&(!A||A.defineEmitComplete)){if(B==="defined")C(Q[$])}else{A=Z(_);if(A.error&&B==="error")C(A.error);else A.on(B,C)}}function A(A,$){var _=A.requireModules,B=false;if($)$(A);else{each(_,function($){var _=getOwn(c,$);if(_){_.error=A;if(_.events.error){B=true;_.emit("error",A)}}});if(!B)req.onError(A)}}function I(){if(globalDefQueue.length){each(globalDefQueue,function(_){var $=_[0];if(typeof $==="string")b.defQueueMap[$]=true;J.push(_)});globalDefQueue=[]}}E={"require":function($){if($.require)return $.require;else return($.require=b.makeRequire($.map))},"exports":function($){$.usingExports=true;if($.map.isDefine)if($.exports)return(Q[$.map.id]=$.exports);else return($.exports=Q[$.map.id]={})},"module":function($){if($.module)return $.module;else return($.module={id:$.map.id,uri:$.map.url,config:function(){return getOwn(M.config,$.map.id)||{}},exports:$.exports||($.exports={})})}};function e($){delete c[$];delete N[$]}function _(C,A,B){var $=C.map.id;if(C.error)C.emit("error",C.error);else{A[$]=true;each(C.depMaps,function($,F){var D=$.id,E=getOwn(c,D);if(E&&!C.depMatched[F]&&!B[D])if(getOwn(A,D)){C.defineDep(F,Q[D]);C.check()}else _(E,A,B)});B[$]=true}}function a(){var F,E,J=M.waitSeconds*1000,B=J&&(b.startTime+J)<new Date().getTime(),I=[],$=[],G=false,D=true;if(H)return;H=true;eachProp(N,function(A){var F=A.map,_=F.id;if(!A.enabled)return;if(!F.isDefine)$.push(A);if(!A.error)if(!A.inited&&B){if(V(_)){E=true;G=true}else{I.push(_);C(_)}}else if(!A.inited&&A.fetched&&F.isDefine){G=true;if(!F.prefix)return(D=false)}});if(B&&I.length){F=makeError("timeout","Load timeout for modules: "+I,null,I);F.contextName=b.contextName;return A(F)}if(D)each($,function($){_($,{},{})});if((!B||E)&&G)if((isBrowser||isWebWorker)&&!R)R=setTimeout(function(){R=0;a()},50);H=false}D=function($){this.events=getOwn(L,$.id)||{};this.map=$;this.shim=getOwn(M.shim,$.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};D.prototype={init:function($,A,_,B){B=B||{};if(this.inited)return;this.factory=A;if(_)this.on("error",_);else if(this.events.error)_=bind(this,function($){this.emit("error",$)});this.depMaps=$&&$.slice(0);this.errback=_;this.inited=true;this.ignore=B.ignore;if(B.enabled||this.enabled)this.enable();else this.check()},defineDep:function(_,$){if(!this.depMatched[_]){this.depMatched[_]=true;this.depCount-=1;this.depExports[_]=$}},fetch:function(){if(this.fetched)return;this.fetched=true;b.startTime=(new Date()).getTime();var $=this.map;if(this.shim)b.makeRequire(this.map,{enableBuildCallback:true})(this.shim.deps||[],bind(this,function(){return $.prefix?this.callPlugin():this.load()}));else return $.prefix?this.callPlugin():this.load()},load:function(){var $=this.map.url;if(!Y[$]){Y[$]=true;b.load(this.map.id,$)}},check:function(){if(!this.enabled||this.enabling)return;var F,C,$=this.map.id,E=this.depExports,_=this.exports,G=this.factory;if(!this.inited){if(!hasProp(b.defQueueMap,$))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(G)){if((this.events.error&&this.map.isDefine)||req.onError!==defaultOnError){try{_=b.execCb($,G,E,_)}catch(B){F=B}}else _=b.execCb($,G,E,_);if(this.map.isDefine&&_===undefined){C=this.module;if(C)_=C.exports;else if(this.usingExports)_=this.exports}if(F){F.requireMap=this.map;F.requireModules=this.map.isDefine?[this.map.id]:null;F.requireType=this.map.isDefine?"define":"require";return A((this.error=F))}}else _=G;this.exports=_;if(this.map.isDefine&&!this.ignore){Q[$]=_;if(req.onResourceLoad){var D=[];each(this.depMaps,function($){D.push($.normalizedMap||$)});req.onResourceLoad(b,this.map,D)}}e($);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 _=this.map,$=_.id,B=W(_.prefix);this.depMaps.push(B);K(B,"defined",bind(this,function(I){var G,E,H,D=getOwn(S,this.map.id),C=this.map.name,J=this.map.parentMap?this.map.parentMap.name:null,B=b.makeRequire(_.parentMap,{enableBuildCallback:true});if(this.map.unnormalized){if(I.normalize)C=I.normalize(C,function($){return F($,J,true)})||"";E=W(_.prefix+"!"+C,this.map.parentMap);K(E,"defined",bind(this,function($){this.map.normalizedMap=E;this.init([],function(){return $},null,{enabled:true,ignore:true})}));H=getOwn(c,E.id);if(H){this.depMaps.push(E);if(this.events.error)H.on("error",bind(this,function($){this.emit("error",$)}));H.enable()}return}if(D){this.map.url=b.nameToUrl(D);this.load();return}G=bind(this,function($){this.init([],function(){return $},null,{enabled:true})});G.error=bind(this,function(_){this.inited=true;this.error=_;_.requireModules=[$];eachProp(c,function(_){if(_.map.id.indexOf($+"_unnormalized")===0)e(_.map.id)});A(_)});G.fromText=bind(this,function(D,I){var H=_.name,F=W(H),C=useInteractive;if(I)D=I;if(C)useInteractive=false;Z(F);if(hasProp(M.config,$))M.config[H]=M.config[$];try{req.exec(D)}catch(E){return A(makeError("fromtexteval","fromText eval for "+$+" failed: "+E,E,[$]))}if(C)useInteractive=true;this.depMaps.push(F);b.completeLoad(H);B([H],G)});I.load(_.name,B,G,M)}));b.enable(B,this);this.pluginMaps[B.id]=B},enable:function(){N[this.map.id]=this;this.enabled=true;this.enabling=true;each(this.depMaps,bind(this,function(_,C){var $,A,B;if(typeof _==="string"){_=W(_,(this.map.isDefine?this.map:this.map.parentMap),false,!this.skipMap);this.depMaps[C]=_;B=getOwn(E,_.id);if(B){this.depExports[C]=B(this);return}this.depCount+=1;K(_,"defined",bind(this,function($){if(this.undefed)return;this.defineDep(C,$);this.check()}));if(this.errback)K(_,"error",bind(this,this.errback));else if(this.events.error)K(_,"error",bind(this,function($){this.emit("error",$)}))}$=_.id;A=c[$];if(!hasProp(E,$)&&A&&!A.enabled)b.enable(_,this)}));eachProp(this.pluginMaps,bind(this,function(_){var $=getOwn(c,_.id);if($&&!$.enabled)b.enable(_,this)}));this.enabling=false;this.check()},on:function(A,_){var $=this.events[A];if(!$)$=this.events[A]=[];$.push(_)},emit:function(_,$){each(this.events[_],function(_){_($)});if(_==="error")delete this.events[_]}};function $($){if(!hasProp(Q,$[0]))Z(W($[0],null,true)).init($[1],$[2])}function U($,A,_,B){if($.detachEvent&&!isOpera){if(B)$.detachEvent(B,A)}else $.removeEventListener(_,A,false)}function d(_){var $=_.currentTarget||_.srcElement;U($,b.onScriptLoad,"load","onreadystatechange");U($,b.onScriptError,"error");return{node:$,id:$&&$.getAttribute("data-requiremodule")}}function T(){var _;I();while(J.length){_=J.shift();if(_[0]===null)return A(makeError("mismatch","Mismatched anonymous define() module: "+_[_.length-1]));else $(_)}b.defQueueMap={}}b={config:M,contextName:O,registry:c,defined:Q,urlFetched:Y,defQueue:J,defQueueMap:{},Module:D,makeModuleMap:W,nextTick:req.nextTick,onError:A,configure:function(B){if(B.baseUrl)if(B.baseUrl.charAt(B.baseUrl.length-1)!=="/")B.baseUrl+="/";if(typeof B.urlArgs==="string"){var $=B.urlArgs;B.urlArgs=function(_,A){return(A.indexOf("?")===-1?"?":"&")+$}}var _=M.shim,A={paths:true,bundles:true,config:true,map:true};eachProp(B,function(_,$){if(A[$]){if(!M[$])M[$]={};mixin(M[$],_,true,true)}else M[$]=_});if(B.bundles)eachProp(B.bundles,function(_,$){each(_,function(_){if(_!==$)S[_]=$})});if(B.shim){eachProp(B.shim,function(A,$){if(isArray(A))A={deps:A};if((A.exports||A.init)&&!A.exportsFn)A.exportsFn=b.makeShimExports(A);_[$]=A});M.shim=_}if(B.packages)each(B.packages,function(A){var $,_;A=typeof A==="string"?{name:A}:A;_=A.name;$=A.location;if($)M.paths[_]=A.location;M.pkgs[_]=A.name+"/"+(A.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")});eachProp(c,function(_,$){if(!_.inited&&!_.map.unnormalized)_.map=W($,null,true)});if(B.deps||B.callback)b.require(B.deps||[],B.callback)},makeShimExports:function($){function _(){var _;if($.init)_=$.init.apply(global,arguments);return _||($.exports&&getGlobal($.exports))}return _},makeRequire:function($,B){B=B||{};function _(H,G,D){var C,F,I;if(B.enableBuildCallback&&G&&isFunction(G))G.__requireJsBuild=true;if(typeof H==="string"){if(isFunction(G))return A(makeError("requireargs","Invalid require call"),D);if($&&hasProp(E,H))return E[H](c[$.id]);if(req.get)return req.get(b,H,$,_);F=W(H,$,false,true);C=F.id;if(!hasProp(Q,C))return A(makeError("notloaded","Module name \""+C+"\" has not been loaded yet for context: "+O+($?"":". Use require([])")));return Q[C]}T();b.nextTick(function(){T();I=Z(W(null,$));I.skipMap=B.skipMap;I.init(H,G,D,{enabled:true});a()});return _}mixin(_,{isBrowser:isBrowser,toUrl:function(C){var D,_=C.lastIndexOf("."),A=C.split("/")[0],B=A==="."||A==="..";if(_!==-1&&(!B||_>1)){D=C.substring(_,C.length);C=C.substring(0,_)}return b.nameToUrl(F(C,$&&$.id,true),D,true)},defined:function(_){return hasProp(Q,W(_,$,false,true).id)},specified:function(_){_=W(_,$,false,true).id;return hasProp(Q,_)||hasProp(c,_)}});if(!$)_.undef=function(_){I();var B=W(_,$,true),A=getOwn(c,_);A.undefed=true;C(_);delete Q[_];delete Y[B.url];delete L[_];eachReverse(J,function($,A){if($[0]===_)J.splice(A,1)});delete b.defQueueMap[_];if(A){if(A.events.defined)L[_]=A.events;e(_)}};return _},enable:function($){var _=getOwn(c,$.id);if(_)Z($).enable()},completeLoad:function(E){var F,C,D,B=getOwn(M.shim,E)||{},_=B.exports;I();while(J.length){C=J.shift();if(C[0]===null){C[0]=E;if(F)break;F=true}else if(C[0]===E)F=true;$(C)}b.defQueueMap={};D=getOwn(c,E);if(!F&&!hasProp(Q,E)&&D&&!D.inited)if(M.enforceDefine&&(!_||!getGlobal(_))){if(V(E))return;else return A(makeError("nodefine","No define call for "+E,null,[E]))}else $([E,(B.deps||[]),B.exportsFn]);a()},nameToUrl:function(B,H,$){var A,_,I,E,G,F,C,D=getOwn(M.pkgs,B);if(D)B=D;C=getOwn(S,B);if(C)return b.nameToUrl(C,H,$);if(req.jsExtRegExp.test(B))G=B+(H||"");else{A=M.paths;_=B.split("/");for(I=_.length;I>0;I-=1){E=_.slice(0,I).join("/");F=getOwn(A,E);if(F){if(isArray(F))F=F[0];_.splice(0,I,F);break}}G=_.join("/");G+=(H||(/^data\:|^blob\:|\?/.test(G)||$?"":".js"));G=(G.charAt(0)==="/"||G.match(/^[\w\+\.\-]+:/)?"":M.baseUrl)+G}return M.urlArgs&&!/^blob\:/.test(G)?G+M.urlArgs(B,G):G},load:function($,_){req.load(b,$,_)},execCb:function(A,B,_,$){return B.apply($,_)},onScriptLoad:function($){if($.type==="load"||(readyRegExp.test(($.currentTarget||$.srcElement).readyState))){interactiveScript=null;var _=d($);b.completeLoad(_.id)}},onScriptError:function(_){var B=d(_);if(!V(B.id)){var $=[];eachProp(c,function(_,A){if(A.indexOf("_@r")!==0)each(_.depMaps,function(_){if(_.id===B.id){$.push(A);return true}})});return A(makeError("scripterror","Script error for \""+B.id+($.length?"\", needed by: "+$.join(", "):"\""),_,[B.id]))}}};b.require=b.makeRequire();return b}req=requirejs=function(D,B,$,_){var A,C,E=defContextName;if(!isArray(D)&&typeof D!=="string"){C=D;if(isArray(B)){D=B;B=$;$=_}else D=[]}if(C&&C.context)E=C.context;A=getOwn(contexts,E);if(!A)A=contexts[E]=req.s.newContext(E);if(C)A.configure(C);return A.require(D,B,$)};req.config=function($){return req($)};req.nextTick=typeof setTimeout!=="undefined"?function($){setTimeout($,4)}:function($){$()};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($){req[$]=function(){var _=contexts[defContextName];return _.require[$].apply(_,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(A,_,B){var $=A.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");$.type=A.scriptType||"text/javascript";$.charset="utf-8";$.async=true;return $};req.load=function(B,A,D){var C=(B&&B.config)||{},$;if(isBrowser){$=req.createNode(C,A,D);$.setAttribute("data-requirecontext",B.contextName);$.setAttribute("data-requiremodule",A);if($.attachEvent&&!($.attachEvent.toString&&$.attachEvent.toString().indexOf("[native code")<0)&&!isOpera){useInteractive=true;$.attachEvent("onreadystatechange",B.onScriptLoad)}else{$.addEventListener("load",B.onScriptLoad,false);$.addEventListener("error",B.onScriptError,false)}$.src=D;if(C.onNodeCreated)C.onNodeCreated($,C,A,D);currentlyAddingScript=$;if(baseElement)head.insertBefore($,baseElement);else head.appendChild($);currentlyAddingScript=null;return $}else if(isWebWorker){try{setTimeout(function(){},0);importScripts(D);B.completeLoad(A)}catch(_){B.onError(makeError("importscripts","importScripts failed for "+A+" at "+D,_,[A]))}}};function getInteractiveScript(){if(interactiveScript&&interactiveScript.readyState==="interactive")return interactiveScript;eachReverse(scripts(),function($){if($.readyState==="interactive")return(interactiveScript=$)});return interactiveScript}if(isBrowser&&!cfg.skipDataMain)eachReverse(scripts(),function($){if(!head)head=$.parentNode;dataMain=$.getAttribute("data-main");if(dataMain){mainScript=dataMain;if(!cfg.baseUrl&&mainScript.indexOf("!")===-1){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(_,C,B){var $,A;if(typeof _!=="string"){B=C;C=_;_=null}if(!isArray(C)){B=C;C=null}if(!C&&isFunction(B)){C=[];if(B.length){B.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function($,_){C.push(_)});C=(B.length===1?["require"]:["require","exports","module"]).concat(C)}}if(useInteractive){$=currentlyAddingScript||getInteractiveScript();if($){if(!_)_=$.getAttribute("data-requiremodule");A=contexts[$.getAttribute("data-requirecontext")]}}if(A){A.defQueue.push([_,C,B]);A.defQueueMap[_]=true}else globalDefQueue.push([_,C,B])};define.amd={jQuery:true};req.exec=function(text){return eval(text)};req(cfg)}(this)) |