'use strict';

exports.__esModule = true;
exports.css = css;
exports.cssScoped = cssScoped;
exports.js = js;
exports.remove = remove;
function css(_ref) {
	var url = _ref.url,
	    id = _ref.id;

	if (document.getElementById(id)) {
		return;
	}

	var styleElement = document.createElement('link');
	styleElement.id = id;
	styleElement.rel = 'stylesheet';
	styleElement.type = 'text/css';
	styleElement.href = url;
	document.head.appendChild(styleElement);
}

function cssScoped(_ref2) {
	var url = _ref2.url,
	    id = _ref2.id,
	    scopeTo = _ref2.scopeTo;

	if (document.getElementById(id)) {
		return;
	}

	var styleElement = document.createElement('style');
	styleElement.id = id;
	styleElement.scoped = "scoped";
	styleElement.innerText = '@import "' + url + '";\n';
	scopeTo.appendChild(styleElement);
}

function js(_ref3) {
	var url = _ref3.url,
	    id = _ref3.id;

	if (document.getElementById(id)) {
		return;
	}

	var scriptElement = document.createElement('link');
	scriptElement.id = id;
	scriptElement.type = 'text/javascript';
	scriptElement.src = url;
	document.head.appendChild(scriptElement);
}

function remove(ids) {
	ids.forEach(function (id) {
		document.head.removeChild(document.getElementById(id));
	});
}