!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("preact")):"function"==typeof define&&define.amd?define(["preact"],n):e.PreactTransitionGroup=n(e.preact)}(this,function(e){function n(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}function t(e,n){var t=e&&e.key;return null===t||void 0===t?n:t}function r(e,n){var t=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return t[n]||(t[n]=function(t){e.refs[n]=t})}function o(e){for(var n={},r=0;r<e.length;r++)if(null!=e[r]){var o=t(e[r],r.toString(36));n[o]=e[r]}return n}function i(e,n){e=e||{},n=n||{};var t=function(t){return n.hasOwnProperty(t)?n[t]:e[t]},r={},o=[];for(var i in e)n.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a={};for(var s in n){if(r.hasOwnProperty(s))for(var p=0;p<r[s].length;p++){var h=r[s][p];a[r[s][p]]=t(h)}a[s]=t(s)}for(var c=0;c<o.length;c++)a[o[c]]=t(o[c]);return a}var a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},s=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)},p=function(e,n){var t={};for(var r in e)n.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},h=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n},c=function(e){return e},f=function(t){function c(){var n,r,i;a(this,c);for(var s=arguments.length,p=Array(s),f=0;f<s;f++)p[f]=arguments[f];return n=r=h(this,t.call.apply(t,[this].concat(p))),r.refs={},r.state={children:o(e.toChildArray(e.toChildArray(r.props.children))||[])},r.performEnter=function(e){r.currentlyTransitioningKeys[e]=!0;var n=r.refs[e];n.componentWillEnter?n.componentWillEnter(r._handleDoneEntering.bind(r,e)):r._handleDoneEntering(e)},r.performLeave=function(e){if(-1===r.keysToAbortLeave.indexOf(e)){r.currentlyTransitioningKeys[e]=!0;var n=r.refs[e];n.componentWillLeave?n.componentWillLeave(r._handleDoneLeaving.bind(r,e)):r._handleDoneLeaving(e)}},i=n,h(r,i)}return s(c,t),c.prototype.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]},c.prototype.componentDidMount=function(){var e=this.state.children;for(var n in e)e[n]&&this.performAppear(n)},c.prototype.componentWillReceiveProps=function(n){var t=o(e.toChildArray(n.children)||[]),r=this.state.children;this.setState(function(e){return{children:i(e.children,t)}});var a=void 0;for(a in t)if(t.hasOwnProperty(a)){var s=r&&r.hasOwnProperty(a);t[a]&&s&&this.currentlyTransitioningKeys[a]?(this.keysToEnter.push(a),this.keysToAbortLeave.push(a)):!t[a]||s||this.currentlyTransitioningKeys[a]||this.keysToEnter.push(a)}for(a in r)if(r.hasOwnProperty(a)){var p=t&&t.hasOwnProperty(a);!r[a]||p||this.currentlyTransitioningKeys[a]||this.keysToLeave.push(a)}},c.prototype.componentDidUpdate=function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var n=this.keysToLeave;this.keysToLeave=[],n.forEach(this.performLeave)},c.prototype._finishAbort=function(e){var n=this.keysToAbortLeave.indexOf(e);-1!==n&&this.keysToAbortLeave.splice(n,1)},c.prototype.performAppear=function(e){this.currentlyTransitioningKeys[e]=!0;var n=this.refs[e];n.componentWillAppear?n.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)},c.prototype._handleDoneAppearing=function(n){var t=this.refs[n];t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[n],this._finishAbort(n);var r=o(e.toChildArray(this.props.children)||[]);r&&r.hasOwnProperty(n)||this.performLeave(n)},c.prototype._handleDoneEntering=function(n){var t=this.refs[n];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[n],this._finishAbort(n);var r=o(e.toChildArray(this.props.children)||[]);r&&r.hasOwnProperty(n)||this.performLeave(n)},c.prototype._handleDoneLeaving=function(t){if(-1===this.keysToAbortLeave.indexOf(t)){var r=this.refs[t];r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[t];var i=o(e.toChildArray(this.props.children)||[]);if(i&&i.hasOwnProperty(t))this.performEnter(t);else{var a=n({},this.state.children);delete a[t],this.setState({children:a})}}},c.prototype.render=function(n,t){var o=t.children,i=n.childFactory,a=(n.transitionLeave,n.transitionName,n.transitionAppear,n.transitionEnter,n.transitionLeaveTimeout,n.transitionEnterTimeout,n.transitionAppearTimeout,n.component),s=p(n,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),h=[];for(var c in o)if(o.hasOwnProperty(c)){var f=o[c];if(f){var l=r(this,c),u=e.cloneElement(i(f),{ref:l,key:c});h.push(u)}}return e.h(a,s,h)},c}(e.Component);return f.defaultProps={component:"span",childFactory:c},f});
//# sourceMappingURL=preact-transition-group.min.js.map