diff --git a/bower.json b/bower.json deleted file mode 100644 index 3e00ac4..0000000 --- a/bower.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "react-foundation-apps", - "version": "0.0.1", - "homepage": "https://github.com/akiran/react-foundation-apps", - "authors": [ - "Kiran Abburi" - ], - "description": "React port for foundation-apps", - "keywords": [ - "React", - "foundation-apps" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "foundation-apps": "~1.1.0" - } -} diff --git a/dist/react-foundation-apps.js b/dist/react-foundation-apps.js index 3302749..8953e17 100644 --- a/dist/react-foundation-apps.js +++ b/dist/react-foundation-apps.js @@ -7,7 +7,7 @@ exports["RFA"] = factory(require("react")); else root["RFA"] = factory(root["React"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_12__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -55,17 +55,17 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { module.exports = { - Accordion: __webpack_require__(23), - ActionSheet: __webpack_require__(2), - Iconic: __webpack_require__(3), - Interchange: __webpack_require__(4), - Modal: __webpack_require__(5), - Notification: __webpack_require__(6), - OffCanvas: __webpack_require__(7), - Panel: __webpack_require__(8), - Popup: __webpack_require__(9), - Tabs: __webpack_require__(10), - Trigger: __webpack_require__(11), + Accordion: __webpack_require__(1), + ActionSheet: __webpack_require__(15), + Iconic: __webpack_require__(21), + Interchange: __webpack_require__(23), + Modal: __webpack_require__(29), + Notification: __webpack_require__(33), + OffCanvas: __webpack_require__(37), + Panel: __webpack_require__(38), + Popup: __webpack_require__(39), + Tabs: __webpack_require__(41), + Trigger: __webpack_require__(43), }; @@ -73,1474 +73,904 @@ return /******/ (function(modules) { // webpackBootstrap /* 1 */ /***/ function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! tether 0.6.5 */ - + 'use strict'; - (function(root, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - module.exports = factory(require,exports,module); - } else { - root.Tether = factory(); - } - }(this, function(require,exports,module) { + var React = __webpack_require__(2); + var cloneWithProps = __webpack_require__(3); - (function() { - var Evented, addClass, defer, deferred, extend, flush, getBounds, getClassName, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, setClassName, uniqueId, updateClasses, zeroPosCache, - __hasProp = {}.hasOwnProperty, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; + var Accordion = React.createClass({ + displayName: 'Accordion', - if (this.Tether == null) { - this.Tether = { - modules: [] + getInitialState: function getInitialState() { + return { sections: [] }; + }, + getDefaultProps: function getDefaultProps() { + return { + autoOpen: true, + multiOpen: false, + collapsible: false }; - } - - getScrollParent = function(el) { - var parent, position, scrollParent, style, _ref; - position = getComputedStyle(el).position; - if (position === 'fixed') { - return el; + }, + componentWillMount: function componentWillMount() { + var sections = []; + React.Children.forEach(this.props.children, function (child, index) { + sections.push({ active: false }); + }); + if (this.props.autoOpen) { + sections[0].active = true; } - scrollParent = void 0; - parent = el; - while (parent = parent.parentNode) { - try { - style = getComputedStyle(parent); - } catch (_error) {} - if (style == null) { - return parent; - } - if (/(auto|scroll)/.test(style['overflow'] + style['overflowY'] + style['overflowX'])) { - if (position !== 'absolute' || ((_ref = style['position']) === 'relative' || _ref === 'absolute' || _ref === 'fixed')) { - return parent; + this.setState({ sections: sections }); + }, + select: function select(selectSection) { + var sections = this.state.sections; + sections.forEach((function (section, index) { + if (this.props.multiOpen) { + if (index === selectSection) { + section.active = !section.active; + } + } else { + if (index === selectSection) { + section.active = this.props.collapsible === true ? !section.active : true; + } else { + section.active = false; } } - } - return document.body; - }; + }).bind(this)); + this.setState({ sections: sections }); + }, + render: function render() { + var children = React.Children.map(this.props.children, (function (child, index) { + return cloneWithProps(child, { + active: this.state.sections[index] ? this.state.sections[index].active : false, + activate: this.select.bind(this, index) + }); + }).bind(this)); + return React.createElement( + 'div', + { className: 'accordion' }, + children + ); + } + }); - uniqueId = (function() { - var id; - id = 0; - return function() { - return id++; - }; - })(); + module.exports = Accordion; + Accordion.Item = __webpack_require__(13); - zeroPosCache = {}; +/***/ }, +/* 2 */ +/***/ function(module, exports) { - getOrigin = function(doc) { - var id, k, node, v, _ref; - node = doc._tetherZeroElement; - if (node == null) { - node = doc.createElement('div'); - node.setAttribute('data-tether-id', uniqueId()); - extend(node.style, { - top: 0, - left: 0, - position: 'absolute' - }); - doc.body.appendChild(node); - doc._tetherZeroElement = node; - } - id = node.getAttribute('data-tether-id'); - if (zeroPosCache[id] == null) { - zeroPosCache[id] = {}; - _ref = node.getBoundingClientRect(); - for (k in _ref) { - v = _ref[k]; - zeroPosCache[id][k] = v; - } - defer(function() { - return zeroPosCache[id] = void 0; - }); - } - return zeroPosCache[id]; - }; + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; - node = null; +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { - getBounds = function(el) { - var box, doc, docEl, k, origin, v, _ref; - if (el === document) { - doc = document; - el = document.documentElement; - } else { - doc = el.ownerDocument; - } - docEl = doc.documentElement; - box = {}; - _ref = el.getBoundingClientRect(); - for (k in _ref) { - v = _ref[k]; - box[k] = v; - } - origin = getOrigin(doc); - box.top -= origin.top; - box.left -= origin.left; - if (box.width == null) { - box.width = document.body.scrollWidth - box.left - box.right; - } - if (box.height == null) { - box.height = document.body.scrollHeight - box.top - box.bottom; - } - box.top = box.top - docEl.clientTop; - box.left = box.left - docEl.clientLeft; - box.right = doc.body.clientWidth - box.width - box.left; - box.bottom = doc.body.clientHeight - box.height - box.top; - return box; - }; + /** + * 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. + * + * @typechecks static-only + * @providesModule cloneWithProps + */ - getOffsetParent = function(el) { - return el.offsetParent || document.documentElement; - }; + 'use strict'; - getScrollBarSize = function() { - var inner, outer, width, widthContained, widthScroll; - inner = document.createElement('div'); - inner.style.width = '100%'; - inner.style.height = '200px'; - outer = document.createElement('div'); - extend(outer.style, { - position: 'absolute', - top: 0, - left: 0, - pointerEvents: 'none', - visibility: 'hidden', - width: '200px', - height: '150px', - overflow: 'hidden' - }); - outer.appendChild(inner); - document.body.appendChild(outer); - widthContained = inner.offsetWidth; - outer.style.overflow = 'scroll'; - widthScroll = inner.offsetWidth; - if (widthContained === widthScroll) { - widthScroll = outer.clientWidth; - } - document.body.removeChild(outer); - width = widthContained - widthScroll; - return { - width: width, - height: width - }; - }; + var ReactElement = __webpack_require__(4); + var ReactPropTransferer = __webpack_require__(8); - extend = function(out) { - var args, key, obj, val, _i, _len, _ref; - if (out == null) { - out = {}; - } - args = []; - Array.prototype.push.apply(args, arguments); - _ref = args.slice(1); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - obj = _ref[_i]; - if (obj) { - for (key in obj) { - if (!__hasProp.call(obj, key)) continue; - val = obj[key]; - out[key] = val; - } - } - } - return out; - }; + var keyOf = __webpack_require__(11); + var warning = __webpack_require__(12); - removeClass = function(el, name) { - var className, cls, _i, _len, _ref, _results; - if (el.classList != null) { - _ref = name.split(' '); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cls = _ref[_i]; - if (cls.trim()) { - _results.push(el.classList.remove(cls)); - } - } - return _results; - } else { - className = getClassName(el).replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' '); - return setClassName(el, className); - } - }; + var CHILDREN_PROP = keyOf({ children: null }); - addClass = function(el, name) { - var cls, _i, _len, _ref, _results; - if (el.classList != null) { - _ref = name.split(' '); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - cls = _ref[_i]; - if (cls.trim()) { - _results.push(el.classList.add(cls)); - } - } - return _results; - } else { - removeClass(el, name); - cls = getClassName(el) + (" " + name); - return setClassName(el, cls); - } - }; - - hasClass = function(el, name) { - if (el.classList != null) { - return el.classList.contains(name); - } else { - return new RegExp("(^| )" + name + "( |$)", 'gi').test(getClassName(el)); - } - }; - - getClassName = function(el) { - if (el.className instanceof SVGAnimatedString) { - return el.className.baseVal; - } else { - return el.className; - } - }; + var didDeprecatedWarn = false; - setClassName = function(el, className) { - return el.setAttribute('class', className); - }; + /** + * Sometimes you want to change the props of a child passed to you. Usually + * this is to add a CSS class. + * + * @param {ReactElement} child child element you'd like to clone + * @param {object} props props you'd like to modify. className and style will be + * merged automatically. + * @return {ReactElement} a clone of child with props merged in. + * @deprecated + */ + function cloneWithProps(child, props) { + if ((undefined) !== 'production') { + (undefined) !== 'production' ? warning(didDeprecatedWarn, 'cloneWithProps(...) is deprecated. ' + 'Please use React.cloneElement instead.') : undefined; + didDeprecatedWarn = true; + (undefined) !== 'production' ? warning(!child.ref, 'You are calling cloneWithProps() on a child with a ref. This is ' + 'dangerous because you\'re creating a new child which will not be ' + 'added as a ref to its parent.') : undefined; + } - updateClasses = function(el, add, all) { - var cls, _i, _j, _len, _len1, _results; - for (_i = 0, _len = all.length; _i < _len; _i++) { - cls = all[_i]; - if (__indexOf.call(add, cls) < 0) { - if (hasClass(el, cls)) { - removeClass(el, cls); - } - } - } - _results = []; - for (_j = 0, _len1 = add.length; _j < _len1; _j++) { - cls = add[_j]; - if (!hasClass(el, cls)) { - _results.push(addClass(el, cls)); - } else { - _results.push(void 0); - } - } - return _results; - }; + var newProps = ReactPropTransferer.mergeProps(props, child.props); - deferred = []; + // Use `child.props.children` if it is provided. + if (!newProps.hasOwnProperty(CHILDREN_PROP) && child.props.hasOwnProperty(CHILDREN_PROP)) { + newProps.children = child.props.children; + } - defer = function(fn) { - return deferred.push(fn); - }; + // The current API doesn't retain _owner, which is why this + // doesn't use ReactElement.cloneAndReplaceProps. + return ReactElement.createElement(child.type, newProps); + } - flush = function() { - var fn, _results; - _results = []; - while (fn = deferred.pop()) { - _results.push(fn()); - } - return _results; - }; + module.exports = cloneWithProps; - Evented = (function() { - function Evented() {} +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { - Evented.prototype.on = function(event, handler, ctx, once) { - var _base; - if (once == null) { - once = false; - } - if (this.bindings == null) { - this.bindings = {}; - } - if ((_base = this.bindings)[event] == null) { - _base[event] = []; - } - return this.bindings[event].push({ - handler: handler, - ctx: ctx, - once: once - }); - }; + /** + * 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. + * + * @providesModule ReactElement + */ - Evented.prototype.once = function(event, handler, ctx) { - return this.on(event, handler, ctx, true); - }; + 'use strict'; - Evented.prototype.off = function(event, handler) { - var i, _ref, _results; - if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) { - return; - } - if (handler == null) { - return delete this.bindings[event]; - } else { - i = 0; - _results = []; - while (i < this.bindings[event].length) { - if (this.bindings[event][i].handler === handler) { - _results.push(this.bindings[event].splice(i, 1)); - } else { - _results.push(i++); - } - } - return _results; - } - }; + var ReactCurrentOwner = __webpack_require__(5); - Evented.prototype.trigger = function() { - var args, ctx, event, handler, i, once, _ref, _ref1, _results; - event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - if ((_ref = this.bindings) != null ? _ref[event] : void 0) { - i = 0; - _results = []; - while (i < this.bindings[event].length) { - _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once; - handler.apply(ctx != null ? ctx : this, args); - if (once) { - _results.push(this.bindings[event].splice(i, 1)); - } else { - _results.push(i++); - } - } - return _results; - } - }; + var assign = __webpack_require__(6); + var canDefineProperty = __webpack_require__(7); - return Evented; + // The Symbol used to tag the ReactElement type. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; - })(); + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; - this.Tether.Utils = { - getScrollParent: getScrollParent, - getBounds: getBounds, - getOffsetParent: getOffsetParent, - extend: extend, - addClass: addClass, - removeClass: removeClass, - hasClass: hasClass, - updateClasses: updateClasses, - defer: defer, - flush: flush, - uniqueId: uniqueId, - Evented: Evented, - getScrollBarSize: getScrollBarSize + /** + * Base constructor for all React elements. This is only used to make this + * work with a dynamic instanceof check. Nothing should live on this prototype. + * + * @param {*} type + * @param {*} key + * @param {string|object} ref + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @param {*} owner + * @param {*} props + * @internal + */ + var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allow us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + + // Record the component responsible for creating this element. + _owner: owner }; - }).call(this); - - (function() { - var MIRROR_LR, MIRROR_TB, OFFSET_MAP, Tether, addClass, addOffset, attachmentToOffset, autoToFixedAttachment, defer, extend, flush, getBounds, getOffsetParent, getOuterSize, getScrollBarSize, getScrollParent, getSize, now, offsetToPx, parseAttachment, parseOffset, position, removeClass, tethers, transformKey, updateClasses, within, _Tether, _ref, - __slice = [].slice, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + if ((undefined) !== 'production') { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; - if (this.Tether == null) { - throw new Error("You must include the utils.js file before tether.js"); + // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + if (canDefineProperty) { + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + // self and source are DEV only properties. + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + } else { + element._store.validated = false; + element._self = self; + element._source = source; + } + Object.freeze(element.props); + Object.freeze(element); } - Tether = this.Tether; + return element; + }; - _ref = Tether.Utils, getScrollParent = _ref.getScrollParent, getSize = _ref.getSize, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getOffsetParent = _ref.getOffsetParent, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, updateClasses = _ref.updateClasses, defer = _ref.defer, flush = _ref.flush, getScrollBarSize = _ref.getScrollBarSize; + ReactElement.createElement = function (type, config, children) { + var propName; - within = function(a, b, diff) { - if (diff == null) { - diff = 1; - } - return (a + diff >= b && b >= a - diff); - }; + // Reserved names are extracted + var props = {}; - transformKey = (function() { - var el, key, _i, _len, _ref1; - el = document.createElement('div'); - _ref1 = ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - key = _ref1[_i]; - if (el.style[key] !== void 0) { - return key; + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + ref = config.ref === undefined ? null : config.ref; + key = config.key === undefined ? null : '' + config.key; + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; + // Remaining properties are added to a new props object + for (propName in config) { + if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; } } - })(); + } - tethers = []; + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } - position = function() { - var tether, _i, _len; - for (_i = 0, _len = tethers.length; _i < _len; _i++) { - tether = tethers[_i]; - tether.position(false); + // Resolve default props + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (typeof props[propName] === 'undefined') { + props[propName] = defaultProps[propName]; + } } - return flush(); - }; + } - now = function() { - var _ref1; - return (_ref1 = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref1 : +(new Date); - }; + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + }; - (function() { - var event, lastCall, lastDuration, pendingTimeout, tick, _i, _len, _ref1, _results; - lastCall = null; - lastDuration = null; - pendingTimeout = null; - tick = function() { - if ((lastDuration != null) && lastDuration > 16) { - lastDuration = Math.min(lastDuration - 16, 250); - pendingTimeout = setTimeout(tick, 250); - return; - } - if ((lastCall != null) && (now() - lastCall) < 10) { - return; - } - if (pendingTimeout != null) { - clearTimeout(pendingTimeout); - pendingTimeout = null; - } - lastCall = now(); - position(); - return lastDuration = now() - lastCall; - }; - _ref1 = ['resize', 'scroll', 'touchmove']; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - event = _ref1[_i]; - _results.push(window.addEventListener(event, tick)); - } - return _results; - })(); + ReactElement.createFactory = function (type) { + var factory = ReactElement.createElement.bind(null, type); + // Expose the type on the factory and the prototype so that it can be + // easily accessed on elements. E.g. `.type === Foo`. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. + // Legacy hook TODO: Warn if this is accessed + factory.type = type; + return factory; + }; - MIRROR_LR = { - center: 'center', - left: 'right', - right: 'left' - }; + ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - MIRROR_TB = { - middle: 'middle', - top: 'bottom', - bottom: 'top' - }; + return newElement; + }; - OFFSET_MAP = { - top: 0, - left: 0, - middle: '50%', - center: '50%', - bottom: '100%', - right: '100%' - }; + ReactElement.cloneAndReplaceProps = function (oldElement, newProps) { + var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps); - autoToFixedAttachment = function(attachment, relativeToAttachment) { - var left, top; - left = attachment.left, top = attachment.top; - if (left === 'auto') { - left = MIRROR_LR[relativeToAttachment.left]; - } - if (top === 'auto') { - top = MIRROR_TB[relativeToAttachment.top]; - } - return { - left: left, - top: top - }; - }; + if ((undefined) !== 'production') { + // If the key on the original is valid, then the clone is valid + newElement._store.validated = oldElement._store.validated; + } - attachmentToOffset = function(attachment) { - var _ref1, _ref2; - return { - left: (_ref1 = OFFSET_MAP[attachment.left]) != null ? _ref1 : attachment.left, - top: (_ref2 = OFFSET_MAP[attachment.top]) != null ? _ref2 : attachment.top - }; - }; + return newElement; + }; - addOffset = function() { - var left, offsets, out, top, _i, _len, _ref1; - offsets = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - out = { - top: 0, - left: 0 - }; - for (_i = 0, _len = offsets.length; _i < _len; _i++) { - _ref1 = offsets[_i], top = _ref1.top, left = _ref1.left; - if (typeof top === 'string') { - top = parseFloat(top, 10); - } - if (typeof left === 'string') { - left = parseFloat(left, 10); - } - out.top += top; - out.left += left; - } - return out; - }; + ReactElement.cloneElement = function (element, config, children) { + var propName; - offsetToPx = function(offset, size) { - if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) { - offset.left = parseFloat(offset.left, 10) / 100 * size.width; - } - if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) { - offset.top = parseFloat(offset.top, 10) / 100 * size.height; - } - return offset; - }; + // Original props are copied + var props = assign({}, element.props); - parseAttachment = parseOffset = function(value) { - var left, top, _ref1; - _ref1 = value.split(' '), top = _ref1[0], left = _ref1[1]; - return { - top: top, - left: left - }; - }; + // Reserved names are extracted + var key = element.key; + var ref = element.ref; + // Self is preserved since the owner is preserved. + var self = element._self; + // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + var source = element._source; - _Tether = (function() { - _Tether.modules = []; + // Owner will be preserved, unless ref is overridden + var owner = element._owner; - function _Tether(options) { - this.position = __bind(this.position, this); - var module, _i, _len, _ref1, _ref2; - tethers.push(this); - this.history = []; - this.setOptions(options, false); - _ref1 = Tether.modules; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - module = _ref1[_i]; - if ((_ref2 = module.initialize) != null) { - _ref2.call(this); - } + if (config != null) { + if (config.ref !== undefined) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (config.key !== undefined) { + key = '' + config.key; + } + // Remaining properties override existing props + for (propName in config) { + if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; } - this.position(); } + } - _Tether.prototype.getClass = function(key) { - var _ref1, _ref2; - if ((_ref1 = this.options.classes) != null ? _ref1[key] : void 0) { - return this.options.classes[key]; - } else if (((_ref2 = this.options.classes) != null ? _ref2[key] : void 0) !== false) { - if (this.options.classPrefix) { - return "" + this.options.classPrefix + "-" + key; - } else { - return key; - } - } else { - return ''; - } - }; + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } - _Tether.prototype.setOptions = function(options, position) { - var defaults, key, _i, _len, _ref1, _ref2; - this.options = options; - if (position == null) { - position = true; - } - defaults = { - offset: '0 0', - targetOffset: '0 0', - targetAttachment: 'auto auto', - classPrefix: 'tether' - }; - this.options = extend(defaults, this.options); - _ref1 = this.options, this.element = _ref1.element, this.target = _ref1.target, this.targetModifier = _ref1.targetModifier; - if (this.target === 'viewport') { - this.target = document.body; - this.targetModifier = 'visible'; - } else if (this.target === 'scroll-handle') { - this.target = document.body; - this.targetModifier = 'scroll-handle'; - } - _ref2 = ['element', 'target']; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - key = _ref2[_i]; - if (this[key] == null) { - throw new Error("Tether Error: Both element and target must be defined"); - } - if (this[key].jquery != null) { - this[key] = this[key][0]; - } else if (typeof this[key] === 'string') { - this[key] = document.querySelector(this[key]); - } - } - addClass(this.element, this.getClass('element')); - addClass(this.target, this.getClass('target')); - if (!this.options.attachment) { - throw new Error("Tether Error: You must provide an attachment"); - } - this.targetAttachment = parseAttachment(this.options.targetAttachment); - this.attachment = parseAttachment(this.options.attachment); - this.offset = parseOffset(this.options.offset); - this.targetOffset = parseOffset(this.options.targetOffset); - if (this.scrollParent != null) { - this.disable(); - } - if (this.targetModifier === 'scroll-handle') { - this.scrollParent = this.target; - } else { - this.scrollParent = getScrollParent(this.target); - } - if (this.options.enabled !== false) { - return this.enable(position); - } - }; + return ReactElement(element.type, key, ref, self, source, owner, props); + }; - _Tether.prototype.getTargetBounds = function() { - var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target; - if (this.targetModifier != null) { - switch (this.targetModifier) { - case 'visible': - if (this.target === document.body) { - return { - top: pageYOffset, - left: pageXOffset, - height: innerHeight, - width: innerWidth - }; - } else { - bounds = getBounds(this.target); - out = { - height: bounds.height, - width: bounds.width, - top: bounds.top, - left: bounds.left - }; - out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top)); - out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight))); - out.height = Math.min(innerHeight, out.height); - out.height -= 2; - out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left)); - out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth))); - out.width = Math.min(innerWidth, out.width); - out.width -= 2; - if (out.top < pageYOffset) { - out.top = pageYOffset; - } - if (out.left < pageXOffset) { - out.left = pageXOffset; - } - return out; - } - break; - case 'scroll-handle': - target = this.target; - if (target === document.body) { - target = document.documentElement; - bounds = { - left: pageXOffset, - top: pageYOffset, - height: innerHeight, - width: innerWidth - }; - } else { - bounds = getBounds(target); - } - style = getComputedStyle(target); - hasBottomScroll = target.scrollWidth > target.clientWidth || 'scroll' === [style.overflow, style.overflowX] || this.target !== document.body; - scrollBottom = 0; - if (hasBottomScroll) { - scrollBottom = 15; - } - height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom; - out = { - width: 15, - height: height * 0.975 * (height / target.scrollHeight), - left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15 - }; - fitAdj = 0; - if (height < 408 && this.target === document.body) { - fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58; - } - if (this.target !== document.body) { - out.height = Math.max(out.height, 24); - } - scrollPercentage = this.target.scrollTop / (target.scrollHeight - height); - out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth); - if (this.target === document.body) { - out.height = Math.max(out.height, 24); - } - return out; - } - } else { - return getBounds(this.target); - } - }; + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid component. + * @final + */ + ReactElement.isValidElement = function (object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + }; - _Tether.prototype.clearCache = function() { - return this._cache = {}; - }; + module.exports = ReactElement; - _Tether.prototype.cache = function(k, getter) { - if (this._cache == null) { - this._cache = {}; - } - if (this._cache[k] == null) { - this._cache[k] = getter.call(this); - } - return this._cache[k]; - }; +/***/ }, +/* 5 */ +/***/ function(module, exports) { - _Tether.prototype.enable = function(position) { - if (position == null) { - position = true; - } - addClass(this.target, this.getClass('enabled')); - addClass(this.element, this.getClass('enabled')); - this.enabled = true; - if (this.scrollParent !== document) { - this.scrollParent.addEventListener('scroll', this.position); - } - if (position) { - return this.position(); - } - }; + /** + * 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. + * + * @providesModule ReactCurrentOwner + */ - _Tether.prototype.disable = function() { - removeClass(this.target, this.getClass('enabled')); - removeClass(this.element, this.getClass('enabled')); - this.enabled = false; - if (this.scrollParent != null) { - return this.scrollParent.removeEventListener('scroll', this.position); - } - }; + 'use strict'; - _Tether.prototype.destroy = function() { - var i, tether, _i, _len, _results; - this.disable(); - _results = []; - for (i = _i = 0, _len = tethers.length; _i < _len; i = ++_i) { - tether = tethers[i]; - if (tether === this) { - tethers.splice(i, 1); - break; - } else { - _results.push(void 0); - } - } - return _results; - }; + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { - _Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) { - var add, all, side, sides, _i, _j, _len, _len1, _ref1, - _this = this; - if (elementAttach == null) { - elementAttach = this.attachment; - } - if (targetAttach == null) { - targetAttach = this.targetAttachment; - } - sides = ['left', 'top', 'bottom', 'right', 'middle', 'center']; - if ((_ref1 = this._addAttachClasses) != null ? _ref1.length : void 0) { - this._addAttachClasses.splice(0, this._addAttachClasses.length); - } - add = this._addAttachClasses != null ? this._addAttachClasses : this._addAttachClasses = []; - if (elementAttach.top) { - add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.top); - } - if (elementAttach.left) { - add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.left); - } - if (targetAttach.top) { - add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.top); - } - if (targetAttach.left) { - add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.left); - } - all = []; - for (_i = 0, _len = sides.length; _i < _len; _i++) { - side = sides[_i]; - all.push("" + (this.getClass('element-attached')) + "-" + side); - } - for (_j = 0, _len1 = sides.length; _j < _len1; _j++) { - side = sides[_j]; - all.push("" + (this.getClass('target-attached')) + "-" + side); - } - return defer(function() { - if (_this._addAttachClasses == null) { - return; - } - updateClasses(_this.element, _this._addAttachClasses, all); - updateClasses(_this.target, _this._addAttachClasses, all); - return _this._addAttachClasses = void 0; - }); - }; + /** + * @internal + * @type {ReactComponent} + */ + current: null - _Tether.prototype.position = function(flushChanges) { - var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, - _this = this; - if (flushChanges == null) { - flushChanges = true; + }; + + module.exports = ReactCurrentOwner; + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + /** + * 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. + * + * @providesModule Object.assign + */ + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign + + 'use strict'; + + function assign(target, sources) { + if (target == null) { + throw new TypeError('Object.assign target cannot be null or undefined'); + } + + var to = Object(target); + var hasOwnProperty = Object.prototype.hasOwnProperty; + + for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { + var nextSource = arguments[nextIndex]; + if (nextSource == null) { + continue; + } + + var from = Object(nextSource); + + // We don't currently support accessors nor proxies. Therefore this + // copy cannot throw. If we ever supported this then we must handle + // exceptions and side-effects. We don't support symbols so they won't + // be transferred. + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; } - if (!this.enabled) { - return; - } - this.clearCache(); - targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment); - this.updateAttachClasses(this.attachment, targetAttachment); - elementPos = this.cache('element-bounds', function() { - return getBounds(_this.element); - }); - width = elementPos.width, height = elementPos.height; - if (width === 0 && height === 0 && (this.lastSize != null)) { - _ref1 = this.lastSize, width = _ref1.width, height = _ref1.height; - } else { - this.lastSize = { - width: width, - height: height - }; - } - targetSize = targetPos = this.cache('target-bounds', function() { - return _this.getTargetBounds(); - }); - offset = offsetToPx(attachmentToOffset(this.attachment), { - width: width, - height: height - }); - targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize); - manualOffset = offsetToPx(this.offset, { - width: width, - height: height - }); - manualTargetOffset = offsetToPx(this.targetOffset, targetSize); - offset = addOffset(offset, manualOffset); - targetOffset = addOffset(targetOffset, manualTargetOffset); - left = targetPos.left + targetOffset.left - offset.left; - top = targetPos.top + targetOffset.top - offset.top; - _ref2 = Tether.modules; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - module = _ref2[_i]; - ret = module.position.call(this, { - left: left, - top: top, - targetAttachment: targetAttachment, - targetPos: targetPos, - attachment: this.attachment, - elementPos: elementPos, - offset: offset, - targetOffset: targetOffset, - manualOffset: manualOffset, - manualTargetOffset: manualTargetOffset, - scrollbarSize: scrollbarSize - }); - if ((ret == null) || typeof ret !== 'object') { - continue; - } else if (ret === false) { - return false; - } else { - top = ret.top, left = ret.left; - } - } - next = { - page: { - top: top, - left: left - }, - viewport: { - top: top - pageYOffset, - bottom: pageYOffset - top - height + innerHeight, - left: left - pageXOffset, - right: pageXOffset - left - width + innerWidth - } - }; - if (document.body.scrollWidth > window.innerWidth) { - scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); - next.viewport.bottom -= scrollbarSize.height; - } - if (document.body.scrollHeight > window.innerHeight) { - scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); - next.viewport.right -= scrollbarSize.width; - } - if (((_ref3 = document.body.style.position) !== '' && _ref3 !== 'static') || ((_ref4 = document.body.parentElement.style.position) !== '' && _ref4 !== 'static')) { - next.page.bottom = document.body.scrollHeight - top - height; - next.page.right = document.body.scrollWidth - left - width; - } - if (((_ref5 = this.options.optimizations) != null ? _ref5.moveElement : void 0) !== false && (this.targetModifier == null)) { - offsetParent = this.cache('target-offsetparent', function() { - return getOffsetParent(_this.target); - }); - offsetPosition = this.cache('target-offsetparent-bounds', function() { - return getBounds(offsetParent); - }); - offsetParentStyle = getComputedStyle(offsetParent); - elementStyle = getComputedStyle(this.element); - offsetParentSize = offsetPosition; - offsetBorder = {}; - _ref6 = ['Top', 'Left', 'Bottom', 'Right']; - for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { - side = _ref6[_j]; - offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle["border" + side + "Width"]); - } - offsetPosition.right = document.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right; - offsetPosition.bottom = document.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom; - if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) { - if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) { - scrollTop = offsetParent.scrollTop; - scrollLeft = offsetParent.scrollLeft; - next.offset = { - top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top, - left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left - }; - } - } - } - this.move(next); - this.history.unshift(next); - if (this.history.length > 3) { - this.history.pop(); - } - if (flushChanges) { - flush(); - } - return true; - }; - - _Tether.prototype.move = function(position) { - var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2, - _this = this; - if (this.element.parentNode == null) { - return; - } - same = {}; - for (type in position) { - same[type] = {}; - for (key in position[type]) { - found = false; - _ref1 = this.history; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - point = _ref1[_i]; - if (!within((_ref2 = point[type]) != null ? _ref2[key] : void 0, position[type][key])) { - found = true; - break; - } - } - if (!found) { - same[type][key] = true; - } - } - } - css = { - top: '', - left: '', - right: '', - bottom: '' - }; - transcribe = function(same, pos) { - var xPos, yPos, _ref3; - if (((_ref3 = _this.options.optimizations) != null ? _ref3.gpu : void 0) !== false) { - if (same.top) { - css.top = 0; - yPos = pos.top; - } else { - css.bottom = 0; - yPos = -pos.bottom; - } - if (same.left) { - css.left = 0; - xPos = pos.left; - } else { - css.right = 0; - xPos = -pos.right; - } - css[transformKey] = "translateX(" + (Math.round(xPos)) + "px) translateY(" + (Math.round(yPos)) + "px)"; - if (transformKey !== 'msTransform') { - return css[transformKey] += " translateZ(0)"; - } - } else { - if (same.top) { - css.top = "" + pos.top + "px"; - } else { - css.bottom = "" + pos.bottom + "px"; - } - if (same.left) { - return css.left = "" + pos.left + "px"; - } else { - return css.right = "" + pos.right + "px"; - } - } - }; - moved = false; - if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) { - css.position = 'absolute'; - transcribe(same.page, position.page); - } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) { - css.position = 'fixed'; - transcribe(same.viewport, position.viewport); - } else if ((same.offset != null) && same.offset.top && same.offset.left) { - css.position = 'absolute'; - offsetParent = this.cache('target-offsetparent', function() { - return getOffsetParent(_this.target); - }); - if (getOffsetParent(this.element) !== offsetParent) { - defer(function() { - _this.element.parentNode.removeChild(_this.element); - return offsetParent.appendChild(_this.element); - }); - } - transcribe(same.offset, position.offset); - moved = true; - } else { - css.position = 'absolute'; - transcribe({ - top: true, - left: true - }, position.page); - } - if (!moved && this.element.parentNode.tagName !== 'BODY') { - this.element.parentNode.removeChild(this.element); - document.body.appendChild(this.element); - } - writeCSS = {}; - write = false; - for (key in css) { - val = css[key]; - elVal = this.element.style[key]; - if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) { - elVal = parseFloat(elVal); - val = parseFloat(val); - } - if (elVal !== val) { - write = true; - writeCSS[key] = css[key]; - } - } - if (write) { - return defer(function() { - return extend(_this.element.style, writeCSS); - }); - } - }; - - return _Tether; - - })(); + } + } - Tether.position = position; + return to; + } - this.Tether = extend(_Tether, Tether); + module.exports = assign; - }).call(this); +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { - (function() { - var BOUNDS_FORMAT, MIRROR_ATTACH, defer, extend, getBoundingRect, getBounds, getOuterSize, getSize, updateClasses, _ref, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + /** + * 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. + * + * @providesModule canDefineProperty + */ - _ref = this.Tether.Utils, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getSize = _ref.getSize, extend = _ref.extend, updateClasses = _ref.updateClasses, defer = _ref.defer; + 'use strict'; - MIRROR_ATTACH = { - left: 'right', - right: 'left', - top: 'bottom', - bottom: 'top', - middle: 'middle' - }; + var canDefineProperty = false; + if ((undefined) !== 'production') { + try { + Object.defineProperty({}, 'x', { get: function () {} }); + canDefineProperty = true; + } catch (x) { + // IE will fail on defineProperty + } + } - BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom']; + module.exports = canDefineProperty; - getBoundingRect = function(tether, to) { - var i, pos, side, size, style, _i, _len; - if (to === 'scrollParent') { - to = tether.scrollParent; - } else if (to === 'window') { - to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset]; +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * 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. + * + * @providesModule ReactPropTransferer + */ + + 'use strict'; + + var assign = __webpack_require__(6); + var emptyFunction = __webpack_require__(9); + var joinClasses = __webpack_require__(10); + + /** + * Creates a transfer strategy that will merge prop values using the supplied + * `mergeStrategy`. If a prop was previously unset, this just sets it. + * + * @param {function} mergeStrategy + * @return {function} + */ + function createTransferStrategy(mergeStrategy) { + return function (props, key, value) { + if (!props.hasOwnProperty(key)) { + props[key] = value; + } else { + props[key] = mergeStrategy(props[key], value); } - if (to === document) { - to = to.documentElement; + }; + } + + var transferStrategyMerge = createTransferStrategy(function (a, b) { + // `merge` overrides the first object's (`props[key]` above) keys using the + // second object's (`value`) keys. An object's style's existing `propA` would + // get overridden. Flip the order here. + return assign({}, b, a); + }); + + /** + * Transfer strategies dictate how props are transferred by `transferPropsTo`. + * NOTE: if you add any more exceptions to this list you should be sure to + * update `cloneWithProps()` accordingly. + */ + var TransferStrategies = { + /** + * Never transfer `children`. + */ + children: emptyFunction, + /** + * Transfer the `className` prop by merging them. + */ + className: createTransferStrategy(joinClasses), + /** + * Transfer the `style` prop (which is an object) by merging them. + */ + style: transferStrategyMerge + }; + + /** + * Mutates the first argument by transferring the properties from the second + * argument. + * + * @param {object} props + * @param {object} newProps + * @return {object} + */ + function transferInto(props, newProps) { + for (var thisKey in newProps) { + if (!newProps.hasOwnProperty(thisKey)) { + continue; } - if (to.nodeType != null) { - pos = size = getBounds(to); - style = getComputedStyle(to); - to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top]; - for (i = _i = 0, _len = BOUNDS_FORMAT.length; _i < _len; i = ++_i) { - side = BOUNDS_FORMAT[i]; - side = side[0].toUpperCase() + side.substr(1); - if (side === 'Top' || side === 'Left') { - to[i] += parseFloat(style["border" + side + "Width"]); - } else { - to[i] -= parseFloat(style["border" + side + "Width"]); - } - } + + var transferStrategy = TransferStrategies[thisKey]; + + if (transferStrategy && TransferStrategies.hasOwnProperty(thisKey)) { + transferStrategy(props, thisKey, newProps[thisKey]); + } else if (!props.hasOwnProperty(thisKey)) { + props[thisKey] = newProps[thisKey]; } - return to; + } + return props; + } + + /** + * ReactPropTransferer are capable of transferring props to another component + * using a `transferPropsTo` method. + * + * @class ReactPropTransferer + */ + var ReactPropTransferer = { + + /** + * Merge two props objects using TransferStrategies. + * + * @param {object} oldProps original props (they take precedence) + * @param {object} newProps new props to merge in + * @return {object} a new object containing both sets of props merged. + */ + mergeProps: function (oldProps, newProps) { + return transferInto(assign({}, oldProps), newProps); + } + + }; + + module.exports = ReactPropTransferer; + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + /** + * 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. + * + * @providesModule emptyFunction + */ + + "use strict"; + + function makeEmptyFunction(arg) { + return function () { + return arg; }; + } - this.Tether.modules.push({ - position: function(_arg) { - var addClasses, allClasses, attachment, bounds, changeAttachX, changeAttachY, cls, constraint, eAttachment, height, left, oob, oobClass, p, pin, pinned, pinnedClass, removeClass, side, tAttachment, targetAttachment, targetHeight, targetSize, targetWidth, to, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, - _this = this; - top = _arg.top, left = _arg.left, targetAttachment = _arg.targetAttachment; - if (!this.options.constraints) { - return true; - } - removeClass = function(prefix) { - var side, _i, _len, _results; - _this.removeClass(prefix); - _results = []; - for (_i = 0, _len = BOUNDS_FORMAT.length; _i < _len; _i++) { - side = BOUNDS_FORMAT[_i]; - _results.push(_this.removeClass("" + prefix + "-" + side)); - } - return _results; - }; - _ref1 = this.cache('element-bounds', function() { - return getBounds(_this.element); - }), height = _ref1.height, width = _ref1.width; - if (width === 0 && height === 0 && (this.lastSize != null)) { - _ref2 = this.lastSize, width = _ref2.width, height = _ref2.height; + /** + * 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. + */ + 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; + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + /** + * 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. + * + * @providesModule joinClasses + * @typechecks static-only + */ + + 'use strict'; + + /** + * Combines multiple className strings into one. + * http://jsperf.com/joinclasses-args-vs-array + * + * @param {...?string} className + * @return {string} + */ + function joinClasses(className /*, ... */) { + if (!className) { + className = ''; + } + var nextClass; + var argLength = arguments.length; + if (argLength > 1) { + for (var ii = 1; ii < argLength; ii++) { + nextClass = arguments[ii]; + if (nextClass) { + className = (className ? className + ' ' : '') + nextClass; } - targetSize = this.cache('target-bounds', function() { - return _this.getTargetBounds(); - }); - targetHeight = targetSize.height; - targetWidth = targetSize.width; - tAttachment = {}; - eAttachment = {}; - allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')]; - _ref3 = this.options.constraints; - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - constraint = _ref3[_i]; - if (constraint.outOfBoundsClass) { - allClasses.push(constraint.outOfBoundsClass); - } - if (constraint.pinnedClass) { - allClasses.push(constraint.pinnedClass); - } - } - for (_j = 0, _len1 = allClasses.length; _j < _len1; _j++) { - cls = allClasses[_j]; - _ref4 = ['left', 'top', 'right', 'bottom']; - for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) { - side = _ref4[_k]; - allClasses.push("" + cls + "-" + side); - } - } - addClasses = []; - tAttachment = extend({}, targetAttachment); - eAttachment = extend({}, this.attachment); - _ref5 = this.options.constraints; - for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { - constraint = _ref5[_l]; - to = constraint.to, attachment = constraint.attachment, pin = constraint.pin; - if (attachment == null) { - attachment = ''; - } - if (__indexOf.call(attachment, ' ') >= 0) { - _ref6 = attachment.split(' '), changeAttachY = _ref6[0], changeAttachX = _ref6[1]; - } else { - changeAttachX = changeAttachY = attachment; - } - bounds = getBoundingRect(this, to); - if (changeAttachY === 'target' || changeAttachY === 'both') { - if (top < bounds[1] && tAttachment.top === 'top') { - top += targetHeight; - tAttachment.top = 'bottom'; - } - if (top + height > bounds[3] && tAttachment.top === 'bottom') { - top -= targetHeight; - tAttachment.top = 'top'; - } - } - if (changeAttachY === 'together') { - if (top < bounds[1] && tAttachment.top === 'top') { - if (eAttachment.top === 'bottom') { - top += targetHeight; - tAttachment.top = 'bottom'; - top += height; - eAttachment.top = 'top'; - } else if (eAttachment.top === 'top') { - top += targetHeight; - tAttachment.top = 'bottom'; - top -= height; - eAttachment.top = 'bottom'; - } - } - if (top + height > bounds[3] && tAttachment.top === 'bottom') { - if (eAttachment.top === 'top') { - top -= targetHeight; - tAttachment.top = 'top'; - top -= height; - eAttachment.top = 'bottom'; - } else if (eAttachment.top === 'bottom') { - top -= targetHeight; - tAttachment.top = 'top'; - top += height; - eAttachment.top = 'top'; - } - } - if (tAttachment.top === 'middle') { - if (top + height > bounds[3] && eAttachment.top === 'top') { - top -= height; - eAttachment.top = 'bottom'; - } else if (top < bounds[1] && eAttachment.top === 'bottom') { - top += height; - eAttachment.top = 'top'; - } - } - } - if (changeAttachX === 'target' || changeAttachX === 'both') { - if (left < bounds[0] && tAttachment.left === 'left') { - left += targetWidth; - tAttachment.left = 'right'; - } - if (left + width > bounds[2] && tAttachment.left === 'right') { - left -= targetWidth; - tAttachment.left = 'left'; - } - } - if (changeAttachX === 'together') { - if (left < bounds[0] && tAttachment.left === 'left') { - if (eAttachment.left === 'right') { - left += targetWidth; - tAttachment.left = 'right'; - left += width; - eAttachment.left = 'left'; - } else if (eAttachment.left === 'left') { - left += targetWidth; - tAttachment.left = 'right'; - left -= width; - eAttachment.left = 'right'; - } - } else if (left + width > bounds[2] && tAttachment.left === 'right') { - if (eAttachment.left === 'left') { - left -= targetWidth; - tAttachment.left = 'left'; - left -= width; - eAttachment.left = 'right'; - } else if (eAttachment.left === 'right') { - left -= targetWidth; - tAttachment.left = 'left'; - left += width; - eAttachment.left = 'left'; - } - } else if (tAttachment.left === 'center') { - if (left + width > bounds[2] && eAttachment.left === 'left') { - left -= width; - eAttachment.left = 'right'; - } else if (left < bounds[0] && eAttachment.left === 'right') { - left += width; - eAttachment.left = 'left'; - } - } - } - if (changeAttachY === 'element' || changeAttachY === 'both') { - if (top < bounds[1] && eAttachment.top === 'bottom') { - top += height; - eAttachment.top = 'top'; - } - if (top + height > bounds[3] && eAttachment.top === 'top') { - top -= height; - eAttachment.top = 'bottom'; - } - } - if (changeAttachX === 'element' || changeAttachX === 'both') { - if (left < bounds[0] && eAttachment.left === 'right') { - left += width; - eAttachment.left = 'left'; - } - if (left + width > bounds[2] && eAttachment.left === 'left') { - left -= width; - eAttachment.left = 'right'; - } - } - if (typeof pin === 'string') { - pin = (function() { - var _len4, _m, _ref7, _results; - _ref7 = pin.split(','); - _results = []; - for (_m = 0, _len4 = _ref7.length; _m < _len4; _m++) { - p = _ref7[_m]; - _results.push(p.trim()); - } - return _results; - })(); - } else if (pin === true) { - pin = ['top', 'left', 'right', 'bottom']; - } - pin || (pin = []); - pinned = []; - oob = []; - if (top < bounds[1]) { - if (__indexOf.call(pin, 'top') >= 0) { - top = bounds[1]; - pinned.push('top'); - } else { - oob.push('top'); - } - } - if (top + height > bounds[3]) { - if (__indexOf.call(pin, 'bottom') >= 0) { - top = bounds[3] - height; - pinned.push('bottom'); - } else { - oob.push('bottom'); - } - } - if (left < bounds[0]) { - if (__indexOf.call(pin, 'left') >= 0) { - left = bounds[0]; - pinned.push('left'); - } else { - oob.push('left'); - } - } - if (left + width > bounds[2]) { - if (__indexOf.call(pin, 'right') >= 0) { - left = bounds[2] - width; - pinned.push('right'); - } else { - oob.push('right'); - } - } - if (pinned.length) { - pinnedClass = (_ref7 = this.options.pinnedClass) != null ? _ref7 : this.getClass('pinned'); - addClasses.push(pinnedClass); - for (_m = 0, _len4 = pinned.length; _m < _len4; _m++) { - side = pinned[_m]; - addClasses.push("" + pinnedClass + "-" + side); - } - } - if (oob.length) { - oobClass = (_ref8 = this.options.outOfBoundsClass) != null ? _ref8 : this.getClass('out-of-bounds'); - addClasses.push(oobClass); - for (_n = 0, _len5 = oob.length; _n < _len5; _n++) { - side = oob[_n]; - addClasses.push("" + oobClass + "-" + side); - } - } - if (__indexOf.call(pinned, 'left') >= 0 || __indexOf.call(pinned, 'right') >= 0) { - eAttachment.left = tAttachment.left = false; - } - if (__indexOf.call(pinned, 'top') >= 0 || __indexOf.call(pinned, 'bottom') >= 0) { - eAttachment.top = tAttachment.top = false; - } - if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== this.attachment.top || eAttachment.left !== this.attachment.left) { - this.updateAttachClasses(eAttachment, tAttachment); - } - } - defer(function() { - updateClasses(_this.target, addClasses, allClasses); - return updateClasses(_this.element, addClasses, allClasses); - }); - return { - top: top, - left: left - }; } - }); + } + return className; + } - }).call(this); + module.exports = joinClasses; - (function() { - var defer, getBounds, updateClasses, _ref; +/***/ }, +/* 11 */ +/***/ function(module, exports) { - _ref = this.Tether.Utils, getBounds = _ref.getBounds, updateClasses = _ref.updateClasses, defer = _ref.defer; + /** + * 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. + * + * @providesModule keyOf + */ - this.Tether.modules.push({ - position: function(_arg) { - var abutted, addClasses, allClasses, bottom, height, left, right, side, sides, targetPos, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5, - _this = this; - top = _arg.top, left = _arg.left; - _ref1 = this.cache('element-bounds', function() { - return getBounds(_this.element); - }), height = _ref1.height, width = _ref1.width; - targetPos = this.getTargetBounds(); - bottom = top + height; - right = left + width; - abutted = []; - if (top <= targetPos.bottom && bottom >= targetPos.top) { - _ref2 = ['left', 'right']; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - side = _ref2[_i]; - if ((_ref3 = targetPos[side]) === left || _ref3 === right) { - abutted.push(side); - } - } - } - if (left <= targetPos.right && right >= targetPos.left) { - _ref4 = ['top', 'bottom']; - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - side = _ref4[_j]; - if ((_ref5 = targetPos[side]) === top || _ref5 === bottom) { - abutted.push(side); - } - } - } - allClasses = []; - addClasses = []; - sides = ['left', 'top', 'right', 'bottom']; - allClasses.push(this.getClass('abutted')); - for (_k = 0, _len2 = sides.length; _k < _len2; _k++) { - side = sides[_k]; - allClasses.push("" + (this.getClass('abutted')) + "-" + side); - } - if (abutted.length) { - addClasses.push(this.getClass('abutted')); - } - for (_l = 0, _len3 = abutted.length; _l < _len3; _l++) { - side = abutted[_l]; - addClasses.push("" + (this.getClass('abutted')) + "-" + side); - } - defer(function() { - updateClasses(_this.target, addClasses, allClasses); - return updateClasses(_this.element, addClasses, allClasses); - }); - return true; + /** + * Allows extraction of a minified key. Let's the build system minify keys + * without losing the ability to dynamically use key strings as values + * themselves. Pass in an object with a single key/val pair and it will return + * you the string key of that single record. Suppose you want to grab the + * value for a key 'className' inside of an object. Key/val minification may + * have aliased that key to be 'xa12'. keyOf({className: null}) will return + * 'xa12' in that case. Resolve keys you want to use once at startup time, then + * reuse those resolutions. + */ + "use strict"; + + var keyOf = function (oneKeyObj) { + var key; + for (key in oneKeyObj) { + if (!oneKeyObj.hasOwnProperty(key)) { + continue; } - }); + return key; + } + return null; + }; - }).call(this); + module.exports = keyOf; - (function() { - this.Tether.modules.push({ - position: function(_arg) { - var left, result, shift, shiftLeft, shiftTop, top, _ref; - top = _arg.top, left = _arg.left; - if (!this.options.shift) { - return; - } - result = function(val) { - if (typeof val === 'function') { - return val.call(this, { - top: top, - left: left - }); - } else { - return val; - } - }; - shift = result(this.options.shift); - if (typeof shift === 'string') { - shift = shift.split(' '); - shift[1] || (shift[1] = shift[0]); - shiftTop = shift[0], shiftLeft = shift[1]; - shiftTop = parseFloat(shiftTop, 10); - shiftLeft = parseFloat(shiftLeft, 10); - } else { - _ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1]; +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * 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. + * + * @providesModule warning + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(9); + + /** + * 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 ((undefined) !== 'production') { + warning = function (condition, format) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _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.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); } - top += shiftTop; - left += shiftLeft; - return { - top: top, - left: left - }; + 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) {} } - }); + }; + } - }).call(this); + module.exports = warning; - return this.Tether; +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { - })); + 'use strict'; + + var React = __webpack_require__(2); + var cx = __webpack_require__(14); + + var AccordionItem = React.createClass({ + displayName: 'AccordionItem', + + render: function render() { + var itemClasses = { + 'accordion-item': true, + 'is-active': this.props.active + }; + return React.createElement( + 'div', + { className: cx(itemClasses) }, + React.createElement( + 'div', + { className: 'accordion-title', onClick: this.props.activate }, + this.props.title + ), + React.createElement( + 'div', + { className: 'accordion-content' }, + this.props.children + ) + ); + } + }); + + module.exports = AccordionItem; /***/ }, -/* 2 */ +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2015 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + */ + /* global define */ + + (function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = ''; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes += ' ' + arg; + } else if (Array.isArray(arg)) { + classes += ' ' + classNames.apply(null, arg); + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes += ' ' + key; + } + } + } + } + + return classes.substr(1); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { + return classNames; + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { + window.classNames = classNames; + } + }()); + + +/***/ }, +/* 15 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var React = __webpack_require__(12); - var cloneWithProps = __webpack_require__(25); - var foundationApi = __webpack_require__(14); + var React = __webpack_require__(2); + var cloneWithProps = __webpack_require__(3); + var foundationApi = __webpack_require__(16); var ActionSheet = React.createClass({ displayName: 'ActionSheet', @@ -1601,1053 +1031,1334 @@ return /******/ (function(modules) { // webpackBootstrap }); module.exports = ActionSheet; - ActionSheet.Button = __webpack_require__(15); - ActionSheet.Content = __webpack_require__(16); + ActionSheet.Button = __webpack_require__(19); + ActionSheet.Content = __webpack_require__(20); /***/ }, -/* 3 */ +/* 16 */ /***/ function(module, exports, __webpack_require__) { + //From https://github.com/zurb/foundation-apps/blob/master/js/angular/common/common.services.js 'use strict'; - var React = __webpack_require__(12); - var ExecutionEnvironment = __webpack_require__(26); - var IconicJs = ExecutionEnvironment.canUseDOM && __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"../vendor/iconic.min\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); - var cloneWithProps = __webpack_require__(25); + var PubSub = __webpack_require__(17); + var assign = __webpack_require__(18); - var Iconic = React.createClass({ - displayName: 'Iconic', + var listeners = []; + var settings = {}; + var uniqueIds = []; - inject: function inject() { - var ico = IconicJs(); - ico.inject(this.getDOMNode()); + var foundationApi = { + subscribe: PubSub.subscribe, + publish: PubSub.publish, + unsubscribe: PubSub.unsubscribe, + closeActiveElements: function closeActiveElements(options) { + var self = this; + options = options || {}; + var activeElements = document.querySelectorAll('.is-active[data-closable]'); + Array.prototype.forEach.call(activeElements, function (el) { + if (options.exclude !== el.id) { + self.publish(el.id, 'close'); + } + }); }, - componentDidMount: function componentDidMount() { - this.inject(); + getSettings: function getSettings() { + return settings; }, - componentDidUpdate: function componentDidUpdate() { - this.inject(); + modifySettings: function modifySettings(tree) { + settings = angular.extend(settings, tree); + return settings; }, - render: function render() { - return React.Children.only(this.props.children); + generateUuid: function generateUuid() { + var uuid = ''; + + //little trick to produce semi-random IDs + do { + uuid += 'zf-uuid-'; + for (var i = 0; i < 15; i++) { + uuid += Math.floor(Math.random() * 16).toString(16); + } + } while (!uniqueIds.indexOf(uuid)); + + uniqueIds.push(uuid); + return uuid; } - }); + }; - module.exports = Iconic; + module.exports = foundationApi; /***/ }, -/* 4 */ +/* 17 */ /***/ function(module, exports, __webpack_require__) { - 'use strict'; - - var React = __webpack_require__(12); - var ResponsiveMixin = __webpack_require__(22); - - var namedQueries = {}; - - var Interchange = React.createClass({ - displayName: 'Interchange', + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* + Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk + License: MIT - http://mrgnrdrck.mit-license.org - mixins: [ResponsiveMixin], - getInitialState: function getInitialState() { - return { matchedMedia: 'large' }; - }, - componentDidMount: function componentDidMount() { - // for (var name in namedQueries) { - // this.media(namedQueries[name], function () { - // this.setState({matchedMedia: name}); - // }.bind(this)); - // } - this.media({ minWidth: 0, maxWidth: 640 }, (function () { - this.setState({ matchedMedia: 'small' }); - }).bind(this)); - this.media({ minWidth: 641, maxWidth: 1200 }, (function () { - this.setState({ matchedMedia: 'medium' }); - }).bind(this)); - this.media({ minWidth: 1200, maxWidth: 1440 }, (function () { - this.setState({ matchedMedia: 'large' }); - }).bind(this)); - }, - render: function render() { - var matchedNode = null; - React.Children.forEach(this.props.children, (function (child) { - if (child.props.media === this.state.matchedMedia) { - matchedNode = child; - } - }).bind(this)); - return matchedNode; - } - }); + https://github.com/mroderick/PubSubJS + */ + (function (root, factory){ + 'use strict'; - module.exports = Interchange; + if (true){ + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - // small: '(min-width: 0) and (max-width: 640px)', - // medium: '(min-width: 641px) and (max-width: 1200px)', - // large: '(min-width: 1201px) and (max-width: 1440px)', - // 'default' : 'only screen', - // landscape : 'only screen and (orientation: landscape)', - // portrait : 'only screen and (orientation: portrait)', - // retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' + - // 'only screen and (min--moz-device-pixel-ratio: 2),' + - // 'only screen and (-o-min-device-pixel-ratio: 2/1),' + - // 'only screen and (min-device-pixel-ratio: 2),' + - // 'only screen and (min-resolution: 192dpi),' + - // 'only screen and (min-resolution: 2dppx)' + } else if (typeof exports === 'object'){ + // CommonJS + factory(exports); -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { + } - 'use strict'; + // Browser globals + var PubSub = {}; + root.PubSub = PubSub; + factory(PubSub); + + }(( typeof window === 'object' && window ) || this, function (PubSub){ + 'use strict'; - var React = __webpack_require__(12); - var cx = __webpack_require__(27); - var Animation = __webpack_require__(17); - var foundationApi = __webpack_require__(14); + var messages = {}, + lastUid = -1; - var Modal = React.createClass({ - displayName: 'Modal', + function hasKeys(obj){ + var key; - getInitialState: function getInitialState() { - return { open: false }; - }, - getDefaultProps: function getDefaultProps() { - return { - overlay: true, - overlayClose: true, - animationIn: 'fadeIn', - animationOut: 'fadeOut' - }; - }, - componentDidMount: function componentDidMount() { - foundationApi.subscribe(this.props.id, (function (name, msg) { - if (msg === 'open') { - this.setState({ open: true }); - } else if (msg === 'close') { - this.setState({ open: false }); - } else if (msg === 'toggle') { - this.setState({ open: !this.state.open }); - } - }).bind(this)); - }, - componentWillUnmount: function componentWillUnmount() { - foundationApi.unsubscribe(this.props.id); - }, - hideOverlay: function hideOverlay(e) { - e.preventDefault(); - if (this.props.overlayClose) { - this.setState({ open: false }); - } - }, - stopClickPropagation: function stopClickPropagation(e) { - e.preventDefault(); - e.stopPropagation(); - }, - render: function render() { - var overlayStyle = {}; - if (!this.props.overlay) { - overlayStyle.background = 'transparent'; - } - return React.createElement( - Animation, - { active: this.state.open, animationIn: 'fadeIn', animationOut: 'fadeOut' }, - React.createElement( - 'div', - { className: 'modal-overlay', style: overlayStyle, onClick: this.hideOverlay }, - React.createElement( - Animation, - { - active: this.state.open, - animationIn: this.props.animationIn, - animationOut: this.props.animationOut - }, - React.createElement( - 'div', - { id: this.props.id, 'data-closable': true, className: 'modal', onClick: this.stopClickPropagation }, - this.props.children - ) - ) - ) - ); - } - }); + for (key in obj){ + if ( obj.hasOwnProperty(key) ){ + return true; + } + } + return false; + } - module.exports = Modal; + /** + * Returns a function that throws the passed exception, for use as argument for setTimeout + * @param { Object } ex An Error object + */ + function throwException( ex ){ + return function reThrowException(){ + throw ex; + }; + } -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { + function callSubscriberWithDelayedExceptions( subscriber, message, data ){ + try { + subscriber( message, data ); + } catch( ex ){ + setTimeout( throwException( ex ), 0); + } + } - 'use strict'; + function callSubscriberWithImmediateExceptions( subscriber, message, data ){ + subscriber( message, data ); + } - module.exports = { - Set: __webpack_require__(18), - Static: __webpack_require__(19) - }; + function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){ + var subscribers = messages[matchedMessage], + callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions, + s; -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { + if ( !messages.hasOwnProperty( matchedMessage ) ) { + return; + } - 'use strict'; + for (s in subscribers){ + if ( subscribers.hasOwnProperty(s)){ + callSubscriber( subscribers[s], originalMessage, data ); + } + } + } - var React = __webpack_require__(12); - var cx = __webpack_require__(27); - // var LayerMixin = require('react-layer-mixin'); - var foundationApi = __webpack_require__(14); + function createDeliveryFunction( message, data, immediateExceptions ){ + return function deliverNamespaced(){ + var topic = String( message ), + position = topic.lastIndexOf( '.' ); - var Offcanvas = React.createClass({ - displayName: 'Offcanvas', + // deliver the message as it is now + deliverMessage(message, message, data, immediateExceptions); - // mixins: [LayerMixin], - getInitialState: function getInitialState() { - return { open: false }; - }, - getDefaultProps: function getDefaultProps() { - return { - position: 'left' - }; - }, - componentDidMount: function componentDidMount() { - foundationApi.subscribe(this.props.id, (function (name, msg) { - if (msg === 'open') { - this.setState({ open: true }); - } else if (msg === 'close') { - this.setState({ open: false }); - } else if (msg === 'toggle') { - this.setState({ open: !this.state.open }); - } - }).bind(this)); - }, - componentWillUnmount: function componentWillUnmount() { - foundationApi.unsubscribe(this.props.id); - }, - render: function render() { - var classes = { - 'off-canvas': true, - 'is-active': this.state.open - }; - classes[this.props.position] = true; - if (this.props.className) { - classes[this.props.className] = true; - } - return React.createElement( - 'div', - { id: this.props.id, 'data-closable': true, className: cx(classes) }, - this.props.children - ); - } - }); + // trim the hierarchy and deliver message to each level + while( position !== -1 ){ + topic = topic.substr( 0, position ); + position = topic.lastIndexOf('.'); + deliverMessage( message, topic, data, immediateExceptions ); + } + }; + } - module.exports = Offcanvas; + function messageHasSubscribers( message ){ + var topic = String( message ), + found = Boolean(messages.hasOwnProperty( topic ) && hasKeys(messages[topic])), + position = topic.lastIndexOf( '.' ); -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { + while ( !found && position !== -1 ){ + topic = topic.substr( 0, position ); + position = topic.lastIndexOf( '.' ); + found = Boolean(messages.hasOwnProperty( topic ) && hasKeys(messages[topic])); + } - 'use strict'; + return found; + } - var React = __webpack_require__(12); - var cx = __webpack_require__(27); - var Animation = __webpack_require__(17); - var foundationApi = __webpack_require__(14); + function publish( message, data, sync, immediateExceptions ){ + var deliver = createDeliveryFunction( message, data, immediateExceptions ), + hasSubscribers = messageHasSubscribers( message ); - var Panel = React.createClass({ - displayName: 'Panel', + if ( !hasSubscribers ){ + return false; + } - getInitialState: function getInitialState() { - return { open: false }; - }, - getDefaultProps: function getDefaultProps() { - return { - position: 'left' - }; - }, - componentDidMount: function componentDidMount() { - foundationApi.subscribe(this.props.id, (function (name, msg) { - if (msg === 'open') { - this.setState({ open: true }); - } else if (msg === 'close') { - this.setState({ open: false }); - } else if (msg === 'toggle') { - this.setState({ open: !this.state.open }); - } - }).bind(this)); - }, - componentWillUnmount: function componentWillUnmount() { - foundationApi.unsubscribe(this.props.id); + if ( sync === true ){ + deliver(); + } else { + setTimeout( deliver, 0 ); + } + return true; + } + + /** + * PubSub.publish( message[, data] ) -> Boolean + * - message (String): The message to publish + * - data: The data to pass to subscribers + * Publishes the the message, passing the data to it's subscribers + **/ + PubSub.publish = function( message, data ){ + return publish( message, data, false, PubSub.immediateExceptions ); + }; + + /** + * PubSub.publishSync( message[, data] ) -> Boolean + * - message (String): The message to publish + * - data: The data to pass to subscribers + * Publishes the the message synchronously, passing the data to it's subscribers + **/ + PubSub.publishSync = function( message, data ){ + return publish( message, data, true, PubSub.immediateExceptions ); + }; + + /** + * PubSub.subscribe( message, func ) -> String + * - message (String): The message to subscribe to + * - func (Function): The function to call when a new message is published + * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if + * you need to unsubscribe + **/ + PubSub.subscribe = function( message, func ){ + if ( typeof func !== 'function'){ + return false; + } + + // message is not registered yet + if ( !messages.hasOwnProperty( message ) ){ + messages[message] = {}; + } + + // forcing token as String, to allow for future expansions without breaking usage + // and allow for easy use as key names for the 'messages' object + var token = 'uid_' + String(++lastUid); + messages[message][token] = func; + + // return token for unsubscribing + return token; + }; + + /* Public: Clears all subscriptions + */ + PubSub.clearAllSubscriptions = function clearAllSubscriptions(){ + messages = {}; + }; + + /*Public: Clear subscriptions by the topic + */ + PubSub.clearSubscriptions = function clearSubscriptions(topic){ + var m; + for (m in messages){ + if (messages.hasOwnProperty(m) && m.indexOf(topic) === 0){ + delete messages[m]; + } + } + }; + + /* Public: removes subscriptions. + * When passed a token, removes a specific subscription. + * When passed a function, removes all subscriptions for that function + * When passed a topic, removes all subscriptions for that topic (hierarchy) + * + * value - A token, function or topic to unsubscribe. + * + * Examples + * + * // Example 1 - unsubscribing with a token + * var token = PubSub.subscribe('mytopic', myFunc); + * PubSub.unsubscribe(token); + * + * // Example 2 - unsubscribing with a function + * PubSub.unsubscribe(myFunc); + * + * // Example 3 - unsubscribing a topic + * PubSub.unsubscribe('mytopic'); + */ + PubSub.unsubscribe = function(value){ + var isTopic = typeof value === 'string' && messages.hasOwnProperty(value), + isToken = !isTopic && typeof value === 'string', + isFunction = typeof value === 'function', + result = false, + m, message, t; + + if (isTopic){ + delete messages[value]; + return; + } + + for ( m in messages ){ + if ( messages.hasOwnProperty( m ) ){ + message = messages[m]; + + if ( isToken && message[value] ){ + delete message[value]; + result = value; + // tokens are unique, so we can just stop here + break; + } + + if (isFunction) { + for ( t in message ){ + if (message.hasOwnProperty(t) && message[t] === value){ + delete message[t]; + result = true; + } + } + } + } + } + + return result; + }; + })); + + +/***/ }, +/* 18 */ +/***/ function(module, exports) { + + 'use strict'; + + function ToObject(val) { + if (val == null) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + module.exports = Object.assign || function (target, source) { + var from; + var keys; + var to = ToObject(target); + + for (var s = 1; s < arguments.length; s++) { + from = arguments[s]; + keys = Object.keys(Object(from)); + + for (var i = 0; i < keys.length; i++) { + to[keys[i]] = from[keys[i]]; + } + } + + return to; + }; + + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var React = __webpack_require__(2); + + var ActionSheetButton = React.createClass({ + displayName: 'ActionSheetButton', + + toggle: function toggle() { + this.props.setActiveState(!this.props.active); }, render: function render() { - var animationIn, animationOut; - var classes = 'panel panel-' + this.props.position; - if (this.props.className) { - classes += ' ' + this.props.className; - } - if (this.props.position === 'left') { - animationIn = this.props.animationIn || 'slideInRight'; - animationOut = this.props.animationOut || 'slideOutLeft'; - } else if (this.props.position === 'right') { - animationIn = this.props.animationIn || 'slideInLeft'; - animationOut = this.props.animationOut || 'slideOutRight'; - } else if (this.props.position === 'top') { - animationIn = this.props.animationIn || 'slideInDown'; - animationOut = this.props.animationOut || 'slideOutUp'; - } else if (this.props.position === 'bottom') { - animationIn = this.props.animationIn || 'slideInUp'; - animationOut = this.props.animationOut || 'slideOutBottom'; + var Title = null; + if (this.props.title.length > 0) { + Title = React.createElement( + 'a', + { className: 'button' }, + this.props.title + ); } return React.createElement( - Animation, - { active: this.state.open, animationIn: animationIn, animationOut: animationOut }, + 'div', + { onClick: this.toggle }, + Title, React.createElement( 'div', - { 'data-closable': true, id: this.props.id, className: classes }, + null, this.props.children ) ); } }); - module.exports = Panel; + module.exports = ActionSheetButton; /***/ }, -/* 9 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var React = __webpack_require__(12); - var cx = __webpack_require__(27); - var ExecutionEnvironment = __webpack_require__(26); - var foundationApi = __webpack_require__(14); - var Tether = ExecutionEnvironment.canUseDOM && __webpack_require__(1); + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); - var Popup = React.createClass({ - displayName: 'Popup', + var ActionSheetContent = React.createClass({ + displayName: 'ActionSheetContent', - getInitialState: function getInitialState() { - return { - active: false, - tetherInit: false - }; - }, getDefaultProps: function getDefaultProps() { - return { - pinTo: 'top center', - pinAt: '' - }; - }, - componentDidMount: function componentDidMount() { - this.tether = {}; - foundationApi.subscribe(this.props.id, (function (name, msg) { - if (msg[0] === 'toggle') { - this.toggle(msg[1]); - } - }).bind(this)); - }, - toggle: function toggle(target) { - var active = !this.state.active; - this.setState({ active: active }, (function () { - if (active) { - this.tetherElement(target); - } else { - this.tether.destroy(); - } - }).bind(this)); - }, - tetherElement: function tetherElement(target) { - var targetElement = document.getElementById(target); - var attachment = 'top center'; - this.tether = new Tether({ - element: this.getDOMNode(), - target: targetElement, - attachment: attachment - }); + return { position: 'bottom' }; }, render: function render() { var classes = { - popup: true, - 'is-active': this.state.active + 'action-sheet': true, + 'is-active': this.props.active }; return React.createElement( 'div', - { id: this.props.id, className: cx(classes), 'data-closable': 'popup' }, + { className: cx(classes) }, this.props.children ); } }); - module.exports = Popup; + module.exports = ActionSheetContent; /***/ }, -/* 10 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var React = __webpack_require__(12); - var cloneWithProps = __webpack_require__(25); + var React = __webpack_require__(2); + var ExecutionEnvironment = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/ExecutionEnvironment\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var IconicJs = ExecutionEnvironment.canUseDOM && __webpack_require__(22); + var cloneWithProps = __webpack_require__(3); - var Tabs = React.createClass({ - displayName: 'Tabs', + var Iconic = React.createClass({ + displayName: 'Iconic', - getInitialState: function getInitialState() { - return { - selectedTab: 0, - content: null - }; + inject: function inject() { + var ico = IconicJs(); + ico.inject(this.getDOMNode()); }, - selectTab: function selectTab(options) { - this.setState(options); + componentDidMount: function componentDidMount() { + this.inject(); + }, + componentDidUpdate: function componentDidUpdate() { + this.inject(); }, render: function render() { - var children = React.Children.map(this.props.children, (function (child, index) { - return cloneWithProps(child, { - active: index === this.state.selectedTab, - index: index, - selectTab: this.selectTab - }); - }).bind(this)); - return React.createElement( - 'div', - null, - React.createElement( - 'div', - { className: 'tabs' }, - children - ), - React.createElement( - 'div', - null, - this.state.content - ) - ); + return React.Children.only(this.props.children); } }); - module.exports = Tabs; - Tabs.Tab = __webpack_require__(20); + module.exports = Iconic; /***/ }, -/* 11 */ +/* 22 */ +/***/ function(module, exports) { + + /*! + * iconic.js v0.4.0 - The Iconic JavaScript library + * Copyright (c) 2014 Waybury - http://useiconic.com + */ + + !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.IconicJS=a():"undefined"!=typeof global?global.IconicJS=a():"undefined"!=typeof self&&(self.IconicJS=a())}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>>0;for(c=0;d>c;++c)c in this&&a.call(b,this[c],c,this)}),function(){if(Event.prototype.preventDefault||(Event.prototype.preventDefault=function(){this.returnValue=!1}),Event.prototype.stopPropagation||(Event.prototype.stopPropagation=function(){this.cancelBubble=!0}),!Element.prototype.addEventListener){var a=[],b=function(b,c){var d=this,e=function(a){a.target=a.srcElement,a.currentTarget=d,c.handleEvent?c.handleEvent(a):c.call(d,a)};if("DOMContentLoaded"==b){var f=function(a){"complete"==document.readyState&&e(a)};if(document.attachEvent("onreadystatechange",f),a.push({object:this,type:b,listener:c,wrapper:f}),"complete"==document.readyState){var g=new Event;g.srcElement=window,f(g)}}else this.attachEvent("on"+b,e),a.push({object:this,type:b,listener:c,wrapper:e})},c=function(b,c){for(var d=0;df?d.width:d.height;var g;g=32>b?"iconic-sm":b>=32&&128>b?"iconic-md":"iconic-lg";var h=a.getAttribute("class"),i=c.test(h)?h.replace(c,g):h+" "+g;a.setAttribute("class",i)}},h=function(){var a=document.querySelectorAll(".injected-svg.iconic-fluid");Array.prototype.forEach.call(a,function(a){g(a)})};document.addEventListener("DOMContentLoaded",function(){f()}),window.addEventListener("resize",function(){h()}),b.exports={refresh:g,refreshAll:h}},{}],8:[function(b,c,d){!function(b,e){"use strict";function f(a){a=a.split(" ");for(var b={},c=a.length,d=[];c--;)b.hasOwnProperty(a[c])||(b[a[c]]=1,d.unshift(a[c]));return d.join(" ")}var g="file:"===b.location.protocol,h=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),i=Array.prototype.forEach||function(a,b){if(void 0===this||null===this||"function"!=typeof a)throw new TypeError;var c,d=this.length>>>0;for(c=0;d>c;++c)c in this&&a.call(b,this[c],c,this)},j={},k=0,l=[],m=[],n={},o=function(a){return a.cloneNode(!0)},p=function(a,b){m[a]=m[a]||[],m[a].push(b)},q=function(a){for(var b=0,c=m[a].length;c>b;b++)!function(b){setTimeout(function(){m[a][b](o(j[a]))},0)}(b)},r=function(a,c){if(void 0!==j[a])j[a]instanceof SVGSVGElement?c(o(j[a])):p(a,c);else{if(!b.XMLHttpRequest)return c("Browser does not support XMLHttpRequest"),!1;j[a]={},p(a,c);var d=new XMLHttpRequest;d.onreadystatechange=function(){if(4===d.readyState){if(404===d.status||null===d.responseXML)return c("Unable to load SVG file: "+a),g&&c("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),c(),!1;if(!(200===d.status||g&&0===d.status))return c("There was a problem injecting the SVG: "+d.status+" "+d.statusText),!1;if(d.responseXML instanceof Document)j[a]=d.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var b;try{var e=new DOMParser;b=e.parseFromString(d.responseText,"text/xml")}catch(f){b=void 0}if(!b||b.getElementsByTagName("parsererror").length)return c("Unable to parse SVG file: "+a),!1;j[a]=b.documentElement}q(a)}},d.open("GET",a),d.overrideMimeType&&d.overrideMimeType("text/xml"),d.send()}},s=function(a,c,d,e){var g=a.getAttribute("data-src")||a.getAttribute("src");if(!/svg$/i.test(g))return e("Attempted to inject a file with a non-svg extension: "+g),void 0;if(!h){var j=a.getAttribute("data-fallback")||a.getAttribute("data-png");return j?(a.setAttribute("src",j),e(null)):d?(a.setAttribute("src",d+"/"+g.split("/").pop().replace(".svg",".png")),e(null)):e("This browser does not support SVG and no PNG fallback was defined."),void 0}-1===l.indexOf(a)&&(l.push(a),a.setAttribute("src",""),r(g,function(d){if("undefined"==typeof d||"string"==typeof d)return e(d),!1;var h=a.getAttribute("id");h&&d.setAttribute("id",h);var j=a.getAttribute("title");j&&d.setAttribute("title",j);var m=[].concat(d.getAttribute("class")||[],"injected-svg",a.getAttribute("class")||[]).join(" ");d.setAttribute("class",f(m));var o=a.getAttribute("style");o&&d.setAttribute("style",o);var p=[].filter.call(a.attributes,function(a){return/^data-\w[\w\-]*$/.test(a.name)});i.call(p,function(a){a.name&&a.value&&d.setAttribute(a.name,a.value)});for(var q,r=d.querySelectorAll("defs clipPath[id]"),s=0,t=r.length;t>s;s++){q=r[s].id+"-"+k;for(var u=d.querySelectorAll('[clip-path*="'+r[s].id+'"]'),v=0,w=u.length;w>v;v++)u[v].setAttribute("clip-path","url(#"+q+")");r[s].id=q}d.removeAttribute("xmlns:a");for(var x,y,z=d.querySelectorAll("script"),A=[],B=0,C=z.length;C>B;B++)y=z[B].getAttribute("type"),y&&"application/ecmascript"!==y&&"application/javascript"!==y||(x=z[B].innerText||z[B].textContent,A.push(x),d.removeChild(z[B]));if(A.length>0&&("always"===c||"once"===c&&!n[g])){for(var D=0,E=A.length;E>D;D++)new Function(A[D])(b);n[g]=!0}a.parentNode.replaceChild(d,a),delete l[l.indexOf(a)],a=null,k++,e(d)}))},t=function(a,b,c){b=b||{};var d=b.evalScripts||"always",e=b.pngFallback||!1,f=b.each;if(void 0!==a.length){var g=0;i.call(a,function(b){s(b,d,e,function(b){f&&"function"==typeof f&&f(b),c&&a.length===++g&&c(g)})})}else a?s(a,d,e,function(b){f&&"function"==typeof f&&f(b),c&&c(1),a=null}):c&&c(0)};"object"==typeof c&&"object"==typeof c.exports?c.exports=d=t:"function"==typeof a&&a.amd?a(function(){return t}):"object"==typeof b&&(b.SVGInjector=t)}(window,document)},{}]},{},[1])(1)}); + +/***/ }, +/* 23 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var React = __webpack_require__(12); - var cloneWithProps = __webpack_require__(25); - var foundationApi = __webpack_require__(14); - var PopupToggle = __webpack_require__(21); - - var Trigger = React.createClass({ - displayName: 'Trigger', + var React = __webpack_require__(2); + var ResponsiveMixin = __webpack_require__(24); + + var namedQueries = { + // small: '(min-width: 0) and (max-width: 640px)', + // medium: '(min-width: 641px) and (max-width: 1200px)', + // large: '(min-width: 1201px) and (max-width: 1440px)', + // 'default' : 'only screen', + // landscape : 'only screen and (orientation: landscape)', + // portrait : 'only screen and (orientation: portrait)', + // retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' + + // 'only screen and (min--moz-device-pixel-ratio: 2),' + + // 'only screen and (-o-min-device-pixel-ratio: 2/1),' + + // 'only screen and (min-device-pixel-ratio: 2),' + + // 'only screen and (min-resolution: 192dpi),' + + // 'only screen and (min-resolution: 2dppx)' + }; - getDefaultProps: function getDefaultProps() { - return { - open: null, - close: null, - toggle: null, - hardToggle: null, - popupToggle: null, - notify: null - }; - }, - getCloseId: function getCloseId() { - if (this.props.close) { - return this.props.close; - } else { - var parentElement = false; - var tempElement = this.getDOMNode().parentNode; - while (parentElement === false) { - if (tempElement.nodeName == 'BODY') { - parentElement = ''; - } - if (typeof tempElement.getAttribute('data-closable') !== 'undefined' && tempElement.getAttribute('data-closable') !== false) { - parentElement = tempElement; - } + var Interchange = React.createClass({ + displayName: 'Interchange', - tempElement = tempElement.parentNode; - } - return parentElement.getAttribute('id'); - } + mixins: [ResponsiveMixin], + getInitialState: function getInitialState() { + return { matchedMedia: 'large' }; }, - clickHandler: function clickHandler(e) { - e.preventDefault(); - if (this.props.open) { - foundationApi.publish(this.props.open, 'open'); - } else if (this.props.close !== null) { - foundationApi.publish(this.getCloseId(), 'close'); - } else if (this.props.toggle) { - foundationApi.publish(this.props.toggle, 'toggle'); - } else if (this.props.hardToggle) { - foundationApi.closeActiveElements({ exclude: this.props.hardToggle }); - foundationApi.publish(this.props.hardToggle, 'toggle'); - } else if (this.props.notify) { - foundationApi.publish(this.props.notify, { - title: this.props.title, - content: this.props.content, - position: this.props.position, - color: this.props.color, - image: this.props.image - }); - } + componentDidMount: function componentDidMount() { + // for (var name in namedQueries) { + // this.media(namedQueries[name], function () { + // this.setState({matchedMedia: name}); + // }.bind(this)); + // } + this.media({ minWidth: 0, maxWidth: 640 }, (function () { + this.setState({ matchedMedia: 'small' }); + }).bind(this)); + this.media({ minWidth: 641, maxWidth: 1200 }, (function () { + this.setState({ matchedMedia: 'medium' }); + }).bind(this)); + this.media({ minWidth: 1200, maxWidth: 1440 }, (function () { + this.setState({ matchedMedia: 'large' }); + }).bind(this)); }, render: function render() { - if (this.props.popupToggle) { - return React.createElement(PopupToggle, this.props); - } else { - var child = React.Children.only(this.props.children); - return cloneWithProps(child, { - onClick: this.clickHandler - }); - } + var matchedNode = null; + React.Children.forEach(this.props.children, (function (child) { + if (child.props.media === this.state.matchedMedia) { + matchedNode = child; + } + }).bind(this)); + return matchedNode; } }); - module.exports = Trigger; + module.exports = Interchange; /***/ }, -/* 12 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { - module.exports = __WEBPACK_EXTERNAL_MODULE_12__; + var canUseDOM = __webpack_require__(25); + var enquire = canUseDOM && __webpack_require__(26); + var json2mq = __webpack_require__(27); -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { + var ResponsiveMixin = { + media: function (query, handler) { + query = json2mq(query); + if (typeof handler === 'function') { + handler = { + match: handler + }; + } + enquire.register(query, handler); - 'use strict'; + // Queue the handlers to unregister them at unmount + if (! this._responsiveMediaHandlers) { + this._responsiveMediaHandlers = []; + } + this._responsiveMediaHandlers.push({query: query, handler: handler}); + }, + componentWillUnmount: function () { + if (this._responsiveMediaHandlers) { + this._responsiveMediaHandlers.forEach(function(obj) { + enquire.unregister(obj.query, obj.handler); + }); + } + } + }; - var React = __webpack_require__(12); - var cx = __webpack_require__(27); + module.exports = ResponsiveMixin; - var AccordionItem = React.createClass({ - displayName: 'AccordionItem', +/***/ }, +/* 25 */ +/***/ function(module, exports) { - render: function render() { - var itemClasses = { - 'accordion-item': true, - 'is-active': this.props.active - }; - return React.createElement( - 'div', - { className: cx(itemClasses) }, - React.createElement( - 'div', - { className: 'accordion-title', onClick: this.props.activate }, - this.props.title - ), - React.createElement( - 'div', - { className: 'accordion-content' }, - this.props.children - ) - ); - } - }); + var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement + ); - module.exports = AccordionItem; + module.exports = canUseDOM; /***/ }, -/* 14 */ +/* 26 */ /***/ function(module, exports, __webpack_require__) { - //From https://github.com/zurb/foundation-apps/blob/master/js/angular/common/common.services.js - 'use strict'; + var __WEBPACK_AMD_DEFINE_RESULT__;/*! + * enquire.js v2.1.1 - Awesome Media Queries in JavaScript + * Copyright (c) 2014 Nick Williams - http://wicky.nillia.ms/enquire.js + * License: MIT (http://www.opensource.org/licenses/mit-license.php) + */ - var PubSub = __webpack_require__(31); - var assign = __webpack_require__(30); + ;(function (name, context, factory) { + var matchMedia = window.matchMedia; - var listeners = []; - var settings = {}; - var uniqueIds = []; + if (typeof module !== 'undefined' && module.exports) { + module.exports = factory(matchMedia); + } + else if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { + return (context[name] = factory(matchMedia)); + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + else { + context[name] = factory(matchMedia); + } + }('enquire', this, function (matchMedia) { - var foundationApi = { - subscribe: PubSub.subscribe, - publish: PubSub.publish, - unsubscribe: PubSub.unsubscribe, - closeActiveElements: function closeActiveElements(options) { - var self = this; - options = options || {}; - var activeElements = document.querySelectorAll('.is-active[data-closable]'); - Array.prototype.forEach.call(activeElements, function (el) { - if (options.exclude !== el.id) { - self.publish(el.id, 'close'); - } - }); - }, - getSettings: function getSettings() { - return settings; - }, - modifySettings: function modifySettings(tree) { - settings = angular.extend(settings, tree); - return settings; - }, - generateUuid: function generateUuid() { - var uuid = ''; - - //little trick to produce semi-random IDs - do { - uuid += 'zf-uuid-'; - for (var i = 0; i < 15; i++) { - uuid += Math.floor(Math.random() * 16).toString(16); - } - } while (!uniqueIds.indexOf(uuid)); - - uniqueIds.push(uuid); - return uuid; - } - }; - - module.exports = foundationApi; + 'use strict'; -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { + /*jshint unused:false */ + /** + * Helper function for iterating over a collection + * + * @param collection + * @param fn + */ + function each(collection, fn) { + var i = 0, + length = collection.length, + cont; - 'use strict'; + for(i; i < length; i++) { + cont = fn(collection[i], i); + if(cont === false) { + break; //allow early exit + } + } + } - var React = __webpack_require__(12); + /** + * Helper function for determining whether target object is an array + * + * @param target the object under test + * @return {Boolean} true if array, false otherwise + */ + function isArray(target) { + return Object.prototype.toString.apply(target) === '[object Array]'; + } - var ActionSheetButton = React.createClass({ - displayName: 'ActionSheetButton', + /** + * Helper function for determining whether target object is a function + * + * @param target the object under test + * @return {Boolean} true if function, false otherwise + */ + function isFunction(target) { + return typeof target === 'function'; + } - toggle: function toggle() { - this.props.setActiveState(!this.props.active); - }, - render: function render() { - var Title = null; - if (this.props.title.length > 0) { - Title = React.createElement( - 'a', - { className: 'button' }, - this.props.title - ); + /** + * Delegate to handle a media query being matched and unmatched. + * + * @param {object} options + * @param {function} options.match callback for when the media query is matched + * @param {function} [options.unmatch] callback for when the media query is unmatched + * @param {function} [options.setup] one-time callback triggered the first time a query is matched + * @param {boolean} [options.deferSetup=false] should the setup callback be run immediately, rather than first time query is matched? + * @constructor + */ + function QueryHandler(options) { + this.options = options; + !options.deferSetup && this.setup(); } - return React.createElement( - 'div', - { onClick: this.toggle }, - Title, - React.createElement( - 'div', - null, - this.props.children - ) - ); - } - }); + QueryHandler.prototype = { - module.exports = ActionSheetButton; + /** + * coordinates setup of the handler + * + * @function + */ + setup : function() { + if(this.options.setup) { + this.options.setup(); + } + this.initialised = true; + }, -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { + /** + * coordinates setup and triggering of the handler + * + * @function + */ + on : function() { + !this.initialised && this.setup(); + this.options.match && this.options.match(); + }, - 'use strict'; + /** + * coordinates the unmatch event for the handler + * + * @function + */ + off : function() { + this.options.unmatch && this.options.unmatch(); + }, - var React = __webpack_require__(12); - var cx = __webpack_require__(27); + /** + * called when a handler is to be destroyed. + * delegates to the destroy or unmatch callbacks, depending on availability. + * + * @function + */ + destroy : function() { + this.options.destroy ? this.options.destroy() : this.off(); + }, - var ActionSheetContent = React.createClass({ - displayName: 'ActionSheetContent', + /** + * determines equality by reference. + * if object is supplied compare options, if function, compare match callback + * + * @function + * @param {object || function} [target] the target for comparison + */ + equals : function(target) { + return this.options === target || this.options.match === target; + } - getDefaultProps: function getDefaultProps() { - return { position: 'bottom' }; - }, - render: function render() { - var classes = { - 'action-sheet': true, - 'is-active': this.props.active }; - return React.createElement( - 'div', - { className: cx(classes) }, - this.props.children - ); - } - }); + /** + * Represents a single media query, manages it's state and registered handlers for this query + * + * @constructor + * @param {string} query the media query string + * @param {boolean} [isUnconditional=false] whether the media query should run regardless of whether the conditions are met. Primarily for helping older browsers deal with mobile-first design + */ + function MediaQuery(query, isUnconditional) { + this.query = query; + this.isUnconditional = isUnconditional; + this.handlers = []; + this.mql = matchMedia(query); - module.exports = ActionSheetContent; + var self = this; + this.listener = function(mql) { + self.mql = mql; + self.assess(); + }; + this.mql.addListener(this.listener); + } + MediaQuery.prototype = { -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { + /** + * add a handler for this query, triggering if already active + * + * @param {object} handler + * @param {function} handler.match callback for when query is activated + * @param {function} [handler.unmatch] callback for when query is deactivated + * @param {function} [handler.setup] callback for immediate execution when a query handler is registered + * @param {boolean} [handler.deferSetup=false] should the setup callback be deferred until the first time the handler is matched? + */ + addHandler : function(handler) { + var qh = new QueryHandler(handler); + this.handlers.push(qh); - // some parts of code from react/lib/ReactCSSTransitionGroupChild.js - 'use strict'; + this.matches() && qh.on(); + }, - var React = __webpack_require__(12); - var ReactTransitionEvents = __webpack_require__(28); - var CSSCore = __webpack_require__(29); - var cloneWithProps = __webpack_require__(25); - var cx = __webpack_require__(27); - var TICK = 17; + /** + * removes the given handler from the collection, and calls it's destroy methods + * + * @param {object || function} handler the handler to remove + */ + removeHandler : function(handler) { + var handlers = this.handlers; + each(handlers, function(h, i) { + if(h.equals(handler)) { + h.destroy(); + return !handlers.splice(i,1); //remove from array and exit each early + } + }); + }, - var Animation = React.createClass({ - displayName: 'Animation', + /** + * Determine whether the media query should be considered a match + * + * @return {Boolean} true if media query can be considered a match, false otherwise + */ + matches : function() { + return this.mql.matches || this.isUnconditional; + }, - getInitialState: function getInitialState() { - return {}; - }, - getDefaultProps: function getDefaultProps() { - return { - active: false, - animationIn: '', - animationOut: '' - }; - }, - reflow: function reflow(node) { - return node.offsetWidth; - }, - reset: function reset(node) { - node.style.transitionDuration = 0; - CSSCore.removeClass(node, 'ng-enter'); - CSSCore.removeClass(node, 'ng-leave'); - CSSCore.removeClass(node, 'ng-enter-active'); - CSSCore.removeClass(node, 'ng-leave-active'); - CSSCore.removeClass(node, this.props.animationIn); - CSSCore.removeClass(node, this.props.animationOut); - }, - finishAnimation: function finishAnimation() { - var node = this.getDOMNode(); - this.reset(node); - CSSCore.removeClass(node, this.props.active ? '' : 'is-active'); - this.reflow(node); - ReactTransitionEvents.removeEndEventListener(node, this.finishAnimation); - }, - animate: function animate(animationClass, animationType) { - var node = this.getDOMNode(); - var initClass = 'ng-' + animationType; - var activeClass = initClass + '-active'; - - this.reset(node); - CSSCore.addClass(node, animationClass); - CSSCore.addClass(node, initClass); - CSSCore.addClass(node, 'is-active'); + /** + * Clears all handlers and unbinds events + */ + clear : function() { + each(this.handlers, function(handler) { + handler.destroy(); + }); + this.mql.removeListener(this.listener); + this.handlers.length = 0; //clear array + }, - //force a "tick" - this.reflow(node); + /* + * Assesses the query, turning on all handlers if it matches, turning them off if it doesn't match + */ + assess : function() { + var action = this.matches() ? 'on' : 'off'; - //activate - node.style.transitionDuration = ''; - CSSCore.addClass(node, activeClass); + each(this.handlers, function(handler) { + handler[action](); + }); + } + }; + /** + * Allows for registration of query handlers. + * Manages the query handler's state and is responsible for wiring up browser events + * + * @constructor + */ + function MediaQueryDispatch () { + if(!matchMedia) { + throw new Error('matchMedia not present, legacy browsers require a polyfill'); + } - ReactTransitionEvents.addEndEventListener(node, this.finishAnimation); - }, - componentDidUpdate: function componentDidUpdate(prevProps) { - if (prevProps.active !== this.props.active) { - var animationClass = this.props.active ? this.props.animationIn : this.props.animationOut; - var animationType = this.props.active ? 'enter' : 'leave'; - this.animate(animationClass, animationType); + this.queries = {}; + this.browserIsIncapable = !matchMedia('only all').matches; } - }, - render: function render() { - var child = React.Children.only(this.props.children); - var extraProps = {}; - return cloneWithProps(child, extraProps); - } - }); - module.exports = Animation; + MediaQueryDispatch.prototype = { + + /** + * Registers a handler for the given media query + * + * @param {string} q the media query + * @param {object || Array || Function} options either a single query handler object, a function, or an array of query handlers + * @param {function} options.match fired when query matched + * @param {function} [options.unmatch] fired when a query is no longer matched + * @param {function} [options.setup] fired when handler first triggered + * @param {boolean} [options.deferSetup=false] whether setup should be run immediately or deferred until query is first matched + * @param {boolean} [shouldDegrade=false] whether this particular media query should always run on incapable browsers + */ + register : function(q, options, shouldDegrade) { + var queries = this.queries, + isUnconditional = shouldDegrade && this.browserIsIncapable; + + if(!queries[q]) { + queries[q] = new MediaQuery(q, isUnconditional); + } + + //normalise to object in an array + if(isFunction(options)) { + options = { match : options }; + } + if(!isArray(options)) { + options = [options]; + } + each(options, function(handler) { + queries[q].addHandler(handler); + }); + + return this; + }, + + /** + * unregisters a query and all it's handlers, or a specific handler for a query + * + * @param {string} q the media query to target + * @param {object || function} [handler] specific handler to unregister + */ + unregister : function(q, handler) { + var query = this.queries[q]; + + if(query) { + if(handler) { + query.removeHandler(handler); + } + else { + query.clear(); + delete this.queries[q]; + } + } + + return this; + } + }; + + return new MediaQueryDispatch(); + + })); /***/ }, -/* 18 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { - 'use strict'; - - 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 camel2hyphen = __webpack_require__(28); - var React = __webpack_require__(12); - var foundationApi = __webpack_require__(14); - var Notification = __webpack_require__(24); - var Animation = __webpack_require__(17); + var isDimension = function (feature) { + var re = /[height|width]$/; + return re.test(feature); + }; - var NotificationSet = React.createClass({ - displayName: 'NotificationSet', + var obj2mq = function (obj) { + var mq = ''; + var features = Object.keys(obj); + features.forEach(function (feature, index) { + var value = obj[feature]; + feature = camel2hyphen(feature); + // Add px to dimension features + if (isDimension(feature) && typeof value === 'number') { + value = value + 'px'; + } + if (value === true) { + mq += feature; + } else if (value === false) { + mq += 'not ' + feature; + } else { + mq += '(' + feature + ': ' + value + ')'; + } + if (index < features.length-1) { + mq += ' and ' + } + }); + return mq; + }; - getInitialState: function getInitialState() { - return { notifications: [] }; - }, - componentDidMount: function componentDidMount() { - foundationApi.subscribe(this.props.id, (function (name, msg) { - if (msg === 'clearall') { - this.clearAll(); - } else { - this.addNotification(msg); + var json2mq = function (query) { + var mq = ''; + if (typeof query === 'string') { + return query; + } + // Handling array of media queries + if (query instanceof Array) { + query.forEach(function (q, index) { + mq += obj2mq(q); + if (index < query.length-1) { + mq += ', ' } - }).bind(this)); - }, - addNotification: function addNotification(notification) { - notification.id = foundationApi.generateUuid(); - var notifications = this.state.notifications.concat(notification); - this.setState({ - notifications: notifications }); - }, - removeNotifcation: function removeNotifcation(id) { - return (function (e) { - var notifications = []; - this.state.notifications.forEach(function (notification) { - if (notification.id !== id) { - notifications.push(notification); - } - }); - this.setState({ - notifications: notifications - }); - e.preventDefault(); - }).bind(this); - }, - clearAll: function clearAll() { - this.setState({ notifications: [] }); - }, - render: function render() { - var notifications = this.state.notifications.map((function (notification) { - return React.createElement( - Notification, - _extends({ key: notification.id }, notification, { closeHandler: this.removeNotifcation(notification.id), className: 'is-active' }), - notification.content - ); - }).bind(this)); - return React.createElement( - 'div', - null, - notifications - ); + return mq; } - }); + // Handling single media query + return obj2mq(query); + }; - module.exports = NotificationSet; + module.exports = json2mq; /***/ }, -/* 19 */ +/* 28 */ +/***/ function(module, exports) { + + var camel2hyphen = function (str) { + return str + .replace(/[A-Z]/g, function (match) { + return '-' + match.toLowerCase(); + }) + .toLowerCase(); + }; + + module.exports = camel2hyphen; + +/***/ }, +/* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - 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 React = __webpack_require__(12); - var cx = __webpack_require__(27); - var foundationApi = __webpack_require__(14); - var Animation = __webpack_require__(17); - var Notification = __webpack_require__(24); + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var Animation = __webpack_require__(30); + var foundationApi = __webpack_require__(16); - var NotificationStatic = React.createClass({ - displayName: 'NotificationStatic', + var Modal = React.createClass({ + displayName: 'Modal', getInitialState: function getInitialState() { return { open: false }; }, + getDefaultProps: function getDefaultProps() { + return { + overlay: true, + overlayClose: true, + animationIn: 'fadeIn', + animationOut: 'fadeOut' + }; + }, componentDidMount: function componentDidMount() { foundationApi.subscribe(this.props.id, (function (name, msg) { if (msg === 'open') { this.setState({ open: true }); } else if (msg === 'close') { this.setState({ open: false }); + } else if (msg === 'toggle') { + this.setState({ open: !this.state.open }); } }).bind(this)); }, componentWillUnmount: function componentWillUnmount() { foundationApi.unsubscribe(this.props.id); }, - closeHandler: function closeHandler(e) { - this.setState({ open: false }); + hideOverlay: function hideOverlay(e) { + e.preventDefault(); + if (this.props.overlayClose) { + this.setState({ open: false }); + } + }, + stopClickPropagation: function stopClickPropagation(e) { e.preventDefault(); e.stopPropagation(); }, render: function render() { + var overlayStyle = {}; + if (!this.props.overlay) { + overlayStyle.background = 'transparent'; + } return React.createElement( Animation, { active: this.state.open, animationIn: 'fadeIn', animationOut: 'fadeOut' }, React.createElement( - Notification, - _extends({}, this.props, { closeHandler: this.closeHandler }), - this.props.children + 'div', + { className: 'modal-overlay', style: overlayStyle, onClick: this.hideOverlay }, + React.createElement( + Animation, + { + active: this.state.open, + animationIn: this.props.animationIn, + animationOut: this.props.animationOut + }, + React.createElement( + 'div', + { id: this.props.id, 'data-closable': true, className: 'modal', onClick: this.stopClickPropagation }, + this.props.children + ) + ) ) ); } }); - module.exports = NotificationStatic; + module.exports = Modal; /***/ }, -/* 20 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { + // some parts of code from react/lib/ReactCSSTransitionGroupChild.js 'use strict'; - var React = __webpack_require__(12); - var cx = __webpack_require__(27); + var React = __webpack_require__(2); + var ReactTransitionEvents = __webpack_require__(31); + var CSSCore = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/CSSCore\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var cloneWithProps = __webpack_require__(3); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var TICK = 17; - var Tab = React.createClass({ - displayName: 'Tab', + var Animation = React.createClass({ + displayName: 'Animation', - componentDidMount: function componentDidMount() { - if (this.props.active) { - this.select(); - } + getInitialState: function getInitialState() { + return {}; }, - select: function select() { - var options = { - selectedTab: this.props.index, - content: this.props.children + getDefaultProps: function getDefaultProps() { + return { + active: false, + animationIn: '', + animationOut: '' }; - this.props.selectTab(options); + }, + reflow: function reflow(node) { + return node.offsetWidth; + }, + reset: function reset(node) { + node.style.transitionDuration = 0; + CSSCore.removeClass(node, 'ng-enter'); + CSSCore.removeClass(node, 'ng-leave'); + CSSCore.removeClass(node, 'ng-enter-active'); + CSSCore.removeClass(node, 'ng-leave-active'); + CSSCore.removeClass(node, this.props.animationIn); + CSSCore.removeClass(node, this.props.animationOut); + }, + finishAnimation: function finishAnimation() { + var node = this.getDOMNode(); + this.reset(node); + CSSCore.removeClass(node, this.props.active ? '' : 'is-active'); + this.reflow(node); + ReactTransitionEvents.removeEndEventListener(node, this.finishAnimation); + }, + animate: function animate(animationClass, animationType) { + var node = this.getDOMNode(); + var initClass = 'ng-' + animationType; + var activeClass = initClass + '-active'; + + this.reset(node); + CSSCore.addClass(node, animationClass); + CSSCore.addClass(node, initClass); + CSSCore.addClass(node, 'is-active'); + + //force a "tick" + this.reflow(node); + + //activate + node.style.transitionDuration = ''; + CSSCore.addClass(node, activeClass); + + ReactTransitionEvents.addEndEventListener(node, this.finishAnimation); + }, + componentDidUpdate: function componentDidUpdate(prevProps) { + if (prevProps.active !== this.props.active) { + var animationClass = this.props.active ? this.props.animationIn : this.props.animationOut; + var animationType = this.props.active ? 'enter' : 'leave'; + this.animate(animationClass, animationType); + } }, render: function render() { - var classes = { - 'tab-item': true, - 'is-active': this.props.active - }; - return React.createElement( - 'div', - { className: cx(classes), onClick: this.select }, - this.props.title - ); + var child = React.Children.only(this.props.children); + var extraProps = {}; + return cloneWithProps(child, extraProps); } }); - module.exports = Tab; + module.exports = Animation; /***/ }, -/* 21 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { - 'use strict'; + /** + * 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. + * + * @providesModule ReactTransitionEvents + */ - var React = __webpack_require__(12); - var foundationApi = __webpack_require__(14); - var cloneWithProps = __webpack_require__(25); + 'use strict'; - var PopupToggle = React.createClass({ - displayName: 'PopupToggle', + var ExecutionEnvironment = __webpack_require__(32); - clickHandler: function clickHandler(id, e) { - e.preventDefault(); - foundationApi.publish(this.props.popupToggle, ['toggle', id]); + /** + * EVENT_NAME_MAP is used to determine which event fired when a + * transition/animation ends, based on the style property used to + * define that event. + */ + var EVENT_NAME_MAP = { + transitionend: { + 'transition': 'transitionend', + 'WebkitTransition': 'webkitTransitionEnd', + 'MozTransition': 'mozTransitionEnd', + 'OTransition': 'oTransitionEnd', + 'msTransition': 'MSTransitionEnd' }, - render: function render() { - var child = React.Children.only(this.props.children); - var id = this.props.id || foundationApi.generateUuid(); - return cloneWithProps(child, { - id: id, - onClick: this.clickHandler.bind(this, id) - }); + + animationend: { + 'animation': 'animationend', + 'WebkitAnimation': 'webkitAnimationEnd', + 'MozAnimation': 'mozAnimationEnd', + 'OAnimation': 'oAnimationEnd', + 'msAnimation': 'MSAnimationEnd' } - }); + }; - module.exports = PopupToggle; + var endEvents = []; -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { + function detectEvents() { + var testEl = document.createElement('div'); + var style = testEl.style; - var canUseDOM = __webpack_require__(37); - var enquire = canUseDOM && __webpack_require__(39); - var json2mq = __webpack_require__(38); + // On some platforms, in particular some releases of Android 4.x, + // the un-prefixed "animation" and "transition" properties are defined on the + // style object but the events that fire will still be prefixed, so we need + // to check if the un-prefixed events are useable, and if not remove them + // from the map + if (!('AnimationEvent' in window)) { + delete EVENT_NAME_MAP.animationend.animation; + } - var ResponsiveMixin = { - media: function (query, handler) { - query = json2mq(query); - if (typeof handler === 'function') { - handler = { - match: handler - }; + if (!('TransitionEvent' in window)) { + delete EVENT_NAME_MAP.transitionend.transition; + } + + for (var baseEventName in EVENT_NAME_MAP) { + var baseEvents = EVENT_NAME_MAP[baseEventName]; + for (var styleName in baseEvents) { + if (styleName in style) { + endEvents.push(baseEvents[styleName]); + break; + } } - enquire.register(query, handler); + } + } - // Queue the handlers to unregister them at unmount - if (! this._responsiveMediaHandlers) { - this._responsiveMediaHandlers = []; + if (ExecutionEnvironment.canUseDOM) { + detectEvents(); + } + + // We use the raw {add|remove}EventListener() call because EventListener + // does not know how to remove event listeners and we really should + // clean up. Also, these events are not triggered in older browsers + // so we should be A-OK here. + + function addEventListener(node, eventName, eventListener) { + node.addEventListener(eventName, eventListener, false); + } + + function removeEventListener(node, eventName, eventListener) { + node.removeEventListener(eventName, eventListener, false); + } + + var ReactTransitionEvents = { + addEndEventListener: function (node, eventListener) { + if (endEvents.length === 0) { + // If CSS transitions are not supported, trigger an "end animation" + // event immediately. + window.setTimeout(eventListener, 0); + return; } - this._responsiveMediaHandlers.push({query: query, handler: handler}); + endEvents.forEach(function (endEvent) { + addEventListener(node, endEvent, eventListener); + }); }, - componentWillUnmount: function () { - this._responsiveMediaHandlers.forEach(function(obj) { - enquire.unregister(obj.query, obj.handler); + + removeEndEventListener: function (node, eventListener) { + if (endEvents.length === 0) { + return; + } + endEvents.forEach(function (endEvent) { + removeEventListener(node, endEvent, eventListener); }); } }; - module.exports = ResponsiveMixin; + module.exports = ReactTransitionEvents; /***/ }, -/* 23 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var React = __webpack_require__(12); - var cloneWithProps = __webpack_require__(25); - - var Accordion = React.createClass({ - displayName: 'Accordion', +/* 32 */ +/***/ function(module, exports) { + + /** + * 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. + * + * @providesModule ExecutionEnvironment + */ + + 'use strict'; + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + + /** + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. + */ + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen, + + isInWorker: !canUseDOM // For now, this is true - might change in the future. + + }; + + module.exports = ExecutionEnvironment; + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = { + Set: __webpack_require__(34), + Static: __webpack_require__(36) + }; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + 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 React = __webpack_require__(2); + var foundationApi = __webpack_require__(16); + var Notification = __webpack_require__(35); + var Animation = __webpack_require__(30); + + var NotificationSet = React.createClass({ + displayName: 'NotificationSet', getInitialState: function getInitialState() { - return { sections: [] }; + return { notifications: [] }; }, - getDefaultProps: function getDefaultProps() { - return { - autoOpen: true, - multiOpen: false, - collapsible: false - }; + componentDidMount: function componentDidMount() { + foundationApi.subscribe(this.props.id, (function (name, msg) { + if (msg === 'clearall') { + this.clearAll(); + } else { + this.addNotification(msg); + } + }).bind(this)); }, - componentWillMount: function componentWillMount() { - var sections = []; - React.Children.forEach(this.props.children, function (child, index) { - sections.push({ active: false }); + addNotification: function addNotification(notification) { + notification.id = foundationApi.generateUuid(); + var notifications = this.state.notifications.concat(notification); + this.setState({ + notifications: notifications }); - if (this.props.autoOpen) { - sections[0].active = true; - } - this.setState({ sections: sections }); }, - select: function select(selectSection) { - var sections = this.state.sections; - sections.forEach((function (section, index) { - if (this.props.multiOpen) { - if (index === selectSection) { - section.active = !section.active; - } - } else { - if (index === selectSection) { - section.active = this.props.collapsible === true ? !section.active : true; - } else { - section.active = false; + removeNotifcation: function removeNotifcation(id) { + return (function (e) { + var notifications = []; + this.state.notifications.forEach(function (notification) { + if (notification.id !== id) { + notifications.push(notification); } - } - }).bind(this)); - this.setState({ sections: sections }); + }); + this.setState({ + notifications: notifications + }); + e.preventDefault(); + }).bind(this); + }, + clearAll: function clearAll() { + this.setState({ notifications: [] }); }, render: function render() { - var children = React.Children.map(this.props.children, (function (child, index) { - return cloneWithProps(child, { - active: this.state.sections[index] ? this.state.sections[index].active : false, - activate: this.select.bind(this, index) - }); + var notifications = this.state.notifications.map((function (notification) { + return React.createElement( + Notification, + _extends({ key: notification.id }, notification, { closeHandler: this.removeNotifcation(notification.id), className: 'is-active' }), + notification.content + ); }).bind(this)); return React.createElement( 'div', - { className: 'accordion' }, - children + null, + notifications ); } }); - module.exports = Accordion; - Accordion.Item = __webpack_require__(13); + module.exports = NotificationSet; /***/ }, -/* 24 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var React = __webpack_require__(12); + var React = __webpack_require__(2); var Notification = React.createClass({ displayName: 'Notification', @@ -2702,1930 +2413,1908 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Notification; /***/ }, -/* 25 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @typechecks static-only - * @providesModule cloneWithProps - */ - 'use strict'; - var ReactElement = __webpack_require__(33); - var ReactPropTransferer = __webpack_require__(34); + 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 keyOf = __webpack_require__(35); - var warning = __webpack_require__(32); + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var foundationApi = __webpack_require__(16); + var Animation = __webpack_require__(30); + var Notification = __webpack_require__(35); - var CHILDREN_PROP = keyOf({children: null}); + var NotificationStatic = React.createClass({ + displayName: 'NotificationStatic', - /** - * Sometimes you want to change the props of a child passed to you. Usually - * this is to add a CSS class. - * - * @param {ReactElement} child child element you'd like to clone - * @param {object} props props you'd like to modify. className and style will be - * merged automatically. - * @return {ReactElement} a clone of child with props merged in. - */ - function cloneWithProps(child, props) { - if ("production" !== (undefined)) { - ("production" !== (undefined) ? warning( - !child.ref, - 'You are calling cloneWithProps() on a child with a ref. This is ' + - 'dangerous because you\'re creating a new child which will not be ' + - 'added as a ref to its parent.' - ) : null); + getInitialState: function getInitialState() { + return { open: false }; + }, + componentDidMount: function componentDidMount() { + foundationApi.subscribe(this.props.id, (function (name, msg) { + if (msg === 'open') { + this.setState({ open: true }); + } else if (msg === 'close') { + this.setState({ open: false }); + } + }).bind(this)); + }, + componentWillUnmount: function componentWillUnmount() { + foundationApi.unsubscribe(this.props.id); + }, + closeHandler: function closeHandler(e) { + this.setState({ open: false }); + e.preventDefault(); + e.stopPropagation(); + }, + render: function render() { + return React.createElement( + Animation, + { active: this.state.open, animationIn: 'fadeIn', animationOut: 'fadeOut' }, + React.createElement( + Notification, + _extends({}, this.props, { closeHandler: this.closeHandler }), + this.props.children + ) + ); } + }); - var newProps = ReactPropTransferer.mergeProps(props, child.props); + module.exports = NotificationStatic; - // Use `child.props.children` if it is provided. - if (!newProps.hasOwnProperty(CHILDREN_PROP) && - child.props.hasOwnProperty(CHILDREN_PROP)) { - newProps.children = child.props.children; - } +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { - // The current API doesn't retain _owner and _context, which is why this - // doesn't use ReactElement.cloneAndReplaceProps. - return ReactElement.createElement(child.type, newProps); - } + 'use strict'; - module.exports = cloneWithProps; + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + // var LayerMixin = require('react-layer-mixin'); + var foundationApi = __webpack_require__(16); + + var Offcanvas = React.createClass({ + displayName: 'Offcanvas', + + // mixins: [LayerMixin], + getInitialState: function getInitialState() { + return { open: false }; + }, + getDefaultProps: function getDefaultProps() { + return { + position: 'left' + }; + }, + componentDidMount: function componentDidMount() { + foundationApi.subscribe(this.props.id, (function (name, msg) { + if (msg === 'open') { + this.setState({ open: true }); + } else if (msg === 'close') { + this.setState({ open: false }); + } else if (msg === 'toggle') { + this.setState({ open: !this.state.open }); + } + }).bind(this)); + }, + componentWillUnmount: function componentWillUnmount() { + foundationApi.unsubscribe(this.props.id); + }, + render: function render() { + var classes = { + 'off-canvas': true, + 'is-active': this.state.open + }; + classes[this.props.position] = true; + if (this.props.className) { + classes[this.props.className] = true; + } + return React.createElement( + 'div', + { id: this.props.id, 'data-closable': true, className: cx(classes) }, + this.props.children + ); + } + }); + module.exports = Offcanvas; /***/ }, -/* 26 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @providesModule ExecutionEnvironment - */ - - /*jslint evil: true */ - - "use strict"; - - var canUseDOM = !!( - (typeof window !== 'undefined' && - window.document && window.document.createElement) - ); - - /** - * Simple, lightweight module assisting with the detection and context of - * Worker. Helps avoid circular dependencies and allows code to reason about - * whether or not they are in a Worker, even if they never include the main - * `ReactWorker` dependency. - */ - var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: - canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen, + 'use strict'; - isInWorker: !canUseDOM // For now, this is true - might change in the future. + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var Animation = __webpack_require__(30); + var foundationApi = __webpack_require__(16); - }; + var Panel = React.createClass({ + displayName: 'Panel', - module.exports = ExecutionEnvironment; + getInitialState: function getInitialState() { + return { open: false }; + }, + getDefaultProps: function getDefaultProps() { + return { + position: 'left' + }; + }, + componentDidMount: function componentDidMount() { + foundationApi.subscribe(this.props.id, (function (name, msg) { + if (msg === 'open') { + this.setState({ open: true }); + } else if (msg === 'close') { + this.setState({ open: false }); + } else if (msg === 'toggle') { + this.setState({ open: !this.state.open }); + } + }).bind(this)); + }, + componentWillUnmount: function componentWillUnmount() { + foundationApi.unsubscribe(this.props.id); + }, + render: function render() { + var animationIn, animationOut; + var classes = 'panel panel-' + this.props.position; + if (this.props.className) { + classes += ' ' + this.props.className; + } + if (this.props.position === 'left') { + animationIn = this.props.animationIn || 'slideInRight'; + animationOut = this.props.animationOut || 'slideOutLeft'; + } else if (this.props.position === 'right') { + animationIn = this.props.animationIn || 'slideInLeft'; + animationOut = this.props.animationOut || 'slideOutRight'; + } else if (this.props.position === 'top') { + animationIn = this.props.animationIn || 'slideInDown'; + animationOut = this.props.animationOut || 'slideOutUp'; + } else if (this.props.position === 'bottom') { + animationIn = this.props.animationIn || 'slideInUp'; + animationOut = this.props.animationOut || 'slideOutBottom'; + } + return React.createElement( + Animation, + { active: this.state.open, animationIn: animationIn, animationOut: animationOut }, + React.createElement( + 'div', + { 'data-closable': true, id: this.props.id, className: classes }, + this.props.children + ) + ); + } + }); + module.exports = Panel; /***/ }, -/* 27 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @providesModule cx - */ + 'use strict'; - /** - * This function is used to mark string literals representing CSS class names - * so that they can be transformed statically. This allows for modularization - * and minification of CSS class names. - * - * In static_upstream, this function is actually implemented, but it should - * eventually be replaced with something more descriptive, and the transform - * that is used in the main stack should be ported for use elsewhere. - * - * @param string|object className to modularize, or an object of key/values. - * In the object case, the values are conditions that - * determine if the className keys should be included. - * @param [string ...] Variable list of classNames in the string case. - * @return string Renderable space-separated CSS className. - */ + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var ExecutionEnvironment = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/ExecutionEnvironment\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var foundationApi = __webpack_require__(16); + var Tether = ExecutionEnvironment.canUseDOM && __webpack_require__(40); - 'use strict'; - var warning = __webpack_require__(32); - - var warned = false; - - function cx(classNames) { - if ("production" !== (undefined)) { - ("production" !== (undefined) ? warning( - warned, - 'React.addons.classSet will be deprecated in a future version. See ' + - 'http://fb.me/react-addons-classset' - ) : null); - warned = true; - } + var Popup = React.createClass({ + displayName: 'Popup', - if (typeof classNames == 'object') { - return Object.keys(classNames).filter(function(className) { - return classNames[className]; - }).join(' '); - } else { - return Array.prototype.join.call(arguments, ' '); + getInitialState: function getInitialState() { + return { + active: false, + tetherInit: false + }; + }, + getDefaultProps: function getDefaultProps() { + return { + pinTo: 'top center', + pinAt: '' + }; + }, + componentDidMount: function componentDidMount() { + this.tether = {}; + foundationApi.subscribe(this.props.id, (function (name, msg) { + if (msg[0] === 'toggle') { + this.toggle(msg[1]); + } + }).bind(this)); + }, + toggle: function toggle(target) { + var active = !this.state.active; + this.setState({ active: active }, (function () { + if (active) { + this.tetherElement(target); + } else { + this.tether.destroy(); + } + }).bind(this)); + }, + tetherElement: function tetherElement(target) { + var targetElement = document.getElementById(target); + var attachment = 'top center'; + this.tether = new Tether({ + element: this.getDOMNode(), + target: targetElement, + attachment: attachment + }); + }, + render: function render() { + var classes = { + popup: true, + 'is-active': this.state.active + }; + return React.createElement( + 'div', + { id: this.props.id, className: cx(classes), 'data-closable': 'popup' }, + this.props.children + ); } - } - - module.exports = cx; + }); + module.exports = Popup; /***/ }, -/* 28 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @providesModule ReactTransitionEvents - */ - - 'use strict'; - - var ExecutionEnvironment = __webpack_require__(26); + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! tether 0.6.5 */ - /** - * EVENT_NAME_MAP is used to determine which event fired when a - * transition/animation ends, based on the style property used to - * define that event. - */ - var EVENT_NAME_MAP = { - transitionend: { - 'transition': 'transitionend', - 'WebkitTransition': 'webkitTransitionEnd', - 'MozTransition': 'mozTransitionEnd', - 'OTransition': 'oTransitionEnd', - 'msTransition': 'MSTransitionEnd' - }, - animationend: { - 'animation': 'animationend', - 'WebkitAnimation': 'webkitAnimationEnd', - 'MozAnimation': 'mozAnimationEnd', - 'OAnimation': 'oAnimationEnd', - 'msAnimation': 'MSAnimationEnd' + (function(root, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports === 'object') { + module.exports = factory(require,exports,module); + } else { + root.Tether = factory(); } - }; - - var endEvents = []; - - function detectEvents() { - var testEl = document.createElement('div'); - var style = testEl.style; + }(this, function(require,exports,module) { - // On some platforms, in particular some releases of Android 4.x, - // the un-prefixed "animation" and "transition" properties are defined on the - // style object but the events that fire will still be prefixed, so we need - // to check if the un-prefixed events are useable, and if not remove them - // from the map - if (!('AnimationEvent' in window)) { - delete EVENT_NAME_MAP.animationend.animation; - } + (function() { + var Evented, addClass, defer, deferred, extend, flush, getBounds, getClassName, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, setClassName, uniqueId, updateClasses, zeroPosCache, + __hasProp = {}.hasOwnProperty, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, + __slice = [].slice; - if (!('TransitionEvent' in window)) { - delete EVENT_NAME_MAP.transitionend.transition; + if (this.Tether == null) { + this.Tether = { + modules: [] + }; } - for (var baseEventName in EVENT_NAME_MAP) { - var baseEvents = EVENT_NAME_MAP[baseEventName]; - for (var styleName in baseEvents) { - if (styleName in style) { - endEvents.push(baseEvents[styleName]); - break; + getScrollParent = function(el) { + var parent, position, scrollParent, style, _ref; + position = getComputedStyle(el).position; + if (position === 'fixed') { + return el; + } + scrollParent = void 0; + parent = el; + while (parent = parent.parentNode) { + try { + style = getComputedStyle(parent); + } catch (_error) {} + if (style == null) { + return parent; + } + if (/(auto|scroll)/.test(style['overflow'] + style['overflowY'] + style['overflowX'])) { + if (position !== 'absolute' || ((_ref = style['position']) === 'relative' || _ref === 'absolute' || _ref === 'fixed')) { + return parent; + } } } - } - } - - if (ExecutionEnvironment.canUseDOM) { - detectEvents(); - } - - // We use the raw {add|remove}EventListener() call because EventListener - // does not know how to remove event listeners and we really should - // clean up. Also, these events are not triggered in older browsers - // so we should be A-OK here. + return document.body; + }; - function addEventListener(node, eventName, eventListener) { - node.addEventListener(eventName, eventListener, false); - } + uniqueId = (function() { + var id; + id = 0; + return function() { + return id++; + }; + })(); - function removeEventListener(node, eventName, eventListener) { - node.removeEventListener(eventName, eventListener, false); - } + zeroPosCache = {}; - var ReactTransitionEvents = { - addEndEventListener: function(node, eventListener) { - if (endEvents.length === 0) { - // If CSS transitions are not supported, trigger an "end animation" - // event immediately. - window.setTimeout(eventListener, 0); - return; + getOrigin = function(doc) { + var id, k, node, v, _ref; + node = doc._tetherZeroElement; + if (node == null) { + node = doc.createElement('div'); + node.setAttribute('data-tether-id', uniqueId()); + extend(node.style, { + top: 0, + left: 0, + position: 'absolute' + }); + doc.body.appendChild(node); + doc._tetherZeroElement = node; } - endEvents.forEach(function(endEvent) { - addEventListener(node, endEvent, eventListener); - }); - }, - - removeEndEventListener: function(node, eventListener) { - if (endEvents.length === 0) { - return; + id = node.getAttribute('data-tether-id'); + if (zeroPosCache[id] == null) { + zeroPosCache[id] = {}; + _ref = node.getBoundingClientRect(); + for (k in _ref) { + v = _ref[k]; + zeroPosCache[id][k] = v; + } + defer(function() { + return zeroPosCache[id] = void 0; + }); } - endEvents.forEach(function(endEvent) { - removeEventListener(node, endEvent, eventListener); - }); - } - }; - - module.exports = ReactTransitionEvents; - + return zeroPosCache[id]; + }; -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { + node = null; - /** - * 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. - * - * @providesModule CSSCore - * @typechecks - */ + getBounds = function(el) { + var box, doc, docEl, k, origin, v, _ref; + if (el === document) { + doc = document; + el = document.documentElement; + } else { + doc = el.ownerDocument; + } + docEl = doc.documentElement; + box = {}; + _ref = el.getBoundingClientRect(); + for (k in _ref) { + v = _ref[k]; + box[k] = v; + } + origin = getOrigin(doc); + box.top -= origin.top; + box.left -= origin.left; + if (box.width == null) { + box.width = document.body.scrollWidth - box.left - box.right; + } + if (box.height == null) { + box.height = document.body.scrollHeight - box.top - box.bottom; + } + box.top = box.top - docEl.clientTop; + box.left = box.left - docEl.clientLeft; + box.right = doc.body.clientWidth - box.width - box.left; + box.bottom = doc.body.clientHeight - box.height - box.top; + return box; + }; - var invariant = __webpack_require__(36); + getOffsetParent = function(el) { + return el.offsetParent || document.documentElement; + }; - /** - * The CSSCore module specifies the API (and implements most of the methods) - * that should be used when dealing with the display of elements (via their - * CSS classes and visibility on screen. It is an API focused on mutating the - * display and not reading it as no logical state should be encoded in the - * display of elements. - */ + getScrollBarSize = function() { + var inner, outer, width, widthContained, widthScroll; + inner = document.createElement('div'); + inner.style.width = '100%'; + inner.style.height = '200px'; + outer = document.createElement('div'); + extend(outer.style, { + position: 'absolute', + top: 0, + left: 0, + pointerEvents: 'none', + visibility: 'hidden', + width: '200px', + height: '150px', + overflow: 'hidden' + }); + outer.appendChild(inner); + document.body.appendChild(outer); + widthContained = inner.offsetWidth; + outer.style.overflow = 'scroll'; + widthScroll = inner.offsetWidth; + if (widthContained === widthScroll) { + widthScroll = outer.clientWidth; + } + document.body.removeChild(outer); + width = widthContained - widthScroll; + return { + width: width, + height: width + }; + }; - var CSSCore = { + extend = function(out) { + var args, key, obj, val, _i, _len, _ref; + if (out == null) { + out = {}; + } + args = []; + Array.prototype.push.apply(args, arguments); + _ref = args.slice(1); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + obj = _ref[_i]; + if (obj) { + for (key in obj) { + if (!__hasProp.call(obj, key)) continue; + val = obj[key]; + out[key] = val; + } + } + } + return out; + }; - /** - * Adds the class passed in to the element if it doesn't already have it. - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @return {DOMElement} the element passed in - */ - addClass: function(element, className) { - ("production" !== (undefined) ? invariant( - !/\s/.test(className), - 'CSSCore.addClass takes only a single class name. "%s" contains ' + - 'multiple classes.', className - ) : invariant(!/\s/.test(className))); - - if (className) { - if (element.classList) { - element.classList.add(className); - } else if (!CSSCore.hasClass(element, className)) { - element.className = element.className + ' ' + className; + removeClass = function(el, name) { + var className, cls, _i, _len, _ref, _results; + if (el.classList != null) { + _ref = name.split(' '); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cls = _ref[_i]; + if (cls.trim()) { + _results.push(el.classList.remove(cls)); + } } + return _results; + } else { + className = getClassName(el).replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' '); + return setClassName(el, className); } - return element; - }, + }; - /** - * Removes the class passed in from the element - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @return {DOMElement} the element passed in - */ - removeClass: function(element, className) { - ("production" !== (undefined) ? invariant( - !/\s/.test(className), - 'CSSCore.removeClass takes only a single class name. "%s" contains ' + - 'multiple classes.', className - ) : invariant(!/\s/.test(className))); - - if (className) { - if (element.classList) { - element.classList.remove(className); - } else if (CSSCore.hasClass(element, className)) { - element.className = element.className - .replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1') - .replace(/\s+/g, ' ') // multiple spaces to one - .replace(/^\s*|\s*$/g, ''); // trim the ends + addClass = function(el, name) { + var cls, _i, _len, _ref, _results; + if (el.classList != null) { + _ref = name.split(' '); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + cls = _ref[_i]; + if (cls.trim()) { + _results.push(el.classList.add(cls)); + } } + return _results; + } else { + removeClass(el, name); + cls = getClassName(el) + (" " + name); + return setClassName(el, cls); } - return element; - }, + }; - /** - * Helper to add or remove a class from an element based on a condition. - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @param {*} bool condition to whether to add or remove the class - * @return {DOMElement} the element passed in - */ - conditionClass: function(element, className, bool) { - return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); - }, + hasClass = function(el, name) { + if (el.classList != null) { + return el.classList.contains(name); + } else { + return new RegExp("(^| )" + name + "( |$)", 'gi').test(getClassName(el)); + } + }; - /** - * Tests whether the element has the class specified. - * - * @param {DOMNode|DOMWindow} element the element to set the class on - * @param {string} className the CSS className - * @return {boolean} true if the element has the class, false if not - */ - hasClass: function(element, className) { - ("production" !== (undefined) ? invariant( - !/\s/.test(className), - 'CSS.hasClass takes only a single class name.' - ) : invariant(!/\s/.test(className))); - if (element.classList) { - return !!className && element.classList.contains(className); + getClassName = function(el) { + if (el.className instanceof SVGAnimatedString) { + return el.className.baseVal; + } else { + return el.className; } - return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; - } + }; - }; + setClassName = function(el, className) { + return el.setAttribute('class', className); + }; - module.exports = CSSCore; + updateClasses = function(el, add, all) { + var cls, _i, _j, _len, _len1, _results; + for (_i = 0, _len = all.length; _i < _len; _i++) { + cls = all[_i]; + if (__indexOf.call(add, cls) < 0) { + if (hasClass(el, cls)) { + removeClass(el, cls); + } + } + } + _results = []; + for (_j = 0, _len1 = add.length; _j < _len1; _j++) { + cls = add[_j]; + if (!hasClass(el, cls)) { + _results.push(addClass(el, cls)); + } else { + _results.push(void 0); + } + } + return _results; + }; + deferred = []; -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { + defer = function(fn) { + return deferred.push(fn); + }; - 'use strict'; + flush = function() { + var fn, _results; + _results = []; + while (fn = deferred.pop()) { + _results.push(fn()); + } + return _results; + }; - function ToObject(val) { - if (val == null) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } + Evented = (function() { + function Evented() {} - return Object(val); - } + Evented.prototype.on = function(event, handler, ctx, once) { + var _base; + if (once == null) { + once = false; + } + if (this.bindings == null) { + this.bindings = {}; + } + if ((_base = this.bindings)[event] == null) { + _base[event] = []; + } + return this.bindings[event].push({ + handler: handler, + ctx: ctx, + once: once + }); + }; - module.exports = Object.assign || function (target, source) { - var from; - var keys; - var to = ToObject(target); + Evented.prototype.once = function(event, handler, ctx) { + return this.on(event, handler, ctx, true); + }; - for (var s = 1; s < arguments.length; s++) { - from = arguments[s]; - keys = Object.keys(Object(from)); + Evented.prototype.off = function(event, handler) { + var i, _ref, _results; + if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) { + return; + } + if (handler == null) { + return delete this.bindings[event]; + } else { + i = 0; + _results = []; + while (i < this.bindings[event].length) { + if (this.bindings[event][i].handler === handler) { + _results.push(this.bindings[event].splice(i, 1)); + } else { + _results.push(i++); + } + } + return _results; + } + }; - for (var i = 0; i < keys.length; i++) { - to[keys[i]] = from[keys[i]]; - } - } + Evented.prototype.trigger = function() { + var args, ctx, event, handler, i, once, _ref, _ref1, _results; + event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + if ((_ref = this.bindings) != null ? _ref[event] : void 0) { + i = 0; + _results = []; + while (i < this.bindings[event].length) { + _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once; + handler.apply(ctx != null ? ctx : this, args); + if (once) { + _results.push(this.bindings[event].splice(i, 1)); + } else { + _results.push(i++); + } + } + return _results; + } + }; - return to; - }; + return Evented; + })(); -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { + this.Tether.Utils = { + getScrollParent: getScrollParent, + getBounds: getBounds, + getOffsetParent: getOffsetParent, + extend: extend, + addClass: addClass, + removeClass: removeClass, + hasClass: hasClass, + updateClasses: updateClasses, + defer: defer, + flush: flush, + uniqueId: uniqueId, + Evented: Evented, + getScrollBarSize: getScrollBarSize + }; - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* - Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk - License: MIT - http://mrgnrdrck.mit-license.org + }).call(this); - https://github.com/mroderick/PubSubJS - */ - (function (root, factory){ - 'use strict'; + (function() { + var MIRROR_LR, MIRROR_TB, OFFSET_MAP, Tether, addClass, addOffset, attachmentToOffset, autoToFixedAttachment, defer, extend, flush, getBounds, getOffsetParent, getOuterSize, getScrollBarSize, getScrollParent, getSize, now, offsetToPx, parseAttachment, parseOffset, position, removeClass, tethers, transformKey, updateClasses, within, _Tether, _ref, + __slice = [].slice, + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - if (true){ - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + if (this.Tether == null) { + throw new Error("You must include the utils.js file before tether.js"); + } - } else if (typeof exports === 'object'){ - // CommonJS - factory(exports); + Tether = this.Tether; - } else { - // Browser globals - var PubSub = {}; - root.PubSub = PubSub; - factory(PubSub); + _ref = Tether.Utils, getScrollParent = _ref.getScrollParent, getSize = _ref.getSize, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getOffsetParent = _ref.getOffsetParent, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, updateClasses = _ref.updateClasses, defer = _ref.defer, flush = _ref.flush, getScrollBarSize = _ref.getScrollBarSize; + + within = function(a, b, diff) { + if (diff == null) { + diff = 1; } - }(( typeof window === 'object' && window ) || this, function (PubSub){ - 'use strict'; + return (a + diff >= b && b >= a - diff); + }; - var messages = {}, - lastUid = -1; + transformKey = (function() { + var el, key, _i, _len, _ref1; + el = document.createElement('div'); + _ref1 = ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + key = _ref1[_i]; + if (el.style[key] !== void 0) { + return key; + } + } + })(); - function hasKeys(obj){ - var key; + tethers = []; - for (key in obj){ - if ( obj.hasOwnProperty(key) ){ - return true; - } - } - return false; - } + position = function() { + var tether, _i, _len; + for (_i = 0, _len = tethers.length; _i < _len; _i++) { + tether = tethers[_i]; + tether.position(false); + } + return flush(); + }; - /** - * Returns a function that throws the passed exception, for use as argument for setTimeout - * @param { Object } ex An Error object - */ - function throwException( ex ){ - return function reThrowException(){ - throw ex; - }; - } + now = function() { + var _ref1; + return (_ref1 = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref1 : +(new Date); + }; - function callSubscriberWithDelayedExceptions( subscriber, message, data ){ - try { - subscriber( message, data ); - } catch( ex ){ - setTimeout( throwException( ex ), 0); - } - } + (function() { + var event, lastCall, lastDuration, pendingTimeout, tick, _i, _len, _ref1, _results; + lastCall = null; + lastDuration = null; + pendingTimeout = null; + tick = function() { + if ((lastDuration != null) && lastDuration > 16) { + lastDuration = Math.min(lastDuration - 16, 250); + pendingTimeout = setTimeout(tick, 250); + return; + } + if ((lastCall != null) && (now() - lastCall) < 10) { + return; + } + if (pendingTimeout != null) { + clearTimeout(pendingTimeout); + pendingTimeout = null; + } + lastCall = now(); + position(); + return lastDuration = now() - lastCall; + }; + _ref1 = ['resize', 'scroll', 'touchmove']; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + event = _ref1[_i]; + _results.push(window.addEventListener(event, tick)); + } + return _results; + })(); - function callSubscriberWithImmediateExceptions( subscriber, message, data ){ - subscriber( message, data ); - } + MIRROR_LR = { + center: 'center', + left: 'right', + right: 'left' + }; - function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){ - var subscribers = messages[matchedMessage], - callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions, - s; + MIRROR_TB = { + middle: 'middle', + top: 'bottom', + bottom: 'top' + }; - if ( !messages.hasOwnProperty( matchedMessage ) ) { - return; - } + OFFSET_MAP = { + top: 0, + left: 0, + middle: '50%', + center: '50%', + bottom: '100%', + right: '100%' + }; - for (s in subscribers){ - if ( subscribers.hasOwnProperty(s)){ - callSubscriber( subscribers[s], originalMessage, data ); - } - } - } - - function createDeliveryFunction( message, data, immediateExceptions ){ - return function deliverNamespaced(){ - var topic = String( message ), - position = topic.lastIndexOf( '.' ); - - // deliver the message as it is now - deliverMessage(message, message, data, immediateExceptions); - - // trim the hierarchy and deliver message to each level - while( position !== -1 ){ - topic = topic.substr( 0, position ); - position = topic.lastIndexOf('.'); - deliverMessage( message, topic, data, immediateExceptions ); - } - }; - } - - function messageHasSubscribers( message ){ - var topic = String( message ), - found = Boolean(messages.hasOwnProperty( topic ) && hasKeys(messages[topic])), - position = topic.lastIndexOf( '.' ); - - while ( !found && position !== -1 ){ - topic = topic.substr( 0, position ); - position = topic.lastIndexOf( '.' ); - found = Boolean(messages.hasOwnProperty( topic ) && hasKeys(messages[topic])); - } - - return found; - } - - function publish( message, data, sync, immediateExceptions ){ - var deliver = createDeliveryFunction( message, data, immediateExceptions ), - hasSubscribers = messageHasSubscribers( message ); - - if ( !hasSubscribers ){ - return false; - } - - if ( sync === true ){ - deliver(); - } else { - setTimeout( deliver, 0 ); - } - return true; - } + autoToFixedAttachment = function(attachment, relativeToAttachment) { + var left, top; + left = attachment.left, top = attachment.top; + if (left === 'auto') { + left = MIRROR_LR[relativeToAttachment.left]; + } + if (top === 'auto') { + top = MIRROR_TB[relativeToAttachment.top]; + } + return { + left: left, + top: top + }; + }; - /** - * PubSub.publish( message[, data] ) -> Boolean - * - message (String): The message to publish - * - data: The data to pass to subscribers - * Publishes the the message, passing the data to it's subscribers - **/ - PubSub.publish = function( message, data ){ - return publish( message, data, false, PubSub.immediateExceptions ); - }; + attachmentToOffset = function(attachment) { + var _ref1, _ref2; + return { + left: (_ref1 = OFFSET_MAP[attachment.left]) != null ? _ref1 : attachment.left, + top: (_ref2 = OFFSET_MAP[attachment.top]) != null ? _ref2 : attachment.top + }; + }; - /** - * PubSub.publishSync( message[, data] ) -> Boolean - * - message (String): The message to publish - * - data: The data to pass to subscribers - * Publishes the the message synchronously, passing the data to it's subscribers - **/ - PubSub.publishSync = function( message, data ){ - return publish( message, data, true, PubSub.immediateExceptions ); - }; + addOffset = function() { + var left, offsets, out, top, _i, _len, _ref1; + offsets = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + out = { + top: 0, + left: 0 + }; + for (_i = 0, _len = offsets.length; _i < _len; _i++) { + _ref1 = offsets[_i], top = _ref1.top, left = _ref1.left; + if (typeof top === 'string') { + top = parseFloat(top, 10); + } + if (typeof left === 'string') { + left = parseFloat(left, 10); + } + out.top += top; + out.left += left; + } + return out; + }; - /** - * PubSub.subscribe( message, func ) -> String - * - message (String): The message to subscribe to - * - func (Function): The function to call when a new message is published - * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if - * you need to unsubscribe - **/ - PubSub.subscribe = function( message, func ){ - if ( typeof func !== 'function'){ - return false; - } + offsetToPx = function(offset, size) { + if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) { + offset.left = parseFloat(offset.left, 10) / 100 * size.width; + } + if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) { + offset.top = parseFloat(offset.top, 10) / 100 * size.height; + } + return offset; + }; - // message is not registered yet - if ( !messages.hasOwnProperty( message ) ){ - messages[message] = {}; - } + parseAttachment = parseOffset = function(value) { + var left, top, _ref1; + _ref1 = value.split(' '), top = _ref1[0], left = _ref1[1]; + return { + top: top, + left: left + }; + }; - // forcing token as String, to allow for future expansions without breaking usage - // and allow for easy use as key names for the 'messages' object - var token = 'uid_' + String(++lastUid); - messages[message][token] = func; + _Tether = (function() { + _Tether.modules = []; - // return token for unsubscribing - return token; - }; + function _Tether(options) { + this.position = __bind(this.position, this); + var module, _i, _len, _ref1, _ref2; + tethers.push(this); + this.history = []; + this.setOptions(options, false); + _ref1 = Tether.modules; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + module = _ref1[_i]; + if ((_ref2 = module.initialize) != null) { + _ref2.call(this); + } + } + this.position(); + } - /* Public: Clears all subscriptions - */ - PubSub.clearAllSubscriptions = function clearAllSubscriptions(){ - messages = {}; - }; + _Tether.prototype.getClass = function(key) { + var _ref1, _ref2; + if ((_ref1 = this.options.classes) != null ? _ref1[key] : void 0) { + return this.options.classes[key]; + } else if (((_ref2 = this.options.classes) != null ? _ref2[key] : void 0) !== false) { + if (this.options.classPrefix) { + return "" + this.options.classPrefix + "-" + key; + } else { + return key; + } + } else { + return ''; + } + }; - /*Public: Clear subscriptions by the topic - */ - PubSub.clearSubscriptions = function clearSubscriptions(topic){ - var m; - for (m in messages){ - if (messages.hasOwnProperty(m) && m.indexOf(topic) === 0){ - delete messages[m]; - } - } - }; + _Tether.prototype.setOptions = function(options, position) { + var defaults, key, _i, _len, _ref1, _ref2; + this.options = options; + if (position == null) { + position = true; + } + defaults = { + offset: '0 0', + targetOffset: '0 0', + targetAttachment: 'auto auto', + classPrefix: 'tether' + }; + this.options = extend(defaults, this.options); + _ref1 = this.options, this.element = _ref1.element, this.target = _ref1.target, this.targetModifier = _ref1.targetModifier; + if (this.target === 'viewport') { + this.target = document.body; + this.targetModifier = 'visible'; + } else if (this.target === 'scroll-handle') { + this.target = document.body; + this.targetModifier = 'scroll-handle'; + } + _ref2 = ['element', 'target']; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + key = _ref2[_i]; + if (this[key] == null) { + throw new Error("Tether Error: Both element and target must be defined"); + } + if (this[key].jquery != null) { + this[key] = this[key][0]; + } else if (typeof this[key] === 'string') { + this[key] = document.querySelector(this[key]); + } + } + addClass(this.element, this.getClass('element')); + addClass(this.target, this.getClass('target')); + if (!this.options.attachment) { + throw new Error("Tether Error: You must provide an attachment"); + } + this.targetAttachment = parseAttachment(this.options.targetAttachment); + this.attachment = parseAttachment(this.options.attachment); + this.offset = parseOffset(this.options.offset); + this.targetOffset = parseOffset(this.options.targetOffset); + if (this.scrollParent != null) { + this.disable(); + } + if (this.targetModifier === 'scroll-handle') { + this.scrollParent = this.target; + } else { + this.scrollParent = getScrollParent(this.target); + } + if (this.options.enabled !== false) { + return this.enable(position); + } + }; - /* Public: removes subscriptions. - * When passed a token, removes a specific subscription. - * When passed a function, removes all subscriptions for that function - * When passed a topic, removes all subscriptions for that topic (hierarchy) - * - * value - A token, function or topic to unsubscribe. - * - * Examples - * - * // Example 1 - unsubscribing with a token - * var token = PubSub.subscribe('mytopic', myFunc); - * PubSub.unsubscribe(token); - * - * // Example 2 - unsubscribing with a function - * PubSub.unsubscribe(myFunc); - * - * // Example 3 - unsubscribing a topic - * PubSub.unsubscribe('mytopic'); - */ - PubSub.unsubscribe = function(value){ - var isTopic = typeof value === 'string' && messages.hasOwnProperty(value), - isToken = !isTopic && typeof value === 'string', - isFunction = typeof value === 'function', - result = false, - m, message, t; - - if (isTopic){ - delete messages[value]; - return; - } - - for ( m in messages ){ - if ( messages.hasOwnProperty( m ) ){ - message = messages[m]; - - if ( isToken && message[value] ){ - delete message[value]; - result = value; - // tokens are unique, so we can just stop here - break; - } - - if (isFunction) { - for ( t in message ){ - if (message.hasOwnProperty(t) && message[t] === value){ - delete message[t]; - result = true; - } - } - } - } - } - - return result; - }; - })); - - -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule warning - */ - - "use strict"; + _Tether.prototype.getTargetBounds = function() { + var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target; + if (this.targetModifier != null) { + switch (this.targetModifier) { + case 'visible': + if (this.target === document.body) { + return { + top: pageYOffset, + left: pageXOffset, + height: innerHeight, + width: innerWidth + }; + } else { + bounds = getBounds(this.target); + out = { + height: bounds.height, + width: bounds.width, + top: bounds.top, + left: bounds.left + }; + out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top)); + out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight))); + out.height = Math.min(innerHeight, out.height); + out.height -= 2; + out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left)); + out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth))); + out.width = Math.min(innerWidth, out.width); + out.width -= 2; + if (out.top < pageYOffset) { + out.top = pageYOffset; + } + if (out.left < pageXOffset) { + out.left = pageXOffset; + } + return out; + } + break; + case 'scroll-handle': + target = this.target; + if (target === document.body) { + target = document.documentElement; + bounds = { + left: pageXOffset, + top: pageYOffset, + height: innerHeight, + width: innerWidth + }; + } else { + bounds = getBounds(target); + } + style = getComputedStyle(target); + hasBottomScroll = target.scrollWidth > target.clientWidth || 'scroll' === [style.overflow, style.overflowX] || this.target !== document.body; + scrollBottom = 0; + if (hasBottomScroll) { + scrollBottom = 15; + } + height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom; + out = { + width: 15, + height: height * 0.975 * (height / target.scrollHeight), + left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15 + }; + fitAdj = 0; + if (height < 408 && this.target === document.body) { + fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58; + } + if (this.target !== document.body) { + out.height = Math.max(out.height, 24); + } + scrollPercentage = this.target.scrollTop / (target.scrollHeight - height); + out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth); + if (this.target === document.body) { + out.height = Math.max(out.height, 24); + } + return out; + } + } else { + return getBounds(this.target); + } + }; - var emptyFunction = __webpack_require__(40); + _Tether.prototype.clearCache = function() { + return this._cache = {}; + }; - /** - * 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. - */ + _Tether.prototype.cache = function(k, getter) { + if (this._cache == null) { + this._cache = {}; + } + if (this._cache[k] == null) { + this._cache[k] = getter.call(this); + } + return this._cache[k]; + }; - var warning = emptyFunction; + _Tether.prototype.enable = function(position) { + if (position == null) { + position = true; + } + addClass(this.target, this.getClass('enabled')); + addClass(this.element, this.getClass('enabled')); + this.enabled = true; + if (this.scrollParent !== document) { + this.scrollParent.addEventListener('scroll', this.position); + } + if (position) { + return this.position(); + } + }; - if ("production" !== (undefined)) { - warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); - if (format === undefined) { - throw new Error( - '`warning(condition, format, ...args)` requires a warning ' + - 'message argument' - ); - } + _Tether.prototype.disable = function() { + removeClass(this.target, this.getClass('enabled')); + removeClass(this.element, this.getClass('enabled')); + this.enabled = false; + if (this.scrollParent != null) { + return this.scrollParent.removeEventListener('scroll', this.position); + } + }; - 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 - ); - } + _Tether.prototype.destroy = function() { + var i, tether, _i, _len, _results; + this.disable(); + _results = []; + for (i = _i = 0, _len = tethers.length; _i < _len; i = ++_i) { + tether = tethers[i]; + if (tether === this) { + tethers.splice(i, 1); + break; + } else { + _results.push(void 0); + } + } + return _results; + }; - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } + _Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) { + var add, all, side, sides, _i, _j, _len, _len1, _ref1, + _this = this; + if (elementAttach == null) { + elementAttach = this.attachment; + } + if (targetAttach == null) { + targetAttach = this.targetAttachment; + } + sides = ['left', 'top', 'bottom', 'right', 'middle', 'center']; + if ((_ref1 = this._addAttachClasses) != null ? _ref1.length : void 0) { + this._addAttachClasses.splice(0, this._addAttachClasses.length); + } + add = this._addAttachClasses != null ? this._addAttachClasses : this._addAttachClasses = []; + if (elementAttach.top) { + add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.top); + } + if (elementAttach.left) { + add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.left); + } + if (targetAttach.top) { + add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.top); + } + if (targetAttach.left) { + add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.left); + } + all = []; + for (_i = 0, _len = sides.length; _i < _len; _i++) { + side = sides[_i]; + all.push("" + (this.getClass('element-attached')) + "-" + side); + } + for (_j = 0, _len1 = sides.length; _j < _len1; _j++) { + side = sides[_j]; + all.push("" + (this.getClass('target-attached')) + "-" + side); + } + return defer(function() { + if (_this._addAttachClasses == null) { + return; + } + updateClasses(_this.element, _this._addAttachClasses, all); + updateClasses(_this.target, _this._addAttachClasses, all); + return _this._addAttachClasses = void 0; + }); + }; - if (!condition) { - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];}); - console.warn(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) {} - } - }; - } - - module.exports = warning; - - -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule ReactElement - */ - - 'use strict'; - - var ReactContext = __webpack_require__(41); - var ReactCurrentOwner = __webpack_require__(42); - - var assign = __webpack_require__(43); - var warning = __webpack_require__(32); - - var RESERVED_PROPS = { - key: true, - ref: true - }; - - /** - * Warn for mutations. - * - * @internal - * @param {object} object - * @param {string} key - */ - function defineWarningProperty(object, key) { - Object.defineProperty(object, key, { - - configurable: false, - enumerable: true, - - get: function() { - if (!this._store) { - return null; + _Tether.prototype.position = function(flushChanges) { + var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, + _this = this; + if (flushChanges == null) { + flushChanges = true; } - return this._store[key]; - }, - - set: function(value) { - ("production" !== (undefined) ? warning( - false, - 'Don\'t set the %s property of the React element. Instead, ' + - 'specify the correct value when initially creating the element.', - key - ) : null); - this._store[key] = value; - } - - }); - } - - /** - * This is updated to true if the membrane is successfully created. - */ - var useMutationMembrane = false; - - /** - * Warn for mutations. - * - * @internal - * @param {object} element - */ - function defineMutationMembrane(prototype) { - try { - var pseudoFrozenProperties = { - props: true - }; - for (var key in pseudoFrozenProperties) { - defineWarningProperty(prototype, key); - } - useMutationMembrane = true; - } catch (x) { - // IE will fail on defineProperty - } - } - - /** - * Base constructor for all React elements. This is only used to make this - * work with a dynamic instanceof check. Nothing should live on this prototype. - * - * @param {*} type - * @param {string|object} ref - * @param {*} key - * @param {*} props - * @internal - */ - var ReactElement = function(type, key, ref, owner, context, props) { - // Built-in properties that belong on the element - this.type = type; - this.key = key; - this.ref = ref; - - // Record the component responsible for creating this element. - this._owner = owner; - - // TODO: Deprecate withContext, and then the context becomes accessible - // through the owner. - this._context = context; - - if ("production" !== (undefined)) { - // The validation flag and props are currently mutative. We put them on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - this._store = {props: props, originalProps: assign({}, props)}; - - // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - try { - Object.defineProperty(this._store, 'validated', { - configurable: false, - enumerable: false, - writable: true + if (!this.enabled) { + return; + } + this.clearCache(); + targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment); + this.updateAttachClasses(this.attachment, targetAttachment); + elementPos = this.cache('element-bounds', function() { + return getBounds(_this.element); }); - } catch (x) { - } - this._store.validated = false; - - // We're not allowed to set props directly on the object so we early - // return and rely on the prototype membrane to forward to the backing - // store. - if (useMutationMembrane) { - Object.freeze(this); - return; - } - } - - this.props = props; - }; - - // We intentionally don't expose the function on the constructor property. - // ReactElement should be indistinguishable from a plain object. - ReactElement.prototype = { - _isReactElement: true - }; - - if ("production" !== (undefined)) { - defineMutationMembrane(ReactElement.prototype); - } - - ReactElement.createElement = function(type, config, children) { - var propName; - - // Reserved names are extracted - var props = {}; - - var key = null; - var ref = null; - - if (config != null) { - ref = config.ref === undefined ? null : config.ref; - key = config.key === undefined ? null : '' + config.key; - // Remaining properties are added to a new props object - for (propName in config) { - if (config.hasOwnProperty(propName) && - !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; + width = elementPos.width, height = elementPos.height; + if (width === 0 && height === 0 && (this.lastSize != null)) { + _ref1 = this.lastSize, width = _ref1.width, height = _ref1.height; + } else { + this.lastSize = { + width: width, + height: height + }; } - } - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - props.children = childArray; - } - - // Resolve default props - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) { - if (typeof props[propName] === 'undefined') { - props[propName] = defaultProps[propName]; + targetSize = targetPos = this.cache('target-bounds', function() { + return _this.getTargetBounds(); + }); + offset = offsetToPx(attachmentToOffset(this.attachment), { + width: width, + height: height + }); + targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize); + manualOffset = offsetToPx(this.offset, { + width: width, + height: height + }); + manualTargetOffset = offsetToPx(this.targetOffset, targetSize); + offset = addOffset(offset, manualOffset); + targetOffset = addOffset(targetOffset, manualTargetOffset); + left = targetPos.left + targetOffset.left - offset.left; + top = targetPos.top + targetOffset.top - offset.top; + _ref2 = Tether.modules; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + module = _ref2[_i]; + ret = module.position.call(this, { + left: left, + top: top, + targetAttachment: targetAttachment, + targetPos: targetPos, + attachment: this.attachment, + elementPos: elementPos, + offset: offset, + targetOffset: targetOffset, + manualOffset: manualOffset, + manualTargetOffset: manualTargetOffset, + scrollbarSize: scrollbarSize + }); + if ((ret == null) || typeof ret !== 'object') { + continue; + } else if (ret === false) { + return false; + } else { + top = ret.top, left = ret.left; + } } - } - } - - return new ReactElement( - type, - key, - ref, - ReactCurrentOwner.current, - ReactContext.current, - props - ); - }; - - ReactElement.createFactory = function(type) { - var factory = ReactElement.createElement.bind(null, type); - // Expose the type on the factory and the prototype so that it can be - // easily accessed on elements. E.g. .type === Foo.type. - // This should not be named `constructor` since this may not be the function - // that created the element, and it may not even be a constructor. - // Legacy hook TODO: Warn if this is accessed - factory.type = type; - return factory; - }; - - ReactElement.cloneAndReplaceProps = function(oldElement, newProps) { - var newElement = new ReactElement( - oldElement.type, - oldElement.key, - oldElement.ref, - oldElement._owner, - oldElement._context, - newProps - ); - - if ("production" !== (undefined)) { - // If the key on the original is valid, then the clone is valid - newElement._store.validated = oldElement._store.validated; - } - return newElement; - }; - - ReactElement.cloneElement = function(element, config, children) { - var propName; - - // Original props are copied - var props = assign({}, element.props); - - // Reserved names are extracted - var key = element.key; - var ref = element.ref; - - // Owner will be preserved, unless ref is overridden - var owner = element._owner; - - if (config != null) { - if (config.ref !== undefined) { - // Silently steal the ref from the parent. - ref = config.ref; - owner = ReactCurrentOwner.current; - } - if (config.key !== undefined) { - key = '' + config.key; - } - // Remaining properties override existing props - for (propName in config) { - if (config.hasOwnProperty(propName) && - !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; + next = { + page: { + top: top, + left: left + }, + viewport: { + top: top - pageYOffset, + bottom: pageYOffset - top - height + innerHeight, + left: left - pageXOffset, + right: pageXOffset - left - width + innerWidth + } + }; + if (document.body.scrollWidth > window.innerWidth) { + scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); + next.viewport.bottom -= scrollbarSize.height; } - } - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - props.children = childArray; - } - - return new ReactElement( - element.type, - key, - ref, - owner, - element._context, - props - ); - }; - - /** - * @param {?object} object - * @return {boolean} True if `object` is a valid component. - * @final - */ - ReactElement.isValidElement = function(object) { - // ReactTestUtils is often used outside of beforeEach where as React is - // within it. This leads to two different instances of React on the same - // page. To identify a element from a different React instance we use - // a flag instead of an instanceof check. - var isElement = !!(object && object._isReactElement); - // if (isElement && !(object instanceof ReactElement)) { - // This is an indicator that you're using multiple versions of React at the - // same time. This will screw with ownership and stuff. Fix it, please. - // TODO: We could possibly warn here. - // } - return isElement; - }; - - module.exports = ReactElement; - - -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule ReactPropTransferer - */ - - 'use strict'; - - var assign = __webpack_require__(43); - var emptyFunction = __webpack_require__(40); - var joinClasses = __webpack_require__(44); - - /** - * Creates a transfer strategy that will merge prop values using the supplied - * `mergeStrategy`. If a prop was previously unset, this just sets it. - * - * @param {function} mergeStrategy - * @return {function} - */ - function createTransferStrategy(mergeStrategy) { - return function(props, key, value) { - if (!props.hasOwnProperty(key)) { - props[key] = value; - } else { - props[key] = mergeStrategy(props[key], value); - } - }; - } - - var transferStrategyMerge = createTransferStrategy(function(a, b) { - // `merge` overrides the first object's (`props[key]` above) keys using the - // second object's (`value`) keys. An object's style's existing `propA` would - // get overridden. Flip the order here. - return assign({}, b, a); - }); - - /** - * Transfer strategies dictate how props are transferred by `transferPropsTo`. - * NOTE: if you add any more exceptions to this list you should be sure to - * update `cloneWithProps()` accordingly. - */ - var TransferStrategies = { - /** - * Never transfer `children`. - */ - children: emptyFunction, - /** - * Transfer the `className` prop by merging them. - */ - className: createTransferStrategy(joinClasses), - /** - * Transfer the `style` prop (which is an object) by merging them. - */ - style: transferStrategyMerge - }; - - /** - * Mutates the first argument by transferring the properties from the second - * argument. - * - * @param {object} props - * @param {object} newProps - * @return {object} - */ - function transferInto(props, newProps) { - for (var thisKey in newProps) { - if (!newProps.hasOwnProperty(thisKey)) { - continue; - } - - var transferStrategy = TransferStrategies[thisKey]; - - if (transferStrategy && TransferStrategies.hasOwnProperty(thisKey)) { - transferStrategy(props, thisKey, newProps[thisKey]); - } else if (!props.hasOwnProperty(thisKey)) { - props[thisKey] = newProps[thisKey]; - } - } - return props; - } - - /** - * ReactPropTransferer are capable of transferring props to another component - * using a `transferPropsTo` method. - * - * @class ReactPropTransferer - */ - var ReactPropTransferer = { - - /** - * Merge two props objects using TransferStrategies. - * - * @param {object} oldProps original props (they take precedence) - * @param {object} newProps new props to merge in - * @return {object} a new object containing both sets of props merged. - */ - mergeProps: function(oldProps, newProps) { - return transferInto(assign({}, oldProps), newProps); - } - - }; - - module.exports = ReactPropTransferer; - - -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule keyOf - */ - - /** - * Allows extraction of a minified key. Let's the build system minify keys - * without loosing the ability to dynamically use key strings as values - * themselves. Pass in an object with a single key/val pair and it will return - * you the string key of that single record. Suppose you want to grab the - * value for a key 'className' inside of an object. Key/val minification may - * have aliased that key to be 'xa12'. keyOf({className: null}) will return - * 'xa12' in that case. Resolve keys you want to use once at startup time, then - * reuse those resolutions. - */ - var keyOf = function(oneKeyObj) { - var key; - for (key in oneKeyObj) { - if (!oneKeyObj.hasOwnProperty(key)) { - continue; - } - return key; - } - return null; - }; - - - module.exports = keyOf; - - -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule invariant - */ - - "use strict"; - - /** - * 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 ("production" !== (undefined)) { - 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( - 'Invariant Violation: ' + - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } - }; - - module.exports = invariant; - - -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { - - var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement - ); - - module.exports = canUseDOM; - -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { - - var camel2hyphen = __webpack_require__(46); - - var isDimension = function (feature) { - var re = /[height|width]$/; - return re.test(feature); - }; - - var obj2mq = function (obj) { - var mq = ''; - var features = Object.keys(obj); - features.forEach(function (feature, index) { - var value = obj[feature]; - feature = camel2hyphen(feature); - // Add px to dimension features - if (isDimension(feature) && typeof value === 'number') { - value = value + 'px'; - } - if (value === true) { - mq += feature; - } else if (value === false) { - mq += 'not ' + feature; - } else { - mq += '(' + feature + ': ' + value + ')'; - } - if (index < features.length-1) { - mq += ' and ' - } - }); - return mq; - }; + if (document.body.scrollHeight > window.innerHeight) { + scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); + next.viewport.right -= scrollbarSize.width; + } + if (((_ref3 = document.body.style.position) !== '' && _ref3 !== 'static') || ((_ref4 = document.body.parentElement.style.position) !== '' && _ref4 !== 'static')) { + next.page.bottom = document.body.scrollHeight - top - height; + next.page.right = document.body.scrollWidth - left - width; + } + if (((_ref5 = this.options.optimizations) != null ? _ref5.moveElement : void 0) !== false && (this.targetModifier == null)) { + offsetParent = this.cache('target-offsetparent', function() { + return getOffsetParent(_this.target); + }); + offsetPosition = this.cache('target-offsetparent-bounds', function() { + return getBounds(offsetParent); + }); + offsetParentStyle = getComputedStyle(offsetParent); + elementStyle = getComputedStyle(this.element); + offsetParentSize = offsetPosition; + offsetBorder = {}; + _ref6 = ['Top', 'Left', 'Bottom', 'Right']; + for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { + side = _ref6[_j]; + offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle["border" + side + "Width"]); + } + offsetPosition.right = document.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right; + offsetPosition.bottom = document.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom; + if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) { + if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) { + scrollTop = offsetParent.scrollTop; + scrollLeft = offsetParent.scrollLeft; + next.offset = { + top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top, + left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left + }; + } + } + } + this.move(next); + this.history.unshift(next); + if (this.history.length > 3) { + this.history.pop(); + } + if (flushChanges) { + flush(); + } + return true; + }; - var json2mq = function (query) { - var mq = ''; - if (typeof query === 'string') { - return query; - } - // Handling array of media queries - if (query instanceof Array) { - query.forEach(function (q, index) { - mq += obj2mq(q); - if (index < query.length-1) { - mq += ', ' + _Tether.prototype.move = function(position) { + var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2, + _this = this; + if (this.element.parentNode == null) { + return; } - }); - return mq; - } - // Handling single media query - return obj2mq(query); - }; + same = {}; + for (type in position) { + same[type] = {}; + for (key in position[type]) { + found = false; + _ref1 = this.history; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + point = _ref1[_i]; + if (!within((_ref2 = point[type]) != null ? _ref2[key] : void 0, position[type][key])) { + found = true; + break; + } + } + if (!found) { + same[type][key] = true; + } + } + } + css = { + top: '', + left: '', + right: '', + bottom: '' + }; + transcribe = function(same, pos) { + var xPos, yPos, _ref3; + if (((_ref3 = _this.options.optimizations) != null ? _ref3.gpu : void 0) !== false) { + if (same.top) { + css.top = 0; + yPos = pos.top; + } else { + css.bottom = 0; + yPos = -pos.bottom; + } + if (same.left) { + css.left = 0; + xPos = pos.left; + } else { + css.right = 0; + xPos = -pos.right; + } + css[transformKey] = "translateX(" + (Math.round(xPos)) + "px) translateY(" + (Math.round(yPos)) + "px)"; + if (transformKey !== 'msTransform') { + return css[transformKey] += " translateZ(0)"; + } + } else { + if (same.top) { + css.top = "" + pos.top + "px"; + } else { + css.bottom = "" + pos.bottom + "px"; + } + if (same.left) { + return css.left = "" + pos.left + "px"; + } else { + return css.right = "" + pos.right + "px"; + } + } + }; + moved = false; + if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) { + css.position = 'absolute'; + transcribe(same.page, position.page); + } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) { + css.position = 'fixed'; + transcribe(same.viewport, position.viewport); + } else if ((same.offset != null) && same.offset.top && same.offset.left) { + css.position = 'absolute'; + offsetParent = this.cache('target-offsetparent', function() { + return getOffsetParent(_this.target); + }); + if (getOffsetParent(this.element) !== offsetParent) { + defer(function() { + _this.element.parentNode.removeChild(_this.element); + return offsetParent.appendChild(_this.element); + }); + } + transcribe(same.offset, position.offset); + moved = true; + } else { + css.position = 'absolute'; + transcribe({ + top: true, + left: true + }, position.page); + } + if (!moved && this.element.parentNode.tagName !== 'BODY') { + this.element.parentNode.removeChild(this.element); + document.body.appendChild(this.element); + } + writeCSS = {}; + write = false; + for (key in css) { + val = css[key]; + elVal = this.element.style[key]; + if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) { + elVal = parseFloat(elVal); + val = parseFloat(val); + } + if (elVal !== val) { + write = true; + writeCSS[key] = css[key]; + } + } + if (write) { + return defer(function() { + return extend(_this.element.style, writeCSS); + }); + } + }; + + return _Tether; - module.exports = json2mq; + })(); -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { + Tether.position = position; - var __WEBPACK_AMD_DEFINE_RESULT__;/*! - * enquire.js v2.1.1 - Awesome Media Queries in JavaScript - * Copyright (c) 2014 Nick Williams - http://wicky.nillia.ms/enquire.js - * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */ + this.Tether = extend(_Tether, Tether); - ;(function (name, context, factory) { - var matchMedia = window.matchMedia; + }).call(this); - if (typeof module !== 'undefined' && module.exports) { - module.exports = factory(matchMedia); - } - else if (true) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { - return (context[name] = factory(matchMedia)); - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - else { - context[name] = factory(matchMedia); - } - }('enquire', this, function (matchMedia) { + (function() { + var BOUNDS_FORMAT, MIRROR_ATTACH, defer, extend, getBoundingRect, getBounds, getOuterSize, getSize, updateClasses, _ref, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - 'use strict'; + _ref = this.Tether.Utils, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getSize = _ref.getSize, extend = _ref.extend, updateClasses = _ref.updateClasses, defer = _ref.defer; - /*jshint unused:false */ - /** - * Helper function for iterating over a collection - * - * @param collection - * @param fn - */ - function each(collection, fn) { - var i = 0, - length = collection.length, - cont; + MIRROR_ATTACH = { + left: 'right', + right: 'left', + top: 'bottom', + bottom: 'top', + middle: 'middle' + }; - for(i; i < length; i++) { - cont = fn(collection[i], i); - if(cont === false) { - break; //allow early exit + BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom']; + + getBoundingRect = function(tether, to) { + var i, pos, side, size, style, _i, _len; + if (to === 'scrollParent') { + to = tether.scrollParent; + } else if (to === 'window') { + to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset]; + } + if (to === document) { + to = to.documentElement; + } + if (to.nodeType != null) { + pos = size = getBounds(to); + style = getComputedStyle(to); + to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top]; + for (i = _i = 0, _len = BOUNDS_FORMAT.length; _i < _len; i = ++_i) { + side = BOUNDS_FORMAT[i]; + side = side[0].toUpperCase() + side.substr(1); + if (side === 'Top' || side === 'Left') { + to[i] += parseFloat(style["border" + side + "Width"]); + } else { + to[i] -= parseFloat(style["border" + side + "Width"]); + } + } + } + return to; + }; + + this.Tether.modules.push({ + position: function(_arg) { + var addClasses, allClasses, attachment, bounds, changeAttachX, changeAttachY, cls, constraint, eAttachment, height, left, oob, oobClass, p, pin, pinned, pinnedClass, removeClass, side, tAttachment, targetAttachment, targetHeight, targetSize, targetWidth, to, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, + _this = this; + top = _arg.top, left = _arg.left, targetAttachment = _arg.targetAttachment; + if (!this.options.constraints) { + return true; + } + removeClass = function(prefix) { + var side, _i, _len, _results; + _this.removeClass(prefix); + _results = []; + for (_i = 0, _len = BOUNDS_FORMAT.length; _i < _len; _i++) { + side = BOUNDS_FORMAT[_i]; + _results.push(_this.removeClass("" + prefix + "-" + side)); + } + return _results; + }; + _ref1 = this.cache('element-bounds', function() { + return getBounds(_this.element); + }), height = _ref1.height, width = _ref1.width; + if (width === 0 && height === 0 && (this.lastSize != null)) { + _ref2 = this.lastSize, width = _ref2.width, height = _ref2.height; + } + targetSize = this.cache('target-bounds', function() { + return _this.getTargetBounds(); + }); + targetHeight = targetSize.height; + targetWidth = targetSize.width; + tAttachment = {}; + eAttachment = {}; + allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')]; + _ref3 = this.options.constraints; + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + constraint = _ref3[_i]; + if (constraint.outOfBoundsClass) { + allClasses.push(constraint.outOfBoundsClass); + } + if (constraint.pinnedClass) { + allClasses.push(constraint.pinnedClass); + } + } + for (_j = 0, _len1 = allClasses.length; _j < _len1; _j++) { + cls = allClasses[_j]; + _ref4 = ['left', 'top', 'right', 'bottom']; + for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) { + side = _ref4[_k]; + allClasses.push("" + cls + "-" + side); + } + } + addClasses = []; + tAttachment = extend({}, targetAttachment); + eAttachment = extend({}, this.attachment); + _ref5 = this.options.constraints; + for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { + constraint = _ref5[_l]; + to = constraint.to, attachment = constraint.attachment, pin = constraint.pin; + if (attachment == null) { + attachment = ''; + } + if (__indexOf.call(attachment, ' ') >= 0) { + _ref6 = attachment.split(' '), changeAttachY = _ref6[0], changeAttachX = _ref6[1]; + } else { + changeAttachX = changeAttachY = attachment; + } + bounds = getBoundingRect(this, to); + if (changeAttachY === 'target' || changeAttachY === 'both') { + if (top < bounds[1] && tAttachment.top === 'top') { + top += targetHeight; + tAttachment.top = 'bottom'; + } + if (top + height > bounds[3] && tAttachment.top === 'bottom') { + top -= targetHeight; + tAttachment.top = 'top'; + } + } + if (changeAttachY === 'together') { + if (top < bounds[1] && tAttachment.top === 'top') { + if (eAttachment.top === 'bottom') { + top += targetHeight; + tAttachment.top = 'bottom'; + top += height; + eAttachment.top = 'top'; + } else if (eAttachment.top === 'top') { + top += targetHeight; + tAttachment.top = 'bottom'; + top -= height; + eAttachment.top = 'bottom'; + } + } + if (top + height > bounds[3] && tAttachment.top === 'bottom') { + if (eAttachment.top === 'top') { + top -= targetHeight; + tAttachment.top = 'top'; + top -= height; + eAttachment.top = 'bottom'; + } else if (eAttachment.top === 'bottom') { + top -= targetHeight; + tAttachment.top = 'top'; + top += height; + eAttachment.top = 'top'; + } + } + if (tAttachment.top === 'middle') { + if (top + height > bounds[3] && eAttachment.top === 'top') { + top -= height; + eAttachment.top = 'bottom'; + } else if (top < bounds[1] && eAttachment.top === 'bottom') { + top += height; + eAttachment.top = 'top'; + } + } + } + if (changeAttachX === 'target' || changeAttachX === 'both') { + if (left < bounds[0] && tAttachment.left === 'left') { + left += targetWidth; + tAttachment.left = 'right'; + } + if (left + width > bounds[2] && tAttachment.left === 'right') { + left -= targetWidth; + tAttachment.left = 'left'; + } + } + if (changeAttachX === 'together') { + if (left < bounds[0] && tAttachment.left === 'left') { + if (eAttachment.left === 'right') { + left += targetWidth; + tAttachment.left = 'right'; + left += width; + eAttachment.left = 'left'; + } else if (eAttachment.left === 'left') { + left += targetWidth; + tAttachment.left = 'right'; + left -= width; + eAttachment.left = 'right'; + } + } else if (left + width > bounds[2] && tAttachment.left === 'right') { + if (eAttachment.left === 'left') { + left -= targetWidth; + tAttachment.left = 'left'; + left -= width; + eAttachment.left = 'right'; + } else if (eAttachment.left === 'right') { + left -= targetWidth; + tAttachment.left = 'left'; + left += width; + eAttachment.left = 'left'; + } + } else if (tAttachment.left === 'center') { + if (left + width > bounds[2] && eAttachment.left === 'left') { + left -= width; + eAttachment.left = 'right'; + } else if (left < bounds[0] && eAttachment.left === 'right') { + left += width; + eAttachment.left = 'left'; } + } + } + if (changeAttachY === 'element' || changeAttachY === 'both') { + if (top < bounds[1] && eAttachment.top === 'bottom') { + top += height; + eAttachment.top = 'top'; + } + if (top + height > bounds[3] && eAttachment.top === 'top') { + top -= height; + eAttachment.top = 'bottom'; + } + } + if (changeAttachX === 'element' || changeAttachX === 'both') { + if (left < bounds[0] && eAttachment.left === 'right') { + left += width; + eAttachment.left = 'left'; + } + if (left + width > bounds[2] && eAttachment.left === 'left') { + left -= width; + eAttachment.left = 'right'; + } } - } - - /** - * Helper function for determining whether target object is an array - * - * @param target the object under test - * @return {Boolean} true if array, false otherwise - */ - function isArray(target) { - return Object.prototype.toString.apply(target) === '[object Array]'; - } - - /** - * Helper function for determining whether target object is a function - * - * @param target the object under test - * @return {Boolean} true if function, false otherwise - */ - function isFunction(target) { - return typeof target === 'function'; - } - - /** - * Delegate to handle a media query being matched and unmatched. - * - * @param {object} options - * @param {function} options.match callback for when the media query is matched - * @param {function} [options.unmatch] callback for when the media query is unmatched - * @param {function} [options.setup] one-time callback triggered the first time a query is matched - * @param {boolean} [options.deferSetup=false] should the setup callback be run immediately, rather than first time query is matched? - * @constructor - */ - function QueryHandler(options) { - this.options = options; - !options.deferSetup && this.setup(); - } - QueryHandler.prototype = { - - /** - * coordinates setup of the handler - * - * @function - */ - setup : function() { - if(this.options.setup) { - this.options.setup(); + if (typeof pin === 'string') { + pin = (function() { + var _len4, _m, _ref7, _results; + _ref7 = pin.split(','); + _results = []; + for (_m = 0, _len4 = _ref7.length; _m < _len4; _m++) { + p = _ref7[_m]; + _results.push(p.trim()); } - this.initialised = true; - }, - - /** - * coordinates setup and triggering of the handler - * - * @function - */ - on : function() { - !this.initialised && this.setup(); - this.options.match && this.options.match(); - }, - - /** - * coordinates the unmatch event for the handler - * - * @function - */ - off : function() { - this.options.unmatch && this.options.unmatch(); - }, - - /** - * called when a handler is to be destroyed. - * delegates to the destroy or unmatch callbacks, depending on availability. - * - * @function - */ - destroy : function() { - this.options.destroy ? this.options.destroy() : this.off(); - }, - - /** - * determines equality by reference. - * if object is supplied compare options, if function, compare match callback - * - * @function - * @param {object || function} [target] the target for comparison - */ - equals : function(target) { - return this.options === target || this.options.match === target; + return _results; + })(); + } else if (pin === true) { + pin = ['top', 'left', 'right', 'bottom']; } - - }; - /** - * Represents a single media query, manages it's state and registered handlers for this query - * - * @constructor - * @param {string} query the media query string - * @param {boolean} [isUnconditional=false] whether the media query should run regardless of whether the conditions are met. Primarily for helping older browsers deal with mobile-first design - */ - function MediaQuery(query, isUnconditional) { - this.query = query; - this.isUnconditional = isUnconditional; - this.handlers = []; - this.mql = matchMedia(query); - - var self = this; - this.listener = function(mql) { - self.mql = mql; - self.assess(); - }; - this.mql.addListener(this.listener); - } - MediaQuery.prototype = { - - /** - * add a handler for this query, triggering if already active - * - * @param {object} handler - * @param {function} handler.match callback for when query is activated - * @param {function} [handler.unmatch] callback for when query is deactivated - * @param {function} [handler.setup] callback for immediate execution when a query handler is registered - * @param {boolean} [handler.deferSetup=false] should the setup callback be deferred until the first time the handler is matched? - */ - addHandler : function(handler) { - var qh = new QueryHandler(handler); - this.handlers.push(qh); - - this.matches() && qh.on(); - }, - - /** - * removes the given handler from the collection, and calls it's destroy methods - * - * @param {object || function} handler the handler to remove - */ - removeHandler : function(handler) { - var handlers = this.handlers; - each(handlers, function(h, i) { - if(h.equals(handler)) { - h.destroy(); - return !handlers.splice(i,1); //remove from array and exit each early - } - }); - }, - - /** - * Determine whether the media query should be considered a match - * - * @return {Boolean} true if media query can be considered a match, false otherwise - */ - matches : function() { - return this.mql.matches || this.isUnconditional; - }, - - /** - * Clears all handlers and unbinds events - */ - clear : function() { - each(this.handlers, function(handler) { - handler.destroy(); - }); - this.mql.removeListener(this.listener); - this.handlers.length = 0; //clear array - }, - - /* - * Assesses the query, turning on all handlers if it matches, turning them off if it doesn't match - */ - assess : function() { - var action = this.matches() ? 'on' : 'off'; - - each(this.handlers, function(handler) { - handler[action](); - }); + pin || (pin = []); + pinned = []; + oob = []; + if (top < bounds[1]) { + if (__indexOf.call(pin, 'top') >= 0) { + top = bounds[1]; + pinned.push('top'); + } else { + oob.push('top'); + } } - }; - /** - * Allows for registration of query handlers. - * Manages the query handler's state and is responsible for wiring up browser events - * - * @constructor - */ - function MediaQueryDispatch () { - if(!matchMedia) { - throw new Error('matchMedia not present, legacy browsers require a polyfill'); + if (top + height > bounds[3]) { + if (__indexOf.call(pin, 'bottom') >= 0) { + top = bounds[3] - height; + pinned.push('bottom'); + } else { + oob.push('bottom'); + } } - - this.queries = {}; - this.browserIsIncapable = !matchMedia('only all').matches; + if (left < bounds[0]) { + if (__indexOf.call(pin, 'left') >= 0) { + left = bounds[0]; + pinned.push('left'); + } else { + oob.push('left'); + } + } + if (left + width > bounds[2]) { + if (__indexOf.call(pin, 'right') >= 0) { + left = bounds[2] - width; + pinned.push('right'); + } else { + oob.push('right'); + } + } + if (pinned.length) { + pinnedClass = (_ref7 = this.options.pinnedClass) != null ? _ref7 : this.getClass('pinned'); + addClasses.push(pinnedClass); + for (_m = 0, _len4 = pinned.length; _m < _len4; _m++) { + side = pinned[_m]; + addClasses.push("" + pinnedClass + "-" + side); + } + } + if (oob.length) { + oobClass = (_ref8 = this.options.outOfBoundsClass) != null ? _ref8 : this.getClass('out-of-bounds'); + addClasses.push(oobClass); + for (_n = 0, _len5 = oob.length; _n < _len5; _n++) { + side = oob[_n]; + addClasses.push("" + oobClass + "-" + side); + } + } + if (__indexOf.call(pinned, 'left') >= 0 || __indexOf.call(pinned, 'right') >= 0) { + eAttachment.left = tAttachment.left = false; + } + if (__indexOf.call(pinned, 'top') >= 0 || __indexOf.call(pinned, 'bottom') >= 0) { + eAttachment.top = tAttachment.top = false; + } + if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== this.attachment.top || eAttachment.left !== this.attachment.left) { + this.updateAttachClasses(eAttachment, tAttachment); + } + } + defer(function() { + updateClasses(_this.target, addClasses, allClasses); + return updateClasses(_this.element, addClasses, allClasses); + }); + return { + top: top, + left: left + }; } + }); - MediaQueryDispatch.prototype = { - - /** - * Registers a handler for the given media query - * - * @param {string} q the media query - * @param {object || Array || Function} options either a single query handler object, a function, or an array of query handlers - * @param {function} options.match fired when query matched - * @param {function} [options.unmatch] fired when a query is no longer matched - * @param {function} [options.setup] fired when handler first triggered - * @param {boolean} [options.deferSetup=false] whether setup should be run immediately or deferred until query is first matched - * @param {boolean} [shouldDegrade=false] whether this particular media query should always run on incapable browsers - */ - register : function(q, options, shouldDegrade) { - var queries = this.queries, - isUnconditional = shouldDegrade && this.browserIsIncapable; - - if(!queries[q]) { - queries[q] = new MediaQuery(q, isUnconditional); - } - - //normalise to object in an array - if(isFunction(options)) { - options = { match : options }; - } - if(!isArray(options)) { - options = [options]; - } - each(options, function(handler) { - queries[q].addHandler(handler); - }); - - return this; - }, + }).call(this); - /** - * unregisters a query and all it's handlers, or a specific handler for a query - * - * @param {string} q the media query to target - * @param {object || function} [handler] specific handler to unregister - */ - unregister : function(q, handler) { - var query = this.queries[q]; + (function() { + var defer, getBounds, updateClasses, _ref; - if(query) { - if(handler) { - query.removeHandler(handler); - } - else { - query.clear(); - delete this.queries[q]; - } - } + _ref = this.Tether.Utils, getBounds = _ref.getBounds, updateClasses = _ref.updateClasses, defer = _ref.defer; - return this; + this.Tether.modules.push({ + position: function(_arg) { + var abutted, addClasses, allClasses, bottom, height, left, right, side, sides, targetPos, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5, + _this = this; + top = _arg.top, left = _arg.left; + _ref1 = this.cache('element-bounds', function() { + return getBounds(_this.element); + }), height = _ref1.height, width = _ref1.width; + targetPos = this.getTargetBounds(); + bottom = top + height; + right = left + width; + abutted = []; + if (top <= targetPos.bottom && bottom >= targetPos.top) { + _ref2 = ['left', 'right']; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + side = _ref2[_i]; + if ((_ref3 = targetPos[side]) === left || _ref3 === right) { + abutted.push(side); + } } - }; - - return new MediaQueryDispatch(); - - })); - -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule emptyFunction - */ - - 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. - */ - 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; - - -/***/ }, -/* 41 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule ReactContext - */ - - 'use strict'; - - var assign = __webpack_require__(43); - var emptyObject = __webpack_require__(45); - var warning = __webpack_require__(32); - - var didWarn = false; - - /** - * Keeps track of the current context. - * - * The context is automatically passed down the component ownership hierarchy - * and is accessible via `this.context` on ReactCompositeComponents. - */ - var ReactContext = { - - /** - * @internal - * @type {object} - */ - current: emptyObject, - - /** - * Temporarily extends the current context while executing scopedCallback. - * - * A typical use case might look like - * - * render: function() { - * var children = ReactContext.withContext({foo: 'foo'}, () => ( - * - * )); - * return
{children}
; - * } - * - * @param {object} newContext New context to merge into the existing context - * @param {function} scopedCallback Callback to run with the new context - * @return {ReactComponent|array} - */ - withContext: function(newContext, scopedCallback) { - if ("production" !== (undefined)) { - ("production" !== (undefined) ? warning( - didWarn, - 'withContext is deprecated and will be removed in a future version. ' + - 'Use a wrapper component with getChildContext instead.' - ) : null); - - didWarn = true; - } - - var result; - var previousContext = ReactContext.current; - ReactContext.current = assign({}, previousContext, newContext); - try { - result = scopedCallback(); - } finally { - ReactContext.current = previousContext; + } + if (left <= targetPos.right && right >= targetPos.left) { + _ref4 = ['top', 'bottom']; + for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { + side = _ref4[_j]; + if ((_ref5 = targetPos[side]) === top || _ref5 === bottom) { + abutted.push(side); + } + } + } + allClasses = []; + addClasses = []; + sides = ['left', 'top', 'right', 'bottom']; + allClasses.push(this.getClass('abutted')); + for (_k = 0, _len2 = sides.length; _k < _len2; _k++) { + side = sides[_k]; + allClasses.push("" + (this.getClass('abutted')) + "-" + side); + } + if (abutted.length) { + addClasses.push(this.getClass('abutted')); + } + for (_l = 0, _len3 = abutted.length; _l < _len3; _l++) { + side = abutted[_l]; + addClasses.push("" + (this.getClass('abutted')) + "-" + side); + } + defer(function() { + updateClasses(_this.target, addClasses, allClasses); + return updateClasses(_this.element, addClasses, allClasses); + }); + return true; } - return result; - } - - }; - - module.exports = ReactContext; - - -/***/ }, -/* 42 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @providesModule ReactCurrentOwner - */ + }); - 'use strict'; + }).call(this); - /** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - * - * The depth indicate how many composite components are above this render level. - */ - var ReactCurrentOwner = { + (function() { + this.Tether.modules.push({ + position: function(_arg) { + var left, result, shift, shiftLeft, shiftTop, top, _ref; + top = _arg.top, left = _arg.left; + if (!this.options.shift) { + return; + } + result = function(val) { + if (typeof val === 'function') { + return val.call(this, { + top: top, + left: left + }); + } else { + return val; + } + }; + shift = result(this.options.shift); + if (typeof shift === 'string') { + shift = shift.split(' '); + shift[1] || (shift[1] = shift[0]); + shiftTop = shift[0], shiftLeft = shift[1]; + shiftTop = parseFloat(shiftTop, 10); + shiftLeft = parseFloat(shiftLeft, 10); + } else { + _ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1]; + } + top += shiftTop; + left += shiftLeft; + return { + top: top, + left: left + }; + } + }); - /** - * @internal - * @type {ReactComponent} - */ - current: null + }).call(this); - }; + return this.Tether; - module.exports = ReactCurrentOwner; + })); /***/ }, -/* 43 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @providesModule Object.assign - */ + 'use strict'; - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign + var React = __webpack_require__(2); + var cloneWithProps = __webpack_require__(3); - 'use strict'; + var Tabs = React.createClass({ + displayName: 'Tabs', - function assign(target, sources) { - if (target == null) { - throw new TypeError('Object.assign target cannot be null or undefined'); + getInitialState: function getInitialState() { + return { + selectedTab: 0, + content: null + }; + }, + selectTab: function selectTab(options) { + this.setState(options); + }, + render: function render() { + var children = React.Children.map(this.props.children, (function (child, index) { + return cloneWithProps(child, { + active: index === this.state.selectedTab, + index: index, + selectTab: this.selectTab + }); + }).bind(this)); + return React.createElement( + 'div', + null, + React.createElement( + 'div', + { className: 'tabs' }, + children + ), + React.createElement( + 'div', + null, + this.state.content + ) + ); } + }); - var to = Object(target); - var hasOwnProperty = Object.prototype.hasOwnProperty; + module.exports = Tabs; + Tabs.Tab = __webpack_require__(42); - for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { - var nextSource = arguments[nextIndex]; - if (nextSource == null) { - continue; - } +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { - var from = Object(nextSource); + 'use strict'; - // We don't currently support accessors nor proxies. Therefore this - // copy cannot throw. If we ever supported this then we must handle - // exceptions and side-effects. We don't support symbols so they won't - // be transferred. + var React = __webpack_require__(2); + var cx = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"react/lib/cx\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } + var Tab = React.createClass({ + displayName: 'Tab', + + componentDidMount: function componentDidMount() { + if (this.props.active) { + this.select(); } + }, + select: function select() { + var options = { + selectedTab: this.props.index, + content: this.props.children + }; + this.props.selectTab(options); + }, + render: function render() { + var classes = { + 'tab-item': true, + 'is-active': this.props.active + }; + return React.createElement( + 'div', + { className: cx(classes), onClick: this.select }, + this.props.title + ); } + }); - return to; - } - - module.exports = assign; - + module.exports = Tab; /***/ }, -/* 44 */ +/* 43 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @providesModule joinClasses - * @typechecks static-only - */ - 'use strict'; - /** - * Combines multiple className strings into one. - * http://jsperf.com/joinclasses-args-vs-array - * - * @param {...?string} classes - * @return {string} - */ - function joinClasses(className/*, ... */) { - if (!className) { - className = ''; - } - var nextClass; - var argLength = arguments.length; - if (argLength > 1) { - for (var ii = 1; ii < argLength; ii++) { - nextClass = arguments[ii]; - if (nextClass) { - className = (className ? className + ' ' : '') + nextClass; + var React = __webpack_require__(2); + var cloneWithProps = __webpack_require__(3); + var foundationApi = __webpack_require__(16); + var PopupToggle = __webpack_require__(44); + + var Trigger = React.createClass({ + displayName: 'Trigger', + + getDefaultProps: function getDefaultProps() { + return { + open: null, + close: null, + toggle: null, + hardToggle: null, + popupToggle: null, + notify: null + }; + }, + getCloseId: function getCloseId() { + if (this.props.close) { + return this.props.close; + } else { + var parentElement = false; + var tempElement = this.getDOMNode().parentNode; + while (parentElement === false) { + if (tempElement.nodeName == 'BODY') { + parentElement = ''; + } + if (typeof tempElement.getAttribute('data-closable') !== 'undefined' && tempElement.getAttribute('data-closable') !== false) { + parentElement = tempElement; + } + + tempElement = tempElement.parentNode; } + return parentElement.getAttribute('id'); + } + }, + clickHandler: function clickHandler(e) { + e.preventDefault(); + if (this.props.open) { + foundationApi.publish(this.props.open, 'open'); + } else if (this.props.close !== null) { + foundationApi.publish(this.getCloseId(), 'close'); + } else if (this.props.toggle) { + foundationApi.publish(this.props.toggle, 'toggle'); + } else if (this.props.hardToggle) { + foundationApi.closeActiveElements({ exclude: this.props.hardToggle }); + foundationApi.publish(this.props.hardToggle, 'toggle'); + } else if (this.props.notify) { + foundationApi.publish(this.props.notify, { + title: this.props.title, + content: this.props.content, + position: this.props.position, + color: this.props.color, + image: this.props.image + }); + } + }, + render: function render() { + if (this.props.popupToggle) { + return React.createElement(PopupToggle, this.props); + } else { + var child = React.Children.only(this.props.children); + return cloneWithProps(child, { + onClick: this.clickHandler + }); } } - return className; - } - - module.exports = joinClasses; + }); + module.exports = Trigger; /***/ }, -/* 45 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { - /** - * 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. - * - * @providesModule emptyObject - */ - - "use strict"; - - var emptyObject = {}; - - if ("production" !== (undefined)) { - Object.freeze(emptyObject); - } - - module.exports = emptyObject; + 'use strict'; + var React = __webpack_require__(2); + var foundationApi = __webpack_require__(16); + var cloneWithProps = __webpack_require__(3); -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { + var PopupToggle = React.createClass({ + displayName: 'PopupToggle', - var camel2hyphen = function (str) { - return str - .replace(/[A-Z]/g, function (match) { - return '-' + match.toLowerCase(); - }) - .toLowerCase(); - }; + clickHandler: function clickHandler(id, e) { + e.preventDefault(); + foundationApi.publish(this.props.popupToggle, ['toggle', id]); + }, + render: function render() { + var child = React.Children.only(this.props.children); + var id = this.props.id || foundationApi.generateUuid(); + return cloneWithProps(child, { + id: id, + onClick: this.clickHandler.bind(this, id) + }); + } + }); - module.exports = camel2hyphen; + module.exports = PopupToggle; /***/ } /******/ ]) diff --git a/dist/react-foundation-apps.min.js b/dist/react-foundation-apps.min.js index 5b66f76..1266e93 100644 --- a/dist/react-foundation-apps.min.js +++ b/dist/react-foundation-apps.min.js @@ -1,3 +1,11 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.RFA=e(require("react")):t.RFA=e(t.React)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports={Accordion:n(23),ActionSheet:n(2),Iconic:n(3),Interchange:n(4),Modal:n(5),Notification:n(6),OffCanvas:n(7),Panel:n(8),Popup:n(9),Tabs:n(10),Trigger:n(11)}},function(t,e,n){var i,o;/*! tether 0.6.5 */ -!function(s,r){i=r,o="function"==typeof i?i.call(e,n,e,t):i,!(void 0!==o&&(t.exports=o))}(this,function(t,e,n){return function(){var t,e,n,i,o,s,r,a,l,c,h,u,p,f,d,m,g,v,b,y={}.hasOwnProperty,w=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},C=[].slice;null==this.Tether&&(this.Tether={modules:[]}),u=function(t){var e,n,i,o,s;if(n=getComputedStyle(t).position,"fixed"===n)return t;for(i=void 0,e=t;e=e.parentNode;){try{o=getComputedStyle(e)}catch(r){}if(null==o)return e;if(/(auto|scroll)/.test(o.overflow+o.overflowY+o.overflowX)&&("absolute"!==n||"relative"===(s=o.position)||"absolute"===s||"fixed"===s))return e}return document.body},g=function(){var t;return t=0,function(){return t++}}(),b={},c=function(t){var e,i,s,r,a;if(s=t._tetherZeroElement,null==s&&(s=t.createElement("div"),s.setAttribute("data-tether-id",g()),o(s.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(s),t._tetherZeroElement=s),e=s.getAttribute("data-tether-id"),null==b[e]){b[e]={},a=s.getBoundingClientRect();for(i in a)r=a[i],b[e][i]=r;n(function(){return b[e]=void 0})}return b[e]},f=null,r=function(t){var e,n,i,o,s,r,a;t===document?(n=document,t=document.documentElement):n=t.ownerDocument,i=n.documentElement,e={},a=t.getBoundingClientRect();for(o in a)r=a[o],e[o]=r;return s=c(n),e.top-=s.top,e.left-=s.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-i.clientTop,e.left=e.left-i.clientLeft,e.right=n.body.clientWidth-e.width-e.left,e.bottom=n.body.clientHeight-e.height-e.top,e},l=function(t){return t.offsetParent||document.documentElement},h=function(){var t,e,n,i,s;return t=document.createElement("div"),t.style.width="100%",t.style.height="200px",e=document.createElement("div"),o(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e),i=t.offsetWidth,e.style.overflow="scroll",s=t.offsetWidth,i===s&&(s=e.clientWidth),document.body.removeChild(e),n=i-s,{width:n,height:n}},o=function(t){var e,n,i,o,s,r,a;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),a=e.slice(1),s=0,r=a.length;r>s;s++)if(i=a[s])for(n in i)y.call(i,n)&&(o=i[n],t[n]=o);return t},d=function(t,e){var n,i,o,s,r,l;if(null!=t.classList){for(r=e.split(" "),l=[],o=0,s=r.length;s>o;o++)i=r[o],i.trim()&&l.push(t.classList.remove(i));return l}return n=a(t).replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," "),m(t,n)},e=function(t,e){var n,i,o,s,r;if(null!=t.classList){for(s=e.split(" "),r=[],i=0,o=s.length;o>i;i++)n=s[i],n.trim()&&r.push(t.classList.add(n));return r}return d(t,e),n=a(t)+(" "+e),m(t,n)},p=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(a(t))},a=function(t){return t.className instanceof SVGAnimatedString?t.className.baseVal:t.className},m=function(t,e){return t.setAttribute("class",e)},v=function(t,n,i){var o,s,r,a,l,c;for(s=0,a=i.length;a>s;s++)o=i[s],w.call(n,o)<0&&p(t,o)&&d(t,o);for(c=[],r=0,l=n.length;l>r;r++)o=n[r],c.push(p(t,o)?void 0:e(t,o));return c},i=[],n=function(t){return i.push(t)},s=function(){var t,e;for(e=[];t=i.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,n,i){var o;return null==i&&(i=!1),null==this.bindings&&(this.bindings={}),null==(o=this.bindings)[t]&&(o[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:i})},t.prototype.once=function(t,e,n){return this.on(t,e,n,!0)},t.prototype.off=function(t,e){var n,i,o;if(null!=(null!=(i=this.bindings)?i[t]:void 0)){if(null==e)return delete this.bindings[t];for(n=0,o=[];n=e&&e>=t-n},x=function(){var t,e,n,i,o;for(t=document.createElement("div"),o=["transform","webkitTransform","OTransform","MozTransform","msTransform"],n=0,i=o.length;i>n;n++)if(e=o[n],void 0!==t.style[e])return e}(),E=[],C=function(){var t,e,n;for(e=0,n=E.length;n>e;e++)t=E[e],t.position(!1);return h()},v=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?t:+new Date},function(){var t,e,n,i,o,s,r,a,l;for(e=null,n=null,i=null,o=function(){if(null!=n&&n>16)return n=Math.min(n-16,250),void(i=setTimeout(o,250));if(!(null!=e&&v()-e<10))return null!=i&&(clearTimeout(i),i=null),e=v(),C(),n=v()-e},a=["resize","scroll","touchmove"],l=[],s=0,r=a.length;r>s;s++)t=a[s],l.push(window.addEventListener(t,o));return l}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},n={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},a=function(n,i){var o,s;return o=n.left,s=n.top,"auto"===o&&(o=t[i.left]),"auto"===s&&(s=e[i.top]),{left:o,top:s}},r=function(t){var e,i;return{left:null!=(e=n[t.left])?e:t.left,top:null!=(i=n[t.top])?i:t.top}},s=function(){var t,e,n,i,o,s,r;for(e=1<=arguments.length?A.call(arguments,0):[],n={top:0,left:0},o=0,s=e.length;s>o;o++)r=e[o],i=r.top,t=r.left,"string"==typeof i&&(i=parseFloat(i,10)),"string"==typeof t&&(t=parseFloat(t,10)),n.top+=i,n.left+=t;return n},b=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},y=w=function(t){var e,n,i;return i=t.split(" "),n=i[0],e=i[1],{top:n,left:e}},T=function(){function t(t){this.position=M(this.position,this);var e,n,o,s,r;for(E.push(this),this.history=[],this.setOptions(t,!1),s=i.modules,n=0,o=s.length;o>n;n++)e=s[n],null!=(r=e.initialize)&&r.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,n;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(n=this.options.classes)?n[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var n,i,s,r,a,l;for(this.options=t,null==e&&(e=!0),n={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=c(n,this.options),a=this.options,this.element=a.element,this.target=a.target,this.targetModifier=a.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),l=["element","target"],s=0,r=l.length;r>s;s++){if(i=l[s],null==this[i])throw new Error("Tether Error: Both element and target must be defined");null!=this[i].jquery?this[i]=this[i][0]:"string"==typeof this[i]&&(this[i]=document.querySelector(this[i]))}if(o(this.element,this.getClass("element")),o(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=y(this.options.targetAttachment),this.attachment=y(this.options.attachment),this.offset=w(this.options.offset),this.targetOffset=w(this.options.targetOffset),null!=this.scrollParent&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParent=this.target:this.scrollParent=m(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,n,i,o,s,r,a,l;if(null==this.targetModifier)return u(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=u(this.target),o={height:t.height,width:t.width,top:t.top,left:t.left},o.height=Math.min(o.height,t.height-(pageYOffset-t.top)),o.height=Math.min(o.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),o.height=Math.min(innerHeight,o.height),o.height-=2,o.width=Math.min(o.width,t.width-(pageXOffset-t.left)),o.width=Math.min(o.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),o.width=Math.min(innerWidth,o.width),o.width-=2,o.topl.clientWidth||"scroll"===[a.overflow,a.overflowX]||this.target!==document.body,s=0,n&&(s=15),i=t.height-parseFloat(a.borderTopWidth)-parseFloat(a.borderBottomWidth)-s,o={width:15,height:.975*i*(i/l.scrollHeight),left:t.left+t.width-parseFloat(a.borderLeftWidth)-15},e=0,408>i&&this.target===document.body&&(e=-11e-5*Math.pow(i,2)-.00727*i+22.58),this.target!==document.body&&(o.height=Math.max(o.height,24)),r=this.target.scrollTop/(l.scrollHeight-i),o.top=r*(i-o.height-e)+t.top+parseFloat(a.borderTopWidth),this.target===document.body&&(o.height=Math.max(o.height,24)),o}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),o(this.target,this.getClass("enabled")),o(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return O(this.target,this.getClass("enabled")),O(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,n,i,o;for(this.disable(),o=[],t=n=0,i=E.length;i>n;t=++n){if(e=E[t],e===this){E.splice(t,1);break}o.push(void 0)}return o},t.prototype.updateAttachClasses=function(t,e){var n,i,o,s,r,a,c,h,u,p=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),s=["left","top","bottom","right","middle","center"],(null!=(u=this._addAttachClasses)?u.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),n=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&n.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&n.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&n.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&n.push(""+this.getClass("target-attached")+"-"+e.left),i=[],r=0,c=s.length;c>r;r++)o=s[r],i.push(""+this.getClass("element-attached")+"-"+o);for(a=0,h=s.length;h>a;a++)o=s[a],i.push(""+this.getClass("target-attached")+"-"+o);return l(function(){return null!=p._addAttachClasses?(S(p.element,p._addAttachClasses,i),S(p.target,p._addAttachClasses,i),p._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,n,o,l,c,f,m,g,v,y,w,C,O,E,x,S,N,T,P,A,M,I,k,D,W,_,L,j,H,B,U,z,q,R,F,Y=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),A=a(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,A),e=this.cache("element-bounds",function(){return u(Y.element)}),W=e.width,o=e.height,0===W&&0===o&&null!=this.lastSize?(B=this.lastSize,W=B.width,o=B.height):this.lastSize={width:W,height:o},k=I=this.cache("target-bounds",function(){return Y.getTargetBounds()}),v=b(r(this.attachment),{width:W,height:o}),M=b(r(A),k),c=b(this.offset,{width:W,height:o}),f=b(this.targetOffset,k),v=s(v,c),M=s(M,f),l=I.left+M.left-v.left,D=I.top+M.top-v.top,U=i.modules,_=0,j=U.length;j>_;_++)if(m=U[_],x=m.position.call(this,{left:l,top:D,targetAttachment:A,targetPos:I,attachment:this.attachment,elementPos:e,offset:v,targetOffset:M,manualOffset:c,manualTargetOffset:f,scrollbarSize:T}),null!=x&&"object"==typeof x){if(x===!1)return!1;D=x.top,l=x.left}if(g={page:{top:D,left:l},viewport:{top:D-pageYOffset,bottom:pageYOffset-D-o+innerHeight,left:l-pageXOffset,right:pageXOffset-l-W+innerWidth}},document.body.scrollWidth>window.innerWidth&&(T=this.cache("scrollbar-size",d),g.viewport.bottom-=T.height),document.body.scrollHeight>window.innerHeight&&(T=this.cache("scrollbar-size",d),g.viewport.right-=T.width),(""!==(z=document.body.style.position)&&"static"!==z||""!==(q=document.body.parentElement.style.position)&&"static"!==q)&&(g.page.bottom=document.body.scrollHeight-D-o,g.page.right=document.body.scrollWidth-l-W),(null!=(R=this.options.optimizations)?R.moveElement:void 0)!==!1&&null==this.targetModifier){for(w=this.cache("target-offsetparent",function(){return p(Y.target)}),E=this.cache("target-offsetparent-bounds",function(){return u(w)}),O=getComputedStyle(w),n=getComputedStyle(this.element),C=E,y={},F=["Top","Left","Bottom","Right"],L=0,H=F.length;H>L;L++)P=F[L],y[P.toLowerCase()]=parseFloat(O["border"+P+"Width"]);E.right=document.body.scrollWidth-E.left-C.width+y.right,E.bottom=document.body.scrollHeight-E.top-C.height+y.bottom,g.page.top>=E.top+y.top&&g.page.bottom>=E.bottom&&g.page.left>=E.left+y.left&&g.page.right>=E.right&&(N=w.scrollTop,S=w.scrollLeft,g.offset={top:g.page.top-E.top+N-y.top,left:g.page.left-E.left+S-y.left})}return this.move(g),this.history.unshift(g),this.history.length>3&&this.history.pop(),t&&h(),!0}},t.prototype.move=function(t){var e,n,i,o,s,r,a,h,u,f,d,m,g,v,b,y,w,C=this;if(null!=this.element.parentNode){h={};for(f in t){h[f]={};for(o in t[f]){for(i=!1,y=this.history,v=0,b=y.length;b>v;v++)if(a=y[v],!N(null!=(w=a[f])?w[o]:void 0,t[f][o])){i=!0;break}i||(h[f][o]=!0)}}e={top:"",left:"",right:"",bottom:""},u=function(t,n){var i,o,s;return(null!=(s=C.options.optimizations)?s.gpu:void 0)===!1?(t.top?e.top=""+n.top+"px":e.bottom=""+n.bottom+"px",t.left?e.left=""+n.left+"px":e.right=""+n.right+"px"):(t.top?(e.top=0,o=n.top):(e.bottom=0,o=-n.bottom),t.left?(e.left=0,i=n.left):(e.right=0,i=-n.right),e[x]="translateX("+Math.round(i)+"px) translateY("+Math.round(o)+"px)","msTransform"!==x?e[x]+=" translateZ(0)":void 0)},s=!1,(h.page.top||h.page.bottom)&&(h.page.left||h.page.right)?(e.position="absolute",u(h.page,t.page)):(h.viewport.top||h.viewport.bottom)&&(h.viewport.left||h.viewport.right)?(e.position="fixed",u(h.viewport,t.viewport)):null!=h.offset&&h.offset.top&&h.offset.left?(e.position="absolute",r=this.cache("target-offsetparent",function(){return p(C.target)}),p(this.element)!==r&&l(function(){return C.element.parentNode.removeChild(C.element),r.appendChild(C.element)}),u(h.offset,t.offset),s=!0):(e.position="absolute",u({top:!0,left:!0},t.page)),s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),g={},m=!1;for(o in e)d=e[o],n=this.element.style[o],""===n||""===d||"top"!==o&&"left"!==o&&"bottom"!==o&&"right"!==o||(n=parseFloat(n),d=parseFloat(d)),n!==d&&(m=!0,g[o]=e[o]);return m?l(function(){return c(C.element.style,g)}):void 0}},t}(),i.position=C,this.Tether=c(T,i)}.call(this),function(){var t,e,n,i,o,s,r,a,l,c,h=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};c=this.Tether.Utils,r=c.getOuterSize,s=c.getBounds,a=c.getSize,i=c.extend,l=c.updateClasses,n=c.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],o=function(e,n){var i,o,r,a,l,c,h;if("scrollParent"===n?n=e.scrollParent:"window"===n&&(n=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),n===document&&(n=n.documentElement),null!=n.nodeType)for(o=a=s(n),l=getComputedStyle(n),n=[o.left,o.top,a.width+o.left,a.height+o.top],i=c=0,h=t.length;h>c;i=++c)r=t[i],r=r[0].toUpperCase()+r.substr(1),"Top"===r||"Left"===r?n[i]+=parseFloat(l["border"+r+"Width"]):n[i]-=parseFloat(l["border"+r+"Width"]);return n},this.Tether.modules.push({position:function(e){var r,a,c,u,p,f,d,m,g,v,b,y,w,C,O,E,x,S,N,T,P,A,M,I,k,D,W,_,L,j,H,B,U,z,q,R,F,Y,X,$,V,Z,G,J,K,Q,tt,et=this;if(D=e.top,b=e.left,P=e.targetAttachment,!this.options.constraints)return!0;for(S=function(e){var n,i,o,s;for(et.removeClass(e),s=[],i=0,o=t.length;o>i;i++)n=t[i],s.push(et.removeClass(""+e+"-"+n));return s},$=this.cache("element-bounds",function(){return s(et.element)}),v=$.height,W=$.width,0===W&&0===v&&null!=this.lastSize&&(V=this.lastSize,W=V.width,v=V.height),M=this.cache("target-bounds",function(){return et.getTargetBounds()}),A=M.height,I=M.width,T={},g={},a=[this.getClass("pinned"),this.getClass("out-of-bounds")],Z=this.options.constraints,_=0,B=Z.length;B>_;_++)m=Z[_],m.outOfBoundsClass&&a.push(m.outOfBoundsClass),m.pinnedClass&&a.push(m.pinnedClass);for(L=0,U=a.length;U>L;L++)for(d=a[L],G=["left","top","right","bottom"],j=0,z=G.length;z>j;j++)N=G[j],a.push(""+d+"-"+N);for(r=[],T=i({},P),g=i({},this.attachment),J=this.options.constraints,H=0,q=J.length;q>H;H++){if(m=J[H],k=m.to,c=m.attachment,O=m.pin,null==c&&(c=""),h.call(c," ")>=0?(K=c.split(" "),f=K[0],p=K[1]):p=f=c,u=o(this,k),("target"===f||"both"===f)&&(Du[3]&&"bottom"===T.top&&(D-=A,T.top="top")),"together"===f&&(Du[3]&&"bottom"===T.top&&("top"===g.top?(D-=A,T.top="top",D-=v,g.top="bottom"):"bottom"===g.top&&(D-=A,T.top="top",D+=v,g.top="top")),"middle"===T.top&&(D+v>u[3]&&"top"===g.top?(D-=v,g.top="bottom"):Du[2]&&"right"===T.left&&(b-=I,T.left="left")),"together"===p&&(bu[2]&&"right"===T.left?"left"===g.left?(b-=I,T.left="left",b-=W,g.left="right"):"right"===g.left&&(b-=I,T.left="left",b+=W,g.left="left"):"center"===T.left&&(b+W>u[2]&&"left"===g.left?(b-=W,g.left="right"):bu[3]&&"top"===g.top&&(D-=v,g.top="bottom")),("element"===p||"both"===p)&&(bu[2]&&"left"===g.left&&(b-=W,g.left="right")),"string"==typeof O?O=function(){var t,e,n,i;for(n=O.split(","),i=[],e=0,t=n.length;t>e;e++)C=n[e],i.push(C.trim());return i}():O===!0&&(O=["top","left","right","bottom"]),O||(O=[]),E=[],y=[],D=0?(D=u[1],E.push("top")):y.push("top")),D+v>u[3]&&(h.call(O,"bottom")>=0?(D=u[3]-v,E.push("bottom")):y.push("bottom")),b=0?(b=u[0],E.push("left")):y.push("left")),b+W>u[2]&&(h.call(O,"right")>=0?(b=u[2]-W,E.push("right")):y.push("right")),E.length)for(x=null!=(Q=this.options.pinnedClass)?Q:this.getClass("pinned"),r.push(x),Y=0,R=E.length;R>Y;Y++)N=E[Y],r.push(""+x+"-"+N);if(y.length)for(w=null!=(tt=this.options.outOfBoundsClass)?tt:this.getClass("out-of-bounds"),r.push(w),X=0,F=y.length;F>X;X++)N=y[X],r.push(""+w+"-"+N);(h.call(E,"left")>=0||h.call(E,"right")>=0)&&(g.left=T.left=!1),(h.call(E,"top")>=0||h.call(E,"bottom")>=0)&&(g.top=T.top=!1),(T.top!==P.top||T.left!==P.left||g.top!==this.attachment.top||g.left!==this.attachment.left)&&this.updateAttachClasses(g,T)}return n(function(){return l(et.target,r,a),l(et.element,r,a)}),{top:D,left:b}}})}.call(this),function(){var t,e,n,i;i=this.Tether.Utils,e=i.getBounds,n=i.updateClasses,t=i.defer,this.Tether.modules.push({position:function(i){var o,s,r,a,l,c,h,u,p,f,d,m,g,v,b,y,w,C,O,E,x,S,N,T,P,A=this;if(d=i.top,c=i.left,x=this.cache("element-bounds",function(){return e(A.element)}),l=x.height,m=x.width,f=this.getTargetBounds(),a=d+l,h=c+m,o=[],d<=f.bottom&&a>=f.top)for(S=["left","right"],g=0,w=S.length;w>g;g++)u=S[g],((N=f[u])===c||N===h)&&o.push(u);if(c<=f.right&&h>=f.left)for(T=["top","bottom"],v=0,C=T.length;C>v;v++)u=T[v],((P=f[u])===d||P===a)&&o.push(u);for(r=[],s=[],p=["left","top","right","bottom"],r.push(this.getClass("abutted")),b=0,O=p.length;O>b;b++)u=p[b],r.push(""+this.getClass("abutted")+"-"+u);for(o.length&&s.push(this.getClass("abutted")),y=0,E=o.length;E>y;y++)u=o[y],s.push(""+this.getClass("abutted")+"-"+u);return t(function(){return n(A.target,s,r),n(A.element,s,r)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(t){var e,n,i,o,s,r,a;return r=t.top,e=t.left,this.options.shift?(n=function(t){return"function"==typeof t?t.call(this,{top:r,left:e}):t},i=n(this.options.shift),"string"==typeof i?(i=i.split(" "),i[1]||(i[1]=i[0]),s=i[0],o=i[1],s=parseFloat(s,10),o=parseFloat(o,10)):(a=[i.top,i.left],s=a[0],o=a[1]),r+=s,e+=o,{top:r,left:e}):void 0}})}.call(this),this.Tether})},function(t,e,n){"use strict";var i=n(12),o=n(25),s=n(14),r=i.createClass({displayName:"ActionSheet",getInitialState:function(){return{active:!1}},setActiveState:function(t){this.setState({active:t})},onBodyClick:function(t){var e=t.target,n=!1;do if(e.classList&&e.classList.contains("action-sheet-container")){n=!0;break}while(e=e.parentNode);n||this.setActiveState(!1)},componentDidMount:function(){this.props.id&&s.subscribe(this.props.id,function(t,e){"open"===e?this.setState({active:!0}):"close"===e?this.setState({active:!1}):"toggle"===e&&this.setState({active:!this.state.active})}.bind(this)),document.body.addEventListener("click",this.onBodyClick)},componentWillUnmount:function(){this.props.id&&s.unsubscribe(this.props.id),document.body.removeEventListener("click",this.onBodyClick)},render:function(){var t=i.Children.map(this.props.children,function(t,e){var n={active:this.state.active};return"ActionSheetButton"===t.type.displayName&&(n.setActiveState=this.setActiveState),o(t,n)}.bind(this));return i.createElement("div",{id:this.props.id,"data-closable":!0,className:"action-sheet-container"},t)}});t.exports=r,r.Button=n(15),r.Content=n(16)},function(t,e,n){"use strict";var i=n(12),o=n(26),s=o.canUseDOM&&n(!function(){var t=new Error('Cannot find module "../vendor/iconic.min"');throw t.code="MODULE_NOT_FOUND",t}()),r=(n(25),i.createClass({displayName:"Iconic",inject:function(){var t=s();t.inject(this.getDOMNode())},componentDidMount:function(){this.inject()},componentDidUpdate:function(){this.inject()},render:function(){return i.Children.only(this.props.children)}}));t.exports=r},function(t,e,n){"use strict";var i=n(12),o=n(22),s=i.createClass({displayName:"Interchange",mixins:[o],getInitialState:function(){return{matchedMedia:"large"}},componentDidMount:function(){this.media({minWidth:0,maxWidth:640},function(){this.setState({matchedMedia:"small"})}.bind(this)),this.media({minWidth:641,maxWidth:1200},function(){this.setState({matchedMedia:"medium"})}.bind(this)),this.media({minWidth:1200,maxWidth:1440},function(){this.setState({matchedMedia:"large"})}.bind(this))},render:function(){var t=null;return i.Children.forEach(this.props.children,function(e){e.props.media===this.state.matchedMedia&&(t=e)}.bind(this)),t}});t.exports=s},function(t,e,n){"use strict";var i=n(12),o=(n(27),n(17)),s=n(14),r=i.createClass({displayName:"Modal",getInitialState:function(){return{open:!1}},getDefaultProps:function(){return{overlay:!0,overlayClose:!0,animationIn:"fadeIn",animationOut:"fadeOut"}},componentDidMount:function(){s.subscribe(this.props.id,function(t,e){"open"===e?this.setState({open:!0}):"close"===e?this.setState({open:!1}):"toggle"===e&&this.setState({open:!this.state.open})}.bind(this))},componentWillUnmount:function(){s.unsubscribe(this.props.id)},hideOverlay:function(t){t.preventDefault(),this.props.overlayClose&&this.setState({open:!1})},stopClickPropagation:function(t){t.preventDefault(),t.stopPropagation()},render:function(){var t={};return this.props.overlay||(t.background="transparent"),i.createElement(o,{active:this.state.open,animationIn:"fadeIn",animationOut:"fadeOut"},i.createElement("div",{className:"modal-overlay",style:t,onClick:this.hideOverlay},i.createElement(o,{active:this.state.open,animationIn:this.props.animationIn,animationOut:this.props.animationOut},i.createElement("div",{id:this.props.id,"data-closable":!0,className:"modal",onClick:this.stopClickPropagation},this.props.children))))}});t.exports=r},function(t,e,n){"use strict";t.exports={Set:n(18),Static:n(19)}},function(t,e,n){"use strict";var i=n(12),o=n(27),s=n(14),r=i.createClass({displayName:"Offcanvas",getInitialState:function(){return{open:!1}},getDefaultProps:function(){return{position:"left"}},componentDidMount:function(){s.subscribe(this.props.id,function(t,e){"open"===e?this.setState({open:!0}):"close"===e?this.setState({open:!1}):"toggle"===e&&this.setState({open:!this.state.open})}.bind(this))},componentWillUnmount:function(){s.unsubscribe(this.props.id)},render:function(){var t={"off-canvas":!0,"is-active":this.state.open};return t[this.props.position]=!0,this.props.className&&(t[this.props.className]=!0),i.createElement("div",{id:this.props.id,"data-closable":!0,className:o(t)},this.props.children)}});t.exports=r},function(t,e,n){"use strict";var i=n(12),o=(n(27),n(17)),s=n(14),r=i.createClass({displayName:"Panel",getInitialState:function(){return{open:!1}},getDefaultProps:function(){return{position:"left"}},componentDidMount:function(){s.subscribe(this.props.id,function(t,e){"open"===e?this.setState({open:!0}):"close"===e?this.setState({open:!1}):"toggle"===e&&this.setState({open:!this.state.open})}.bind(this))},componentWillUnmount:function(){s.unsubscribe(this.props.id)},render:function(){var t,e,n="panel panel-"+this.props.position;return this.props.className&&(n+=" "+this.props.className),"left"===this.props.position?(t=this.props.animationIn||"slideInRight",e=this.props.animationOut||"slideOutLeft"):"right"===this.props.position?(t=this.props.animationIn||"slideInLeft",e=this.props.animationOut||"slideOutRight"):"top"===this.props.position?(t=this.props.animationIn||"slideInDown",e=this.props.animationOut||"slideOutUp"):"bottom"===this.props.position&&(t=this.props.animationIn||"slideInUp",e=this.props.animationOut||"slideOutBottom"),i.createElement(o,{active:this.state.open,animationIn:t,animationOut:e},i.createElement("div",{"data-closable":!0,id:this.props.id,className:n},this.props.children))}});t.exports=r},function(t,e,n){"use strict";var i=n(12),o=n(27),s=n(26),r=n(14),a=s.canUseDOM&&n(1),l=i.createClass({displayName:"Popup",getInitialState:function(){return{active:!1,tetherInit:!1}},getDefaultProps:function(){return{pinTo:"top center",pinAt:""}},componentDidMount:function(){this.tether={},r.subscribe(this.props.id,function(t,e){"toggle"===e[0]&&this.toggle(e[1])}.bind(this))},toggle:function(t){var e=!this.state.active;this.setState({active:e},function(){e?this.tetherElement(t):this.tether.destroy()}.bind(this))},tetherElement:function(t){var e=document.getElementById(t),n="top center";this.tether=new a({element:this.getDOMNode(),target:e,attachment:n})},render:function(){var t={popup:!0,"is-active":this.state.active};return i.createElement("div",{id:this.props.id,className:o(t),"data-closable":"popup"},this.props.children)}});t.exports=l},function(t,e,n){"use strict";var i=n(12),o=n(25),s=i.createClass({displayName:"Tabs",getInitialState:function(){return{selectedTab:0,content:null}},selectTab:function(t){this.setState(t)},render:function(){var t=i.Children.map(this.props.children,function(t,e){return o(t,{active:e===this.state.selectedTab,index:e,selectTab:this.selectTab})}.bind(this));return i.createElement("div",null,i.createElement("div",{className:"tabs"},t),i.createElement("div",null,this.state.content))}});t.exports=s,s.Tab=n(20)},function(t,e,n){"use strict";var i=n(12),o=n(25),s=n(14),r=n(21),a=i.createClass({displayName:"Trigger",getDefaultProps:function(){return{open:null,close:null,toggle:null,hardToggle:null,popupToggle:null,notify:null}},getCloseId:function(){if(this.props.close)return this.props.close;for(var t=!1,e=this.getDOMNode().parentNode;t===!1;)"BODY"==e.nodeName&&(t=""),"undefined"!=typeof e.getAttribute("data-closable")&&e.getAttribute("data-closable")!==!1&&(t=e),e=e.parentNode;return t.getAttribute("id")},clickHandler:function(t){t.preventDefault(),this.props.open?s.publish(this.props.open,"open"):null!==this.props.close?s.publish(this.getCloseId(),"close"):this.props.toggle?s.publish(this.props.toggle,"toggle"):this.props.hardToggle?(s.closeActiveElements({exclude:this.props.hardToggle}),s.publish(this.props.hardToggle,"toggle")):this.props.notify&&s.publish(this.props.notify,{title:this.props.title,content:this.props.content,position:this.props.position,color:this.props.color,image:this.props.image})},render:function(){if(this.props.popupToggle)return i.createElement(r,this.props);var t=i.Children.only(this.props.children);return o(t,{onClick:this.clickHandler})}});t.exports=a},function(e,n,i){e.exports=t},function(t,e,n){"use strict";var i=n(12),o=n(27),s=i.createClass({displayName:"AccordionItem",render:function(){var t={"accordion-item":!0,"is-active":this.props.active};return i.createElement("div",{className:o(t)},i.createElement("div",{className:"accordion-title",onClick:this.props.activate},this.props.title),i.createElement("div",{className:"accordion-content"},this.props.children))}});t.exports=s},function(t,e,n){"use strict";var i=n(31),o=(n(30),{}),s=[],r={subscribe:i.subscribe,publish:i.publish,unsubscribe:i.unsubscribe,closeActiveElements:function(t){var e=this;t=t||{};var n=document.querySelectorAll(".is-active[data-closable]");Array.prototype.forEach.call(n,function(n){t.exclude!==n.id&&e.publish(n.id,"close")})},getSettings:function(){return o},modifySettings:function(t){return o=angular.extend(o,t)},generateUuid:function(){var t="";do{t+="zf-uuid-";for(var e=0;15>e;e++)t+=Math.floor(16*Math.random()).toString(16)}while(!s.indexOf(t));return s.push(t),t}};t.exports=r},function(t,e,n){"use strict";var i=n(12),o=i.createClass({displayName:"ActionSheetButton",toggle:function(){this.props.setActiveState(!this.props.active)},render:function(){var t=null;return this.props.title.length>0&&(t=i.createElement("a",{className:"button"},this.props.title)),i.createElement("div",{onClick:this.toggle},t,i.createElement("div",null,this.props.children))}});t.exports=o},function(t,e,n){"use strict";var i=n(12),o=n(27),s=i.createClass({displayName:"ActionSheetContent",getDefaultProps:function(){return{position:"bottom"}},render:function(){var t={"action-sheet":!0,"is-active":this.props.active};return i.createElement("div",{className:o(t)},this.props.children)}});t.exports=s},function(t,e,n){"use strict";var i=n(12),o=n(28),s=n(29),r=n(25),a=(n(27),i.createClass({displayName:"Animation",getInitialState:function(){return{}},getDefaultProps:function(){return{active:!1,animationIn:"",animationOut:""}},reflow:function(t){return t.offsetWidth},reset:function(t){t.style.transitionDuration=0,s.removeClass(t,"ng-enter"),s.removeClass(t,"ng-leave"),s.removeClass(t,"ng-enter-active"),s.removeClass(t,"ng-leave-active"),s.removeClass(t,this.props.animationIn),s.removeClass(t,this.props.animationOut)},finishAnimation:function(){var t=this.getDOMNode();this.reset(t),s.removeClass(t,this.props.active?"":"is-active"), -this.reflow(t),o.removeEndEventListener(t,this.finishAnimation)},animate:function(t,e){var n=this.getDOMNode(),i="ng-"+e,r=i+"-active";this.reset(n),s.addClass(n,t),s.addClass(n,i),s.addClass(n,"is-active"),this.reflow(n),n.style.transitionDuration="",s.addClass(n,r),o.addEndEventListener(n,this.finishAnimation)},componentDidUpdate:function(t){if(t.active!==this.props.active){var e=this.props.active?this.props.animationIn:this.props.animationOut,n=this.props.active?"enter":"leave";this.animate(e,n)}},render:function(){var t=i.Children.only(this.props.children),e={};return r(t,e)}}));t.exports=a},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e-1}};t.exports=o},function(t,e,n){"use strict";function i(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=Object.assign||function(t,e){for(var n,o,s=i(t),r=1;ri;i++)n.push(arguments[i]);if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(0!==e.indexOf("Failed Composite propType: ")&&!t){var s=0,r="Warning: "+e.replace(/%s/g,function(){return n[s++]});console.warn(r);try{throw new Error(r)}catch(a){}}},t.exports=o},function(t,e,n){"use strict";function i(t,e){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[e]:null},set:function(t){l(!1,"Don't set the %s property of the React element. Instead, specify the correct value when initially creating the element.",e),this._store[e]=t}})}function o(t){try{var e={props:!0};for(var n in e)i(t,n);h=!0}catch(o){}}var s=n(41),r=n(42),a=n(43),l=n(32),c={key:!0,ref:!0},h=!1,u=function(t,e,n,i,o,s){this.type=t,this.key=e,this.ref=n,this._owner=i,this._context=o,this._store={props:s,originalProps:a({},s)};try{Object.defineProperty(this._store,"validated",{configurable:!1,enumerable:!1,writable:!0})}catch(r){}return this._store.validated=!1,h?void Object.freeze(this):void(this.props=s)};u.prototype={_isReactElement:!0},o(u.prototype),u.createElement=function(t,e,n){var i,o={},a=null,l=null;if(null!=e){l=void 0===e.ref?null:e.ref,a=void 0===e.key?null:""+e.key;for(i in e)e.hasOwnProperty(i)&&!c.hasOwnProperty(i)&&(o[i]=e[i])}var h=arguments.length-2;if(1===h)o.children=n;else if(h>1){for(var p=Array(h),f=0;h>f;f++)p[f]=arguments[f+2];o.children=p}if(t&&t.defaultProps){var d=t.defaultProps;for(i in d)"undefined"==typeof o[i]&&(o[i]=d[i])}return new u(t,a,l,r.current,s.current,o)},u.createFactory=function(t){var e=u.createElement.bind(null,t);return e.type=t,e},u.cloneAndReplaceProps=function(t,e){var n=new u(t.type,t.key,t.ref,t._owner,t._context,e);return n._store.validated=t._store.validated,n},u.cloneElement=function(t,e,n){var i,o=a({},t.props),s=t.key,l=t.ref,h=t._owner;if(null!=e){void 0!==e.ref&&(l=e.ref,h=r.current),void 0!==e.key&&(s=""+e.key);for(i in e)e.hasOwnProperty(i)&&!c.hasOwnProperty(i)&&(o[i]=e[i])}var p=arguments.length-2;if(1===p)o.children=n;else if(p>1){for(var f=Array(p),d=0;p>d;d++)f[d]=arguments[d+2];o.children=f}return new u(t.type,s,l,h,t._context,o)},u.isValidElement=function(t){var e=!(!t||!t._isReactElement);return e},t.exports=u},function(t,e,n){"use strict";function i(t){return function(e,n,i){e.hasOwnProperty(n)?e[n]=t(e[n],i):e[n]=i}}function o(t,e){for(var n in e)if(e.hasOwnProperty(n)){var i=c[n];i&&c.hasOwnProperty(n)?i(t,n,e[n]):t.hasOwnProperty(n)||(t[n]=e[n])}return t}var s=n(43),r=n(40),a=n(44),l=i(function(t,e){return s({},e,t)}),c={children:r,className:i(a),style:l},h={mergeProps:function(t,e){return o(s({},t),e)}};t.exports=h},function(t,e,n){var i=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return e;return null};t.exports=i},function(t,e,n){var i=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=i},function(t,e,n){"use strict";var i=function(t,e,n,i,o,s,r,a){if(void 0===e)throw new Error("invariant requires an error message argument");if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,i,o,s,r,a],h=0;l=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[h++]}))}throw l.framesToPop=1,l}};t.exports=i},function(t,e,n){var i=n(46),o=function(t){var e=/[height|width]$/;return e.test(t)},s=function(t){var e="",n=Object.keys(t);return n.forEach(function(s,r){var a=t[s];s=i(s),o(s)&&"number"==typeof a&&(a+="px"),e+=a===!0?s:a===!1?"not "+s:"("+s+": "+a+")",ri&&(n=e(t[i],i),n!==!1);i++);}function n(t){return"[object Array]"===Object.prototype.toString.apply(t)}function i(t){return"function"==typeof t}function o(t){this.options=t,!t.deferSetup&&this.setup()}function s(e,n){this.query=e,this.isUnconditional=n,this.handlers=[],this.mql=t(e);var i=this;this.listener=function(t){i.mql=t,i.assess()},this.mql.addListener(this.listener)}function r(){if(!t)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return o.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},s.prototype={addHandler:function(t){var e=new o(t);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(t){var n=this.handlers;e(n,function(e,i){return e.equals(t)?(e.destroy(),!n.splice(i,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){e(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";e(this.handlers,function(e){e[t]()})}},r.prototype={register:function(t,o,r){var a=this.queries,l=r&&this.browserIsIncapable;return a[t]||(a[t]=new s(t,l)),i(o)&&(o={match:o}),n(o)||(o=[o]),e(o,function(e){a[t].addHandler(e)}),this},unregister:function(t,e){var n=this.queries[t];return n&&(e?n.removeHandler(e):(n.clear(),delete this.queries[t])),this}},new r})},function(t,e,n){function i(t){return function(){return t}}function o(){}o.thatReturns=i,o.thatReturnsFalse=i(!1),o.thatReturnsTrue=i(!0),o.thatReturnsNull=i(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,n){"use strict";var i=n(43),o=n(45),s=n(32),r=!1,a={current:o,withContext:function(t,e){s(r,"withContext is deprecated and will be removed in a future version. Use a wrapper component with getChildContext instead."),r=!0;var n,o=a.current;a.current=i({},o,t);try{n=e()}finally{a.current=o}return n}};t.exports=a},function(t,e,n){"use strict";var i={current:null};t.exports=i},function(t,e,n){"use strict";function i(t,e){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(t),i=Object.prototype.hasOwnProperty,o=1;o1)for(var i=1;n>i;i++)e=arguments[i],e&&(t=(t?t+" ":"")+e);return t}t.exports=i},function(t,e,n){"use strict";var i={};Object.freeze(i),t.exports=i},function(t,e,n){var i=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=i}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.RFA=e(require("react")):t.RFA=e(t.React)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports={Accordion:n(1),ActionSheet:n(15),Iconic:n(21),Interchange:n(23),Modal:n(29),Notification:n(33),OffCanvas:n(37),Panel:n(38),Popup:n(39),Tabs:n(41),Trigger:n(43)}},function(t,e,n){"use strict";var i=n(2),o=n(3),r=i.createClass({displayName:"Accordion",getInitialState:function(){return{sections:[]}},getDefaultProps:function(){return{autoOpen:!0,multiOpen:!1,collapsible:!1}},componentWillMount:function(){var t=[];i.Children.forEach(this.props.children,function(e,n){t.push({active:!1})}),this.props.autoOpen&&(t[0].active=!0),this.setState({sections:t})},select:function(t){var e=this.state.sections;e.forEach(function(e,n){this.props.multiOpen?n===t&&(e.active=!e.active):n===t?e.active=this.props.collapsible===!0?!e.active:!0:e.active=!1}.bind(this)),this.setState({sections:e})},render:function(){var t=i.Children.map(this.props.children,function(t,e){return o(t,{active:this.state.sections[e]?this.state.sections[e].active:!1,activate:this.select.bind(this,e)})}.bind(this));return i.createElement("div",{className:"accordion"},t)}});t.exports=r,r.Item=n(13)},function(e,n){e.exports=t},function(t,e,n){"use strict";function i(t,e){a(l,"cloneWithProps(...) is deprecated. Please use React.cloneElement instead."),l=!0,a(!t.ref,"You are calling cloneWithProps() on a child with a ref. This is dangerous because you're creating a new child which will not be added as a ref to its parent.");var n=r.mergeProps(e,t.props);return!n.hasOwnProperty(c)&&t.props.hasOwnProperty(c)&&(n.children=t.props.children),o.createElement(t.type,n)}var o=n(4),r=n(8),s=n(11),a=n(12),c=s({children:null}),l=!1;t.exports=i},function(t,e,n){"use strict";var i=n(5),o=n(6),r=n(7),s="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,a={key:!0,ref:!0,__self:!0,__source:!0},c=function(t,e,n,i,o,a,c){var l={$$typeof:s,type:t,key:e,ref:n,props:c,_owner:a};return l._store={},r?(Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o})):(l._store.validated=!1,l._self=i,l._source=o),Object.freeze(l.props),Object.freeze(l),l};c.createElement=function(t,e,n){var o,r={},s=null,l=null,u=null,p=null;if(null!=e){l=void 0===e.ref?null:e.ref,s=void 0===e.key?null:""+e.key,u=void 0===e.__self?null:e.__self,p=void 0===e.__source?null:e.__source;for(o in e)e.hasOwnProperty(o)&&!a.hasOwnProperty(o)&&(r[o]=e[o])}var h=arguments.length-2;if(1===h)r.children=n;else if(h>1){for(var f=Array(h),d=0;h>d;d++)f[d]=arguments[d+2];r.children=f}if(t&&t.defaultProps){var g=t.defaultProps;for(o in g)"undefined"==typeof r[o]&&(r[o]=g[o])}return c(t,s,l,u,p,i.current,r)},c.createFactory=function(t){var e=c.createElement.bind(null,t);return e.type=t,e},c.cloneAndReplaceKey=function(t,e){var n=c(t.type,e,t.ref,t._self,t._source,t._owner,t.props);return n},c.cloneAndReplaceProps=function(t,e){var n=c(t.type,t.key,t.ref,t._self,t._source,t._owner,e);return n._store.validated=t._store.validated,n},c.cloneElement=function(t,e,n){var r,s=o({},t.props),l=t.key,u=t.ref,p=t._self,h=t._source,f=t._owner;if(null!=e){void 0!==e.ref&&(u=e.ref,f=i.current),void 0!==e.key&&(l=""+e.key);for(r in e)e.hasOwnProperty(r)&&!a.hasOwnProperty(r)&&(s[r]=e[r])}var d=arguments.length-2;if(1===d)s.children=n;else if(d>1){for(var g=Array(d),m=0;d>m;m++)g[m]=arguments[m+2];s.children=g}return c(t.type,l,u,p,h,f,s)},c.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},t.exports=c},function(t,e){"use strict";var n={current:null};t.exports=n},function(t,e){"use strict";function n(t,e){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(t),i=Object.prototype.hasOwnProperty,o=1;o1)for(var i=1;n>i;i++)e=arguments[i],e&&(t=(t?t+" ":"")+e);return t}t.exports=n},function(t,e){"use strict";var n=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return e;return null};t.exports=n},function(t,e,n){"use strict";var i=n(9),o=i;o=function(t,e){for(var n=arguments.length,i=Array(n>2?n-2:0),o=2;n>o;o++)i[o-2]=arguments[o];if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==e.indexOf("Failed Composite propType: ")&&!t){var r=0,s="Warning: "+e.replace(/%s/g,function(){return i[r++]});"undefined"!=typeof console&&console.error(s);try{throw new Error(s)}catch(a){}}},t.exports=o},function(t,e,n){"use strict";var i=n(2),o=n(14),r=i.createClass({displayName:"AccordionItem",render:function(){var t={"accordion-item":!0,"is-active":this.props.active};return i.createElement("div",{className:o(t)},i.createElement("div",{className:"accordion-title",onClick:this.props.activate},this.props.title),i.createElement("div",{className:"accordion-content"},this.props.children))}});t.exports=r},function(t,e,n){var i,o;/*! + Copyright (c) 2015 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + */ +!function(){"use strict";function n(){for(var t="",e=0;ee;e++)t+=Math.floor(16*Math.random()).toString(16)}while(!r.indexOf(t));return r.push(t),t}};t.exports=s},function(t,e,n){var i,o,r;!function(n,s){"use strict";o=[e],i=s,r="function"==typeof i?i.apply(e,o):i,!(void 0!==r&&(t.exports=r));var a={};n.PubSub=a,s(a)}("object"==typeof window&&window||this,function(t){"use strict";function e(t){var e;for(e in t)if(t.hasOwnProperty(e))return!0;return!1}function n(t){return function(){throw t}}function i(t,e,i){try{t(e,i)}catch(o){setTimeout(n(o),0)}}function o(t,e,n){t(e,n)}function r(t,e,n,r){var s,a=l[e],c=r?o:i;if(l.hasOwnProperty(e))for(s in a)a.hasOwnProperty(s)&&c(a[s],t,n)}function s(t,e,n){return function(){var i=String(t),o=i.lastIndexOf(".");for(r(t,t,e,n);-1!==o;)i=i.substr(0,o),o=i.lastIndexOf("."),r(t,i,e,n)}}function a(t){for(var n=String(t),i=Boolean(l.hasOwnProperty(n)&&e(l[n])),o=n.lastIndexOf(".");!i&&-1!==o;)n=n.substr(0,o),o=n.lastIndexOf("."),i=Boolean(l.hasOwnProperty(n)&&e(l[n]));return i}function c(t,e,n,i){var o=s(t,e,i),r=a(t);return r?(n===!0?o():setTimeout(o,0),!0):!1}var l={},u=-1;t.publish=function(e,n){return c(e,n,!1,t.immediateExceptions)},t.publishSync=function(e,n){return c(e,n,!0,t.immediateExceptions)},t.subscribe=function(t,e){if("function"!=typeof e)return!1;l.hasOwnProperty(t)||(l[t]={});var n="uid_"+String(++u);return l[t][n]=e,n},t.clearAllSubscriptions=function(){l={}},t.clearSubscriptions=function(t){var e;for(e in l)l.hasOwnProperty(e)&&0===e.indexOf(t)&&delete l[e]},t.unsubscribe=function(t){var e,n,i,o="string"==typeof t&&l.hasOwnProperty(t),r=!o&&"string"==typeof t,s="function"==typeof t,a=!1;if(o)return void delete l[t];for(e in l)if(l.hasOwnProperty(e)){if(n=l[e],r&&n[t]){delete n[t],a=t;break}if(s)for(i in n)n.hasOwnProperty(i)&&n[i]===t&&(delete n[i],a=!0)}return a}})},function(t,e){"use strict";function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=Object.assign||function(t,e){for(var i,o,r=n(t),s=1;s0&&(t=i.createElement("a",{className:"button"},this.props.title)),i.createElement("div",{onClick:this.toggle},t,i.createElement("div",null,this.props.children))}});t.exports=o},function(t,e,n){"use strict";var i=n(2),o=n(!function(){var t=new Error('Cannot find module "react/lib/cx"');throw t.code="MODULE_NOT_FOUND",t}()),r=i.createClass({displayName:"ActionSheetContent",getDefaultProps:function(){return{position:"bottom"}},render:function(){var t={"action-sheet":!0,"is-active":this.props.active};return i.createElement("div",{className:o(t)},this.props.children)}});t.exports=r},function(t,e,n){"use strict";var i=n(2),o=n(!function(){var t=new Error('Cannot find module "react/lib/ExecutionEnvironment"');throw t.code="MODULE_NOT_FOUND",t}()),r=o.canUseDOM&&n(22),s=(n(3),i.createClass({displayName:"Iconic",inject:function(){var t=r();t.inject(this.getDOMNode())},componentDidMount:function(){this.inject()},componentDidUpdate:function(){this.inject()},render:function(){return i.Children.only(this.props.children)}}));t.exports=s},function(t,e){/*! + * iconic.js v0.4.0 - The Iconic JavaScript library + * Copyright (c) 2014 Waybury - http://useiconic.com + */ +!function(n){"object"==typeof e?t.exports=n():"function"==typeof define&&define.amd?define(n):"undefined"!=typeof window?window.IconicJS=n():"undefined"!=typeof global?global.IconicJS=n():"undefined"!=typeof self&&(self.IconicJS=n())}(function(){var t;return function e(t,n,i){function o(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(r)return r(s,!0);throw new Error("Cannot find module '"+s+"'")}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.exports,e,t,n,i)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s>>0;for(n=0;i>n;++n)n in this&&t.call(e,this[n],n,this)}),function(){if(Event.prototype.preventDefault||(Event.prototype.preventDefault=function(){this.returnValue=!1}),Event.prototype.stopPropagation||(Event.prototype.stopPropagation=function(){this.cancelBubble=!0}),!Element.prototype.addEventListener){var t=[],e=function(e,n){var i=this,o=function(t){t.target=t.srcElement,t.currentTarget=i,n.handleEvent?n.handleEvent(t):n.call(i,t)};if("DOMContentLoaded"==e){var r=function(t){"complete"==document.readyState&&o(t)};if(document.attachEvent("onreadystatechange",r),t.push({object:this,type:e,listener:n,wrapper:r}),"complete"==document.readyState){var s=new Event;s.srcElement=window,r(s)}}else this.attachEvent("on"+e,o),t.push({object:this,type:e,listener:n,wrapper:o})},n=function(e,n){for(var i=0;ir?i.width:i.height;var s;s=32>e?"iconic-sm":e>=32&&128>e?"iconic-md":"iconic-lg";var a=t.getAttribute("class"),c=n.test(a)?a.replace(n,s):a+" "+s;t.setAttribute("class",c)}},a=function(){var t=document.querySelectorAll(".injected-svg.iconic-fluid");Array.prototype.forEach.call(t,function(t){s(t)})};document.addEventListener("DOMContentLoaded",function(){r()}),window.addEventListener("resize",function(){a()}),e.exports={refresh:s,refreshAll:a}},{}],8:[function(e,n,i){!function(e,o){"use strict";function r(t){t=t.split(" ");for(var e={},n=t.length,i=[];n--;)e.hasOwnProperty(t[n])||(e[t[n]]=1,i.unshift(t[n]));return i.join(" ")}var s="file:"===e.location.protocol,a=o.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),c=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var n,i=this.length>>>0;for(n=0;i>n;++n)n in this&&t.call(e,this[n],n,this)},l={},u=0,p=[],h=[],f={},d=function(t){return t.cloneNode(!0)},g=function(t,e){h[t]=h[t]||[],h[t].push(e)},m=function(t){for(var e=0,n=h[t].length;n>e;e++)!function(e){setTimeout(function(){h[t][e](d(l[t]))},0)}(e)},v=function(t,n){if(void 0!==l[t])l[t]instanceof SVGSVGElement?n(d(l[t])):g(t,n);else{if(!e.XMLHttpRequest)return n("Browser does not support XMLHttpRequest"),!1;l[t]={},g(t,n);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return n("Unable to load SVG file: "+t),s&&n("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),n(),!1;if(!(200===i.status||s&&0===i.status))return n("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)l[t]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var e;try{var o=new DOMParser;e=o.parseFromString(i.responseText,"text/xml")}catch(r){e=void 0}if(!e||e.getElementsByTagName("parsererror").length)return n("Unable to parse SVG file: "+t),!1;l[t]=e.documentElement}m(t)}},i.open("GET",t),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},b=function(t,n,i,o){var s=t.getAttribute("data-src")||t.getAttribute("src");if(!/svg$/i.test(s))return void o("Attempted to inject a file with a non-svg extension: "+s);if(!a){var l=t.getAttribute("data-fallback")||t.getAttribute("data-png");return void(l?(t.setAttribute("src",l),o(null)):i?(t.setAttribute("src",i+"/"+s.split("/").pop().replace(".svg",".png")),o(null)):o("This browser does not support SVG and no PNG fallback was defined."))}-1===p.indexOf(t)&&(p.push(t),t.setAttribute("src",""),v(s,function(i){if("undefined"==typeof i||"string"==typeof i)return o(i),!1;var a=t.getAttribute("id");a&&i.setAttribute("id",a);var l=t.getAttribute("title");l&&i.setAttribute("title",l);var h=[].concat(i.getAttribute("class")||[],"injected-svg",t.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(h));var d=t.getAttribute("style");d&&i.setAttribute("style",d);var g=[].filter.call(t.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});c.call(g,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});for(var m,v=i.querySelectorAll("defs clipPath[id]"),b=0,y=v.length;y>b;b++){m=v[b].id+"-"+u;for(var w=i.querySelectorAll('[clip-path*="'+v[b].id+'"]'),E=0,O=w.length;O>E;E++)w[E].setAttribute("clip-path","url(#"+m+")");v[b].id=m}i.removeAttribute("xmlns:a");for(var C,x,S=i.querySelectorAll("script"),A=[],N=0,T=S.length;T>N;N++)x=S[N].getAttribute("type"),x&&"application/ecmascript"!==x&&"application/javascript"!==x||(C=S[N].innerText||S[N].textContent,A.push(C),i.removeChild(S[N]));if(A.length>0&&("always"===n||"once"===n&&!f[s])){for(var M=0,D=A.length;D>M;M++)new Function(A[M])(e);f[s]=!0}t.parentNode.replaceChild(i,t),delete p[p.indexOf(t)],t=null,u++,o(i)}))},y=function(t,e,n){e=e||{};var i=e.evalScripts||"always",o=e.pngFallback||!1,r=e.each;if(void 0!==t.length){var s=0;c.call(t,function(e){b(e,i,o,function(e){r&&"function"==typeof r&&r(e),n&&t.length===++s&&n(s)})})}else t?b(t,i,o,function(e){r&&"function"==typeof r&&r(e),n&&n(1),t=null}):n&&n(0)};"object"==typeof n&&"object"==typeof n.exports?n.exports=i=y:"function"==typeof t&&t.amd?t(function(){return y}):"object"==typeof e&&(e.SVGInjector=y)}(window,document)},{}]},{},[1])(1)})},function(t,e,n){"use strict";var i=n(2),o=n(24),r=i.createClass({displayName:"Interchange",mixins:[o],getInitialState:function(){return{matchedMedia:"large"}},componentDidMount:function(){this.media({minWidth:0,maxWidth:640},function(){this.setState({matchedMedia:"small"})}.bind(this)),this.media({minWidth:641,maxWidth:1200},function(){this.setState({matchedMedia:"medium"})}.bind(this)),this.media({minWidth:1200,maxWidth:1440},function(){this.setState({matchedMedia:"large"})}.bind(this))},render:function(){var t=null;return i.Children.forEach(this.props.children,function(e){e.props.media===this.state.matchedMedia&&(t=e)}.bind(this)),t}});t.exports=r},function(t,e,n){var i=n(25),o=i&&n(26),r=n(27),s={media:function(t,e){t=r(t),"function"==typeof e&&(e={match:e}),o.register(t,e),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:e})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(t){o.unregister(t.query,t.handler)})}};t.exports=s},function(t,e){var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=n},function(t,e,n){var i;!function(o,r,s){var a=window.matchMedia;"undefined"!=typeof t&&t.exports?t.exports=s(a):(i=function(){return r[o]=s(a)}.call(e,n,e,t),!(void 0!==i&&(t.exports=i)))}("enquire",this,function(t){"use strict";function e(t,e){var n,i=0,o=t.length;for(i;o>i&&(n=e(t[i],i),n!==!1);i++);}function n(t){return"[object Array]"===Object.prototype.toString.apply(t)}function i(t){return"function"==typeof t}function o(t){this.options=t,!t.deferSetup&&this.setup()}function r(e,n){this.query=e,this.isUnconditional=n,this.handlers=[],this.mql=t(e);var i=this;this.listener=function(t){i.mql=t,i.assess()},this.mql.addListener(this.listener)}function s(){if(!t)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return o.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},r.prototype={addHandler:function(t){var e=new o(t);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(t){var n=this.handlers;e(n,function(e,i){return e.equals(t)?(e.destroy(),!n.splice(i,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){e(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";e(this.handlers,function(e){e[t]()})}},s.prototype={register:function(t,o,s){var a=this.queries,c=s&&this.browserIsIncapable;return a[t]||(a[t]=new r(t,c)),i(o)&&(o={match:o}),n(o)||(o=[o]),e(o,function(e){a[t].addHandler(e)}),this},unregister:function(t,e){var n=this.queries[t];return n&&(e?n.removeHandler(e):(n.clear(),delete this.queries[t])),this}},new s})},function(t,e,n){var i=n(28),o=function(t){var e=/[height|width]$/;return e.test(t)},r=function(t){var e="",n=Object.keys(t);return n.forEach(function(r,s){var a=t[r];r=i(r),o(r)&&"number"==typeof a&&(a+="px"),e+=a===!0?r:a===!1?"not "+r:"("+r+": "+a+")",se;e++)if(e in this&&this[e]===t)return e;return-1},E=[].slice;null==this.Tether&&(this.Tether={modules:[]}),p=function(t){var e,n,i,o,r;if(n=getComputedStyle(t).position,"fixed"===n)return t;for(i=void 0,e=t;e=e.parentNode;){try{o=getComputedStyle(e)}catch(s){}if(null==o)return e;if(/(auto|scroll)/.test(o.overflow+o.overflowY+o.overflowX)&&("absolute"!==n||"relative"===(r=o.position)||"absolute"===r||"fixed"===r))return e}return document.body},m=function(){var t;return t=0,function(){return t++}}(),b={},l=function(t){var e,i,r,s,a;if(r=t._tetherZeroElement,null==r&&(r=t.createElement("div"),r.setAttribute("data-tether-id",m()),o(r.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(r),t._tetherZeroElement=r),e=r.getAttribute("data-tether-id"),null==b[e]){b[e]={},a=r.getBoundingClientRect();for(i in a)s=a[i],b[e][i]=s;n(function(){return b[e]=void 0})}return b[e]},f=null,s=function(t){var e,n,i,o,r,s,a;t===document?(n=document,t=document.documentElement):n=t.ownerDocument,i=n.documentElement,e={},a=t.getBoundingClientRect();for(o in a)s=a[o],e[o]=s;return r=l(n),e.top-=r.top,e.left-=r.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-i.clientTop,e.left=e.left-i.clientLeft,e.right=n.body.clientWidth-e.width-e.left,e.bottom=n.body.clientHeight-e.height-e.top,e},c=function(t){return t.offsetParent||document.documentElement},u=function(){var t,e,n,i,r;return t=document.createElement("div"),t.style.width="100%",t.style.height="200px",e=document.createElement("div"),o(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e),i=t.offsetWidth,e.style.overflow="scroll",r=t.offsetWidth,i===r&&(r=e.clientWidth),document.body.removeChild(e),n=i-r,{width:n,height:n}},o=function(t){var e,n,i,o,r,s,a;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),a=e.slice(1),r=0,s=a.length;s>r;r++)if(i=a[r])for(n in i)y.call(i,n)&&(o=i[n],t[n]=o);return t},d=function(t,e){var n,i,o,r,s,c;if(null!=t.classList){for(s=e.split(" "),c=[],o=0,r=s.length;r>o;o++)i=s[o],i.trim()&&c.push(t.classList.remove(i));return c}return n=a(t).replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," "),g(t,n)},e=function(t,e){var n,i,o,r,s;if(null!=t.classList){for(r=e.split(" "),s=[],i=0,o=r.length;o>i;i++)n=r[i],n.trim()&&s.push(t.classList.add(n));return s}return d(t,e),n=a(t)+(" "+e),g(t,n)},h=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(a(t))},a=function(t){return t.className instanceof SVGAnimatedString?t.className.baseVal:t.className},g=function(t,e){return t.setAttribute("class",e)},v=function(t,n,i){var o,r,s,a,c,l;for(r=0,a=i.length;a>r;r++)o=i[r],w.call(n,o)<0&&h(t,o)&&d(t,o);for(l=[],s=0,c=n.length;c>s;s++)o=n[s],h(t,o)?l.push(void 0):l.push(e(t,o));return l},i=[],n=function(t){return i.push(t)},r=function(){var t,e;for(e=[];t=i.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,n,i){var o;return null==i&&(i=!1),null==this.bindings&&(this.bindings={}),null==(o=this.bindings)[t]&&(o[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:i})},t.prototype.once=function(t,e,n){return this.on(t,e,n,!0)},t.prototype.off=function(t,e){var n,i,o;if(null!=(null!=(i=this.bindings)?i[t]:void 0)){if(null==e)return delete this.bindings[t];for(n=0,o=[];n=e&&e>=t-n},x=function(){var t,e,n,i,o;for(t=document.createElement("div"),o=["transform","webkitTransform","OTransform","MozTransform","msTransform"],n=0,i=o.length;i>n;n++)if(e=o[n],void 0!==t.style[e])return e}(),C=[],E=function(){var t,e,n;for(e=0,n=C.length;n>e;e++)t=C[e],t.position(!1);return u()},v=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?t:+new Date},function(){var t,e,n,i,o,r,s,a,c;for(e=null,n=null,i=null,o=function(){if(null!=n&&n>16)return n=Math.min(n-16,250),void(i=setTimeout(o,250));if(!(null!=e&&v()-e<10))return null!=i&&(clearTimeout(i),i=null),e=v(),E(),n=v()-e},a=["resize","scroll","touchmove"],c=[],r=0,s=a.length;s>r;r++)t=a[r],c.push(window.addEventListener(t,o));return c}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},n={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},a=function(n,i){var o,r;return o=n.left,r=n.top,"auto"===o&&(o=t[i.left]),"auto"===r&&(r=e[i.top]),{left:o,top:r}},s=function(t){var e,i;return{left:null!=(e=n[t.left])?e:t.left,top:null!=(i=n[t.top])?i:t.top}},r=function(){var t,e,n,i,o,r,s;for(e=1<=arguments.length?M.call(arguments,0):[],n={top:0,left:0},o=0,r=e.length;r>o;o++)s=e[o],i=s.top,t=s.left,"string"==typeof i&&(i=parseFloat(i,10)),"string"==typeof t&&(t=parseFloat(t,10)),n.top+=i,n.left+=t;return n},b=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},y=w=function(t){var e,n,i;return i=t.split(" "),n=i[0],e=i[1],{top:n,left:e}},N=function(){function t(t){this.position=D(this.position,this);var e,n,o,r,s;for(C.push(this),this.history=[],this.setOptions(t,!1),r=i.modules,n=0,o=r.length;o>n;n++)e=r[n],null!=(s=e.initialize)&&s.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,n;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(n=this.options.classes)?n[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var n,i,r,s,a,c;for(this.options=t,null==e&&(e=!0),n={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=l(n,this.options),a=this.options,this.element=a.element,this.target=a.target,this.targetModifier=a.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),c=["element","target"],r=0,s=c.length;s>r;r++){if(i=c[r],null==this[i])throw new Error("Tether Error: Both element and target must be defined");null!=this[i].jquery?this[i]=this[i][0]:"string"==typeof this[i]&&(this[i]=document.querySelector(this[i]))}if(o(this.element,this.getClass("element")),o(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=y(this.options.targetAttachment),this.attachment=y(this.options.attachment),this.offset=w(this.options.offset),this.targetOffset=w(this.options.targetOffset),null!=this.scrollParent&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParent=this.target:this.scrollParent=g(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,n,i,o,r,s,a,c;if(null==this.targetModifier)return p(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=p(this.target),o={height:t.height,width:t.width,top:t.top,left:t.left},o.height=Math.min(o.height,t.height-(pageYOffset-t.top)),o.height=Math.min(o.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),o.height=Math.min(innerHeight,o.height),o.height-=2,o.width=Math.min(o.width,t.width-(pageXOffset-t.left)),o.width=Math.min(o.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),o.width=Math.min(innerWidth,o.width),o.width-=2,o.topc.clientWidth||"scroll"===[a.overflow,a.overflowX]||this.target!==document.body,r=0,n&&(r=15),i=t.height-parseFloat(a.borderTopWidth)-parseFloat(a.borderBottomWidth)-r,o={width:15,height:.975*i*(i/c.scrollHeight),left:t.left+t.width-parseFloat(a.borderLeftWidth)-15},e=0,408>i&&this.target===document.body&&(e=-11e-5*Math.pow(i,2)-.00727*i+22.58),this.target!==document.body&&(o.height=Math.max(o.height,24)),s=this.target.scrollTop/(c.scrollHeight-i),o.top=s*(i-o.height-e)+t.top+parseFloat(a.borderTopWidth),this.target===document.body&&(o.height=Math.max(o.height,24)),o}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),o(this.target,this.getClass("enabled")),o(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return O(this.target,this.getClass("enabled")),O(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,n,i,o;for(this.disable(),o=[],t=n=0,i=C.length;i>n;t=++n){if(e=C[t],e===this){C.splice(t,1);break}o.push(void 0)}return o},t.prototype.updateAttachClasses=function(t,e){var n,i,o,r,s,a,l,u,p,h=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),r=["left","top","bottom","right","middle","center"],(null!=(p=this._addAttachClasses)?p.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),n=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&n.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&n.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&n.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&n.push(""+this.getClass("target-attached")+"-"+e.left),i=[],s=0,l=r.length;l>s;s++)o=r[s],i.push(""+this.getClass("element-attached")+"-"+o);for(a=0,u=r.length;u>a;a++)o=r[a],i.push(""+this.getClass("target-attached")+"-"+o);return c(function(){return null!=h._addAttachClasses?(S(h.element,h._addAttachClasses,i),S(h.target,h._addAttachClasses,i),h._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,n,o,c,l,f,g,m,v,y,w,E,O,C,x,S,A,N,T,M,D,P,I,_,j,L,k,U,W,F,B,z,q,H,R,V=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),M=a(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,M),e=this.cache("element-bounds",function(){return p(V.element)}),j=e.width,o=e.height,0===j&&0===o&&null!=this.lastSize?(F=this.lastSize,j=F.width,o=F.height):this.lastSize={width:j,height:o},I=P=this.cache("target-bounds",function(){return V.getTargetBounds()}),v=b(s(this.attachment),{width:j,height:o}),D=b(s(M),I),l=b(this.offset,{width:j,height:o}),f=b(this.targetOffset,I),v=r(v,l),D=r(D,f),c=P.left+D.left-v.left,_=P.top+D.top-v.top,B=i.modules,L=0,U=B.length;U>L;L++)if(g=B[L],x=g.position.call(this,{left:c,top:_,targetAttachment:M,targetPos:P,attachment:this.attachment,elementPos:e,offset:v,targetOffset:D,manualOffset:l,manualTargetOffset:f,scrollbarSize:N}),null!=x&&"object"==typeof x){if(x===!1)return!1;_=x.top,c=x.left}if(m={page:{top:_,left:c},viewport:{top:_-pageYOffset,bottom:pageYOffset-_-o+innerHeight,left:c-pageXOffset,right:pageXOffset-c-j+innerWidth}},document.body.scrollWidth>window.innerWidth&&(N=this.cache("scrollbar-size",d),m.viewport.bottom-=N.height),document.body.scrollHeight>window.innerHeight&&(N=this.cache("scrollbar-size",d),m.viewport.right-=N.width),(""!==(z=document.body.style.position)&&"static"!==z||""!==(q=document.body.parentElement.style.position)&&"static"!==q)&&(m.page.bottom=document.body.scrollHeight-_-o,m.page.right=document.body.scrollWidth-c-j),(null!=(H=this.options.optimizations)?H.moveElement:void 0)!==!1&&null==this.targetModifier){for(w=this.cache("target-offsetparent",function(){return h(V.target)}),C=this.cache("target-offsetparent-bounds",function(){return p(w)}),O=getComputedStyle(w),n=getComputedStyle(this.element),E=C,y={},R=["Top","Left","Bottom","Right"],k=0,W=R.length;W>k;k++)T=R[k],y[T.toLowerCase()]=parseFloat(O["border"+T+"Width"]);C.right=document.body.scrollWidth-C.left-E.width+y.right,C.bottom=document.body.scrollHeight-C.top-E.height+y.bottom,m.page.top>=C.top+y.top&&m.page.bottom>=C.bottom&&m.page.left>=C.left+y.left&&m.page.right>=C.right&&(A=w.scrollTop,S=w.scrollLeft,m.offset={top:m.page.top-C.top+A-y.top,left:m.page.left-C.left+S-y.left})}return this.move(m),this.history.unshift(m),this.history.length>3&&this.history.pop(),t&&u(),!0}},t.prototype.move=function(t){var e,n,i,o,r,s,a,u,p,f,d,g,m,v,b,y,w,E=this;if(null!=this.element.parentNode){u={};for(f in t){u[f]={};for(o in t[f]){for(i=!1,y=this.history,v=0,b=y.length;b>v;v++)if(a=y[v],!A(null!=(w=a[f])?w[o]:void 0,t[f][o])){i=!0;break}i||(u[f][o]=!0)}}e={top:"",left:"",right:"",bottom:""},p=function(t,n){var i,o,r;return(null!=(r=E.options.optimizations)?r.gpu:void 0)===!1?(t.top?e.top=""+n.top+"px":e.bottom=""+n.bottom+"px",t.left?e.left=""+n.left+"px":e.right=""+n.right+"px"):(t.top?(e.top=0,o=n.top):(e.bottom=0,o=-n.bottom),t.left?(e.left=0,i=n.left):(e.right=0,i=-n.right),e[x]="translateX("+Math.round(i)+"px) translateY("+Math.round(o)+"px)","msTransform"!==x?e[x]+=" translateZ(0)":void 0)},r=!1,(u.page.top||u.page.bottom)&&(u.page.left||u.page.right)?(e.position="absolute",p(u.page,t.page)):(u.viewport.top||u.viewport.bottom)&&(u.viewport.left||u.viewport.right)?(e.position="fixed",p(u.viewport,t.viewport)):null!=u.offset&&u.offset.top&&u.offset.left?(e.position="absolute",s=this.cache("target-offsetparent",function(){return h(E.target)}),h(this.element)!==s&&c(function(){return E.element.parentNode.removeChild(E.element),s.appendChild(E.element)}),p(u.offset,t.offset),r=!0):(e.position="absolute",p({top:!0,left:!0},t.page)),r||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),m={},g=!1;for(o in e)d=e[o],n=this.element.style[o],""===n||""===d||"top"!==o&&"left"!==o&&"bottom"!==o&&"right"!==o||(n=parseFloat(n),d=parseFloat(d)),n!==d&&(g=!0,m[o]=e[o]);return g?c(function(){return l(E.element.style,m)}):void 0}},t}(),i.position=E,this.Tether=l(N,i)}.call(this),function(){var t,e,n,i,o,r,s,a,c,l,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};l=this.Tether.Utils,s=l.getOuterSize,r=l.getBounds,a=l.getSize,i=l.extend,c=l.updateClasses,n=l.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],o=function(e,n){var i,o,s,a,c,l,u;if("scrollParent"===n?n=e.scrollParent:"window"===n&&(n=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),n===document&&(n=n.documentElement),null!=n.nodeType)for(o=a=r(n),c=getComputedStyle(n),n=[o.left,o.top,a.width+o.left,a.height+o.top],i=l=0,u=t.length;u>l;i=++l)s=t[i],s=s[0].toUpperCase()+s.substr(1),"Top"===s||"Left"===s?n[i]+=parseFloat(c["border"+s+"Width"]):n[i]-=parseFloat(c["border"+s+"Width"]);return n},this.Tether.modules.push({position:function(e){var s,a,l,p,h,f,d,g,m,v,b,y,w,E,O,C,x,S,A,N,T,M,D,P,I,_,j,L,k,U,W,F,B,z,q,H,R,V,X,G,Y,$,Z,J,K,Q,tt,et=this;if(_=e.top,b=e.left,T=e.targetAttachment,!this.options.constraints)return!0;for(S=function(e){var n,i,o,r;for(et.removeClass(e),r=[],i=0,o=t.length;o>i;i++)n=t[i],r.push(et.removeClass(""+e+"-"+n));return r},G=this.cache("element-bounds",function(){return r(et.element)}),v=G.height,j=G.width,0===j&&0===v&&null!=this.lastSize&&(Y=this.lastSize,j=Y.width,v=Y.height),D=this.cache("target-bounds",function(){return et.getTargetBounds()}),M=D.height,P=D.width,N={},m={},a=[this.getClass("pinned"),this.getClass("out-of-bounds")],$=this.options.constraints,L=0,F=$.length;F>L;L++)g=$[L],g.outOfBoundsClass&&a.push(g.outOfBoundsClass),g.pinnedClass&&a.push(g.pinnedClass);for(k=0,B=a.length;B>k;k++)for(d=a[k],Z=["left","top","right","bottom"],U=0,z=Z.length;z>U;U++)A=Z[U],a.push(""+d+"-"+A);for(s=[],N=i({},T),m=i({},this.attachment),J=this.options.constraints,W=0,q=J.length;q>W;W++){if(g=J[W],I=g.to,l=g.attachment,O=g.pin,null==l&&(l=""),u.call(l," ")>=0?(K=l.split(" "),f=K[0],h=K[1]):h=f=l,p=o(this,I),("target"===f||"both"===f)&&(_p[3]&&"bottom"===N.top&&(_-=M,N.top="top")),"together"===f&&(_p[3]&&"bottom"===N.top&&("top"===m.top?(_-=M,N.top="top",_-=v,m.top="bottom"):"bottom"===m.top&&(_-=M,N.top="top",_+=v,m.top="top")),"middle"===N.top&&(_+v>p[3]&&"top"===m.top?(_-=v,m.top="bottom"):_p[2]&&"right"===N.left&&(b-=P,N.left="left")),"together"===h&&(bp[2]&&"right"===N.left?"left"===m.left?(b-=P,N.left="left",b-=j,m.left="right"):"right"===m.left&&(b-=P,N.left="left",b+=j,m.left="left"):"center"===N.left&&(b+j>p[2]&&"left"===m.left?(b-=j,m.left="right"):bp[3]&&"top"===m.top&&(_-=v,m.top="bottom")),("element"===h||"both"===h)&&(bp[2]&&"left"===m.left&&(b-=j,m.left="right")),"string"==typeof O?O=function(){var t,e,n,i;for(n=O.split(","),i=[],e=0,t=n.length;t>e;e++)E=n[e],i.push(E.trim());return i}():O===!0&&(O=["top","left","right","bottom"]),O||(O=[]),C=[],y=[],_=0?(_=p[1],C.push("top")):y.push("top")),_+v>p[3]&&(u.call(O,"bottom")>=0?(_=p[3]-v,C.push("bottom")):y.push("bottom")),b=0?(b=p[0],C.push("left")):y.push("left")),b+j>p[2]&&(u.call(O,"right")>=0?(b=p[2]-j,C.push("right")):y.push("right")),C.length)for(x=null!=(Q=this.options.pinnedClass)?Q:this.getClass("pinned"),s.push(x),V=0,H=C.length;H>V;V++)A=C[V],s.push(""+x+"-"+A);if(y.length)for(w=null!=(tt=this.options.outOfBoundsClass)?tt:this.getClass("out-of-bounds"),s.push(w),X=0,R=y.length;R>X;X++)A=y[X],s.push(""+w+"-"+A);(u.call(C,"left")>=0||u.call(C,"right")>=0)&&(m.left=N.left=!1),(u.call(C,"top")>=0||u.call(C,"bottom")>=0)&&(m.top=N.top=!1),(N.top!==T.top||N.left!==T.left||m.top!==this.attachment.top||m.left!==this.attachment.left)&&this.updateAttachClasses(m,N)}return n(function(){return c(et.target,s,a),c(et.element,s,a)}),{top:_,left:b}}})}.call(this),function(){var t,e,n,i;i=this.Tether.Utils,e=i.getBounds,n=i.updateClasses,t=i.defer,this.Tether.modules.push({position:function(i){var o,r,s,a,c,l,u,p,h,f,d,g,m,v,b,y,w,E,O,C,x,S,A,N,T,M=this;if(d=i.top,l=i.left,x=this.cache("element-bounds",function(){return e(M.element)}),c=x.height,g=x.width,f=this.getTargetBounds(),a=d+c,u=l+g,o=[],d<=f.bottom&&a>=f.top)for(S=["left","right"],m=0,w=S.length;w>m;m++)p=S[m],((A=f[p])===l||A===u)&&o.push(p);if(l<=f.right&&u>=f.left)for(N=["top","bottom"],v=0,E=N.length;E>v;v++)p=N[v],((T=f[p])===d||T===a)&&o.push(p);for(s=[],r=[],h=["left","top","right","bottom"],s.push(this.getClass("abutted")),b=0,O=h.length;O>b;b++)p=h[b],s.push(""+this.getClass("abutted")+"-"+p);for(o.length&&r.push(this.getClass("abutted")),y=0,C=o.length;C>y;y++)p=o[y],r.push(""+this.getClass("abutted")+"-"+p);return t(function(){return n(M.target,r,s),n(M.element,r,s)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(t){var e,n,i,o,r,s,a;return s=t.top,e=t.left,this.options.shift?(n=function(t){return"function"==typeof t?t.call(this,{top:s,left:e}):t},i=n(this.options.shift),"string"==typeof i?(i=i.split(" "),i[1]||(i[1]=i[0]),r=i[0],o=i[1],r=parseFloat(r,10),o=parseFloat(o,10)):(a=[i.top,i.left],r=a[0],o=a[1]),s+=r,e+=o,{top:s,left:e}):void 0}})}.call(this),this.Tether})},function(t,e,n){"use strict";var i=n(2),o=n(3),r=i.createClass({displayName:"Tabs",getInitialState:function(){return{selectedTab:0,content:null}},selectTab:function(t){this.setState(t)},render:function(){var t=i.Children.map(this.props.children,function(t,e){return o(t,{active:e===this.state.selectedTab,index:e,selectTab:this.selectTab})}.bind(this));return i.createElement("div",null,i.createElement("div",{className:"tabs"},t),i.createElement("div",null,this.state.content))}});t.exports=r,r.Tab=n(42)},function(t,e,n){"use strict";var i=n(2),o=n(!function(){var t=new Error('Cannot find module "react/lib/cx"');throw t.code="MODULE_NOT_FOUND",t}()),r=i.createClass({displayName:"Tab",componentDidMount:function(){this.props.active&&this.select()},select:function(){var t={selectedTab:this.props.index,content:this.props.children};this.props.selectTab(t)},render:function(){var t={"tab-item":!0,"is-active":this.props.active};return i.createElement("div",{className:o(t),onClick:this.select},this.props.title)}});t.exports=r},function(t,e,n){"use strict";var i=n(2),o=n(3),r=n(16),s=n(44),a=i.createClass({displayName:"Trigger",getDefaultProps:function(){return{open:null,close:null,toggle:null,hardToggle:null,popupToggle:null,notify:null}},getCloseId:function(){if(this.props.close)return this.props.close;for(var t=!1,e=this.getDOMNode().parentNode;t===!1;)"BODY"==e.nodeName&&(t=""),"undefined"!=typeof e.getAttribute("data-closable")&&e.getAttribute("data-closable")!==!1&&(t=e),e=e.parentNode;return t.getAttribute("id")},clickHandler:function(t){t.preventDefault(),this.props.open?r.publish(this.props.open,"open"):null!==this.props.close?r.publish(this.getCloseId(),"close"):this.props.toggle?r.publish(this.props.toggle,"toggle"):this.props.hardToggle?(r.closeActiveElements({exclude:this.props.hardToggle}),r.publish(this.props.hardToggle,"toggle")):this.props.notify&&r.publish(this.props.notify,{title:this.props.title,content:this.props.content,position:this.props.position,color:this.props.color,image:this.props.image})},render:function(){if(this.props.popupToggle)return i.createElement(s,this.props);var t=i.Children.only(this.props.children);return o(t,{onClick:this.clickHandler})}});t.exports=a},function(t,e,n){"use strict";var i=n(2),o=n(16),r=n(3),s=i.createClass({displayName:"PopupToggle",clickHandler:function(t,e){e.preventDefault(),o.publish(this.props.popupToggle,["toggle",t])},render:function(){var t=i.Children.only(this.props.children),e=this.props.id||o.generateUuid();return r(t,{id:e,onClick:this.clickHandler.bind(this,e)})}});t.exports=s}])}); \ No newline at end of file diff --git a/docs/docs.jsx b/docs/docs.jsx index 34a60dd..145a08b 100644 --- a/docs/docs.jsx +++ b/docs/docs.jsx @@ -1,9 +1,8 @@ var React = require('react'); -var Router = require('react-router'); -var Link = Router.Link; -var Route = Router.Route; -var DefaultRoute = Router.DefaultRoute; -var RouteHandler = Router.RouteHandler; +var ReactRouter = require('react-router'); +var Router = ReactRouter.Router; +var Route = ReactRouter.Route; +var Link = ReactRouter.Link; var Offcanvas = require('../src/offcanvas'); var Trigger = require('../src/trigger'); var Panel = require('../src/panel'); @@ -52,18 +51,18 @@ var Docs = React.createClass({
    -
  • Installation & Usage
  • -
  • Trigger
  • -
  • Modal
  • -
  • Panel
  • -
  • Off-canvas Menu
  • -
  • Notification
  • -
  • Action Sheet
  • -
  • Tabs
  • -
  • Iconic
  • -
  • Accordion
  • -
  • Interchange
  • -
  • Popup
  • +
  • Installation & Usage
  • +
  • Trigger
  • +
  • Modal
  • +
  • Panel
  • +
  • Off-canvas Menu
  • +
  • Notification
  • +
  • Action Sheet
  • +
  • Tabs
  • +
  • Iconic
  • +
  • Accordion
  • +
  • Interchange
  • +
  • Popup
@@ -73,7 +72,7 @@ var Docs = React.createClass({ Show Components - + {this.props.children} @@ -83,8 +82,4 @@ var Docs = React.createClass({ } }); - - - - -module.exports = Docs; \ No newline at end of file +module.exports = Docs; diff --git a/docs/iconic/basic.jsx b/docs/iconic/basic.jsx index ac131e2..f09aaa6 100644 --- a/docs/iconic/basic.jsx +++ b/docs/iconic/basic.jsx @@ -15,4 +15,4 @@ var BasicIconic = React.createClass({ } }); -module.exports = BasicIconic; \ No newline at end of file +module.exports = BasicIconic; diff --git a/docs/index.html b/docs/index.html index 5918736..918355d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,6 +4,5 @@ - - \ No newline at end of file + diff --git a/docs/index.jsx b/docs/index.jsx index 80ee79a..e79d811 100644 --- a/docs/index.jsx +++ b/docs/index.jsx @@ -1,12 +1,10 @@ var React = require('react'); -var Router = require('react-router'); +var render = require('react-dom').render; var routes = require('./routes'); var canUseDOM = require('can-use-dom'); - + if (canUseDOM) { document.addEventListener('DOMContentLoaded', function () { - Router.run(routes, Router.HistoryLocation, function (Handler) { - React.render(, document.body); - }); + render(routes, document.body); }); -} \ No newline at end of file +} diff --git a/docs/routes.jsx b/docs/routes.jsx index 844e8c2..e689dd4 100644 --- a/docs/routes.jsx +++ b/docs/routes.jsx @@ -1,7 +1,12 @@ var React = require('react'); -var Router = require('react-router'); -var Route = Router.Route; -var DefaultRoute = Router.DefaultRoute; +var ReactRouter = require('react-router'); +var Router = ReactRouter.Router; +var Route = ReactRouter.Route; +var IndexRoute = ReactRouter.IndexRoute; + +var createBrowserHistory = require('history/lib/createBrowserHistory'); +var history = createBrowserHistory() + var Install = require('./install'); var Accordion = require('./accordion'); var Interchange = require('./interchange'); @@ -18,23 +23,23 @@ var Docs = require('./docs'); var path = (process.env.NODE_ENV==='dev_docs') ? '/': '/opensource/react-foundation-apps'; var routes = ( - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + ); - - -module.exports = routes; \ No newline at end of file +module.exports = routes; diff --git a/gulpfile.js b/gulpfile.js index c877ee2..2639333 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,7 +18,7 @@ gulp.task('copy', function () { gulp.src('./docs/img/*') .pipe(gulp.dest('build/img')); - gulp.src('./bower_components/foundation-apps/iconic/*') + gulp.src('./node_modules/foundation-apps/iconic/*') .pipe(gulp.dest('build/img/iconic')); }); diff --git a/package.json b/package.json index 8c8a0cb..a5d827a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "'React port of foundation-apps'", "main": "index.js", "scripts": { - "postinstall": "bower install", "start": "./node_modules/.bin/gulp server", "prepublish": "./node_modules/.bin/babel ./src --out-dir ./lib && ./node_modules/.bin/gulp dist" }, @@ -45,6 +44,7 @@ "gulp-sass": "^2.0.1", "highlight.js": "^8.4.0", "highlightjs-themes": "git+https://github.com/akiran/highlightjs-themes", + "history": "^1.13.1", "html-loader": "^0.2.3", "jsx-loader": "^0.12.2", "markdown-loader": "^0.1.2", @@ -70,6 +70,10 @@ }, "dependencies": { "can-use-dom": "^0.1.0", + "classnames": "^2.2.1", + "exenv": "^1.2.0", + "fbjs": "^0.5.0", + "foundation-apps": "^1.2.0", "object-assign": "^2.0.0", "pubsub-js": "^1.5.0", "tether": "^0.6.5" diff --git a/src/accordion/index.jsx b/src/accordion/index.jsx index ec868c1..b6f6e76 100644 --- a/src/accordion/index.jsx +++ b/src/accordion/index.jsx @@ -1,12 +1,11 @@ var React = require('react'); -var cloneWithProps = require('react/lib/cloneWithProps'); var Accordion = React.createClass({ getInitialState: function () { return { sections: [] }; }, getDefaultProps: function () { - return { + return { autoOpen: true, multiOpen: false, collapsible: false @@ -41,7 +40,7 @@ var Accordion = React.createClass({ }, render: function () { var children = React.Children.map(this.props.children, function (child, index) { - return cloneWithProps(child, { + return React.cloneElement(child, { active: this.state.sections[index]? this.state.sections[index].active: false, activate: this.select.bind(this, index) }); @@ -53,4 +52,4 @@ var Accordion = React.createClass({ }); module.exports = Accordion; -Accordion.Item = require('./item'); \ No newline at end of file +Accordion.Item = require('./item'); diff --git a/src/accordion/item.jsx b/src/accordion/item.jsx index 157ca9f..574d5c1 100644 --- a/src/accordion/item.jsx +++ b/src/accordion/item.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); var AccordionItem = React.createClass({ render: function () { @@ -20,4 +20,4 @@ var AccordionItem = React.createClass({ } }); -module.exports = AccordionItem; \ No newline at end of file +module.exports = AccordionItem; diff --git a/src/action-sheet/content.jsx b/src/action-sheet/content.jsx index 493d37a..56578e4 100644 --- a/src/action-sheet/content.jsx +++ b/src/action-sheet/content.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); var ActionSheetContent = React.createClass({ getDefaultProps: function () { @@ -16,4 +16,4 @@ var ActionSheetContent = React.createClass({ } }); -module.exports = ActionSheetContent; \ No newline at end of file +module.exports = ActionSheetContent; diff --git a/src/action-sheet/index.jsx b/src/action-sheet/index.jsx index 188dc8b..8044e11 100644 --- a/src/action-sheet/index.jsx +++ b/src/action-sheet/index.jsx @@ -1,5 +1,4 @@ var React = require('react'); -var cloneWithProps = require('react/lib/cloneWithProps'); var foundationApi = require('../utils/foundation-api'); var ActionSheet = React.createClass({ @@ -49,7 +48,7 @@ var ActionSheet = React.createClass({ if (child.type.displayName === 'ActionSheetButton') { extraProps.setActiveState = this.setActiveState; } - return cloneWithProps(child, extraProps); + return React.cloneElement(child, extraProps); }.bind(this)); return (
diff --git a/src/iconic/index.jsx b/src/iconic/index.jsx index f2d218a..f1ac2e4 100644 --- a/src/iconic/index.jsx +++ b/src/iconic/index.jsx @@ -1,12 +1,12 @@ var React = require('react'); -var ExecutionEnvironment = require('react/lib/ExecutionEnvironment'); +var ReactDOM = require('react-dom'); +var ExecutionEnvironment = require('exenv'); var IconicJs = ExecutionEnvironment.canUseDOM && require('../../vendor/iconic.min'); -var cloneWithProps = require('react/lib/cloneWithProps'); var Iconic = React.createClass({ inject: function () { var ico = IconicJs(); - ico.inject(this.getDOMNode()); + ico.inject(ReactDOM.findDOMNode(this)); }, componentDidMount: function () { this.inject(); @@ -19,4 +19,4 @@ var Iconic = React.createClass({ } }); -module.exports = Iconic; \ No newline at end of file +module.exports = Iconic; diff --git a/src/modal/index.jsx b/src/modal/index.jsx index 509fa9e..56a7d7e 100644 --- a/src/modal/index.jsx +++ b/src/modal/index.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); var Animation = require('../utils/animation'); var foundationApi = require('../utils/foundation-api'); diff --git a/src/notification/static.jsx b/src/notification/static.jsx index 09c4c22..448a2da 100644 --- a/src/notification/static.jsx +++ b/src/notification/static.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); var foundationApi = require('../utils/foundation-api'); var Animation = require('../utils/animation'); var Notification = require('./notification'); @@ -36,4 +36,4 @@ var NotificationStatic = React.createClass({ } }); -module.exports = NotificationStatic; \ No newline at end of file +module.exports = NotificationStatic; diff --git a/src/offcanvas/index.jsx b/src/offcanvas/index.jsx index 4a1e77c..05b4cb5 100644 --- a/src/offcanvas/index.jsx +++ b/src/offcanvas/index.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); // var LayerMixin = require('react-layer-mixin'); var foundationApi = require('../utils/foundation-api'); @@ -44,4 +44,4 @@ var Offcanvas = React.createClass({ }, }); -module.exports = Offcanvas; \ No newline at end of file +module.exports = Offcanvas; diff --git a/src/panel/index.jsx b/src/panel/index.jsx index c4f0c10..0d7b472 100644 --- a/src/panel/index.jsx +++ b/src/panel/index.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); var Animation = require('../utils/animation'); var foundationApi = require('../utils/foundation-api'); @@ -55,4 +55,4 @@ var Panel = React.createClass({ }, }); -module.exports = Panel; \ No newline at end of file +module.exports = Panel; diff --git a/src/popup/index.jsx b/src/popup/index.jsx index 2f4ce88..c304129 100644 --- a/src/popup/index.jsx +++ b/src/popup/index.jsx @@ -1,6 +1,7 @@ var React = require('react'); -var cx = require('react/lib/cx'); -var ExecutionEnvironment = require('react/lib/ExecutionEnvironment'); +var ReactDOM = require('react-dom'); +var cx = require('classnames'); +var ExecutionEnvironment = require('exenv'); var foundationApi = require('../utils/foundation-api'); var Tether = ExecutionEnvironment.canUseDOM && require('tether/tether'); @@ -39,7 +40,7 @@ var Popup = React.createClass({ var targetElement = document.getElementById(target); var attachment = 'top center'; this.tether = new Tether({ - element: this.getDOMNode(), + element: ReactDOM.findDOMNode(this), target: targetElement, attachment: attachment, }); @@ -57,4 +58,4 @@ var Popup = React.createClass({ }, }); -module.exports = Popup; \ No newline at end of file +module.exports = Popup; diff --git a/src/popup/toggle.jsx b/src/popup/toggle.jsx index f30af01..11992c3 100644 --- a/src/popup/toggle.jsx +++ b/src/popup/toggle.jsx @@ -1,6 +1,5 @@ var React = require('react'); var foundationApi = require('../utils/foundation-api'); -var cloneWithProps = require('react/lib/cloneWithProps'); var PopupToggle = React.createClass({ clickHandler: function (id, e) { @@ -10,11 +9,11 @@ var PopupToggle = React.createClass({ render: function () { var child = React.Children.only(this.props.children); var id = this.props.id || foundationApi.generateUuid(); - return cloneWithProps(child, { + return React.cloneElement(child, { id: id, onClick: this.clickHandler.bind(this, id) }); } }); -module.exports = PopupToggle; \ No newline at end of file +module.exports = PopupToggle; diff --git a/src/tabs/index.jsx b/src/tabs/index.jsx index 14622c8..a02563c 100644 --- a/src/tabs/index.jsx +++ b/src/tabs/index.jsx @@ -1,5 +1,4 @@ var React = require('react'); -var cloneWithProps = require('react/lib/cloneWithProps'); var Tabs = React.createClass({ getInitialState: function () { @@ -13,7 +12,7 @@ var Tabs = React.createClass({ }, render: function () { var children = React.Children.map(this.props.children, function (child, index) { - return cloneWithProps(child, { + return React.cloneElement(child, { active: (index === this.state.selectedTab), index: index, selectTab: this.selectTab @@ -22,11 +21,11 @@ var Tabs = React.createClass({ return (
{children}
-
{this.state.content}
+
{this.state.content}
); } }); module.exports = Tabs; -Tabs.Tab = require('./tab'); \ No newline at end of file +Tabs.Tab = require('./tab'); diff --git a/src/tabs/tab.jsx b/src/tabs/tab.jsx index 9e7f737..b271bb2 100644 --- a/src/tabs/tab.jsx +++ b/src/tabs/tab.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cx = require('react/lib/cx'); +var cx = require('classnames'); var Tab = React.createClass({ componentDidMount: function () { diff --git a/src/trigger/index.jsx b/src/trigger/index.jsx index 5b698dc..ca8fb43 100644 --- a/src/trigger/index.jsx +++ b/src/trigger/index.jsx @@ -1,5 +1,5 @@ var React = require('react'); -var cloneWithProps = require('react/lib/cloneWithProps'); +var ReactDOM = require('react-dom'); var foundationApi = require('../utils/foundation-api'); var PopupToggle = require('../popup/toggle'); @@ -19,7 +19,7 @@ var Trigger = React.createClass({ return this.props.close; } else { var parentElement= false; - var tempElement = this.getDOMNode().parentNode; + var tempElement = ReactDOM.findDOMNode(this).parentNode; while(parentElement === false) { if(tempElement.nodeName == 'BODY') { parentElement = ''; @@ -59,11 +59,11 @@ var Trigger = React.createClass({ return ; } else { var child = React.Children.only(this.props.children); - return cloneWithProps(child, { + return React.cloneElement(child, { onClick: this.clickHandler }); } } }); -module.exports = Trigger; \ No newline at end of file +module.exports = Trigger; diff --git a/src/utils/animation.jsx b/src/utils/animation.jsx index 2275b5d..171e63a 100644 --- a/src/utils/animation.jsx +++ b/src/utils/animation.jsx @@ -1,9 +1,9 @@ // some parts of code from react/lib/ReactCSSTransitionGroupChild.js var React = require('react'); +var ReactDOM = require('react-dom'); var ReactTransitionEvents = require('react/lib/ReactTransitionEvents'); -var CSSCore = require('react/lib/CSSCore'); -var cloneWithProps = require('react/lib/cloneWithProps'); -var cx = require('react/lib/cx'); +var CSSCore = require('fbjs/lib/CSSCore'); +var cx = require('classnames'); var TICK = 17; var Animation = React.createClass({ @@ -31,17 +31,17 @@ var Animation = React.createClass({ CSSCore.removeClass(node, this.props.animationOut); }, finishAnimation: function () { - var node = this.getDOMNode(); + var node = ReactDOM.findDOMNode(this); this.reset(node); CSSCore.removeClass(node, this.props.active? '' : 'is-active'); this.reflow(node); ReactTransitionEvents.removeEndEventListener(node, this.finishAnimation); }, animate: function(animationClass, animationType) { - var node = this.getDOMNode(); + var node = ReactDOM.findDOMNode(this); var initClass = 'ng-' + animationType; var activeClass = initClass + '-active'; - + this.reset(node); CSSCore.addClass(node, animationClass); @@ -54,7 +54,7 @@ var Animation = React.createClass({ //activate node.style.transitionDuration = ''; CSSCore.addClass(node, activeClass); - + ReactTransitionEvents.addEndEventListener(node, this.finishAnimation); }, componentDidUpdate: function (prevProps) { @@ -67,8 +67,8 @@ var Animation = React.createClass({ render: function () { var child = React.Children.only(this.props.children); var extraProps = {}; - return cloneWithProps(child, extraProps); + return React.cloneElement(child, extraProps); } }); -module.exports = Animation; \ No newline at end of file +module.exports = Animation; diff --git a/webpack.config.js b/webpack.config.js index adee06b..61467d0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,10 +3,10 @@ var path = require('path'); var autoprefixer = require('autoprefixer-core'); module.exports = { - devtool: '#inline-source-map', + devtool: 'source-map', entry: { 'docs.js': [ - 'webpack-dev-server/client?http://192.168.0.100:8000', + 'webpack-dev-server/client?http://localhost:8000', 'webpack/hot/only-dev-server', './docs/index.jsx' ] @@ -36,4 +36,4 @@ module.exports = { plugins: [ new webpack.HotModuleReplacementPlugin(), ] -}; \ No newline at end of file +};