-
Notifications
You must be signed in to change notification settings - Fork 0
/
require.js
31 lines (31 loc) · 12.6 KB
/
require.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
RequireJS 0.15.0 Copyright (c) 2010, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var require,define;
(function(){function B(a){return J.call(a)==="[object Function]"}function C(a,b,d){var c=h.plugins.defined[a];if(c)c[d.name].apply(null,d.args);else{c=h.plugins.waiting[a]||(h.plugins.waiting[a]=[]);c.push(d);f(["require/"+a],b.contextName)}}function D(a,b){E.apply(f,a);b.loaded[a[0]]=true}function K(a,b,d){var c,e,g;for(c=0;g=b[c];c++){g=typeof g==="string"?{name:g}:g;e=g.location;if(d&&(!e||e.indexOf("/")!==0&&e.indexOf(":")===-1))g.location=d+"/"+(g.location||g.name);g.location=g.location||g.name;
g.lib=g.lib||"lib";g.main=g.main||"main";a[g.name]=g}}function L(a){var b=true,d=a.config.priorityWait,c,e;if(d){for(e=0;c=d[e];e++)if(!a.loaded[c]){b=false;break}b&&delete a.config.priorityWait}return b}function y(a){var b,d=h.paused;if(a.scriptCount<=0){for(a.scriptCount=0;v.length;){b=v.shift();b[0]===null?f.onError(new Error("Mismatched anonymous require.def modules")):D(b,a)}if(!(a.config.priorityWait&&!L(a))){if(d.length){h.paused=[];for(a=0;b=d[a];a++)f.checkDeps.apply(f,b)}F?setTimeout(function(){f.checkLoaded(h.ctxName)},
30):f.checkLoaded(h.ctxName)}}}function S(a,b){var d=h.plugins.callbacks[a]=[];h.plugins[a]=function(){for(var c=0,e;e=d[c];c++)if(e.apply(null,arguments)===true&&b)return true;return false}}function M(a,b){if(!a.jQuery)if((b=b||(typeof jQuery!=="undefined"?jQuery:null))&&"readyWait"in b){a.jQuery=b;if(!a.defined.jquery&&!a.jQueryDef)a.defined.jquery=b;if(a.scriptCount){b.readyWait+=1;a.jQueryIncremented=true}}}function T(a){return function(b){a.exports=b}}function t(a,b,d){return function(){var c=
[].concat(U.call(arguments,0));c.push(b,d);return(a?require[a]:require).apply(null,c)}}function V(a,b){var d=a.contextName,c=t(null,d,b);f.mixin(c,{modify:t("modify",d,b),def:t("def",d,b),get:t("get",d,b),nameToUrl:t("nameToUrl",d,b),toUrl:t("toUrl",d,b),ready:f.ready,context:a,config:a.config,isBrowser:h.isBrowser});return c}var q={},h,n,w=[],G,x,N,s,O,z,p={},P,W=/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,X=/require\(["']([\w\!\-_\.\/]+)["']\)/g,E,r=!!(typeof window!=="undefined"&&navigator&&document),F=
!r&&typeof importScripts!=="undefined",Y=r&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,J=Object.prototype.toString,Q=Array.prototype,U=Q.slice,H,f,A,v=[],R=false,I;if(typeof require!=="undefined")if(B(require))return;else p=require;f=require=function(a,b,d,c,e){var g;if(typeof a==="string"&&!B(b))return require.get(a,b,d,c);if(!require.isArray(a)){g=a;if(require.isArray(b)){a=b;b=d;d=c;c=e}else a=[]}E(null,a,b,g,d,c);(a=h.contexts[d||g&&g.context||h.ctxName])&&a.scriptCount===
0&&y(a)};f.onError=function(a){throw a;};define=f.def=function(a,b,d,c){var e,g,i=I;if(typeof a!=="string"){c=d;d=b;b=a;a=null}if(!f.isArray(b)){c=d;d=b;b=[]}if(!a&&!b.length&&f.isFunction(d)){d.toString().replace(W,"").replace(X,function(j,l){b.push(l)});b=["require","exports","module"].concat(b)}if(!a&&R){e=document.getElementsByTagName("script");for(a=e.length-1;a>-1&&(g=e[a]);a--)if(g.readyState==="interactive"){i=g;break}i||f.onError(new Error("ERROR: No matching script interactive for "+d));
a=i.getAttribute("data-requiremodule")}if(typeof a==="string")h.contexts[h.ctxName].jQueryDef=a==="jquery";v.push([a,b,d,null,c])};E=function(a,b,d,c,e,g){var i,j,l,m,k;e=e?e:c&&c.context?c.context:h.ctxName;i=h.contexts[e];if(a){j=a.indexOf("!");if(j!==-1){l=a.substring(0,j);a=a.substring(j+1,a.length)}else l=i.defPlugin[a];j=i.waiting[a];if(i&&(i.defined[a]||j&&j!==Q[a]))return}if(e!==h.ctxName){j=h.contexts[h.ctxName]&&h.contexts[h.ctxName].loaded;m=true;if(j)for(k in j)if(!(k in q))if(!j[k]){m=
false;break}if(m)h.ctxName=e}if(!i){i={contextName:e,config:{waitSeconds:7,baseUrl:h.baseUrl||"./",paths:{},packages:{}},waiting:[],specified:{require:true,exports:true,module:true},loaded:{},scriptCount:0,urlFetched:{},defPlugin:{},defined:{},modifiers:{}};h.plugins.newContext&&h.plugins.newContext(i);i=h.contexts[e]=i}if(c){if(c.baseUrl)if(c.baseUrl.charAt(c.baseUrl.length-1)!=="/")c.baseUrl+="/";m=i.config.paths;j=i.config.packages;f.mixin(i.config,c,true);if(c.paths){for(k in c.paths)k in q||
(m[k]=c.paths[k]);i.config.paths=m}if((m=c.packagePaths)||c.packages){if(m)for(k in m)k in q||K(j,m[k],k);c.packages&&K(j,c.packages);i.config.packages=j}if(c.priority){f(c.priority);i.config.priorityWait=c.priority}if(c.deps||c.callback)f(c.deps||[],c.callback);c.ready&&f.ready(c.ready);if(!b)return}if(b){k=b;b=[];for(c=0;c<k.length;c++)b[c]=f.splitPrefix(k[c],a||g,i)}g=i.waiting.push({name:a,deps:b,callback:d});if(a){i.waiting[a]=g-1;i.specified[a]=true;if(g=i.modifiers[a]){f(g,e);if(g=g.__deferMods)for(c=
0;c<g.length;c++){k=g[c];j=k[k.length-1];if(j===undefined)k[k.length-1]=e;else typeof j==="string"&&g.push(e);require.def.apply(require,k)}}}if(a&&d&&!f.isFunction(d))i.defined[a]=d;l&&C(l,i,{name:"require",args:[a,b,d,i]});h.paused.push([l,a,b,i]);if(a){i.loaded[a]=true;i.jQueryDef=a==="jquery"}};f.mixin=function(a,b,d){for(var c in b)if(!(c in q)&&(!(c in a)||d))a[c]=b[c];return f};f.version="0.15.0";h=f.s={ctxName:"_",contexts:{},paused:[],plugins:{defined:{},callbacks:{},waiting:{}},skipAsync:{},
isBrowser:r,isPageLoaded:!r,readyCalls:[],doc:r?document:null};f.isBrowser=h.isBrowser;if(r){h.head=document.getElementsByTagName("head")[0];if(A=document.getElementsByTagName("base")[0])h.head=A.parentNode}f.plugin=function(a){var b,d,c,e=a.prefix,g=h.plugins.callbacks,i=h.plugins.waiting[e],j;b=h.plugins.defined;c=h.contexts;if(b[e])return f;b[e]=a;j=["newContext","isWaiting","orderDeps"];for(b=0;d=j[b];b++){h.plugins[d]||S(d,d==="isWaiting");g[d].push(a[d])}if(a.newContext)for(d in c)if(!(d in
q)){b=c[d];a.newContext(b)}if(i){for(b=0;c=i[b];b++)a[c.name]&&a[c.name].apply(null,c.args);delete h.plugins.waiting[e]}return f};f.completeLoad=function(a,b){for(var d;v.length;){d=v.shift();if(d[0]===null){d[0]=a;break}else if(d[0]===a)break;else D(d,b)}d&&D(d,b);b.loaded[a]=true;M(b);b.scriptCount-=1;y(b)};f.pause=f.resume=function(){};f.checkDeps=function(a,b,d,c){if(a)C(a,c,{name:"checkDeps",args:[b,d,c]});else for(a=0;b=d[a];a++)if(!c.specified[b.fullName]){c.specified[b.fullName]=true;c.startTime=
(new Date).getTime();b.prefix?C(b.prefix,c,{name:"load",args:[b.name,c.contextName]}):f.load(b.name,c.contextName)}};f.modify=function(a,b,d,c,e){var g,i,j=(typeof a==="string"?e:b)||h.ctxName,l=h.contexts[j],m=l.modifiers;if(typeof a==="string"){i=m[a]||(m[a]=[]);if(!i[b]){i.push(b);i[b]=true}l.specified[a]?f.def(b,d,c,e):(i.__deferMods||(i.__deferMods=[])).push([b,d,c,e])}else for(g in a)if(!(g in q)){b=a[g];i=m[g]||(l.modifiers[g]=[]);if(!i[b]){i.push(b);i[b]=true;l.specified[g]&&f([b],j)}}};f.isArray=
function(a){return J.call(a)==="[object Array]"};f.isFunction=B;f.get=function(a,b,d){if(a==="require"||a==="exports"||a==="module")f.onError(new Error("Explicit require of "+a+" is not allowed."));b=b||h.ctxName;var c;c=h.contexts[b];d=f.splitPrefix(a,d,c);c=c.defined[d.name];c===undefined&&f.onError(new Error("require: module name '"+a+"' has not been loaded yet for context: "+b));return c};f.load=function(a,b){var d=h.contexts[b],c=d.urlFetched,e=d.loaded;h.isDone=false;e[a]||(e[a]=false);if(b!==
h.ctxName)w.push(arguments);else{e=f.nameToUrl(a,null,b);if(!c[e]){d.scriptCount+=1;f.attach(e,b,a);c[e]=true;if(d.jQuery&&!d.jQueryIncremented){d.jQuery.readyWait+=1;d.jQueryIncremented=true}}}};f.jsExtRegExp=/^\/|:|\?|\.js$/;f.normalizeName=function(a,b,d){if(a.charAt(0)===".")if(b){if(d.config.packages[b])b=[b];else{b=b.split("/");b=b.slice(0,b.length-1)}a=b.concat(a.split("/"));for(n=0;b=a[n];n++)if(b==="."){a.splice(n,1);n-=1}else if(b==="..")if(n===1)break;else if(n>1){a.splice(n-1,2);n-=2}a=
a.join("/")}return a};f.splitPrefix=function(a,b,d){var c=a.indexOf("!"),e=null;if(c!==-1){e=a.substring(0,c);a=a.substring(c+1,a.length)}a=f.normalizeName(a,b,d);return{prefix:e,name:a,fullName:e?e+"!"+a:a}};f.nameToUrl=function(a,b,d,c){var e,g,i,j;j=h.contexts[d];d=j.config;a=f.normalizeName(a,c,j);if(f.jsExtRegExp.test(a))a=a+(b?b:"");else{e=d.paths;g=d.packages;c=a.split("/");for(j=c.length;j>0;j--){i=c.slice(0,j).join("/");if(e[i]){c.splice(0,j,e[i]);break}else if(i=g[i]){e=i.location+"/"+i.lib;
if(a===i.name)e+="/"+i.main;c.splice(0,j,e);break}}a=c.join("/")+(b||".js");a=(a.charAt(0)==="/"||a.match(/^\w+:/)?"":d.baseUrl)+a}return d.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+d.urlArgs):a};f.blockCheckLoaded=true;f.checkLoaded=function(a){var b=h.contexts[a||h.ctxName],d=b.config.waitSeconds*1E3,c=d&&b.startTime+d<(new Date).getTime(),e,g=b.defined,i=b.modifiers,j="",l=false,m=false,k,o=h.plugins.isWaiting,u=h.plugins.orderDeps;if(!b.isCheckLoaded){if(b.config.priorityWait)if(L(b))y(b);else return;
b.isCheckLoaded=f.blockCheckLoaded;d=b.waiting;e=b.loaded;for(k in e)if(!(k in q)){l=true;if(!e[k])if(c)j+=k+" ";else{m=true;break}}if(!l&&!d.length&&(!o||!o(b)))b.isCheckLoaded=false;else{if(c&&j){e=new Error("require.js load timeout for modules: "+j);e.requireType="timeout";e.requireModules=j;f.onError(e)}if(m){b.isCheckLoaded=false;if(r||F)setTimeout(function(){f.checkLoaded(a)},50)}else{b.waiting=[];b.loaded={};u&&u(b);for(k in i)k in q||g[k]&&f.execModifiers(k,{},d,b);for(e=0;g=d[e];e++)f.exec(g,
{},d,b);b.isCheckLoaded=false;if(b.waiting.length||o&&o(b))f.checkLoaded(a);else if(w.length){e=b.loaded;b=true;for(k in e)if(!(k in q))if(!e[k]){b=false;break}if(b){h.ctxName=w[0][1];k=w;w=[];for(e=0;b=k[e];e++)f.load.apply(f,b)}}else{h.ctxName="_";h.isDone=true;f.callReady&&f.callReady()}}}}};f.exec=function(a,b,d,c){if(a){var e=a.name,g=a.callback;g=a.deps;var i,j,l=c.defined,m,k=[],o,u=false;if(e){if(b[e]||e in l)return l[e];b[e]=true}if(g)for(i=0;j=g[i];i++){j=j.name;if(j==="require")j=V(c,e);
else if(j==="exports"){j=l[e]={};u=true}else if(j==="module"){o=j={id:e,uri:e?f.nameToUrl(e,null,c.contextName):undefined};o.setExports=T(o)}else j=j in l?l[j]:b[j]?undefined:f.exec(d[d[j]],b,d,c);k.push(j)}if((g=a.callback)&&f.isFunction(g)){m=f.execCb(e,g,k);if(e)if(u&&m===undefined&&(!o||!("exports"in o)))m=l[e];else if(o&&"exports"in o)m=l[e]=o.exports;else{e in l&&!u&&f.onError(new Error(e+" has already been defined"));l[e]=m}}f.execModifiers(e,b,d,c);return m}};f.execCb=function(a,b,d){return b.apply(null,
d)};f.execModifiers=function(a,b,d,c){var e=c.modifiers,g=e[a],i,j;if(g){for(j=0;j<g.length;j++){i=g[j];i in d&&f.exec(d[d[i]],b,d,c)}delete e[a]}};f.onScriptLoad=function(a){var b=a.currentTarget||a.srcElement,d;if(a.type==="load"||Y.test(b.readyState)){d=b.getAttribute("data-requirecontext");a=b.getAttribute("data-requiremodule");d=h.contexts[d];f.completeLoad(a,d);b.removeEventListener?b.removeEventListener("load",f.onScriptLoad,false):b.detachEvent("onreadystatechange",f.onScriptLoad)}};f.attach=
function(a,b,d,c,e){var g;if(r){c=c||f.onScriptLoad;g=document.createElement("script");g.type=e||"text/javascript";g.charset="utf-8";g.async=!h.skipAsync[a];g.setAttribute("data-requirecontext",b);g.setAttribute("data-requiremodule",d);if(g.addEventListener)g.addEventListener("load",c,false);else{R=true;g.attachEvent("onreadystatechange",c)}g.src=a;I=g;A?h.head.insertBefore(g,A):h.head.appendChild(g);I=null;return g}else if(F){c=h.contexts[b];b=c.loaded;b[d]=false;importScripts(a);f.completeLoad(d,
c)}return null};h.baseUrl=p.baseUrl;if(r&&(!h.baseUrl||!h.head)){G=document.getElementsByTagName("script");N=p.baseUrlMatch?p.baseUrlMatch:/(allplugins-)?require\.js(\W|$)/i;for(n=G.length-1;n>-1&&(x=G[n]);n--){if(!h.head)h.head=x.parentNode;if(!z&&(z=x.getAttribute("data-main"))){p.deps=p.deps?p.deps.concat(z):[z];if(!p.baseUrl&&(s=x.src)){s=s.split("/");s.pop();h.baseUrl=p.baseUrl=s.length?s.join("/"):"./"}}if(!h.baseUrl&&(s=x.src))if(O=s.match(N)){h.baseUrl=s.substring(0,O.index);break}}}f.pageLoaded=
function(){if(!h.isPageLoaded){h.isPageLoaded=true;H&&clearInterval(H);if(P)document.readyState="complete";f.callReady()}};f.callReady=function(){var a=h.readyCalls,b,d,c;if(h.isPageLoaded&&h.isDone){if(a.length){h.readyCalls=[];for(b=0;d=a[b];b++)d()}a=h.contexts;for(c in a)if(!(c in q)){b=a[c];if(b.jQueryIncremented){b.jQuery.readyWait-=1;b.jQueryIncremented=false}}}};f.ready=function(a){h.isPageLoaded&&h.isDone?a():h.readyCalls.push(a);return f};if(r){if(document.addEventListener){document.addEventListener("DOMContentLoaded",
f.pageLoaded,false);window.addEventListener("load",f.pageLoaded,false);if(!document.readyState){P=true;document.readyState="loading"}}else if(window.attachEvent){window.attachEvent("onload",f.pageLoaded);if(self===self.top)H=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");f.pageLoaded()}}catch(a){}},30)}document.readyState==="complete"&&f.pageLoaded()}f(p);typeof setTimeout!=="undefined"&&setTimeout(function(){var a=h.contexts[p.context||"_"];M(a);y(a)},0)})();