module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmory imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmory exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		Object.defineProperty(exports, name, {
/******/ 			configurable: false,
/******/ 			enumerable: true,
/******/ 			get: getter
/******/ 		});
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 136);
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/document-types/page-config.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.markdownPageConfig = exports.formatId = exports.javascriptPageConfig = exports.decorate = exports.testDocument = undefined;

var _extends2 = __webpack_require__(0);

var _extends3 = _interopRequireDefault(_extends2);

var _assign = __webpack_require__(1);

var _assign2 = _interopRequireDefault(_assign);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var pathToRegexp = __webpack_require__(50);

var testDocument = exports.testDocument = function testDocument(doc) {
  var project = doc.project;

  var pagesPattern = project.getOption('patterns.pages', '(screens|pages)*/:name/(index|screen).:extension');

  return pathToRegexp(pagesPattern).test(doc.path);
};

var decorate = exports.decorate = function decorate(doc) {

  (0, _assign2.default)(doc, {
    buildPageConfig: function buildPageConfig() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (doc.fileExtname === '.md') {
        return markdownPageConfig(doc);
      } else if (doc.fileExtname === '.js') {
        return javascriptPageConfig(doc);
      }
    }
  });

  return doc;
};

var javascriptPageConfig = exports.javascriptPageConfig = function javascriptPageConfig(doc) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _options$buildRoute = options.buildRoute,
      buildRoute = _options$buildRoute === undefined ? function (v) {
    return v;
  } : _options$buildRoute,
      _options$publicRoot = options.publicRoot,
      publicRoot = _options$publicRoot === undefined ? /.*(pages\screens)\/?/i : _options$publicRoot;


  return {
    id: doc.id,
    idParts: doc.idParts,
    baseRelativePath: doc.baseRelativePath,
    isIndex: doc.isIndex,
    route: buildRoute(formatId(doc.id)).replace(publicRoot, '/'),
    meta: {
      id: doc.id,
      cacheKey: doc.cacheKey,
      lastModified: doc.get('file.stat.mtime')
    }
  };
};

var formatId = exports.formatId = function formatId(id) {
  return id.replace(/(index|page|screen).*$/i, '').replace(/\/$/, '').split('/').slice(-2);
};

var markdownPageConfig = exports.markdownPageConfig = function markdownPageConfig(doc) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var frontmatter = doc.exportables.frontmatter;
  var _options$publicRoot2 = options.publicRoot,
      publicRoot = _options$publicRoot2 === undefined ? /.*(pages|screens)\/?/i : _options$publicRoot2,
      _options$buildRoute2 = options.buildRoute,
      buildRoute = _options$buildRoute2 === undefined ? function (v) {
    return v;
  } : _options$buildRoute2;


  return {
    id: doc.id,
    route: buildRoute(frontmatter.route || formatId(doc.id)).replace(publicRoot, '/'),
    idParts: doc.idParts,
    baseRelativePath: doc.baseRelativePath,
    isIndex: doc.isIndex,
    meta: (0, _extends3.default)({
      id: doc.id,
      cacheKey: doc.cacheKey
    }, frontmatter)
  };
};

/***/ },

/***/ 0:
/***/ function(module, exports) {

module.exports = require("babel-runtime/helpers/extends");

/***/ },

/***/ 1:
/***/ function(module, exports) {

module.exports = require("babel-runtime/core-js/object/assign");

/***/ },

/***/ 136:
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__("./src/document-types/page-config.js");


/***/ },

/***/ 50:
/***/ function(module, exports) {

module.exports = require("path-to-regexp");

/***/ }

/******/ });
//# sourceMappingURL=page-config.js.map