styles.bundle.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. webpackJsonp(["styles"],{
  2. /***/ "./node_modules/raw-loader/index.js!./node_modules/postcss-loader/lib/index.js??embedded!./src/styles.css":
  3. /***/ (function(module, exports) {
  4. module.exports = "/* You can add global styles to this file, and also import other style files */\n"
  5. /***/ }),
  6. /***/ "./node_modules/style-loader/lib/addStyles.js":
  7. /***/ (function(module, exports, __webpack_require__) {
  8. /*
  9. MIT License http://www.opensource.org/licenses/mit-license.php
  10. Author Tobias Koppers @sokra
  11. */
  12. var stylesInDom = {};
  13. var memoize = function (fn) {
  14. var memo;
  15. return function () {
  16. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  17. return memo;
  18. };
  19. };
  20. var isOldIE = memoize(function () {
  21. // Test for IE <= 9 as proposed by Browserhacks
  22. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  23. // Tests for existence of standard globals is to allow style-loader
  24. // to operate correctly into non-standard environments
  25. // @see https://github.com/webpack-contrib/style-loader/issues/177
  26. return window && document && document.all && !window.atob;
  27. });
  28. var getElement = (function (fn) {
  29. var memo = {};
  30. return function(selector) {
  31. if (typeof memo[selector] === "undefined") {
  32. var styleTarget = fn.call(this, selector);
  33. // Special case to return head of iframe instead of iframe itself
  34. if (styleTarget instanceof window.HTMLIFrameElement) {
  35. try {
  36. // This will throw an exception if access to iframe is blocked
  37. // due to cross-origin restrictions
  38. styleTarget = styleTarget.contentDocument.head;
  39. } catch(e) {
  40. styleTarget = null;
  41. }
  42. }
  43. memo[selector] = styleTarget;
  44. }
  45. return memo[selector]
  46. };
  47. })(function (target) {
  48. return document.querySelector(target)
  49. });
  50. var singleton = null;
  51. var singletonCounter = 0;
  52. var stylesInsertedAtTop = [];
  53. var fixUrls = __webpack_require__("./node_modules/style-loader/lib/urls.js");
  54. module.exports = function(list, options) {
  55. if (typeof DEBUG !== "undefined" && DEBUG) {
  56. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  57. }
  58. options = options || {};
  59. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  60. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  61. // tags it will allow on a page
  62. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  63. // By default, add <style> tags to the <head> element
  64. if (!options.insertInto) options.insertInto = "head";
  65. // By default, add <style> tags to the bottom of the target
  66. if (!options.insertAt) options.insertAt = "bottom";
  67. var styles = listToStyles(list, options);
  68. addStylesToDom(styles, options);
  69. return function update (newList) {
  70. var mayRemove = [];
  71. for (var i = 0; i < styles.length; i++) {
  72. var item = styles[i];
  73. var domStyle = stylesInDom[item.id];
  74. domStyle.refs--;
  75. mayRemove.push(domStyle);
  76. }
  77. if(newList) {
  78. var newStyles = listToStyles(newList, options);
  79. addStylesToDom(newStyles, options);
  80. }
  81. for (var i = 0; i < mayRemove.length; i++) {
  82. var domStyle = mayRemove[i];
  83. if(domStyle.refs === 0) {
  84. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  85. delete stylesInDom[domStyle.id];
  86. }
  87. }
  88. };
  89. };
  90. function addStylesToDom (styles, options) {
  91. for (var i = 0; i < styles.length; i++) {
  92. var item = styles[i];
  93. var domStyle = stylesInDom[item.id];
  94. if(domStyle) {
  95. domStyle.refs++;
  96. for(var j = 0; j < domStyle.parts.length; j++) {
  97. domStyle.parts[j](item.parts[j]);
  98. }
  99. for(; j < item.parts.length; j++) {
  100. domStyle.parts.push(addStyle(item.parts[j], options));
  101. }
  102. } else {
  103. var parts = [];
  104. for(var j = 0; j < item.parts.length; j++) {
  105. parts.push(addStyle(item.parts[j], options));
  106. }
  107. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  108. }
  109. }
  110. }
  111. function listToStyles (list, options) {
  112. var styles = [];
  113. var newStyles = {};
  114. for (var i = 0; i < list.length; i++) {
  115. var item = list[i];
  116. var id = options.base ? item[0] + options.base : item[0];
  117. var css = item[1];
  118. var media = item[2];
  119. var sourceMap = item[3];
  120. var part = {css: css, media: media, sourceMap: sourceMap};
  121. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  122. else newStyles[id].parts.push(part);
  123. }
  124. return styles;
  125. }
  126. function insertStyleElement (options, style) {
  127. var target = getElement(options.insertInto)
  128. if (!target) {
  129. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  130. }
  131. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  132. if (options.insertAt === "top") {
  133. if (!lastStyleElementInsertedAtTop) {
  134. target.insertBefore(style, target.firstChild);
  135. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  136. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  137. } else {
  138. target.appendChild(style);
  139. }
  140. stylesInsertedAtTop.push(style);
  141. } else if (options.insertAt === "bottom") {
  142. target.appendChild(style);
  143. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  144. var nextSibling = getElement(options.insertInto + " " + options.insertAt.before);
  145. target.insertBefore(style, nextSibling);
  146. } else {
  147. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  148. }
  149. }
  150. function removeStyleElement (style) {
  151. if (style.parentNode === null) return false;
  152. style.parentNode.removeChild(style);
  153. var idx = stylesInsertedAtTop.indexOf(style);
  154. if(idx >= 0) {
  155. stylesInsertedAtTop.splice(idx, 1);
  156. }
  157. }
  158. function createStyleElement (options) {
  159. var style = document.createElement("style");
  160. options.attrs.type = "text/css";
  161. addAttrs(style, options.attrs);
  162. insertStyleElement(options, style);
  163. return style;
  164. }
  165. function createLinkElement (options) {
  166. var link = document.createElement("link");
  167. options.attrs.type = "text/css";
  168. options.attrs.rel = "stylesheet";
  169. addAttrs(link, options.attrs);
  170. insertStyleElement(options, link);
  171. return link;
  172. }
  173. function addAttrs (el, attrs) {
  174. Object.keys(attrs).forEach(function (key) {
  175. el.setAttribute(key, attrs[key]);
  176. });
  177. }
  178. function addStyle (obj, options) {
  179. var style, update, remove, result;
  180. // If a transform function was defined, run it on the css
  181. if (options.transform && obj.css) {
  182. result = options.transform(obj.css);
  183. if (result) {
  184. // If transform returns a value, use that instead of the original css.
  185. // This allows running runtime transformations on the css.
  186. obj.css = result;
  187. } else {
  188. // If the transform function returns a falsy value, don't add this css.
  189. // This allows conditional loading of css
  190. return function() {
  191. // noop
  192. };
  193. }
  194. }
  195. if (options.singleton) {
  196. var styleIndex = singletonCounter++;
  197. style = singleton || (singleton = createStyleElement(options));
  198. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  199. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  200. } else if (
  201. obj.sourceMap &&
  202. typeof URL === "function" &&
  203. typeof URL.createObjectURL === "function" &&
  204. typeof URL.revokeObjectURL === "function" &&
  205. typeof Blob === "function" &&
  206. typeof btoa === "function"
  207. ) {
  208. style = createLinkElement(options);
  209. update = updateLink.bind(null, style, options);
  210. remove = function () {
  211. removeStyleElement(style);
  212. if(style.href) URL.revokeObjectURL(style.href);
  213. };
  214. } else {
  215. style = createStyleElement(options);
  216. update = applyToTag.bind(null, style);
  217. remove = function () {
  218. removeStyleElement(style);
  219. };
  220. }
  221. update(obj);
  222. return function updateStyle (newObj) {
  223. if (newObj) {
  224. if (
  225. newObj.css === obj.css &&
  226. newObj.media === obj.media &&
  227. newObj.sourceMap === obj.sourceMap
  228. ) {
  229. return;
  230. }
  231. update(obj = newObj);
  232. } else {
  233. remove();
  234. }
  235. };
  236. }
  237. var replaceText = (function () {
  238. var textStore = [];
  239. return function (index, replacement) {
  240. textStore[index] = replacement;
  241. return textStore.filter(Boolean).join('\n');
  242. };
  243. })();
  244. function applyToSingletonTag (style, index, remove, obj) {
  245. var css = remove ? "" : obj.css;
  246. if (style.styleSheet) {
  247. style.styleSheet.cssText = replaceText(index, css);
  248. } else {
  249. var cssNode = document.createTextNode(css);
  250. var childNodes = style.childNodes;
  251. if (childNodes[index]) style.removeChild(childNodes[index]);
  252. if (childNodes.length) {
  253. style.insertBefore(cssNode, childNodes[index]);
  254. } else {
  255. style.appendChild(cssNode);
  256. }
  257. }
  258. }
  259. function applyToTag (style, obj) {
  260. var css = obj.css;
  261. var media = obj.media;
  262. if(media) {
  263. style.setAttribute("media", media)
  264. }
  265. if(style.styleSheet) {
  266. style.styleSheet.cssText = css;
  267. } else {
  268. while(style.firstChild) {
  269. style.removeChild(style.firstChild);
  270. }
  271. style.appendChild(document.createTextNode(css));
  272. }
  273. }
  274. function updateLink (link, options, obj) {
  275. var css = obj.css;
  276. var sourceMap = obj.sourceMap;
  277. /*
  278. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  279. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  280. on by default. Otherwise default to the convertToAbsoluteUrls option
  281. directly
  282. */
  283. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  284. if (options.convertToAbsoluteUrls || autoFixUrls) {
  285. css = fixUrls(css);
  286. }
  287. if (sourceMap) {
  288. // http://stackoverflow.com/a/26603875
  289. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  290. }
  291. var blob = new Blob([css], { type: "text/css" });
  292. var oldSrc = link.href;
  293. link.href = URL.createObjectURL(blob);
  294. if(oldSrc) URL.revokeObjectURL(oldSrc);
  295. }
  296. /***/ }),
  297. /***/ "./node_modules/style-loader/lib/urls.js":
  298. /***/ (function(module, exports) {
  299. /**
  300. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  301. * embed the css on the page. This breaks all relative urls because now they are relative to a
  302. * bundle instead of the current page.
  303. *
  304. * One solution is to only use full urls, but that may be impossible.
  305. *
  306. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  307. *
  308. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  309. *
  310. */
  311. module.exports = function (css) {
  312. // get current location
  313. var location = typeof window !== "undefined" && window.location;
  314. if (!location) {
  315. throw new Error("fixUrls requires window.location");
  316. }
  317. // blank or null?
  318. if (!css || typeof css !== "string") {
  319. return css;
  320. }
  321. var baseUrl = location.protocol + "//" + location.host;
  322. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  323. // convert each url(...)
  324. /*
  325. This regular expression is just a way to recursively match brackets within
  326. a string.
  327. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  328. ( = Start a capturing group
  329. (?: = Start a non-capturing group
  330. [^)(] = Match anything that isn't a parentheses
  331. | = OR
  332. \( = Match a start parentheses
  333. (?: = Start another non-capturing groups
  334. [^)(]+ = Match anything that isn't a parentheses
  335. | = OR
  336. \( = Match a start parentheses
  337. [^)(]* = Match anything that isn't a parentheses
  338. \) = Match a end parentheses
  339. ) = End Group
  340. *\) = Match anything and then a close parens
  341. ) = Close non-capturing group
  342. * = Match anything
  343. ) = Close capturing group
  344. \) = Match a close parens
  345. /gi = Get all matches, not the first. Be case insensitive.
  346. */
  347. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  348. // strip quotes (if they exist)
  349. var unquotedOrigUrl = origUrl
  350. .trim()
  351. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  352. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  353. // already a full url? no change
  354. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
  355. return fullMatch;
  356. }
  357. // convert the url to a full url
  358. var newUrl;
  359. if (unquotedOrigUrl.indexOf("//") === 0) {
  360. //TODO: should we add protocol?
  361. newUrl = unquotedOrigUrl;
  362. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  363. // path should be relative to the base url
  364. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  365. } else {
  366. // path should be relative to current directory
  367. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  368. }
  369. // send back the fixed url(...)
  370. return "url(" + JSON.stringify(newUrl) + ")";
  371. });
  372. // send back the fixed css
  373. return fixedCss;
  374. };
  375. /***/ }),
  376. /***/ "./src/styles.css":
  377. /***/ (function(module, exports, __webpack_require__) {
  378. // style-loader: Adds some css to the DOM by adding a <style> tag
  379. // load the styles
  380. var content = __webpack_require__("./node_modules/raw-loader/index.js!./node_modules/postcss-loader/lib/index.js??embedded!./src/styles.css");
  381. if(typeof content === 'string') content = [[module.i, content, '']];
  382. // Prepare cssTransformation
  383. var transform;
  384. var options = {"hmr":true}
  385. options.transform = transform
  386. // add the styles to the DOM
  387. var update = __webpack_require__("./node_modules/style-loader/lib/addStyles.js")(content, options);
  388. if(content.locals) module.exports = content.locals;
  389. // Hot Module Replacement
  390. if(false) {
  391. // When the styles change, update the <style> tags
  392. if(!content.locals) {
  393. module.hot.accept("!!../node_modules/raw-loader/index.js!../node_modules/postcss-loader/lib/index.js??embedded!./styles.css", function() {
  394. var newContent = require("!!../node_modules/raw-loader/index.js!../node_modules/postcss-loader/lib/index.js??embedded!./styles.css");
  395. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  396. update(newContent);
  397. });
  398. }
  399. // When the module is disposed, remove the <style> tags
  400. module.hot.dispose(function() { update(); });
  401. }
  402. /***/ }),
  403. /***/ 2:
  404. /***/ (function(module, exports, __webpack_require__) {
  405. module.exports = __webpack_require__("./src/styles.css");
  406. /***/ })
  407. },[2]);
  408. //# sourceMappingURL=styles.bundle.js.map