From 6315fba9a83bb3e24193f35421ec8a41dde6c5ad Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 5 Jan 2018 08:43:07 +0100 Subject: db url --- public/bundle.js | 6056 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 6055 insertions(+), 1 deletion(-) (limited to 'public/bundle.js') diff --git a/public/bundle.js b/public/bundle.js index 5598d75..dc438ea 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -1,2 +1,6056 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=16)}([function(t,e,n){t.exports=n(21)()},function(t,e,n){"use strict";(function(t){function r(){return null}function o(t){var e=t.nodeName,n=t.attributes;t.attributes={},e.defaultProps&&w(t.attributes,e.defaultProps),n&&w(t.attributes,n)}function i(t,e){var n,r,o;if(e){for(o in e)if(n=$.test(o))break;if(n){r=t.attributes={};for(o in e)e.hasOwnProperty(o)&&(r[$.test(o)?o.replace(/([A-Z0-9])/,"-$1").toLowerCase():o]=e[o])}}}function a(t,e,n){var r=e&&e._preactCompatRendered&&e._preactCompatRendered.base;r&&r.parentNode!==e&&(r=null),r||(r=e.children[0]);for(var o=e.childNodes.length;o--;)e.childNodes[o]!==r&&e.removeChild(e.childNodes[o]);var i=q.render(t,e,r);return e&&(e._preactCompatRendered=i&&(i._component||{base:i})),"function"==typeof n&&n(),i&&i._component||i}function c(t,e,n,r){var o=q.h(J,{context:t.context},e),i=a(o,n);return r&&r(i),i._component||i.base}function u(t){var e=t._preactCompatRendered&&t._preactCompatRendered.base;return!(!e||e.parentNode!==t)&&(q.render(q.h(r),t,e),!0)}function s(t){return d.bind(null,t)}function l(t,e){for(var n=e||0;n0;)n[r]=arguments[r+2];if(!m(t))return t;var o=t.attributes||t.props,i=q.h(t.nodeName||t.type,o,t.children||o&&o.children),a=[i,e];return n&&n.length?a.push(n):e&&e.children&&a.push(e.children),y(q.cloneElement.apply(void 0,a))}function m(t){return t&&(t instanceof G||t.$$typeof===D)}function b(t,e){return e._refProxies[t]||(e._refProxies[t]=function(n){e&&e.refs&&(e.refs[t]=n,null===n&&(delete e._refProxies[t],e=null))})}function g(t){var e=t.nodeName,n=t.attributes;if(n&&"string"==typeof e){var r={};for(var o in n)r[o.toLowerCase()]=o;if(r.ondoubleclick&&(n.ondblclick=n[r.ondoubleclick],delete n[r.ondoubleclick]),r.onchange&&("textarea"===e||"input"===e.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var i=r.oninput||"oninput";n[i]||(n[i]=R([n[i],n[r.onchange]]),delete n[r.onchange])}}}function _(t){var e=t.attributes;if(e){var n=e.className||e.class;n&&(e.className=n)}}function w(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function O(t,e){for(var n in t)if(!(n in e))return!0;for(var r in e)if(t[r]!==e[r])return!0;return!1}function P(t){return t&&t.base||t}function x(){}function j(t){function e(t,e){T(this),M.call(this,t,e,F),S.call(this,t,e)}return t=w({constructor:e},t),t.mixins&&E(t,C(t.mixins)),t.statics&&w(e,t.statics),t.propTypes&&(e.propTypes=t.propTypes),t.defaultProps&&(e.defaultProps=t.defaultProps),t.getDefaultProps&&(e.defaultProps=t.getDefaultProps()),x.prototype=M.prototype,e.prototype=w(new x,t),e.displayName=t.displayName||"Component",e}function C(t){for(var e={},n=0;n2;)L.push(arguments[a]);for(n&&null!=n.children&&(L.length||L.push(n.children),delete n.children);L.length;)if((o=L.pop())&&void 0!==o.pop)for(a=o.length;a--;)L.push(o[a]);else!0!==o&&!1!==o||(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?c[c.length-1]+=o:c===A?c=[o]:c.push(o),r=i;var u=new e;return u.nodeName=t,u.children=c,u.attributes=null==n?void 0:n,u.key=null==n?void 0:n.key,void 0!==S.vnode&&S.vnode(u),u}function r(t,e){for(var n in e)t[n]=e[n];return t}function o(t,e){return n(t.nodeName,r(r({},t.attributes),e),arguments.length>2?[].slice.call(arguments,2):t.children)}function i(t){!t.__d&&(t.__d=!0)&&1==M.push(t)&&(S.debounceRendering||setTimeout)(a)}function a(){var t,e=M;for(M=[];t=e.pop();)t.__d&&C(t)}function c(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&u(t,e.nodeName):n||t._componentConstructor===e.nodeName}function u(t,e){return t.__n===e||t.nodeName.toLowerCase()===e.toLowerCase()}function s(t){var e=r({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===e[o]&&(e[o]=n[o]);return e}function l(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.__n=t,n}function p(t){t.parentNode&&t.parentNode.removeChild(t)}function f(t,e,n,r,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),r&&r(t);else if("class"!==e||o)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(t.style[i]="");for(var i in r)t.style[i]="number"==typeof r[i]&&!1===N.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||t.addEventListener(e,d,a):t.removeEventListener(e,d,a),(t.__l||(t.__l={}))[e]=r}else if("list"!==e&&"type"!==e&&!o&&e in t)h(t,e,null==r?"":r),null!=r&&!1!==r||t.removeAttribute(e);else{var c=o&&e!==(e=e.replace(/^xlink\:?/,""));null==r||!1===r?c?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof r&&(c?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function h(t,e,n){try{t[e]=n}catch(t){}}function d(t){return this.__l[t.type](S.event&&S.event(t)||t)}function y(){for(var t;t=U.pop();)S.afterMount&&S.afterMount(t),t.componentDidMount&&t.componentDidMount()}function v(t,e,n,r,o,i){W++||(H=null!=o&&void 0!==o.ownerSVGElement,q=null!=t&&!("__preactattr_"in t));var a=m(t,e,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--W||(q=!1,i||y()),a}function m(t,e,n,r,o){var i=t,a=H;if(null==e&&(e=""),"string"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),g(t,!0))),i.__preactattr_=!0,i;if("function"==typeof e.nodeName)return E(t,e,n,r);if(H="svg"===e.nodeName||"foreignObject"!==e.nodeName&&H,(!t||!u(t,String(e.nodeName)))&&(i=l(String(e.nodeName),H),t)){for(;t.firstChild;)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),g(t,!0)}var c=i.firstChild,s=i.__preactattr_||(i.__preactattr_={}),p=e.children;return!q&&p&&1===p.length&&"string"==typeof p[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=p[0]&&(c.nodeValue=p[0]):(p&&p.length||null!=c)&&b(i,p,n,r,q||null!=s.dangerouslySetInnerHTML),w(i,e.attributes,s),H=a,i}function b(t,e,n,r,o){var i,a,u,s,l=t.childNodes,f=[],h={},d=0,y=0,v=l.length,b=0,_=e?e.length:0;if(0!==v)for(var w=0;w=v?t.appendChild(s):s!==l[w]&&(s===l[w+1]?p(l[w]):t.insertBefore(s,l[w]||null)))}if(d)for(var w in h)void 0!==h[w]&&g(h[w],!1);for(;y<=b;)void 0!==(s=f[b--])&&g(s,!1)}function g(t,e){var n=t._component;n?T(n):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||p(t),_(t))}function _(t){for(t=t.lastChild;t;){var e=t.previousSibling;g(t,!0),t=e}}function w(t,e,n){var r;for(r in n)e&&null!=e[r]||null==n[r]||f(t,r,n[r],n[r]=void 0,H);for(r in e)"children"===r||"innerHTML"===r||r in n&&e[r]===("value"===r||"checked"===r?t[r]:n[r])||f(t,r,n[r],n[r]=e[r],H)}function O(t){var e=t.constructor.name;(I[e]||(I[e]=[])).push(t)}function P(t,e,n){var r,o=I[t.name];if(t.prototype&&t.prototype.render?(r=new t(e,n),k.call(r,e,n)):(r=new k(e,n),r.constructor=t,r.render=x),o)for(var i=o.length;i--;)if(o[i].constructor===t){r.__b=o[i].__b,o.splice(i,1);break}return r}function x(t,e,n){return this.constructor(t,n)}function j(t,e,n,r,o){t.__x||(t.__x=!0,(t.__r=e.ref)&&delete e.ref,(t.__k=e.key)&&delete e.key,!t.base||o?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,r),r&&r!==t.context&&(t.__c||(t.__c=t.context),t.context=r),t.__p||(t.__p=t.props),t.props=e,t.__x=!1,0!==n&&(1!==n&&!1===S.syncComponentUpdates&&t.base?i(t):C(t,1,o)),t.__r&&t.__r(t))}function C(t,e,n,o){if(!t.__x){var i,a,c,u=t.props,l=t.state,p=t.context,f=t.__p||u,h=t.__s||l,d=t.__c||p,m=t.base,b=t.__b,_=m||b,w=t._component,O=!1;if(m&&(t.props=f,t.state=h,t.context=d,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,l,p)?O=!0:t.componentWillUpdate&&t.componentWillUpdate(u,l,p),t.props=u,t.state=l,t.context=p),t.__p=t.__s=t.__c=t.__b=null,t.__d=!1,!O){i=t.render(u,l,p),t.getChildContext&&(p=r(r({},p),t.getChildContext()));var x,E,k=i&&i.nodeName;if("function"==typeof k){var R=s(i);a=w,a&&a.constructor===k&&R.key==a.__k?j(a,R,1,p,!1):(x=a,t._component=a=P(k,R,p),a.__b=a.__b||b,a.__u=t,j(a,R,0,p,!1),C(a,1,n,!0)),E=a.base}else c=_,x=w,x&&(c=t._component=null),(_||1===e)&&(c&&(c._component=null),E=v(c,i,p,n||!m,_&&_.parentNode,!0));if(_&&E!==_&&a!==w){var L=_.parentNode;L&&E!==L&&(L.replaceChild(E,_),x||(_._component=null,g(_,!1)))}if(x&&T(x),t.base=E,E&&!o){for(var A=t,N=t;N=N.__u;)(A=N).base=E;E._component=A,E._componentConstructor=A.constructor}}if(!m||n?U.unshift(t):O||(y(),t.componentDidUpdate&&t.componentDidUpdate(f,h,d),S.afterUpdate&&S.afterUpdate(t)),null!=t.__h)for(;t.__h.length;)t.__h.pop().call(t);W||o||y()}}function E(t,e,n,r){for(var o=t&&t._component,i=o,a=t,c=o&&t._componentConstructor===e.nodeName,u=c,l=s(e);o&&!u&&(o=o.__u);)u=o.constructor===e.nodeName;return o&&u&&(!r||o._component)?(j(o,l,3,n,r),t=o.base):(i&&!c&&(T(i),t=a=null),o=P(e.nodeName,l,n),t&&!o.__b&&(o.__b=t,a=null),j(o,l,1,n,r),t=o.base,a&&t!==a&&(a._component=null,g(a,!1))),t}function T(t){S.beforeUnmount&&S.beforeUnmount(t);var e=t.base;t.__x=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var n=t._component;n?T(n):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),t.__b=e,p(e),O(t),_(e)),t.__r&&t.__r(null)}function k(t,e){this.__d=!0,this.context=e,this.props=t,this.state=this.state||{}}function R(t,e,n){return v(n,t,{},!1,e,!1)}var S={},L=[],A=[],N=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,M=[],U=[],W=0,H=!1,q=!1,I={};r(k.prototype,{setState:function(t,e){var n=this.state;this.__s||(this.__s=r({},n)),r(n,"function"==typeof t?t(n,this.props):t),e&&(this.__h=this.__h||[]).push(e),i(this)},forceUpdate:function(t){t&&(this.__h=this.__h||[]).push(t),C(this,2)},render:function(){}});var D={h:n,createElement:n,cloneElement:o,Component:k,render:R,rerender:a,options:S};t.exports=D}()},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19);n.d(e,"BrowserRouter",function(){return r.a});var o=n(38);n.d(e,"HashRouter",function(){return o.a});var i=n(15);n.d(e,"Link",function(){return i.a});var a=n(40);n.d(e,"MemoryRouter",function(){return a.a});var c=n(41);n.d(e,"NavLink",function(){return c.a});var u=n(42);n.d(e,"Prompt",function(){return u.a});var s=n(43);n.d(e,"Redirect",function(){return s.a});var l=n(44);n.d(e,"Route",function(){return l.a});var p=n(45);n.d(e,"Router",function(){return p.a});var f=n(46);n.d(e,"StaticRouter",function(){return f.a});var h=n(47);n.d(e,"Switch",function(){return h.a});var d=n(48);n.d(e,"matchPath",function(){return d.a});var y=n(49);n.d(e,"withRouter",function(){return y.a})},function(t,e,n){"use strict";e.__esModule=!0;var r=(e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)});e.stripBasename=function(t,e){return r(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}},e.createPath=function(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,a,c){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,a,c],l=0;u=new Error(e.replace(/%s/g,function(){return s[l++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};t.exports=r},function(t,e,n){"use strict";function r(t){return Math.random()*t|0}function o(t,e){return Math.random()*(e-t)+t|0}function i(t){return t[r(t.length)]}Object.defineProperty(e,"__esModule",{value:!0});var a=!!navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i),c=!!navigator.userAgent.match(/iPad/i),u=!!navigator.userAgent.match(/Android/i),s=a||c||u,l=!s;document.body.classList.add(l?"desktop":"mobile"),e.isIphone=a,e.isIpad=c,e.isAndroid=u,e.isMobile=s,e.isDesktop=l,e.randint=r,e.randrange=o,e.choice=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var o=Object.assign||function(t){for(var e=1;e may have only one child element"),this.unlisten=r.listen(function(){t.setState({match:t.computeMatch(r.location.pathname)})})},e.prototype.componentWillReceiveProps=function(t){c.a(this.props.history===t.history,"You cannot change ")},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var t=this.props.children;return t?l.a.Children.only(t):null},e}(l.a.Component);d.propTypes={history:f.a.object.isRequired,children:f.a.node},d.contextTypes={router:f.a.object},d.childContextTypes={router:f.a.object.isRequired},e.a=d},function(t,e,n){"use strict";var r=n(32),o=n.n(r),i={},a=0,c=function(t,e){var n=""+e.end+e.strict,r=i[n]||(i[n]={});if(r[t])return r[t];var c=[],u=o.a(t,c,e),s={re:u,keys:c};return a<1e4&&(r[t]=s,a++),s},u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={path:e});var n=e,r=n.path,o=void 0===r?"/":r,i=n.exact,a=void 0!==i&&i,u=n.strict,s=void 0!==u&&u,l=c(o,{end:a,strict:s}),p=l.re,f=l.keys,h=p.exec(t);if(!h)return null;var d=h[0],y=h.slice(1),v=t===d;return a&&!v?null:{path:o,url:"/"===o&&""===d?"/":d,isExact:v,params:f.reduce(function(t,e,n){return t[e.name]=y[n],t},{})}};e.a=u},function(t,e,n){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(4),c=n.n(a),u=n(1),s=n(0),l=n.n(s),p=n(12),f=Object.assign||function(t){for(var e=1;e and in the same route; will be ignored"),c.a(!(e&&r),"You should not use and in the same route; will be ignored"),c.a(!(n&&r),"You should not use and in the same route; will be ignored")},e.prototype.componentWillReceiveProps=function(t,e){c.a(!(t.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),c.a(!(!t.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(t,e.router)})},e.prototype.render=function(){var t=this.state.match,e=this.props,n=e.children,r=e.component,o=e.render,i=this.context.router,a=i.history,c=i.route,s=i.staticContext,l=this.props.location||c.location,p={match:t,location:l,history:a,staticContext:s};return r?t?u.a.createElement(r,p):null:o?t?o(p):null:n?"function"==typeof n?n(p):!Array.isArray(n)||n.length?u.a.Children.only(n):null:null},e}(u.a.Component);h.propTypes={computedMatch:l.a.object,path:l.a.string,exact:l.a.bool,strict:l.a.bool,component:l.a.func,render:l.a.func,children:l.a.oneOfType([l.a.func,l.a.node]),location:l.a.object},h.contextTypes={router:l.a.shape({history:l.a.object.isRequired,route:l.a.object.isRequired,staticContext:l.a.object})},h.childContextTypes={router:l.a.object.isRequired},e.a=h},function(t,e,n){"use strict";function r(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var c=n(1),u=n(0),s=n.n(u),l=Object.assign||function(t){for(var e=1;e1)for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{};(0,s.default)(d.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,d.supportsHistory)(),r=!(0,d.supportsPopStateOnHashChange)(),a=t.forceRefresh,u=void 0!==a&&a,f=t.getUserConfirmation,v=void 0===f?d.getConfirmation:f,m=t.keyLength,b=void 0===m?6:m,g=t.basename?(0,p.stripTrailingSlash)((0,p.addLeadingSlash)(t.basename)):"",_=function(t){var e=t||{},n=e.key,r=e.state,o=window.location,i=o.pathname,a=o.search,u=o.hash,s=i+a+u;return(0,c.default)(!g||(0,p.hasBasename)(s,g),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+s+'" to begin with "'+g+'".'),g&&(s=(0,p.stripBasename)(s,g)),(0,l.createLocation)(s,r,n)},w=function(){return Math.random().toString(36).substr(2,b)},O=(0,h.default)(),P=function(t){i(B,t),B.length=e.length,O.notifyListeners(B.location,B.action)},x=function(t){(0,d.isExtraneousPopstateEvent)(t)||E(_(t.state))},j=function(){E(_(y()))},C=!1,E=function(t){if(C)C=!1,P();else{O.confirmTransitionTo(t,"POP",v,function(e){e?P({action:"POP",location:t}):T(t)})}},T=function(t){var e=B.location,n=R.indexOf(e.key);-1===n&&(n=0);var r=R.indexOf(t.key);-1===r&&(r=0);var o=n-r;o&&(C=!0,N(o))},k=_(y()),R=[k.key],S=function(t){return g+(0,p.createPath)(t)},L=function(t,r){(0,c.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var i=(0,l.createLocation)(t,r,w(),B.location);O.confirmTransitionTo(i,"PUSH",v,function(t){if(t){var r=S(i),o=i.key,a=i.state;if(n)if(e.pushState({key:o,state:a},null,r),u)window.location.href=r;else{var s=R.indexOf(B.location.key),l=R.slice(0,-1===s?0:s+1);l.push(i.key),R=l,P({action:"PUSH",location:i})}else(0,c.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=r}})},A=function(t,r){(0,c.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var i=(0,l.createLocation)(t,r,w(),B.location);O.confirmTransitionTo(i,"REPLACE",v,function(t){if(t){var r=S(i),o=i.key,a=i.state;if(n)if(e.replaceState({key:o,state:a},null,r),u)window.location.replace(r);else{var s=R.indexOf(B.location.key);-1!==s&&(R[s]=i.key),P({action:"REPLACE",location:i})}else(0,c.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(r)}})},N=function(t){e.go(t)},M=function(){return N(-1)},U=function(){return N(1)},W=0,H=function(t){W+=t,1===W?((0,d.addEventListener)(window,"popstate",x),r&&(0,d.addEventListener)(window,"hashchange",j)):0===W&&((0,d.removeEventListener)(window,"popstate",x),r&&(0,d.removeEventListener)(window,"hashchange",j))},q=!1,I=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=O.setPrompt(t);return q||(H(1),q=!0),function(){return q&&(q=!1,H(-1)),e()}},D=function(t){var e=O.appendListener(t);return H(1),function(){H(-1),e()}},B={length:e.length,action:"POP",location:k,createHref:S,push:L,replace:A,go:N,goBack:M,goForward:U,block:I,listen:D};return B};e.default=v},function(t,e,n){"use strict";var r=function(t){return"/"===t.charAt(0)},o=function(t,e){for(var n=e,r=n+1,o=t.length;r1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],i=e&&e.split("/")||[],a=t&&r(t),c=e&&r(e),u=a||c;if(t&&r(t)?i=n:n.length&&(i.pop(),i=i.concat(n)),!i.length)return"/";var s=void 0;if(i.length){var l=i[i.length-1];s="."===l||".."===l||""===l}else s=!1;for(var p=0,f=i.length;f>=0;f--){var h=i[f];"."===h?o(i,f):".."===h?(o(i,f),p++):p&&(o(i,f),p--)}if(!u)for(;p--;p)i.unshift("..");!u||""===i[0]||i[0]&&r(i[0])||i.unshift("");var d=i.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d};t.exports=i},function(t,e,n){"use strict";e.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,r){return t(e,n[r])});var o=void 0===e?"undefined":r(e);if(o!==(void 0===n?"undefined":r(n)))return!1;if("object"===o){var i=e.valueOf(),a=n.valueOf();if(i!==e||a!==n)return t(i,a);var c=Object.keys(e),u=Object.keys(n);return c.length===u.length&&c.every(function(r){return t(e[r],n[r])})}return!1};e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(1),c=n(0),u=n.n(c),s=n(29),l=n.n(s),p=n(11),f=function(t){function e(){var n,i,a;r(this,e);for(var c=arguments.length,u=Array(c),s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,r=void 0===n?["/"]:n,a=t.initialIndex,l=void 0===a?0:a,h=t.keyLength,d=void 0===h?6:h,y=(0,p.default)(),v=function(t){i(k,t),k.length=k.entries.length,y.notifyListeners(k.location,k.action)},m=function(){return Math.random().toString(36).substr(2,d)},b=f(l,0,r.length-1),g=r.map(function(t){return"string"==typeof t?(0,s.createLocation)(t,void 0,m()):(0,s.createLocation)(t,void 0,t.key||m())}),_=u.createPath,w=function(t,n){(0,c.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var r=(0,s.createLocation)(t,n,m(),k.location);y.confirmTransitionTo(r,"PUSH",e,function(t){if(t){var e=k.index,n=e+1,o=k.entries.slice(0);o.length>n?o.splice(n,o.length-n,r):o.push(r),v({action:"PUSH",location:r,index:n,entries:o})}})},O=function(t,n){(0,c.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var r=(0,s.createLocation)(t,n,m(),k.location);y.confirmTransitionTo(r,"REPLACE",e,function(t){t&&(k.entries[k.index]=r,v({action:"REPLACE",location:r}))})},P=function(t){var n=f(k.index+t,0,k.entries.length-1),r=k.entries[n];y.confirmTransitionTo(r,"POP",e,function(t){t?v({action:"POP",location:r,index:n}):v()})},x=function(){return P(-1)},j=function(){return P(1)},C=function(t){var e=k.index+t;return e>=0&&e0&&void 0!==arguments[0]&&arguments[0];return y.setPrompt(t)},T=function(t){return y.appendListener(t)},k={length:g.length,action:"POP",location:g[b],index:b,entries:g,createHref:_,push:w,replace:O,go:P,goBack:x,goForward:j,canGo:C,block:E,listen:T};return k};e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(1),c=n(0),u=n.n(c),s=function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(a.a.Component);s.propTypes={when:u.a.bool,message:u.a.oneOfType([u.a.func,u.a.string]).isRequired},s.defaultProps={when:!0},s.contextTypes={router:u.a.shape({history:u.a.shape({block:u.a.func.isRequired}).isRequired}).isRequired},e.a=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(1),c=n(0),u=n.n(c),s=function(t){function e(){return r(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},e.prototype.componentWillMount=function(){this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.perform=function(){var t=this.context.router.history,e=this.props,n=e.push,r=e.to;n?t.push(r):t.replace(r)},e.prototype.render=function(){return null},e}(a.a.Component);s.propTypes={push:u.a.bool,from:u.a.string,to:u.a.oneOfType([u.a.string,u.a.object])},s.defaultProps={push:!1},s.contextTypes={router:u.a.shape({history:u.a.shape({push:u.a.func.isRequired,replace:u.a.func.isRequired}).isRequired,staticContext:u.a.object}).isRequired},e.a=s},function(t,e,n){function r(t,e){for(var n,r=[],o=0,i=0,a="",c=e&&e.delimiter||"/";null!=(n=b.exec(t));){var l=n[0],p=n[1],f=n.index;if(a+=t.slice(i,f),i=f+l.length,p)a+=p[1];else{var h=t[i],d=n[2],y=n[3],v=n[4],m=n[5],g=n[6],_=n[7];a&&(r.push(a),a="");var w=null!=d&&null!=h&&h!==d,O="+"===g||"*"===g,P="?"===g||"*"===g,x=n[2]||c,j=v||m;r.push({name:y||o++,prefix:d||"",delimiter:x,optional:P,repeat:O,partial:w,asterisk:!!_,pattern:j?s(j):_?".*":"[^"+u(x)+"]+?"})}}return i=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var c=n(7),u=n.n(c),s=n(1),l=n(0),p=n.n(l),f=n(6),h=(n.n(f),n(11)),d=Object.assign||function(t){for(var e=1;e",t)}},w=function(){},O=function(t){function e(){var n,r,a;o(this,e);for(var c=arguments.length,u=Array(c),s=0;s elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),l.a(!(!t.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},e.prototype.render=function(){var t=this.context.router.route,e=this.props.children,n=this.props.location||t.location,r=void 0,o=void 0;return a.a.Children.forEach(e,function(e){if(a.a.isValidElement(e)){var i=e.props,c=i.path,u=i.exact,s=i.strict,l=i.from,f=c||l;null==r&&(o=e,r=f?p.a(n.pathname,{path:f,exact:u,strict:s}):t.match)}}),r?a.a.cloneElement(o,{location:n,computedMatch:r}):null},e}(a.a.Component);f.contextTypes={router:u.a.shape({route:u.a.object.isRequired}).isRequired},f.propTypes={children:u.a.node,location:u.a.object},e.a=f},function(t,e,n){"use strict";function r(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var o=n(1),i=n(0),a=n.n(i),c=n(37),u=n.n(c),s=n(14),l=Object.assign||function(t){for(var e=1;e=0?e:0)+"#"+t)},b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.default)(h.canUseDOM,"Hash history needs a DOM");var e=window.history,n=(0,h.supportsGoWithoutReloadUsingHash)(),r=t.getUserConfirmation,i=void 0===r?h.getConfirmation:r,c=t.hashType,p=void 0===c?"slash":c,b=t.basename?(0,l.stripTrailingSlash)((0,l.addLeadingSlash)(t.basename)):"",g=d[p],_=g.encodePath,w=g.decodePath,O=function(){var t=w(y());return(0,a.default)(!b||(0,l.hasBasename)(t,b),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+b+'".'),b&&(t=(0,l.stripBasename)(t,b)),(0,s.createLocation)(t)},P=(0,f.default)(),x=function(t){o(F,t),F.length=e.length,P.notifyListeners(F.location,F.action)},j=!1,C=null,E=function(){var t=y(),e=_(t);if(t!==e)m(e);else{var n=O(),r=F.location;if(!j&&(0,s.locationsAreEqual)(r,n))return;if(C===(0,l.createPath)(n))return;C=null,T(n)}},T=function(t){if(j)j=!1,x();else{P.confirmTransitionTo(t,"POP",i,function(e){e?x({action:"POP",location:t}):k(t)})}},k=function(t){var e=F.location,n=A.lastIndexOf((0,l.createPath)(e));-1===n&&(n=0);var r=A.lastIndexOf((0,l.createPath)(t));-1===r&&(r=0);var o=n-r;o&&(j=!0,W(o))},R=y(),S=_(R);R!==S&&m(S);var L=O(),A=[(0,l.createPath)(L)],N=function(t){return"#"+_(b+(0,l.createPath)(t))},M=function(t,e){(0,a.default)(void 0===e,"Hash history cannot push state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,F.location);P.confirmTransitionTo(n,"PUSH",i,function(t){if(t){var e=(0,l.createPath)(n),r=_(b+e);if(y()!==r){C=e,v(r);var o=A.lastIndexOf((0,l.createPath)(F.location)),i=A.slice(0,-1===o?0:o+1);i.push(e),A=i,x({action:"PUSH",location:n})}else(0,a.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),x()}})},U=function(t,e){(0,a.default)(void 0===e,"Hash history cannot replace state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,F.location);P.confirmTransitionTo(n,"REPLACE",i,function(t){if(t){var e=(0,l.createPath)(n),r=_(b+e);y()!==r&&(C=e,m(r));var o=A.indexOf((0,l.createPath)(F.location));-1!==o&&(A[o]=e),x({action:"REPLACE",location:n})}})},W=function(t){(0,a.default)(n,"Hash history go(n) causes a full page reload in this browser"),e.go(t)},H=function(){return W(-1)},q=function(){return W(1)},I=0,D=function(t){I+=t,1===I?(0,h.addEventListener)(window,"hashchange",E):0===I&&(0,h.removeEventListener)(window,"hashchange",E)},B=!1,Y=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=P.setPrompt(t);return B||(D(1),B=!0),function(){return B&&(B=!1,D(-1)),e()}},$=function(t){var e=P.appendListener(t);return D(1),function(){D(-1),e()}},F={length:e.length,action:"POP",location:L,createHref:N,push:M,replace:U,go:W,goBack:H,goForward:q,block:Y,listen:$};return F};e.default=b},function(t,e,n){"use strict";var r=n(2);n.d(e,"a",function(){return r.a})},function(t,e,n){"use strict";function r(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var o=n(1),i=n(0),a=n.n(i),c=n(2),u=n(15),s=Object.assign||function(t){for(var e=1;e"))))}),e=this.props.data.page[0],n=(e.body||"").replace(/\n/g,"
"),r=(0,c.h)("div",{class:"cell"},(0,c.h)("div",{class:"painting"},(0,c.h)("a",{href:"http://asdf.us/pepper",target:"_blank"},(0,c.h)("div",{class:"image",style:"background-image: url("+e.image.uri+")"}))),(0,c.h)("div",{class:"about"},(0,c.h)("div",{dangerouslySetInnerHTML:{__html:n}})));return(0,c.h)("div",{class:"paintings"},t,r)}}]),e}(c.Component);e.default=l},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){t=t||"";for(var e=/(https?:\/\/[^\s]+)/g,n=e.exec(t),r=[],o=void 0,i={};null!=n;)o=n[0].replace(/",?/,""),o&&!i[o]&&(i[o]=!0,r.push((0,s.h)("a",{href:o,key:o},(0,s.h)(p,{source:o})))),n=e.exec(t);return r}function c(t){return(t||"").split("} {").map(function(t){return(0,s.h)("div",null,t,(0,s.h)("br",null),(0,s.h)("br",null))})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n 0 ) children[ len ] = arguments[ len + 2 ]; + + if (!isValidElement(element)) { return element; } + var elementProps = element.attributes || element.props; + var node = __WEBPACK_IMPORTED_MODULE_1_preact__["h"]( + element.nodeName || element.type, + elementProps, + element.children || elementProps && elementProps.children + ); + // Only provide the 3rd argument if needed. + // Arguments 3+ overwrite element.children in preactCloneElement + var cloneArgs = [node, props]; + if (children && children.length) { + cloneArgs.push(children); + } + else if (props && props.children) { + cloneArgs.push(props.children); + } + return normalizeVNode(__WEBPACK_IMPORTED_MODULE_1_preact__["cloneElement"].apply(void 0, cloneArgs)); +} + + +function isValidElement(element) { + return element && ((element instanceof VNode) || element.$$typeof===REACT_ELEMENT_TYPE); +} + + +function createStringRefProxy(name, component) { + return component._refProxies[name] || (component._refProxies[name] = function (resolved) { + if (component && component.refs) { + component.refs[name] = resolved; + if (resolved===null) { + delete component._refProxies[name]; + component = null; + } + } + }); +} + + +function applyEventNormalization(ref) { + var nodeName = ref.nodeName; + var attributes = ref.attributes; + + if (!attributes || typeof nodeName!=='string') { return; } + var props = {}; + for (var i in attributes) { + props[i.toLowerCase()] = i; + } + if (props.ondoubleclick) { + attributes.ondblclick = attributes[props.ondoubleclick]; + delete attributes[props.ondoubleclick]; + } + // for *textual inputs* (incl textarea), normalize `onChange` -> `onInput`: + if (props.onchange && (nodeName==='textarea' || (nodeName.toLowerCase()==='input' && !/^fil|che|rad/i.test(attributes.type)))) { + var normalized = props.oninput || 'oninput'; + if (!attributes[normalized]) { + attributes[normalized] = multihook([attributes[normalized], attributes[props.onchange]]); + delete attributes[props.onchange]; + } + } +} + + +function applyClassName(ref) { + var attributes = ref.attributes; + + if (!attributes) { return; } + var cl = attributes.className || attributes.class; + if (cl) { attributes.className = cl; } +} + + +function extend(base, props) { + for (var key in props) { + if (props.hasOwnProperty(key)) { + base[key] = props[key]; + } + } + return base; +} + + +function shallowDiffers(a, b) { + for (var i in a) { if (!(i in b)) { return true; } } + for (var i$1 in b) { if (a[i$1]!==b[i$1]) { return true; } } + return false; +} + + +function findDOMNode(component) { + return component && component.base || component; +} + + +function F(){} + +function createClass(obj) { + function cl(props, context) { + bindAll(this); + Component$1.call(this, props, context, BYPASS_HOOK); + newComponentHook.call(this, props, context); + } + + obj = extend({ constructor: cl }, obj); + + // We need to apply mixins here so that getDefaultProps is correctly mixed + if (obj.mixins) { + applyMixins(obj, collateMixins(obj.mixins)); + } + if (obj.statics) { + extend(cl, obj.statics); + } + if (obj.propTypes) { + cl.propTypes = obj.propTypes; + } + if (obj.defaultProps) { + cl.defaultProps = obj.defaultProps; + } + if (obj.getDefaultProps) { + cl.defaultProps = obj.getDefaultProps(); + } + + F.prototype = Component$1.prototype; + cl.prototype = extend(new F(), obj); + + cl.displayName = obj.displayName || 'Component'; + + return cl; +} + + +// Flatten an Array of mixins to a map of method name to mixin implementations +function collateMixins(mixins) { + var keyed = {}; + for (var i=0; i 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +!function() { + 'use strict'; + function VNode() {} + function h(nodeName, attributes) { + var lastSimple, child, simple, i, children = EMPTY_CHILDREN; + for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]); + if (attributes && null != attributes.children) { + if (!stack.length) stack.push(attributes.children); + delete attributes.children; + } + while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else { + if (child === !0 || child === !1) child = null; + if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1; + if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child); + lastSimple = simple; + } + var p = new VNode(); + p.nodeName = nodeName; + p.children = children; + p.attributes = null == attributes ? void 0 : attributes; + p.key = null == attributes ? void 0 : attributes.key; + if (void 0 !== options.vnode) options.vnode(p); + return p; + } + function extend(obj, props) { + for (var i in props) obj[i] = props[i]; + return obj; + } + function cloneElement(vnode, props) { + return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children); + } + function enqueueRender(component) { + if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender); + } + function rerender() { + var p, list = items; + items = []; + while (p = list.pop()) if (p.__d) renderComponent(p); + } + function isSameNodeType(node, vnode, hydrating) { + if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText; + if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName; + } + function isNamedNode(node, nodeName) { + return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase(); + } + function getNodeProps(vnode) { + var props = extend({}, vnode.attributes); + props.children = vnode.children; + var defaultProps = vnode.nodeName.defaultProps; + if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i]; + return props; + } + function createNode(nodeName, isSvg) { + var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName); + node.__n = nodeName; + return node; + } + function removeNode(node) { + if (node.parentNode) node.parentNode.removeChild(node); + } + function setAccessor(node, name, old, value, isSvg) { + if ('className' === name) name = 'class'; + if ('key' === name) ; else if ('ref' === name) { + if (old) old(null); + if (value) value(node); + } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) { + if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || ''; + if (value && 'object' == typeof value) { + if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = ''; + for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i]; + } + } else if ('dangerouslySetInnerHTML' === name) { + if (value) node.innerHTML = value.__html || ''; + } else if ('o' == name[0] && 'n' == name[1]) { + var useCapture = name !== (name = name.replace(/Capture$/, '')); + name = name.toLowerCase().substring(2); + if (value) { + if (!old) node.addEventListener(name, eventProxy, useCapture); + } else node.removeEventListener(name, eventProxy, useCapture); + (node.__l || (node.__l = {}))[name] = value; + } else if ('list' !== name && 'type' !== name && !isSvg && name in node) { + setProperty(node, name, null == value ? '' : value); + if (null == value || value === !1) node.removeAttribute(name); + } else { + var ns = isSvg && name !== (name = name.replace(/^xlink\:?/, '')); + if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value); + } + } + function setProperty(node, name, value) { + try { + node[name] = value; + } catch (e) {} + } + function eventProxy(e) { + return this.__l[e.type](options.event && options.event(e) || e); + } + function flushMounts() { + var c; + while (c = mounts.pop()) { + if (options.afterMount) options.afterMount(c); + if (c.componentDidMount) c.componentDidMount(); + } + } + function diff(dom, vnode, context, mountAll, parent, componentRoot) { + if (!diffLevel++) { + isSvgMode = null != parent && void 0 !== parent.ownerSVGElement; + hydrating = null != dom && !('__preactattr_' in dom); + } + var ret = idiff(dom, vnode, context, mountAll, componentRoot); + if (parent && ret.parentNode !== parent) parent.appendChild(ret); + if (!--diffLevel) { + hydrating = !1; + if (!componentRoot) flushMounts(); + } + return ret; + } + function idiff(dom, vnode, context, mountAll, componentRoot) { + var out = dom, prevSvgMode = isSvgMode; + if (null == vnode) vnode = ''; + if ('string' == typeof vnode) { + if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) { + if (dom.nodeValue != vnode) dom.nodeValue = vnode; + } else { + out = document.createTextNode(vnode); + if (dom) { + if (dom.parentNode) dom.parentNode.replaceChild(out, dom); + recollectNodeTree(dom, !0); + } + } + out.__preactattr_ = !0; + return out; + } + if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll); + isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode; + if (!dom || !isNamedNode(dom, String(vnode.nodeName))) { + out = createNode(String(vnode.nodeName), isSvgMode); + if (dom) { + while (dom.firstChild) out.appendChild(dom.firstChild); + if (dom.parentNode) dom.parentNode.replaceChild(out, dom); + recollectNodeTree(dom, !0); + } + } + var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children; + if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) { + if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0]; + } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML); + diffAttributes(out, vnode.attributes, props); + isSvgMode = prevSvgMode; + return out; + } + function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) { + var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0; + if (0 !== len) for (var i = 0; i < len; i++) { + var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null; + if (null != key) { + keyedLen++; + keyed[key] = _child; + } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child; + } + if (0 !== vlen) for (var i = 0; i < vlen; i++) { + vchild = vchildren[i]; + child = null; + var key = vchild.key; + if (null != key) { + if (keyedLen && void 0 !== keyed[key]) { + child = keyed[key]; + keyed[key] = void 0; + keyedLen--; + } + } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) { + child = c; + children[j] = void 0; + if (j === childrenLen - 1) childrenLen--; + if (j === min) min++; + break; + } + child = idiff(child, vchild, context, mountAll); + if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null); + } + if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1); + while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1); + } + function recollectNodeTree(node, unmountOnly) { + var component = node._component; + if (component) unmountComponent(component); else { + if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null); + if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node); + removeChildren(node); + } + } + function removeChildren(node) { + node = node.lastChild; + while (node) { + var next = node.previousSibling; + recollectNodeTree(node, !0); + node = next; + } + } + function diffAttributes(dom, attrs, old) { + var name; + for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode); + for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode); + } + function collectComponent(component) { + var name = component.constructor.name; + (components[name] || (components[name] = [])).push(component); + } + function createComponent(Ctor, props, context) { + var inst, list = components[Ctor.name]; + if (Ctor.prototype && Ctor.prototype.render) { + inst = new Ctor(props, context); + Component.call(inst, props, context); + } else { + inst = new Component(props, context); + inst.constructor = Ctor; + inst.render = doRender; + } + if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) { + inst.__b = list[i].__b; + list.splice(i, 1); + break; + } + return inst; + } + function doRender(props, state, context) { + return this.constructor(props, context); + } + function setComponentProps(component, props, opts, context, mountAll) { + if (!component.__x) { + component.__x = !0; + if (component.__r = props.ref) delete props.ref; + if (component.__k = props.key) delete props.key; + if (!component.base || mountAll) { + if (component.componentWillMount) component.componentWillMount(); + } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context); + if (context && context !== component.context) { + if (!component.__c) component.__c = component.context; + component.context = context; + } + if (!component.__p) component.__p = component.props; + component.props = props; + component.__x = !1; + if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component); + if (component.__r) component.__r(component); + } + } + function renderComponent(component, opts, mountAll, isChild) { + if (!component.__x) { + var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1; + if (isUpdate) { + component.props = previousProps; + component.state = previousState; + component.context = previousContext; + if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context); + component.props = props; + component.state = state; + component.context = context; + } + component.__p = component.__s = component.__c = component.__b = null; + component.__d = !1; + if (!skip) { + rendered = component.render(props, state, context); + if (component.getChildContext) context = extend(extend({}, context), component.getChildContext()); + var toUnmount, base, childComponent = rendered && rendered.nodeName; + if ('function' == typeof childComponent) { + var childProps = getNodeProps(rendered); + inst = initialChildComponent; + if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else { + toUnmount = inst; + component._component = inst = createComponent(childComponent, childProps, context); + inst.__b = inst.__b || nextBase; + inst.__u = component; + setComponentProps(inst, childProps, 0, context, !1); + renderComponent(inst, 1, mountAll, !0); + } + base = inst.base; + } else { + cbase = initialBase; + toUnmount = initialChildComponent; + if (toUnmount) cbase = component._component = null; + if (initialBase || 1 === opts) { + if (cbase) cbase._component = null; + base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0); + } + } + if (initialBase && base !== initialBase && inst !== initialChildComponent) { + var baseParent = initialBase.parentNode; + if (baseParent && base !== baseParent) { + baseParent.replaceChild(base, initialBase); + if (!toUnmount) { + initialBase._component = null; + recollectNodeTree(initialBase, !1); + } + } + } + if (toUnmount) unmountComponent(toUnmount); + component.base = base; + if (base && !isChild) { + var componentRef = component, t = component; + while (t = t.__u) (componentRef = t).base = base; + base._component = componentRef; + base._componentConstructor = componentRef.constructor; + } + } + if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) { + flushMounts(); + if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext); + if (options.afterUpdate) options.afterUpdate(component); + } + if (null != component.__h) while (component.__h.length) component.__h.pop().call(component); + if (!diffLevel && !isChild) flushMounts(); + } + } + function buildComponentFromVNode(dom, vnode, context, mountAll) { + var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode); + while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName; + if (c && isOwner && (!mountAll || c._component)) { + setComponentProps(c, props, 3, context, mountAll); + dom = c.base; + } else { + if (originalComponent && !isDirectOwner) { + unmountComponent(originalComponent); + dom = oldDom = null; + } + c = createComponent(vnode.nodeName, props, context); + if (dom && !c.__b) { + c.__b = dom; + oldDom = null; + } + setComponentProps(c, props, 1, context, mountAll); + dom = c.base; + if (oldDom && dom !== oldDom) { + oldDom._component = null; + recollectNodeTree(oldDom, !1); + } + } + return dom; + } + function unmountComponent(component) { + if (options.beforeUnmount) options.beforeUnmount(component); + var base = component.base; + component.__x = !0; + if (component.componentWillUnmount) component.componentWillUnmount(); + component.base = null; + var inner = component._component; + if (inner) unmountComponent(inner); else if (base) { + if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null); + component.__b = base; + removeNode(base); + collectComponent(component); + removeChildren(base); + } + if (component.__r) component.__r(null); + } + function Component(props, context) { + this.__d = !0; + this.context = context; + this.props = props; + this.state = this.state || {}; + } + function render(vnode, parent, merge) { + return diff(merge, vnode, {}, !1, parent, !1); + } + var options = {}; + var stack = []; + var EMPTY_CHILDREN = []; + var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i; + var items = []; + var mounts = []; + var diffLevel = 0; + var isSvgMode = !1; + var hydrating = !1; + var components = {}; + extend(Component.prototype, { + setState: function(state, callback) { + var s = this.state; + if (!this.__s) this.__s = extend({}, s); + extend(s, 'function' == typeof state ? state(s, this.props) : state); + if (callback) (this.__h = this.__h || []).push(callback); + enqueueRender(this); + }, + forceUpdate: function(callback) { + if (callback) (this.__h = this.__h || []).push(callback); + renderComponent(this, 2); + }, + render: function() {} + }); + var preact = { + h: h, + createElement: h, + cloneElement: cloneElement, + Component: Component, + render: render, + rerender: rerender, + options: options + }; + if (true) module.exports = preact; else self.preact = preact; +}(); +//# sourceMappingURL=preact.js.map + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + warning = function(condition, format, args) { + var len = arguments.length; + args = new Array(len > 2 ? len - 2 : 0); + for (var key = 2; key < len; key++) { + args[key - 2] = arguments[key]; + } + if (format === undefined) { + throw new Error( + '`warning(condition, format, ...args)` requires a warning ' + + 'message argument' + ); + } + + if (format.length < 10 || (/^[s\W]*$/).test(format)) { + throw new Error( + 'The warning format should be able to uniquely identify this ' + + 'warning. Please, use a more descriptive format than: ' + format + ); + } + + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + + format.replace(/%s/g, function() { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch(x) {} + } + }; +} + +module.exports = warning; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) + +/***/ }), +/* 6 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__(24); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserRouter", function() { return __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__(41); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "HashRouter", function() { return __WEBPACK_IMPORTED_MODULE_1__HashRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__(20); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return __WEBPACK_IMPORTED_MODULE_2__Link__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__(43); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__(44); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return __WEBPACK_IMPORTED_MODULE_4__NavLink__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__(45); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_5__Prompt__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(46); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_6__Redirect__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(47); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_7__Route__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Router__ = __webpack_require__(48); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_8__Router__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__(49); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_9__StaticRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__(50); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_10__Switch__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__(51); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_11__matchPath__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__(52); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_12__withRouter__["a"]; }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) { + return path.charAt(0) === '/' ? path : '/' + path; +}; + +var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) { + return path.charAt(0) === '/' ? path.substr(1) : path; +}; + +var hasBasename = exports.hasBasename = function hasBasename(path, prefix) { + return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); +}; + +var stripBasename = exports.stripBasename = function stripBasename(path, prefix) { + return hasBasename(path, prefix) ? path.substr(prefix.length) : path; +}; + +var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) { + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; +}; + +var parsePath = exports.parsePath = function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + + var hashIndex = pathname.indexOf('#'); + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; +}; + +var createPath = exports.createPath = function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + + + var path = pathname || '/'; + + if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search; + + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash; + + return path; +}; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var invariant = function(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; + +module.exports = invariant; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var isIphone = !!navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i); +var isIpad = !!navigator.userAgent.match(/iPad/i); +var isAndroid = !!navigator.userAgent.match(/Android/i); +var isMobile = isIphone || isIpad || isAndroid; +var isDesktop = !isMobile; + +document.body.classList.add(isDesktop ? 'desktop' : 'mobile'); + +function randint(n) { + return Math.random() * n | 0; +} +function randrange(a, b) { + return Math.random() * (b - a) + a | 0; +} +function choice(a) { + return a[randint(a.length)]; +} + +exports.isIphone = isIphone; +exports.isIpad = isIpad; +exports.isAndroid = isAndroid; +exports.isMobile = isMobile; +exports.isDesktop = isDesktop; +exports.randint = randint; +exports.randrange = randrange; +exports.choice = choice; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; +}; + +module.exports = emptyFunction; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var validateFormat = function validateFormat(format) {}; + +if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +module.exports = invariant; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.locationsAreEqual = exports.createLocation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _resolvePathname = __webpack_require__(29); + +var _resolvePathname2 = _interopRequireDefault(_resolvePathname); + +var _valueEqual = __webpack_require__(30); + +var _valueEqual2 = _interopRequireDefault(_valueEqual); + +var _PathUtils = __webpack_require__(7); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) { + var location = void 0; + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = (0, _PathUtils.parsePath)(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); + + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; +}; + +var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state); +}; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _warning = __webpack_require__(5); + +var _warning2 = _interopRequireDefault(_warning); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var createTransitionManager = function createTransitionManager() { + var prompt = null; + + var setPrompt = function setPrompt(nextPrompt) { + (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time'); + + prompt = nextPrompt; + + return function () { + if (prompt === nextPrompt) prompt = null; + }; + }; + + var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + }; + + var listeners = []; + + var appendListener = function appendListener(fn) { + var isActive = true; + + var listener = function listener() { + if (isActive) fn.apply(undefined, arguments); + }; + + listeners.push(listener); + + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + }; + + var notifyListeners = function notifyListeners() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(undefined, args); + }); + }; + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; +}; + +exports.default = createTransitionManager; + +/***/ }), +/* 15 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +/** + * The public API for putting history on context. + */ + +var Router = function (_React$Component) { + _inherits(Router, _React$Component); + + function Router() { + var _temp, _this, _ret; + + _classCallCheck(this, Router); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { + match: _this.computeMatch(_this.props.history.location.pathname) + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + Router.prototype.getChildContext = function getChildContext() { + return { + router: _extends({}, this.context.router, { + history: this.props.history, + route: { + location: this.props.history.location, + match: this.state.match + } + }) + }; + }; + + Router.prototype.computeMatch = function computeMatch(pathname) { + return { + path: '/', + url: '/', + params: {}, + isExact: pathname === '/' + }; + }; + + Router.prototype.componentWillMount = function componentWillMount() { + var _this2 = this; + + var _props = this.props, + children = _props.children, + history = _props.history; + + + __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(children == null || __WEBPACK_IMPORTED_MODULE_2_react__["a" /* default */].Children.count(children) === 1, 'A may have only one child element'); + + // Do this here so we can setState when a changes the + // location in componentWillMount. This happens e.g. when doing + // server rendering using a . + this.unlisten = history.listen(function () { + _this2.setState({ + match: _this2.computeMatch(history.location.pathname) + }); + }); + }; + + Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(this.props.history === nextProps.history, 'You cannot change '); + }; + + Router.prototype.componentWillUnmount = function componentWillUnmount() { + this.unlisten(); + }; + + Router.prototype.render = function render() { + var children = this.props.children; + + return children ? __WEBPACK_IMPORTED_MODULE_2_react__["a" /* default */].Children.only(children) : null; + }; + + return Router; +}(__WEBPACK_IMPORTED_MODULE_2_react__["a" /* default */].Component); + +Router.propTypes = { + history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, + children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node +}; +Router.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object +}; +Router.childContextTypes = { + router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired +}; + + +/* harmony default export */ __webpack_exports__["a"] = (Router); + +/***/ }), +/* 16 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(35); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__); + + +var patternCache = {}; +var cacheLimit = 10000; +var cacheCount = 0; + +var compilePath = function compilePath(pattern, options) { + var cacheKey = '' + options.end + options.strict; + var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {}); + + if (cache[pattern]) return cache[pattern]; + + var keys = []; + var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a(pattern, keys, options); + var compiledPattern = { re: re, keys: keys }; + + if (cacheCount < cacheLimit) { + cache[pattern] = compiledPattern; + cacheCount++; + } + + return compiledPattern; +}; + +/** + * Public API for matching a URL pathname to a path pattern. + */ +var matchPath = function matchPath(pathname) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (typeof options === 'string') options = { path: options }; + + var _options = options, + _options$path = _options.path, + path = _options$path === undefined ? '/' : _options$path, + _options$exact = _options.exact, + exact = _options$exact === undefined ? false : _options$exact, + _options$strict = _options.strict, + strict = _options$strict === undefined ? false : _options$strict; + + var _compilePath = compilePath(path, { end: exact, strict: strict }), + re = _compilePath.re, + keys = _compilePath.keys; + + var match = re.exec(pathname); + + if (!match) return null; + + var url = match[0], + values = match.slice(1); + + var isExact = pathname === url; + + if (exact && !isExact) return null; + + return { + path: path, // the path pattern used to match + url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL + isExact: isExact, // whether or not we matched exactly + params: keys.reduce(function (memo, key, index) { + memo[key.name] = values[index]; + return memo; + }, {}) + }; +}; + +/* harmony default export */ __webpack_exports__["a"] = (matchPath); + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var emptyFunction = __webpack_require__(10); + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + (function () { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + })(); +} + +module.exports = warning; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) { + return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener); +}; + +var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) { + return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener); +}; + +var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) { + return callback(window.confirm(message)); +}; // eslint-disable-line no-alert + +/** + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 + */ +var supportsHistory = exports.supportsHistory = function supportsHistory() { + var ua = window.navigator.userAgent; + + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; + + return window.history && 'pushState' in window.history; +}; + +/** + * Returns true if browser fires popstate on hash change. + * IE10 and IE11 do not. + */ +var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() { + return window.navigator.userAgent.indexOf('Trident') === -1; +}; + +/** + * Returns false if using go(n) with hash history causes a full page reload. + */ +var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() { + return window.navigator.userAgent.indexOf('Firefox') === -1; +}; + +/** + * Returns true if a given popstate event is an extraneous WebKit event. + * Accounts for the fact that Chrome on iOS fires real popstate events + * containing undefined state when pressing the back button. + */ +var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { + return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; +}; + +/***/ }), +/* 19 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(16); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +/** + * The public API for matching a single path and rendering. + */ + +var Route = function (_React$Component) { + _inherits(Route, _React$Component); + + function Route() { + var _temp, _this, _ret; + + _classCallCheck(this, Route); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { + match: _this.computeMatch(_this.props, _this.context.router) + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + Route.prototype.getChildContext = function getChildContext() { + return { + router: _extends({}, this.context.router, { + route: { + location: this.props.location || this.context.router.route.location, + match: this.state.match + } + }) + }; + }; + + Route.prototype.computeMatch = function computeMatch(_ref, _ref2) { + var computedMatch = _ref.computedMatch, + location = _ref.location, + path = _ref.path, + strict = _ref.strict, + exact = _ref.exact; + var route = _ref2.route; + + if (computedMatch) return computedMatch; // already computed the match for us + + var pathname = (location || route.location).pathname; + + return path ? __WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */](pathname, { path: path, strict: strict, exact: exact }) : route.match; + }; + + Route.prototype.componentWillMount = function componentWillMount() { + var _props = this.props, + component = _props.component, + render = _props.render, + children = _props.children; + + + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(component && render), 'You should not use and in the same route; will be ignored'); + + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(component && children), 'You should not use and in the same route; will be ignored'); + + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(render && children), 'You should not use and in the same route; will be ignored'); + }; + + Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) { + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + + this.setState({ + match: this.computeMatch(nextProps, nextContext.router) + }); + }; + + Route.prototype.render = function render() { + var match = this.state.match; + var _props2 = this.props, + children = _props2.children, + component = _props2.component, + render = _props2.render; + var _context$router = this.context.router, + history = _context$router.history, + route = _context$router.route, + staticContext = _context$router.staticContext; + + var location = this.props.location || route.location; + var props = { match: match, location: location, history: history, staticContext: staticContext }; + + return component ? // component prop gets first priority, only called if there's a match + match ? __WEBPACK_IMPORTED_MODULE_1_react__["a" /* default */].createElement(component, props) : null : render ? // render prop is next, only called if there's a match + match ? render(props) : null : children ? // children come last, always called + typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array + __WEBPACK_IMPORTED_MODULE_1_react__["a" /* default */].Children.only(children) : null : null; + }; + + return Route; +}(__WEBPACK_IMPORTED_MODULE_1_react__["a" /* default */].Component); + +Route.propTypes = { + computedMatch: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object, // private, from + path: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, + exact: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, + strict: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, + component: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, + render: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, + children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node]), + location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object +}; +Route.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, + route: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, + staticContext: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object + }) +}; +Route.childContextTypes = { + router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired +}; + + +/* harmony default export */ __webpack_exports__["a"] = (Route); + +/***/ }), +/* 20 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + +var isModifiedEvent = function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); +}; + +/** + * The public API for rendering a history-aware . + */ + +var Link = function (_React$Component) { + _inherits(Link, _React$Component); + + function Link() { + var _temp, _this, _ret; + + _classCallCheck(this, Link); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) { + if (_this.props.onClick) _this.props.onClick(event); + + if (!event.defaultPrevented && // onClick prevented default + event.button === 0 && // ignore right clicks + !_this.props.target && // let browser handle "target=_blank" etc. + !isModifiedEvent(event) // ignore clicks with modifier keys + ) { + event.preventDefault(); + + var history = _this.context.router.history; + var _this$props = _this.props, + replace = _this$props.replace, + to = _this$props.to; + + + if (replace) { + history.replace(to); + } else { + history.push(to); + } + } + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + Link.prototype.render = function render() { + var _props = this.props, + replace = _props.replace, + to = _props.to, + props = _objectWithoutProperties(_props, ['replace', 'to']); // eslint-disable-line no-unused-vars + + var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to); + + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement('a', _extends({}, props, { onClick: this.handleClick, href: href })); + }; + + return Link; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +Link.propTypes = { + onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired +}; +Link.defaultProps = { + replace: false +}; +Link.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired + }).isRequired + }).isRequired +}; + + +/* harmony default export */ __webpack_exports__["a"] = (Link); + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _preact = __webpack_require__(4); + +var _App = __webpack_require__(22); + +var _App2 = _interopRequireDefault(_App); + +var _reactRouterDom = __webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var app = (0, _preact.h)( + _reactRouterDom.BrowserRouter, + null, + (0, _preact.h)(_App2.default, null) +); + +(0, _preact.render)(app, document.getElementById('container')); + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _preact = __webpack_require__(4); + +var _util = __webpack_require__(9); + +var _db = __webpack_require__(23); + +var _db2 = _interopRequireDefault(_db); + +var _reactRouterDom = __webpack_require__(6); + +var _Header = __webpack_require__(53); + +var _Header2 = _interopRequireDefault(_Header); + +var _Paintings = __webpack_require__(54); + +var _Paintings2 = _interopRequireDefault(_Paintings); + +var _Details = __webpack_require__(55); + +var _Details2 = _interopRequireDefault(_Details); + +var _Modal = __webpack_require__(56); + +var _Modal2 = _interopRequireDefault(_Modal); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var App = function (_Component) { + _inherits(App, _Component); + + function App(props) { + _classCallCheck(this, App); + + var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this)); + + _this.state = { + data: _db2.default.backupDB, + painting: null + }; + _db2.default.fetch(function (data) { + document.body.parentNode.classList.remove('loading'); + _this.setState({ data: data }); + }); + return _this; + } + + _createClass(App, [{ + key: 'setIdFromLocation', + value: function setIdFromLocation(props) { + var id = props.location.pathname.split('/')[2]; + if (id) { + this.setState({ painting: id }); + } + } + }, { + key: 'componentWillMount', + value: function componentWillMount() { + this.setIdFromLocation(this.props); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(props) { + this.setIdFromLocation(props); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var painting = void 0; + this.state.data.painting.some(function (el) { + if (el.id == _this2.state.painting) { + painting = el; + return true; + } + return false; + }); + return (0, _preact.h)( + 'div', + null, + (0, _preact.h)(_Header2.default, { location: this.props.location }), + (0, _preact.h)(_Paintings2.default, { data: this.state.data }), + (0, _preact.h)( + _Modal2.default, + { visible: this.props.location.pathname !== '/' }, + (0, _preact.h)(_Details2.default, { painting: painting }) + ) + ); + } + }]); + + return App; +}(_preact.Component); + +exports.default = (0, _reactRouterDom.withRouter)(App); + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +function fetchDB(cb) { + var raw_db = void 0; + var url = void 0; + if (window.location.origin.match('paintings.asdf.us')) { + url = '/db.json'; + } else { + url = '/paintings/db.json'; + } + fetch(url, { + method: 'GET' + }).then(function (res) { + if (res.status !== 200) { + return null; + } + return res.json(); + }).then(function (json) { + if (json) { + raw_db = parse(json); + } + cb(raw_db); + }).catch(function (err) { + console.warn(err); + }); +} + +function parse(db) { + Object.keys(db).forEach(function (key) { + db[key] = db[key].filter(function (el) { + return !el.disabled; + }).sort(function (a, b) { + return a.__index < b.__index ? -1 : a.__index === b.__index ? 0 : 1; + }); + }); + return db; +} + +var backupDB = { + painting: [], + page: [{ image: { uri: 'about:blank' } }] +}; + +exports.default = { fetch: fetchDB, backupDB: backupDB }; + +/***/ }), +/* 24 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__ = __webpack_require__(28); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(2); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +/** + * The public API for a that uses HTML5 history. + */ + +var BrowserRouter = function (_React$Component) { + _inherits(BrowserRouter, _React$Component); + + function BrowserRouter() { + var _temp, _this, _ret; + + _classCallCheck(this, BrowserRouter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + } + + BrowserRouter.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["e" /* Router */], { history: this.history, children: this.props.children }); + }; + + return BrowserRouter; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +BrowserRouter.propTypes = { + basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + forceRefresh: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + + +/* harmony default export */ __webpack_exports__["a"] = (BrowserRouter); + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +var emptyFunction = __webpack_require__(10); +var invariant = __webpack_require__(11); +var warning = __webpack_require__(17); + +var ReactPropTypesSecret = __webpack_require__(12); +var checkPropTypes = __webpack_require__(26); + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +if (process.env.NODE_ENV !== 'production') { + var invariant = __webpack_require__(11); + var warning = __webpack_require__(17); + var ReactPropTypesSecret = __webpack_require__(12); + var loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +var emptyFunction = __webpack_require__(10); +var invariant = __webpack_require__(11); +var ReactPropTypesSecret = __webpack_require__(12); + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _warning = __webpack_require__(5); + +var _warning2 = _interopRequireDefault(_warning); + +var _invariant = __webpack_require__(8); + +var _invariant2 = _interopRequireDefault(_invariant); + +var _LocationUtils = __webpack_require__(13); + +var _PathUtils = __webpack_require__(7); + +var _createTransitionManager = __webpack_require__(14); + +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + +var _DOMUtils = __webpack_require__(18); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var PopStateEvent = 'popstate'; +var HashChangeEvent = 'hashchange'; + +var getHistoryState = function getHistoryState() { + try { + return window.history.state || {}; + } catch (e) { + // IE 11 sometimes throws when accessing window.history.state + // See https://github.com/ReactTraining/history/pull/289 + return {}; + } +}; + +/** + * Creates a history object that uses the HTML5 history API including + * pushState, replaceState, and the popstate event. + */ +var createBrowserHistory = function createBrowserHistory() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM'); + + var globalHistory = window.history; + var canUseHistory = (0, _DOMUtils.supportsHistory)(); + var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)(); + + var _props$forceRefresh = props.forceRefresh, + forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh, + _props$getUserConfirm = props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, + _props$keyLength = props.keyLength, + keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; + + var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; + + var getDOMLocation = function getDOMLocation(historyState) { + var _ref = historyState || {}, + key = _ref.key, + state = _ref.state; + + var _window$location = window.location, + pathname = _window$location.pathname, + search = _window$location.search, + hash = _window$location.hash; + + + var path = pathname + search + hash; + + (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + + if (basename) path = (0, _PathUtils.stripBasename)(path, basename); + + return (0, _LocationUtils.createLocation)(path, state, key); + }; + + var createKey = function createKey() { + return Math.random().toString(36).substr(2, keyLength); + }; + + var transitionManager = (0, _createTransitionManager2.default)(); + + var setState = function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + + transitionManager.notifyListeners(history.location, history.action); + }; + + var handlePopState = function handlePopState(event) { + // Ignore extraneous popstate events in WebKit. + if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return; + + handlePop(getDOMLocation(event.state)); + }; + + var handleHashChange = function handleHashChange() { + handlePop(getDOMLocation(getHistoryState())); + }; + + var forceNextPop = false; + + var handlePop = function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ action: action, location: location }); + } else { + revertPop(location); + } + }); + } + }; + + var revertPop = function revertPop(fromLocation) { + var toLocation = history.location; + + // TODO: We could probably make this more reliable by + // keeping a list of keys we've seen in sessionStorage. + // Instead, we just default to 0 for keys we don't know. + + var toIndex = allKeys.indexOf(toLocation.key); + + if (toIndex === -1) toIndex = 0; + + var fromIndex = allKeys.indexOf(fromLocation.key); + + if (fromIndex === -1) fromIndex = 0; + + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + }; + + var initialLocation = getDOMLocation(getHistoryState()); + var allKeys = [initialLocation.key]; + + // Public interface + + var createHref = function createHref(location) { + return basename + (0, _PathUtils.createPath)(location); + }; + + var push = function push(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + + var action = 'PUSH'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + + var href = createHref(location); + var key = location.key, + state = location.state; + + + if (canUseHistory) { + globalHistory.pushState({ key: key, state: state }, null, href); + + if (forceRefresh) { + window.location.href = href; + } else { + var prevIndex = allKeys.indexOf(history.location.key); + var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + + nextKeys.push(location.key); + allKeys = nextKeys; + + setState({ action: action, location: location }); + } + } else { + (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); + + window.location.href = href; + } + }); + }; + + var replace = function replace(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + + var action = 'REPLACE'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + + var href = createHref(location); + var key = location.key, + state = location.state; + + + if (canUseHistory) { + globalHistory.replaceState({ key: key, state: state }, null, href); + + if (forceRefresh) { + window.location.replace(href); + } else { + var prevIndex = allKeys.indexOf(history.location.key); + + if (prevIndex !== -1) allKeys[prevIndex] = location.key; + + setState({ action: action, location: location }); + } + } else { + (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); + + window.location.replace(href); + } + }); + }; + + var go = function go(n) { + globalHistory.go(n); + }; + + var goBack = function goBack() { + return go(-1); + }; + + var goForward = function goForward() { + return go(1); + }; + + var listenerCount = 0; + + var checkDOMListeners = function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1) { + (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState); + + if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState); + + if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); + } + }; + + var isBlocked = false; + + var block = function block() { + var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + }; + + var listen = function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + + return function () { + checkDOMListeners(-1); + unlisten(); + }; + }; + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + + return history; +}; + +exports.default = createBrowserHistory; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsolute = function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; +}; + +// About 1.5x faster than the two-arg version of Array#splice() +var spliceOne = function spliceOne(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) { + list[i] = list[k]; + }list.pop(); +}; + +// This implementation is based heavily on node's url.parse +var resolvePathname = function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; +}; + +module.exports = resolvePathname; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var valueEqual = function valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; +}; + +exports.default = valueEqual; + +/***/ }), +/* 31 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__ = __webpack_require__(32); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Router__ = __webpack_require__(15); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +/** + * The public API for a that stores location in memory. + */ + +var MemoryRouter = function (_React$Component) { + _inherits(MemoryRouter, _React$Component); + + function MemoryRouter() { + var _temp, _this, _ret; + + _classCallCheck(this, MemoryRouter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + } + + MemoryRouter.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_3__Router__["a" /* default */], { history: this.history, children: this.props.children }); + }; + + return MemoryRouter; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +MemoryRouter.propTypes = { + initialEntries: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array, + initialIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + + +/* harmony default export */ __webpack_exports__["a"] = (MemoryRouter); + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _warning = __webpack_require__(5); + +var _warning2 = _interopRequireDefault(_warning); + +var _PathUtils = __webpack_require__(7); + +var _LocationUtils = __webpack_require__(13); + +var _createTransitionManager = __webpack_require__(14); + +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var clamp = function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); +}; + +/** + * Creates a history object that stores locations in memory. + */ +var createMemoryHistory = function createMemoryHistory() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var getUserConfirmation = props.getUserConfirmation, + _props$initialEntries = props.initialEntries, + initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries, + _props$initialIndex = props.initialIndex, + initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex, + _props$keyLength = props.keyLength, + keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; + + + var transitionManager = (0, _createTransitionManager2.default)(); + + var setState = function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + + transitionManager.notifyListeners(history.location, history.action); + }; + + var createKey = function createKey() { + return Math.random().toString(36).substr(2, keyLength); + }; + + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey()); + }); + + // Public interface + + var createHref = _PathUtils.createPath; + + var push = function push(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + + var action = 'PUSH'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + + var nextEntries = history.entries.slice(0); + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + }; + + var replace = function replace(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + + var action = 'REPLACE'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + + history.entries[history.index] = location; + + setState({ action: action, location: location }); + }); + }; + + var go = function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + + var action = 'POP'; + var location = history.entries[nextIndex]; + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + }; + + var goBack = function goBack() { + return go(-1); + }; + + var goForward = function goForward() { + return go(1); + }; + + var canGo = function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + }; + + var block = function block() { + var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + return transitionManager.setPrompt(prompt); + }; + + var listen = function listen(listener) { + return transitionManager.appendListener(listener); + }; + + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; + + return history; +}; + +exports.default = createMemoryHistory; + +/***/ }), +/* 33 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + +/** + * The public API for prompting the user before navigating away + * from a screen with a component. + */ + +var Prompt = function (_React$Component) { + _inherits(Prompt, _React$Component); + + function Prompt() { + _classCallCheck(this, Prompt); + + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + + Prompt.prototype.enable = function enable(message) { + if (this.unblock) this.unblock(); + + this.unblock = this.context.router.history.block(message); + }; + + Prompt.prototype.disable = function disable() { + if (this.unblock) { + this.unblock(); + this.unblock = null; + } + }; + + Prompt.prototype.componentWillMount = function componentWillMount() { + if (this.props.when) this.enable(this.props.message); + }; + + Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (nextProps.when) { + if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message); + } else { + this.disable(); + } + }; + + Prompt.prototype.componentWillUnmount = function componentWillUnmount() { + this.disable(); + }; + + Prompt.prototype.render = function render() { + return null; + }; + + return Prompt; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +Prompt.propTypes = { + when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired +}; +Prompt.defaultProps = { + when: true +}; +Prompt.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired + }).isRequired + }).isRequired +}; + + +/* harmony default export */ __webpack_exports__["a"] = (Prompt); + +/***/ }), +/* 34 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + +/** + * The public API for updating the location programatically + * with a component. + */ + +var Redirect = function (_React$Component) { + _inherits(Redirect, _React$Component); + + function Redirect() { + _classCallCheck(this, Redirect); + + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + + Redirect.prototype.isStatic = function isStatic() { + return this.context.router && this.context.router.staticContext; + }; + + Redirect.prototype.componentWillMount = function componentWillMount() { + if (this.isStatic()) this.perform(); + }; + + Redirect.prototype.componentDidMount = function componentDidMount() { + if (!this.isStatic()) this.perform(); + }; + + Redirect.prototype.perform = function perform() { + var history = this.context.router.history; + var _props = this.props, + push = _props.push, + to = _props.to; + + + if (push) { + history.push(to); + } else { + history.replace(to); + } + }; + + Redirect.prototype.render = function render() { + return null; + }; + + return Redirect; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +Redirect.propTypes = { + push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]) +}; +Redirect.defaultProps = { + push: false +}; +Redirect.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired + }).isRequired, + staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object + }).isRequired +}; + + +/* harmony default export */ __webpack_exports__["a"] = (Redirect); + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var isarray = __webpack_require__(36) + +/** + * Expose `pathToRegexp`. + */ +module.exports = pathToRegexp +module.exports.parse = parse +module.exports.compile = compile +module.exports.tokensToFunction = tokensToFunction +module.exports.tokensToRegExp = tokensToRegExp + +/** + * The main path matching regexp utility. + * + * @type {RegExp} + */ +var PATH_REGEXP = new RegExp([ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' +].join('|'), 'g') + +/** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ +function parse (str, options) { + var tokens = [] + var key = 0 + var index = 0 + var path = '' + var defaultDelimiter = options && options.delimiter || '/' + var res + + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0] + var escaped = res[1] + var offset = res.index + path += str.slice(index, offset) + index = offset + m.length + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1] + continue + } + + var next = str[index] + var prefix = res[2] + var name = res[3] + var capture = res[4] + var group = res[5] + var modifier = res[6] + var asterisk = res[7] + + // Push the current path onto the tokens. + if (path) { + tokens.push(path) + path = '' + } + + var partial = prefix != null && next != null && next !== prefix + var repeat = modifier === '+' || modifier === '*' + var optional = modifier === '?' || modifier === '*' + var delimiter = res[2] || defaultDelimiter + var pattern = capture || group + + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') + }) + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index) + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path) + } + + return tokens +} + +/** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ +function compile (str, options) { + return tokensToFunction(parse(str, options)) +} + +/** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ +function encodeURIComponentPretty (str) { + return encodeURI(str).replace(/[\/?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ +function encodeAsterisk (str) { + return encodeURI(str).replace(/[?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction (tokens) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length) + + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') + } + } + + return function (obj, opts) { + var path = '' + var data = obj || {} + var options = opts || {} + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] + + if (typeof token === 'string') { + path += token + + continue + } + + var value = data[token.name] + var segment + + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix + } + + continue + } else { + throw new TypeError('Expected "' + token.name + '" to be defined') + } + } + + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + } + + if (value.length === 0) { + if (token.optional) { + continue + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty') + } + } + + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]) + + if (!matches[i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + } + + path += (j === 0 ? token.prefix : token.delimiter) + segment + } + + continue + } + + segment = token.asterisk ? encodeAsterisk(value) : encode(value) + + if (!matches[i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + } + + path += token.prefix + segment + } + + return path + } +} + +/** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ +function escapeString (str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') +} + +/** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ +function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1') +} + +/** + * Attach the keys as a property of the regexp. + * + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ +function attachKeys (re, keys) { + re.keys = keys + return re +} + +/** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ +function flags (options) { + return options.sensitive ? '' : 'i' +} + +/** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ +function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g) + + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null + }) + } + } + + return attachKeys(path, keys) +} + +/** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function arrayToRegexp (path, keys, options) { + var parts = [] + + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source) + } + + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) + + return attachKeys(regexp, keys) +} + +/** + * Create a path regexp from string input. + * + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function stringToRegexp (path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options) +} + +/** + * Expose a function for taking tokens and returning a RegExp. + * + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function tokensToRegExp (tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options) + keys = [] + } + + options = options || {} + + var strict = options.strict + var end = options.end !== false + var route = '' + + // Iterate over the tokens and create our regexp string. + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] + + if (typeof token === 'string') { + route += escapeString(token) + } else { + var prefix = escapeString(token.prefix) + var capture = '(?:' + token.pattern + ')' + + keys.push(token) + + if (token.repeat) { + capture += '(?:' + prefix + capture + ')*' + } + + if (token.optional) { + if (!token.partial) { + capture = '(?:' + prefix + '(' + capture + '))?' + } else { + capture = prefix + '(' + capture + ')?' + } + } else { + capture = prefix + '(' + capture + ')' + } + + route += capture + } + } + + var delimiter = escapeString(options.delimiter || '/') + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' + } + + if (end) { + route += '$' + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' + } + + return attachKeys(new RegExp('^' + route, flags(options)), keys) +} + +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function pathToRegexp (path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options) + keys = [] + } + + options = options || {} + + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)) + } + + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + } + + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) +} + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + + +/***/ }), +/* 37 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_invariant__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(15); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + + +var normalizeLocation = function normalizeLocation(object) { + var _object$pathname = object.pathname, + pathname = _object$pathname === undefined ? '/' : _object$pathname, + _object$search = object.search, + search = _object$search === undefined ? '' : _object$search, + _object$hash = object.hash, + hash = _object$hash === undefined ? '' : _object$hash; + + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; +}; + +var addBasename = function addBasename(basename, location) { + if (!basename) return location; + + return _extends({}, location, { + pathname: __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](basename) + location.pathname + }); +}; + +var stripBasename = function stripBasename(basename, location) { + if (!basename) return location; + + var base = __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](basename); + + if (location.pathname.indexOf(base) !== 0) return location; + + return _extends({}, location, { + pathname: location.pathname.substr(base.length) + }); +}; + +var createLocation = function createLocation(location) { + return typeof location === 'string' ? __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["parsePath"](location) : normalizeLocation(location); +}; + +var createURL = function createURL(location) { + return typeof location === 'string' ? location : __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["createPath"](location); +}; + +var staticHandler = function staticHandler(methodName) { + return function () { + __WEBPACK_IMPORTED_MODULE_0_invariant___default.a(false, 'You cannot %s with ', methodName); + }; +}; + +var noop = function noop() {}; + +/** + * The public top-level API for a "static" , so-called because it + * can't actually change the current location. Instead, it just records + * location changes in a context object. Useful mainly in testing and + * server-rendering scenarios. + */ + +var StaticRouter = function (_React$Component) { + _inherits(StaticRouter, _React$Component); + + function StaticRouter() { + var _temp, _this, _ret; + + _classCallCheck(this, StaticRouter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) { + return __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](_this.props.basename + createURL(path)); + }, _this.handlePush = function (location) { + var _this$props = _this.props, + basename = _this$props.basename, + context = _this$props.context; + + context.action = 'PUSH'; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }, _this.handleReplace = function (location) { + var _this$props2 = _this.props, + basename = _this$props2.basename, + context = _this$props2.context; + + context.action = 'REPLACE'; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }, _this.handleListen = function () { + return noop; + }, _this.handleBlock = function () { + return noop; + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + StaticRouter.prototype.getChildContext = function getChildContext() { + return { + router: { + staticContext: this.props.context + } + }; + }; + + StaticRouter.prototype.render = function render() { + var _props = this.props, + basename = _props.basename, + context = _props.context, + location = _props.location, + props = _objectWithoutProperties(_props, ['basename', 'context', 'location']); + + var history = { + createHref: this.createHref, + action: 'POP', + location: stripBasename(basename, createLocation(location)), + push: this.handlePush, + replace: this.handleReplace, + go: staticHandler('go'), + goBack: staticHandler('goBack'), + goForward: staticHandler('goForward'), + listen: this.handleListen, + block: this.handleBlock + }; + + return __WEBPACK_IMPORTED_MODULE_1_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], _extends({}, props, { history: history })); + }; + + return StaticRouter; +}(__WEBPACK_IMPORTED_MODULE_1_react__["a" /* default */].Component); + +StaticRouter.propTypes = { + basename: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, + context: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, + location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object]) +}; +StaticRouter.defaultProps = { + basename: '', + location: '/' +}; +StaticRouter.childContextTypes = { + router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired +}; + + +/* harmony default export */ __webpack_exports__["a"] = (StaticRouter); + +/***/ }), +/* 38 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(16); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +/** + * The public API for rendering the first that matches. + */ + +var Switch = function (_React$Component) { + _inherits(Switch, _React$Component); + + function Switch() { + _classCallCheck(this, Switch); + + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + + Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + __WEBPACK_IMPORTED_MODULE_2_warning___default.a(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + + __WEBPACK_IMPORTED_MODULE_2_warning___default.a(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; + + Switch.prototype.render = function render() { + var route = this.context.router.route; + var children = this.props.children; + + var location = this.props.location || route.location; + + var match = void 0, + child = void 0; + __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Children.forEach(children, function (element) { + if (!__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].isValidElement(element)) return; + + var _element$props = element.props, + pathProp = _element$props.path, + exact = _element$props.exact, + strict = _element$props.strict, + from = _element$props.from; + + var path = pathProp || from; + + if (match == null) { + child = element; + match = path ? __WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */](location.pathname, { path: path, exact: exact, strict: strict }) : route.match; + } + }); + + return match ? __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].cloneElement(child, { location: location, computedMatch: match }) : null; + }; + + return Switch; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +Switch.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired + }).isRequired +}; +Switch.propTypes = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + + +/* harmony default export */ __webpack_exports__["a"] = (Switch); + +/***/ }), +/* 39 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(19); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + + + + +/** + * A public higher-order component to access the imperative API + */ +var withRouter = function withRouter(Component) { + var C = function C(props) { + var wrappedComponentRef = props.wrappedComponentRef, + remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']); + + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" /* default */], { render: function render(routeComponentProps) { + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef })); + } }); + }; + + C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')'; + C.WrappedComponent = Component; + C.propTypes = { + wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func + }; + + return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default.a(C, Component); +}; + +/* harmony default export */ __webpack_exports__["a"] = (withRouter); + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + + +var REACT_STATICS = { + childContextTypes: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + arguments: true, + arity: true +}; + +var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function'; + +module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) { + if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components + var keys = Object.getOwnPropertyNames(sourceComponent); + + /* istanbul ignore else */ + if (isGetOwnPropertySymbolsAvailable) { + keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent)); + } + + for (var i = 0; i < keys.length; ++i) { + if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) { + try { + targetComponent[keys[i]] = sourceComponent[keys[i]]; + } catch (error) { + + } + } + } + } + + return targetComponent; +}; + + +/***/ }), +/* 41 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__ = __webpack_require__(42); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(2); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + +/** + * The public API for a that uses window.location.hash. + */ + +var HashRouter = function (_React$Component) { + _inherits(HashRouter, _React$Component); + + function HashRouter() { + var _temp, _this, _ret; + + _classCallCheck(this, HashRouter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + } + + HashRouter.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["e" /* Router */], { history: this.history, children: this.props.children }); + }; + + return HashRouter; +}(__WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].Component); + +HashRouter.propTypes = { + basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + hashType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hashbang', 'noslash', 'slash']), + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + + +/* harmony default export */ __webpack_exports__["a"] = (HashRouter); + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _warning = __webpack_require__(5); + +var _warning2 = _interopRequireDefault(_warning); + +var _invariant = __webpack_require__(8); + +var _invariant2 = _interopRequireDefault(_invariant); + +var _LocationUtils = __webpack_require__(13); + +var _PathUtils = __webpack_require__(7); + +var _createTransitionManager = __webpack_require__(14); + +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + +var _DOMUtils = __webpack_require__(18); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var HashChangeEvent = 'hashchange'; + +var HashPathCoders = { + hashbang: { + encodePath: function encodePath(path) { + return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path); + }, + decodePath: function decodePath(path) { + return path.charAt(0) === '!' ? path.substr(1) : path; + } + }, + noslash: { + encodePath: _PathUtils.stripLeadingSlash, + decodePath: _PathUtils.addLeadingSlash + }, + slash: { + encodePath: _PathUtils.addLeadingSlash, + decodePath: _PathUtils.addLeadingSlash + } +}; + +var getHashPath = function getHashPath() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var hashIndex = href.indexOf('#'); + return hashIndex === -1 ? '' : href.substring(hashIndex + 1); +}; + +var pushHashPath = function pushHashPath(path) { + return window.location.hash = path; +}; + +var replaceHashPath = function replaceHashPath(path) { + var hashIndex = window.location.href.indexOf('#'); + + window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); +}; + +var createHashHistory = function createHashHistory() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM'); + + var globalHistory = window.history; + var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)(); + + var _props$getUserConfirm = props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, + _props$hashType = props.hashType, + hashType = _props$hashType === undefined ? 'slash' : _props$hashType; + + var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; + + var _HashPathCoders$hashT = HashPathCoders[hashType], + encodePath = _HashPathCoders$hashT.encodePath, + decodePath = _HashPathCoders$hashT.decodePath; + + + var getDOMLocation = function getDOMLocation() { + var path = decodePath(getHashPath()); + + (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + + if (basename) path = (0, _PathUtils.stripBasename)(path, basename); + + return (0, _LocationUtils.createLocation)(path); + }; + + var transitionManager = (0, _createTransitionManager2.default)(); + + var setState = function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + + transitionManager.notifyListeners(history.location, history.action); + }; + + var forceNextPop = false; + var ignorePath = null; + + var handleHashChange = function handleHashChange() { + var path = getHashPath(); + var encodedPath = encodePath(path); + + if (path !== encodedPath) { + // Ensure we always have a properly-encoded hash. + replaceHashPath(encodedPath); + } else { + var location = getDOMLocation(); + var prevLocation = history.location; + + if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change. + + if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace. + + ignorePath = null; + + handlePop(location); + } + }; + + var handlePop = function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ action: action, location: location }); + } else { + revertPop(location); + } + }); + } + }; + + var revertPop = function revertPop(fromLocation) { + var toLocation = history.location; + + // TODO: We could probably make this more reliable by + // keeping a list of paths we've seen in sessionStorage. + // Instead, we just default to 0 for paths we don't know. + + var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation)); + + if (toIndex === -1) toIndex = 0; + + var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation)); + + if (fromIndex === -1) fromIndex = 0; + + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + }; + + // Ensure the hash is encoded properly before doing anything else. + var path = getHashPath(); + var encodedPath = encodePath(path); + + if (path !== encodedPath) replaceHashPath(encodedPath); + + var initialLocation = getDOMLocation(); + var allPaths = [(0, _PathUtils.createPath)(initialLocation)]; + + // Public interface + + var createHref = function createHref(location) { + return '#' + encodePath(basename + (0, _PathUtils.createPath)(location)); + }; + + var push = function push(path, state) { + (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored'); + + var action = 'PUSH'; + var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + + var path = (0, _PathUtils.createPath)(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a PUSH, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + pushHashPath(encodedPath); + + var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location)); + var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + + nextPaths.push(path); + allPaths = nextPaths; + + setState({ action: action, location: location }); + } else { + (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); + + setState(); + } + }); + }; + + var replace = function replace(path, state) { + (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored'); + + var action = 'REPLACE'; + var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); + + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + + var path = (0, _PathUtils.createPath)(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a REPLACE, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + replaceHashPath(encodedPath); + } + + var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location)); + + if (prevIndex !== -1) allPaths[prevIndex] = path; + + setState({ action: action, location: location }); + }); + }; + + var go = function go(n) { + (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); + + globalHistory.go(n); + }; + + var goBack = function goBack() { + return go(-1); + }; + + var goForward = function goForward() { + return go(1); + }; + + var listenerCount = 0; + + var checkDOMListeners = function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1) { + (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); + } + }; + + var isBlocked = false; + + var block = function block() { + var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + }; + + var listen = function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + + return function () { + checkDOMListeners(-1); + unlisten(); + }; + }; + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + + return history; +}; + +exports.default = createHashHistory; + +/***/ }), +/* 43 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["a"]; }); + + +/***/ }), +/* 44 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(20); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + + + + +/** + * A wrapper that knows if it's "active" or not. + */ +var NavLink = function NavLink(_ref) { + var to = _ref.to, + exact = _ref.exact, + strict = _ref.strict, + location = _ref.location, + activeClassName = _ref.activeClassName, + className = _ref.className, + activeStyle = _ref.activeStyle, + style = _ref.style, + getIsActive = _ref.isActive, + rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive']); + + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["d" /* Route */], { + path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to, + exact: exact, + strict: strict, + location: location, + children: function children(_ref2) { + var location = _ref2.location, + match = _ref2.match; + + var isActive = !!(getIsActive ? getIsActive(match, location) : match); + + return __WEBPACK_IMPORTED_MODULE_0_react__["a" /* default */].createElement(__WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */], _extends({ + to: to, + className: isActive ? [activeClassName, className].filter(function (i) { + return i; + }).join(' ') : className, + style: isActive ? _extends({}, style, activeStyle) : style + }, rest)); + } + }); +}; + +NavLink.propTypes = { + to: __WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */].propTypes.to, + exact: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + strict: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + activeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + activeStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + isActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func +}; + +NavLink.defaultProps = { + activeClassName: 'active' +}; + +/* harmony default export */ __webpack_exports__["a"] = (NavLink); + +/***/ }), +/* 45 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["b"]; }); + + +/***/ }), +/* 46 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["c"]; }); + + +/***/ }), +/* 47 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["d"]; }); + + +/***/ }), +/* 48 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["e"]; }); + + +/***/ }), +/* 49 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["f"]; }); + + +/***/ }), +/* 50 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["g"]; }); + + +/***/ }), +/* 51 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["h"]; }); + + +/***/ }), +/* 52 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["i"]; }); + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _preact = __webpack_require__(4); + +var _reactRouterDom = __webpack_require__(6); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Header = function (_Component) { + _inherits(Header, _Component); + + function Header() { + _classCallCheck(this, Header); + + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } + + _createClass(Header, [{ + key: 'render', + value: function render() { + return (0, _preact.h)( + 'div', + { 'class': 'header' }, + (0, _preact.h)( + _reactRouterDom.Link, + { to: '/', 'class': 'back' }, + '\u25C1' + ), + (0, _preact.h)( + 'div', + { 'class': 'inner' }, + 'Procedural Paintings by Pepper' + ) + ); + } + }]); + + return Header; +}(_preact.Component); + +exports.default = Header; + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _preact = __webpack_require__(4); + +var _reactRouterDom = __webpack_require__(6); + +var _util = __webpack_require__(9); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Paintings = function (_Component) { + _inherits(Paintings, _Component); + + function Paintings() { + _classCallCheck(this, Paintings); + + return _possibleConstructorReturn(this, (Paintings.__proto__ || Object.getPrototypeOf(Paintings)).call(this)); + } + + _createClass(Paintings, [{ + key: 'render', + value: function render() { + var paintings = this.props.data.painting.map(function (painting, i) { + painting.style = painting.style || 'background-color:hsl(' + (0, _util.randrange)(300, 460) + ',50%,98%)'; + return (0, _preact.h)( + 'div', + { 'class': 'cell', key: i, style: painting.style }, + (0, _preact.h)( + 'div', + { 'class': 'painting' }, + (0, _preact.h)( + _reactRouterDom.Link, + { to: '/painting/' + painting.id }, + (0, _preact.h)('div', { 'class': 'image', style: 'background-image: url(' + painting.image.uri + ')' }) + ) + ), + (0, _preact.h)( + 'div', + { 'class': 'about' }, + (0, _preact.h)( + 'div', + null, + (0, _preact.h)( + 'div', + null, + painting.title + ), + (0, _preact.h)( + 'div', + null, + painting.medium + ), + (0, _preact.h)( + 'div', + null, + painting.date + ), + (0, _preact.h)( + 'div', + null, + painting.image.caption + ), + (0, _preact.h)('br', null), + (0, _preact.h)( + _reactRouterDom.Link, + { to: '/painting/' + painting.id }, + 'More info >' + ) + ) + ) + ); + }); + var about = this.props.data.page[0]; + var body = (about.body || '').replace(/\n/g, '
'); + var page = (0, _preact.h)( + 'div', + { 'class': 'cell' }, + (0, _preact.h)( + 'div', + { 'class': 'painting' }, + (0, _preact.h)( + 'a', + { href: 'http://asdf.us/pepper', target: '_blank' }, + (0, _preact.h)('div', { 'class': 'image', style: 'background-image: url(' + about.image.uri + ')' }) + ) + ), + (0, _preact.h)( + 'div', + { 'class': 'about' }, + (0, _preact.h)('div', { dangerouslySetInnerHTML: { __html: body } }) + ) + ); + return (0, _preact.h)( + 'div', + { 'class': 'paintings' }, + paintings, + page + ); + } + }]); + + return Paintings; +}(_preact.Component); + +exports.default = Paintings; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _preact = __webpack_require__(4); + +var _reactRouterDom = __webpack_require__(6); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Details = function (_Component) { + _inherits(Details, _Component); + + function Details() { + _classCallCheck(this, Details); + + return _possibleConstructorReturn(this, (Details.__proto__ || Object.getPrototypeOf(Details)).call(this)); + } + + _createClass(Details, [{ + key: 'onWheel', + value: function onWheel(e) { + e.stopPropagation(); + } + }, { + key: 'render', + value: function render() { + var painting = this.props.painting; + if (!painting) return; + + var source_images = findImages(painting.parameters); + var parameters = breakUpJSON(painting.parameters); + return (0, _preact.h)( + 'div', + { 'class': 'details', onWheel: this.onWheel }, + (0, _preact.h)( + 'h1', + null, + painting.title + ), + (0, _preact.h)( + 'div', + { 'class': 'stats' }, + painting.medium, + (0, _preact.h)('br', null), + painting.date, + (0, _preact.h)('br', null), + painting.image.caption + ), + (0, _preact.h)('img', { src: painting.image.uri, key: painting.image.uri }), + painting.originalImage && (0, _preact.h)( + 'div', + null, + (0, _preact.h)( + 'h2', + null, + 'Original Image' + ), + (0, _preact.h)('img', { src: painting.originalImage.uri }) + ), + painting.parameters && (0, _preact.h)( + 'div', + null, + (0, _preact.h)( + 'h2', + null, + 'Creation Parameters' + ), + (0, _preact.h)( + 'div', + { 'class': 'parameters' }, + parameters + ), + (0, _preact.h)( + 'h2', + null, + 'Source Images' + ), + source_images + ) + ); + } + }]); + + return Details; +}(_preact.Component); + +exports.default = Details; + +var PossiblyBadImage = function (_Component2) { + _inherits(PossiblyBadImage, _Component2); + + function PossiblyBadImage() { + _classCallCheck(this, PossiblyBadImage); + + var _this2 = _possibleConstructorReturn(this, (PossiblyBadImage.__proto__ || Object.getPrototypeOf(PossiblyBadImage)).call(this)); + + _this2.state = { error: false }; + _this2.onError = _this2.onError.bind(_this2); + return _this2; + } + + _createClass(PossiblyBadImage, [{ + key: 'onError', + value: function onError() { + this.setState({ error: true }); + } + }, { + key: 'render', + value: function render() { + if (this.state.error) return; + return (0, _preact.h)('img', { src: this.props.source, onError: this.onError }); + } + }]); + + return PossiblyBadImage; +}(_preact.Component); + +function findImages(s) { + s = s || ""; + var urlRegex = /(https?:\/\/[^\s]+)/g; + var match = urlRegex.exec(s); + var urls = []; + var url = void 0; + var seen = {}; + while (match != null) { + url = match[0].replace(/",?/, ""); + if (url && !seen[url]) { + seen[url] = true; + urls.push((0, _preact.h)( + 'a', + { href: url, key: url }, + (0, _preact.h)(PossiblyBadImage, { + source: url + }) + )); + } + match = urlRegex.exec(s); + } + return urls; +} + +function breakUpJSON(ss) { + return (ss || '').split("} {").map(function (s) { + return (0, _preact.h)( + 'div', + null, + s, + (0, _preact.h)('br', null), + (0, _preact.h)('br', null) + ); + }); +} + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _preact = __webpack_require__(4); + +var _reactRouterDom = __webpack_require__(6); + +var _util = __webpack_require__(9); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Modal = function (_Component) { + _inherits(Modal, _Component); + + function Modal() { + _classCallCheck(this, Modal); + + return _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).apply(this, arguments)); + } + + _createClass(Modal, [{ + key: 'render', + value: function render() { + if (this.props.visible) { + document.body.classList.add("inModal"); + } else { + document.body.classList.remove("inModal"); + } + + var className = this.props.visible ? 'modal visible' : 'modal'; + + var style = 'background-color:hsl(' + (0, _util.randrange)(330, 80) + ',50%,99%)'; + + return (0, _preact.h)( + 'div', + { 'class': className, style: style }, + (0, _preact.h)( + 'div', + { 'class': 'inner' }, + this.props.children + ) + ); + } + }]); + + return Modal; +}(_preact.Component); + +exports.default = Modal; + +/***/ }) +/******/ ]); //# sourceMappingURL=bundle.js.map \ No newline at end of file -- cgit v1.2.3-70-g09d2