// https://d3js.org/d3-transition/ v1.1.3 Copyright 2018 Mike Bostock !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-dispatch"),require("d3-timer"),require("d3-color"),require("d3-interpolate"),require("d3-selection"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-timer","d3-color","d3-interpolate","d3-selection","d3-ease"],n):n(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o,a){"use strict";var u=n.dispatch("start","end","interrupt"),s=[],l=0,f=1,c=2,h=3,d=4,_=5,p=6;function v(t,n,r,i,o,a){var v=t.__transition;if(v){if(r in v)return}else t.__transition={};!function(t,n,r){var i,o=t.__transition;function a(l){var _,v,y,m;if(r.state!==f)return s();for(_ in o)if((m=o[_]).name===r.name){if(m.state===h)return e.timeout(a);m.state===d?(m.state=p,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete o[_]):+_l)throw new Error("too late; already scheduled");return e}function m(t,n){var e=w(t,n);if(e.state>c)throw new Error("too late; already started");return e}function w(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function g(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>c&&e.state<_,e.state=p,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function b(t,n,e){var r=t._id;return t.each(function(){var t=m(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return w(t,r).value[n]}}function A(t,n){var e;return("number"==typeof n?i.interpolateNumber:n instanceof r.color?i.interpolateRgb:(e=r.color(n))?(n=e,i.interpolateRgb):i.interpolateString)(t,n)}var x=o.selection.prototype.constructor;var E=0;function N(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function S(t){return o.selection().transition(t)}function T(){return++E}var q=o.selection.prototype;N.prototype=S.prototype={constructor:N,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=o.selector(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?y:m;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=o.namespace(t),r="transform"===e?i.interpolateTransformSvg:A;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttribute(t))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttribute(t)}})(e,r,b(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}:function(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=o.namespace(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?i.interpolateTransformCss:A;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var a=o.style(this,t),u=(this.style.removeProperty(t),o.style(this,t));return a===u?null:a===e&&u===r?i:i=n(e=a,r=u)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,a;return function(){var u=o.style(this,t),s=e(this);return null==s&&(this.style.removeProperty(t),s=o.style(this,t)),u===s?null:u===r&&s===i?a:a=n(r=u,i=s)}}(t,r,b(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var a=o.style(this,t);return a===e?null:a===r?i:i=n(r=a,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(b(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=w(this.node(),e).tween,o=0,a=i.length;of&&e.name===n)return new N([[t]],O,n,+r);return null},t.interrupt=g,Object.defineProperty(t,"__esModule",{value:!0})});