
SystemJS.amdDefine('getlibs/plugins/index', [], function(){

	var roots = ['https://unpkg.com/', 'https://cdnjs.cloudflare.com/'];

	function defineRoots(url){

		var i, root;

		for(i=0; i<roots.length; i++){

			root = roots[i];

			if (url.substr(0, root.length) == root){
				return;
			}
		}

		if (!url.match(/\.(ts|js)$/)){
			return;
		}

		var ext = RegExp.$1,
			packages = {};


		if (!System.resolveSync('./aaaa', url).match(/\.(ts|js)$/)){
			root = System.resolveSync('.', url);
			packages[root] = {defaultExtension: ext};
			System.config({packages: packages});
			roots.push(root);
		}
	}


	function build(base){

		var loader = {};

		Object.keys(base).forEach(function(i){
			loader[i] = base[i];
		});


		loader.fetch = function(load, defaultFetch){

			defineRoots(String(load.address));

			function proceed(source){
				load.source = source;
				return source;
			}

			function retry(err){

				var address = load.address,
					index = address.replace(/\.(ts|js)$/, '/index.$1'),
					ext = RegExp.$1,
					path = JSON.stringify(index),
					source = (ext == 'ts') ?
						'export * from' + path :
						'module.exports = require(' + path + ')';

				if (address.match(/\.(ts|js)$/) && !address.match(/index\.(ts|js)$/)){
					load.source = source;
					return source;
				}

				throw err;
			}


			var result = base.fetch ? base.fetch(load, defaultFetch) : defaultFetch(load);

			return Promise.resolve(result).then(proceed, retry);
		}

		return loader;
	}


	function skip(){
		return ''
	}


	function instantiate(load){
		return System.import(load.address).then(build);
	}


	return {
		fetch: skip,
		instantiate: instantiate
	};
});


@@ -629,32 +629,220 @@
 ;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%0D%0A
+%09function fileAccessWarning()%7B%0D%0A%09%09/* eslint no-console: %22off%22 */%0D%0A%09%09console.warn(%22Allow file access when running directly from files: http://getlibs.com/allow-file-access.html%22);%0D%0A%09%7D%0D%0A%0D%0A%0D%0A
 %09function build(
@@ -951,16 +951,101 @@
 );%0D%0A%0D%0A%0D%0A
+%09%09var loadingFromFiles = (location.protocol == 'file:'),%0D%0A%09%09%09fileAccessAllowed;%0D%0A%0D%0A%0D%0A
 %09%09loader
@@ -1161,86 +1161,352 @@
 )%7B%0D%0A
-%09%09%09%09load.source = source;%0D%0A%09%09%09%09return source;%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%09function retry(err)%7B
+%0D%0A%09%09%09%09if (load.address.indexOf('file:') == 0)%7B%0D%0A%09%09%09%09%09fileAccessAllowed = true;%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09load.source = source;%0D%0A%09%09%09%09return source;%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%09function retry(err)%7B%0D%0A%0D%0A%09%09%09%09if (loadingFromFiles && !fileAccessAllowed)%7B%0D%0A%09%09%09%09%09setTimeout(fileAccessWarning, 100);%0D%0A%09%09%09%09%09throw new Error('No access to files or wrong path: ' + load.address);%0D%0A%09%09%09%09%7D
 %0D%0A%0D%0A

add file access warning