define(["text"],function(text){var CACHE_BUST_QUERY_PARAM="bust",CACHE_BUST_FLAG="!bust",jsonParse=typeof JSON!=="undefined"&&typeof JSON.parse==="function"?JSON.parse:function(val){return eval("("+val+")")},buildMap={};function cacheBust(url){url=url.replace(CACHE_BUST_FLAG,"");url+=url.indexOf("?")<0?"?":"&";return url+CACHE_BUST_QUERY_PARAM+"="+Math.round(2147483647*Math.random())}return{load:function(name,req,onLoad,config){if(config.isBuild&&(config.inlineJSON===false||name.indexOf(CACHE_BUST_QUERY_PARAM+"=")!==-1)||req.toUrl(name).indexOf("empty:")===0){onLoad(null)}else{text.get(req.toUrl(name),function(data){var parsed;if(config.isBuild){buildMap[name]=data;onLoad(data)}else{try{parsed=jsonParse(data)}catch(e){onLoad.error(e)}onLoad(parsed)}},onLoad.error,{accept:"application/json"})}},normalize:function(name,normalize){if(name.indexOf(CACHE_BUST_FLAG)!==-1){name=cacheBust(name)}return normalize(name)},write:function(pluginName,moduleName,write){if(moduleName in buildMap){var content=buildMap[moduleName];write('define("'+pluginName+"!"+moduleName+'", function(){ return '+content+";});\n")}}}});