<body>
<div id="canvas-container">
<canvas id="canvas" width="600" height="300"></canvas>
</div>
</body>
#canvas-container {
width: 100%;
text-align:center;
}
canvas {
display: inline;
}
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(8)["default"],i=n(9),o=(r(i),n(31)),u=r(o),s=n(46),a=r(s),c=n(47),f=r(c),l=n(44),h=r(l);!function(){var t=document.getElementById("canvas"),e=t.getContext("2d"),n=t.width,r=t.height,i=u["default"].rectangleWalls(n,r),o=new a["default"](n,r),s=o.generate(),c=new h["default"](e,n,r),l=function(){c.clearRect(),c.drawRect(),s.forEach(function(t){return c.drawParticle(t)})},p=new f["default"](s,i,function(t){}),d=function v(t){p.step(p.clock+50),l(),window.requestAnimationFrame(v)};window.requestAnimationFrame(function(t){p.start(t),l(),window.requestAnimationFrame(d)})}()},function(t,e){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(t,e,n){var r=n(41)("wks"),i=n(3).Symbol;t.exports=function(t){return r[t]||(r[t]=i&&i[t]||(i||n(27))("Symbol."+t))}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e,n){"use strict";var r=n(50)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r(t,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){var r=n(14);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports={version:"1.2.3"};"number"==typeof __e&&(__e=n)},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"],o=n(19)["default"],u=n(8)["default"];Object.defineProperty(e,"__esModule",{value:!0});var s=n(30),a=(u(s),function(){function t(e,n,r){i(this,t),this.mass=e*e,this.radius=e,this.position=n,this.speed=r,this.hits=0}return r(t,[{key:"move",value:function(t){this.position=this.position.add(this.speed.multiply(t))}},{key:"timeToHitParticle",value:function(t){if(this==t)return o;var e=t.position.subtract(this.position),n=t.speed.subtract(this.speed),r=e.dot(n);if(r>0)return o;var i=n.dot(n);if(0==i)return o;var u=e.dot(e),s=this.radius+t.radius,a=r*r-i*(u-s*s);return 0>a?o:-(r+Math.sqrt(a))/i}},{key:"bounceOffParticle",value:function(t){var e=t.position.subtract(this.position),n=t.speed.subtract(this.speed),r=e.dot(n),i=this.radius+t.radius,o=2*this.mass*t.mass*r/((this.mass+t.mass)*i),u=o*(t.position.x-this.position.x)/i,s=o*(t.position.y-this.position.y)/i;this.speed.x+=u/this.mass,this.speed.y+=s/this.mass,t.speed.x-=u/t.mass,t.speed.y-=s/t.mass,this.hits++,t.hits++}},{key:"overlap",value:function(t){var e=t.position.subtract(this.position),n=t.radius+this.radius;return e.dot(e)<n*n}},{key:"toString",value:function(){return"Particle {r@"+this.position.toString()+", v@"+this.speed.toString()+"}"}}]),t}());e["default"]=a,t.exports=e["default"]},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(20);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(3),i=n(7),o="prototype",u=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e,n){var a,c,f,l,h=t&s.G,p=t&s.P,d=h?r:t&s.S?r[e]:(r[e]||{})[o],v=h?i:i[e]||(i[e]={});h&&(n=e);for(a in n)c=!(t&s.F)&&d&&a in d,c&&a in v||(f=c?d[a]:n[a],h&&"function"!=typeof d[a]?l=n[a]:t&s.B&&c?l=u(f,r):t&s.W&&d[a]==f?!function(t){l=function(e){return this instanceof t?new t(e):t(e)},l[o]=t[o]}(f):l=p&&"function"==typeof f?u(Function.call,f):f,v[a]=l,p&&((v[o]||(v[o]={}))[a]=f))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,e){t.exports={}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(1).setDesc,i=n(22),o=n(2)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(66),i=n(21);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(78)(!0);n(39)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){t.exports={"default":n(54),__esModule:!0}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(1),i=n(25);t.exports=n(15)?function(t,e,n){return r.setDesc(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=!0},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){t.exports=n(23)},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(35),i=n(2)("iterator"),o=n(13);t.exports=n(7).getIteratorMethod=function(t){return void 0!=t?t[i]||t["@@iterator"]||o[r(t)]:void 0}},function(t,e,n){n(84);var r=n(13);r.NodeList=r.HTMLCollection=r.Array},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(e,n){i(this,t),this.x=e,this.y=n}return r(t,[{key:"add",value:function(e){return new t(this.x+e.x,this.y+e.y)}},{key:"subtract",value:function(e){return new t(this.x-e.x,this.y-e.y)}},{key:"multiply",value:function(e){return new t(this.x*e,this.y*e)}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}}]),t}();e["default"]=o,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"],o=n(19)["default"],u=n(8)["default"];Object.defineProperty(e,"__esModule",{value:!0});var s=n(9),a=(u(s),function(){function t(e,n,r){i(this,t),this.bound=e,this.dimensionSelector=n,this.speedTransformer=r}return r(t,null,[{key:"rectangleWalls",value:function(e,n){var r=function(t){return t.x},i=function(t){return t.y},o=function(t){t.speed.x=-1*t.speed.x},u=function(t){t.speed.y=-1*t.speed.y},s=new t(0,i,u),a=new t(n,i,u),c=new t(0,r,o),f=new t(e,r,o);return[s,a,c,f]}}]),r(t,[{key:"timeToHitParticle",value:function(t){var e=this.dimensionSelector(t.position)-this.bound,n=this.dimensionSelector(t.speed);if(0>e*n){var r=Math.abs(this.dimensionSelector(t.position)-this.bound)-t.radius,i=Math.abs(n);return r/i}return o}},{key:"bounceOffParticle",value:function(t){this.speedTransformer(t),t.hits++}},{key:"toString",value:function(){return"Wall "+this.bound}}]),t}());e["default"]=a,t.exports=e["default"]},function(t,e,n){t.exports={"default":n(53),__esModule:!0}},function(t,e,n){t.exports={"default":n(58),__esModule:!0}},function(t,e,n){t.exports={"default":n(59),__esModule:!0}},function(t,e,n){var r=n(10),i=n(2)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=(e=Object(t))[i])?n:o?r(e):"Object"==(u=r(e))&&"function"==typeof e.callee?"Arguments":u}},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){var r=n(13),i=n(2)("iterator");t.exports=function(t){return(r.Array||Array.prototype[i])===t}},function(t,e,n){var r=n(6);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(o){var u=t["return"];throw void 0!==u&&r(u.call(t)),o}}},function(t,e,n){"use strict";var r=n(24),i=n(12),o=n(26),u=n(23),s=n(22),a=n(2)("iterator"),c=n(13),f=!([].keys&&"next"in[].keys()),l="@@iterator",h="keys",p="values",d=function(){return this};t.exports=function(t,e,v,y,g,m,x){n(68)(v,e,y);var w,b,_=function(t){switch(t){case h:return function(){return new v(this,t)};case p:return function(){return new v(this,t)}}return function(){return new v(this,t)}},k=e+" Iterator",S=t.prototype,E=S[a]||S[l]||g&&S[g],P=E||_(g);if(E){var j=n(1).getProto(P.call(new t));n(16)(j,k,!0),!r&&s(S,l)&&u(j,a,d)}if((!r||x)&&u(S,a,P),c[e]=P,c[k]=d,g)if(w={values:g==p?P:_(p),keys:m?P:_(h),entries:g!=p?P:_("entries")},x)for(b in w)b in S||o(S,b,w[b]);else i(i.P+i.F*f,e,w)}},function(t,e,n){var r=n(2)("iterator"),i=!1;try{var o=[7][r]();o["return"]=function(){i=!0},Array.from(o,function(){throw 2})}catch(u){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],u=o[r]();u.next=function(){n=!0},o[r]=function(){return u},t(o)}catch(s){}return n}},function(t,e,n){var r=n(3),i="__core-js_shared__",o=r[i]||(r[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(42),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(e,n,r){i(this,t),this.ctx=e,this.width=n,this.height=r}return r(t,[{key:"drawParticle",value:function(t){var e=t.position;if(e.x>this.width||e.y>this.height)throw"out of board ("+e.x+","+e.y+")";this.ctx.beginPath(),this.ctx.arc(t.position.x,t.position.y,t.radius,0,2*Math.PI,!1),this.ctx.fillStyle="green",this.ctx.fill(),this.ctx.stroke()}},{key:"drawRect",value:function(){this.ctx.beginPath(),this.ctx.rect(0,0,this.width,this.height),this.ctx.stroke()}},{key:"clearRect",value:function(){this.ctx.clearRect(0,0,this.width,this.height)}}]),t}();e["default"]=o,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"],o=n(8)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u=n(9),s=o(u),a=function(){function t(e,n,r,o){i(this,t),this.id=e,this.time=n,this.first=r,this.second=o,this.first instanceof s["default"]&&(this.hitCountFirst=r.hits),this.second instanceof s["default"]&&(this.hitCountSecond=o.hits)}return r(t,[{key:"isValid",value:function(){return this.first instanceof s["default"]&&this.hitCountFirst!=this.first.hits?!1:this.second instanceof s["default"]&&this.hitCountSecond!=this.second.hits?!1:!0}},{key:"toString",value:function(){return"Event "+this.id+" toward time "+this.time+" for "+this.first.toString()+"@"+this.hitCountFirst+" and "+this.second.toString()+"@"+this.hitCountSecond}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"],o=n(8)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u=n(30),s=o(u),a=n(9),c=o(a),f=function(){function t(e,n){i(this,t),this.x=e,this.y=n}return r(t,[{key:"generate",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],n=arguments.length<=1||void 0===arguments[1]?0:arguments[1];if(n>500)return e;var r=function(){var r=Math.random(),i=Math.random(),o=.01,u=new c["default"](10*r+1,new s["default"](t.x*r,t.y*i),new s["default"](r*o,i*o));return t.inside(u)&&!e.some(function(t){return u.overlap(t)})?(e.push(u),{v:t.generate(e,n+1)}):{v:t.generate(e,n+1)}}();return"object"==typeof r?r.v:void 0}},{key:"inside",value:function(t){return t.position.x+t.radius<this.x&&t.position.y+t.radius<this.y&&t.position.x-t.radius>0&&t.position.y-t.radius>0}}]),t}();e["default"]=f,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(5)["default"],i=n(4)["default"],o=n(32)["default"],u=n(19)["default"],s=n(8)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(45),c=s(a),f=n(9),l=s(f),h=n(31),p=(s(h),n(91)),d=s(p),v=function(){function t(e,n,r){i(this,t),this.particles=e,this.walls=n,this.bouncable=e.concat(n),this.log=r,this.clock=0,this.pq=new d["default"](function(t,e){return t.time-e.time}),this.eventId=0}return r(t,[{key:"start",value:function(t){var e=this;this.log("start "+t),this.clock=t,this.particles.forEach(function(t){return e.predict(t)})}},{key:"step",value:function(t){for(this.log("step "+t);this.pq.size>0;){var e=this.pq.peek();if(this.log("get "+e),!(e.time<=t))break;var n=this.pq.remove();n.isValid()?(this.log("resolve "+n),this.play(n)):this.log("invalid "+n)}this.move(t-this.clock),this.clock=t}},{key:"play",value:function(t){this.move(t.time-this.clock),this.clock=t.time,t.second.bounceOffParticle(t.first),this.predict(t.first),t.second instanceof l["default"]&&this.predict(t.second)}},{key:"predict",value:function(t){var e=!0,n=!1,r=void 0;try{for(var i,s=o(this.bouncable);!(e=(i=s.next()).done);e=!0){var a=i.value,f=a.timeToHitParticle(t);if(isNaN(f))throw a+" + "+t+" time NaN";if(f!=u){var l=new c["default"](this.eventId,this.clock+f,t,a);this.pq.add(l),this.log("add "+l),this.eventId++}}}catch(h){n=!0,r=h}finally{try{!e&&s["return"]&&s["return"]()}finally{if(n)throw r}}}},{key:"move",value:function(t){this.log("move "+t),this.particles.forEach(function(e){return e.move(t)})}}]),t}();e["default"]=v,t.exports=e["default"]},function(t,e,n){t.exports={"default":n(52),__esModule:!0}},function(t,e,n){t.exports={"default":n(55),__esModule:!0}},function(t,e,n){t.exports={"default":n(56),__esModule:!0}},function(t,e,n){t.exports={"default":n(57),__esModule:!0}},function(t,e,n){n(18),n(83),t.exports=n(7).Array.from},function(t,e,n){n(29),n(18),t.exports=n(82)},function(t,e,n){n(85),t.exports=9007199254740991},function(t,e,n){var r=n(1);t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(1);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e,n){n(86),n(18),n(29),n(87),t.exports=n(7).Promise},function(t,e,n){n(88),t.exports=n(7).Symbol},function(t,e,n){n(18),n(29),t.exports=n(2)("iterator")},function(t,e,n){var r=n(14),i=n(3).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(1);t.exports=function(t){var e=r.getKeys(t),n=r.getSymbols;if(n)for(var i,o=n(t),u=r.isEnum,s=0;o.length>s;)u.call(t,i=o[s++])&&e.push(i);return e}},function(t,e,n){var r=n(11),i=n(38),o=n(37),u=n(6),s=n(43),a=n(28);t.exports=function(t,e,n,c){var f,l,h,p=a(t),d=r(n,c,e?2:1),v=0;if("function"!=typeof p)throw TypeError(t+" is not iterable!");if(o(p))for(f=s(t.length);f>v;v++)e?d(u(l=t[v])[0],l[1]):d(t[v]);else for(h=p.call(t);!(l=h.next()).done;)i(h,d,l.value,e)}},function(t,e,n){var r={}.toString,i=n(17),o=n(1).getNames,u="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return o(t)}catch(e){return u.slice()}};t.exports.get=function(t){return u&&"[object Window]"==r.call(t)?s(t):o(i(t))}},function(t,e,n){t.exports=n(3).document&&document.documentElement},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(10);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r=n(1),i={};n(23)(i,n(2)("iterator"),function(){return this}),t.exports=function(t,e,o){t.prototype=r.create(i,{next:n(25)(1,o)}),n(16)(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(1),i=n(17);t.exports=function(t,e){for(var n,o=i(t),u=r.getKeys(o),s=u.length,a=0;s>a;)if(o[n=u[a++]]===e)return n}},function(t,e,n){var r,i,o,u=n(3),s=n(79).set,a=u.MutationObserver||u.WebKitMutationObserver,c=u.process,f="process"==n(10)(c),l=function(){var t,e;for(f&&(t=c.domain)&&(c.domain=null,t.exit());r;)e=r.domain,e&&e.enter(),r.fn.call(),e&&e.exit(),r=r.next;i=void 0,t&&t.enter()};if(f)o=function(){c.nextTick(l)};else if(a){var h=1,p=document.createTextNode("");new a(l).observe(p,{characterData:!0}),o=function(){p.data=h=-h}}else o=function(){s.call(u,l)};t.exports=function(t){var e={fn:t,next:void 0,domain:f&&c.domain};i&&(i.next=e),r||(r=e,o()),i=e}},function(t,e,n){var r=n(26);t.exports=function(t,e){for(var n in e)r(t,n,e[n]);return t}},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},function(t,e,n){var r=n(1).getDesc,i=n(14),o=n(6),u=function(t,e){if(o(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=n(11)(Function.call,r(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,n){return u(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:u}},function(t,e,n){var r=n(6),i=n(20),o=n(2)("species");t.exports=function(t,e){var n,u=r(t).constructor;return void 0===u||void 0==(n=r(u)[o])?e:i(n)}},function(t,e,n){"use strict";var r=n(1),i=n(2)("species");t.exports=function(t){!n(15)||i in t||r.setDesc(t,i,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError(n+": use the 'new' operator!");return t}},function(t,e,n){var r=n(42),i=n(21);t.exports=function(t){return function(e,n){var o,u,s=String(i(e)),a=r(n),c=s.length;return 0>a||a>=c?t?"":void 0:(o=s.charCodeAt(a),55296>o||o>56319||a+1===c||(u=s.charCodeAt(a+1))<56320||u>57343?t?s.charAt(a):o:t?s.slice(a,a+2):(o-55296<<10)+(u-56320)+65536)}}},function(t,e,n){"use strict";var r,i,o,u=n(11),s=n(65),a=n(64),c=n(60),f=n(3),l=f.process,h=f.setImmediate,p=f.clearImmediate,d=f.MessageChannel,v=0,y={},g="onreadystatechange",m=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},x=function(t){m.call(t.data)};h&&p||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++v]=function(){s("function"==typeof t?t:Function(t),e)},r(v),v},p=function(t){delete y[t]},"process"==n(10)(l)?r=function(t){l.nextTick(u(m,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=x,r=u(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",x,!1)):r=g in c("script")?function(t){a.appendChild(c("script"))[g]=function(){a.removeChild(this),m.call(t)}}:function(t){setTimeout(u(m,t,1),0)}),t.exports={set:h,clear:p}},function(t,e,n){var r=n(21);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(6),i=n(28);t.exports=n(7).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,n){"use strict";var r=n(11),i=n(12),o=n(80),u=n(38),s=n(37),a=n(43),c=n(28);i(i.S+i.F*!n(40)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,f,l=o(t),h="function"==typeof this?this:Array,p=arguments,d=p.length,v=d>1?p[1]:void 0,y=void 0!==v,g=0,m=c(l);if(y&&(v=r(v,d>2?p[2]:void 0,2)),void 0==m||h==Array&&s(m))for(e=a(l.length),n=new h(e);e>g;g++)n[g]=y?v(l[g],g):l[g];else for(f=m.call(l),n=new h;!(i=f.next()).done;g++)n[g]=y?u(f,v,[i.value,g],!0):i.value;return n.length=g,n}})},function(t,e,n){"use strict";var r=n(81),i=n(69),o=n(13),u=n(17);n(39)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(12);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e){},function(t,e,n){"use strict";var r,i=n(1),o=n(24),u=n(3),s=n(11),a=n(35),c=n(12),f=n(14),l=n(6),h=n(20),p=n(77),d=n(62),v=n(74).set,y=n(73),g=n(76),m=n(2)("species"),x=n(75),w=n(27)("record"),b=n(71),_="Promise",k=u.process,S="process"==a(k),E=u[_],P=function(t){var e=new E(function(){});return t&&(e.constructor=Object),E.resolve(e)===e},j=function(){function t(e){var n=new E(e);return v(n,t.prototype),n}var e=!1;try{if(e=E&&E.resolve&&P(),v(t,E),t.prototype=i.create(E.prototype,{constructor:{value:t}}),t.resolve(5).then(function(){})instanceof t||(e=!1),e&&n(15)){var r=!1;E.resolve(i.setDesc({},"then",{get:function(){r=!0}})),e=r}}catch(o){e=!1}return e}(),O=function(t){return f(t)&&(j?"Promise"==a(t):w in t)},M=function(t,e){return o&&t===E&&e===r?!0:y(t,e)},L=function(t){var e=l(t)[m];return void 0!=e?e:t},N=function(t){var e;return f(t)&&"function"==typeof(e=t.then)?e:!1},A=function(t,e){if(!t.n){t.n=!0;var n=t.c;b(function(){for(var r=t.v,i=1==t.s,o=0,s=function(e){var n,o,u=i?e.ok:e.fail;try{u?(i||(t.h=!0),n=u===!0?r:u(r),n===e.P?e.rej(TypeError("Promise-chain cycle")):(o=N(n))?o.call(n,e.res,e.rej):e.res(n)):e.rej(r)}catch(s){e.rej(s)}};n.length>o;)s(n[o++]);n.length=0,t.n=!1,e&&setTimeout(function(){var e,n,i=t.p;T(i)&&(S?k.emit("unhandledRejection",r,i):(e=u.onunhandledrejection)?e({promise:i,reason:r}):(n=u.console)&&n.error&&n.error("Unhandled promise rejection",r)),t.a=void 0},1)})}},T=function(t){var e,n=t[w],r=n.a||n.c,i=0;if(n.h)return!1;for(;r.length>i;)if(e=r[i++],e.fail||!T(e.P))return!1;return!0},F=function(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),A(e,!0))},D=function(t){var e,n=this;if(!n.d){n.d=!0,n=n.r||n;try{(e=N(t))?b(function(){var r={r:n,d:!1};try{e.call(t,s(D,r,1),s(F,r,1))}catch(i){F.call(r,i)}}):(n.v=t,n.s=1,A(n,!1))}catch(r){F.call({r:n,d:!1},r)}}};j||(E=function(t){h(t);var e={p:p(this,E,_),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};this[w]=e;try{t(s(D,e,1),s(F,e,1))}catch(n){F.call(e,n)}},n(72)(E.prototype,{then:function(t,e){var n={ok:"function"==typeof t?t:!0,fail:"function"==typeof e?e:!1},r=n.P=new(x(this,E))(function(t,e){n.res=t,n.rej=e});h(n.res),h(n.rej);var i=this[w];return i.c.push(n),i.a&&i.a.push(n),i.s&&A(i,!1),r},"catch":function(t){return this.then(void 0,t)}})),c(c.G+c.W+c.F*!j,{Promise:E}),n(16)(E,_),g(E),g(r=n(7)[_]),c(c.S+c.F*!j,_,{reject:function(t){return new this(function(e,n){n(t)})}}),c(c.S+c.F*(!j||P(!0)),_,{resolve:function(t){return O(t)&&M(t.constructor,this)?t:new this(function(e){e(t)})}}),c(c.S+c.F*!(j&&n(40)(function(t){E.all(t)["catch"](function(){})})),_,{all:function(t){var e=L(this),n=[];return new e(function(r,o){d(t,!1,n.push,n);var u=n.length,s=Array(u);u?i.each.call(n,function(t,n){e.resolve(t).then(function(t){s[n]=t,--u||r(s)},o)}):r(s)})},race:function(t){var e=L(this);return new e(function(n,r){d(t,!1,function(t){e.resolve(t).then(n,r)})})}})},function(t,e,n){"use strict";var r=n(1),i=n(3),o=n(22),u=n(15),s=n(12),a=n(26),c=n(36),f=n(41),l=n(16),h=n(27),p=n(2),d=n(70),v=n(63),y=n(61),g=n(67),m=n(6),x=n(17),w=n(25),b=r.getDesc,_=r.setDesc,k=r.create,S=v.get,E=i.Symbol,P=i.JSON,j=P&&P.stringify,O=!1,M=p("_hidden"),L=r.isEnum,N=f("symbol-registry"),A=f("symbols"),T="function"==typeof E,F=Object.prototype,D=u&&c(function(){return 7!=k(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=b(F,e);r&&delete F[e],_(t,e,n),r&&t!==F&&_(F,e,r)}:_,C=function(t){var e=A[t]=k(E.prototype);return e._k=t,u&&O&&D(F,t,{configurable:!0,set:function(e){o(this,M)&&o(this[M],t)&&(this[M][t]=!1),D(this,t,w(1,e))}}),e},I=function(t){return"symbol"==typeof t},R=function(t,e,n){return n&&o(A,e)?(n.enumerable?(o(t,M)&&t[M][e]&&(t[M][e]=!1),n=k(n,{enumerable:w(0,!1)})):(o(t,M)||_(t,M,w(1,{})),t[M][e]=!0),D(t,e,n)):_(t,e,n)},G=function(t,e){m(t);for(var n,r=y(e=x(e)),i=0,o=r.length;o>i;)R(t,n=r[i++],e[n]);return t},q=function(t,e){return void 0===e?k(t):G(k(t),e)},z=function(t){var e=L.call(this,t);return e||!o(this,t)||!o(A,t)||o(this,M)&&this[M][t]?e:!0},W=function(t,e){var n=b(t=x(t),e);return!n||!o(A,e)||o(t,M)&&t[M][e]||(n.enumerable=!0),n},H=function(t){for(var e,n=S(x(t)),r=[],i=0;n.length>i;)o(A,e=n[i++])||e==M||r.push(e);return r},J=function(t){for(var e,n=S(x(t)),r=[],i=0;n.length>i;)o(A,e=n[i++])&&r.push(A[e]);return r},K=function(t){for(var e,n,r=[t],i=1,o=arguments;o.length>i;)r.push(o[i++]);return e=r[1],"function"==typeof e&&(n=e),(n||!g(e))&&(e=function(t,e){return n&&(e=n.call(this,t,e)),I(e)?void 0:e}),r[1]=e,j.apply(P,r)},B=c(function(){var t=E();return"[null]"!=j([t])||"{}"!=j({a:t})||"{}"!=j(Object(t))});T||(E=function(){if(I(this))throw TypeError("Symbol is not a constructor");return C(h(arguments.length>0?arguments[0]:void 0))},a(E.prototype,"toString",function(){return this._k}),I=function(t){return t instanceof E},r.create=q,r.isEnum=z,r.getDesc=W,r.setDesc=R,r.setDescs=G,r.getNames=v.get=H,r.getSymbols=J,u&&!n(24)&&a(F,"propertyIsEnumerable",z,!0));var U={"for":function(t){return o(N,t+="")?N[t]:N[t]=E(t)},keyFor:function(t){return d(N,t)},useSetter:function(){O=!0},useSimple:function(){O=!1}};r.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(t){var e=p(t);U[t]=T?e:C(e)}),O=!0,s(s.G+s.W,{Symbol:E}),s(s.S,"Symbol",U),s(s.S+s.F*!T,"Object",{create:q,defineProperty:R,defineProperties:G,getOwnPropertyDescriptor:W,getOwnPropertyNames:H,getOwnPropertySymbols:J}),P&&s(s.S+s.F*(!T||B),"JSON",{stringify:K}),l(E,"Symbol"),l(Math,"Math",!0),l(i.JSON,"JSON",!0)},function(t,e,n){(function(e){var r="object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this,i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(90),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(u){r.regeneratorRuntime=void 0}t.exports={"default":t.exports,__esModule:!0}}).call(e,function(){return this}())},function(t,e,n){(function(e,r){"use strict";var i=n(33)["default"],o=n(34)["default"],u=n(49)["default"],s=n(51)["default"];!function(e){function n(t,e,n,r){var i=u((e||c).prototype);return i._invoke=v(t,n||null,new m(r||[])),i}function a(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}function c(){}function f(){}function l(){}function h(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function p(t){this.arg=t}function d(t){function e(e,n){var r=t[e](n),i=r.value;return i instanceof p?s.resolve(i.arg).then(o,u):s.resolve(i).then(function(t){return r.value=t,r})}function n(t,n){var r=i?i.then(function(){return e(t,n)}):new s(function(r){r(e(t,n))});return i=r["catch"](function(t){}),r}"object"==typeof r&&r.domain&&(e=r.domain.bind(e));var i,o=e.bind(t,"next"),u=e.bind(t,"throw");e.bind(t,"return");this._invoke=n}function v(t,e,n){var r=P;return function(i,o){if(r===O)throw new Error("Generator is already running");if(r===M){if("throw"===i)throw o;return w()}for(;;){var u=n.delegate;if(u){if("return"===i||"throw"===i&&u.iterator[i]===b){n.delegate=null;var s=u.iterator["return"];if(s){var c=a(s,u.iterator,o);if("throw"===c.type){i="throw",o=c.arg;continue}}if("return"===i)continue}var c=a(u.iterator[i],u.iterator,o);if("throw"===c.type){n.delegate=null,i="throw",o=c.arg;continue}i="next",o=b;var f=c.arg;if(!f.done)return r=j,f;n[u.resultName]=f.value,n.next=u.nextLoc,n.delegate=null}if("next"===i)r===j?n.sent=o:n.sent=b;else if("throw"===i){if(r===P)throw r=M,o;n.dispatchException(o)&&(i="next",o=b)}else"return"===i&&n.abrupt("return",o);r=O;var c=a(t,e,n);if("normal"===c.type){r=n.done?M:j;var f={value:c.arg,done:n.done};if(c.arg!==L)return f;n.delegate&&"next"===i&&(o=b)}else"throw"===c.type&&(r=M,i="throw",o=c.arg)}}}function y(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function g(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function m(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(y,this),this.reset(!0)}function x(t){if(t){var e=t[k];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function i(){for(;++n<t.length;)if(_.call(t,n))return i.value=t[n],i.done=!1,i;return i.value=b,i.done=!0,i};return r.next=r}}return{next:w}}function w(){return{value:b,done:!0}}var b,_=Object.prototype.hasOwnProperty,k="function"==typeof i&&o||"@@iterator",S="object"==typeof t,E=e.regeneratorRuntime;if(E)return void(S&&(t.exports=E));E=e.regeneratorRuntime=S?t.exports:{},E.wrap=n;var P="suspendedStart",j="suspendedYield",O="executing",M="completed",L={},N=l.prototype=c.prototype;f.prototype=N.constructor=l,l.constructor=f,f.displayName="GeneratorFunction",E.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return e?e===f||"GeneratorFunction"===(e.displayName||e.name):!1},E.mark=function(t){return t.__proto__=l,t.prototype=u(N),t},E.awrap=function(t){return new p(t)},h(d.prototype),E.async=function(t,e,r,i){var o=new d(n(t,e,r,i));return E.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},h(N),N[k]=function(){return this},N.toString=function(){return"[object Generator]"},E.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},E.values=x,m.prototype={constructor:m,reset:function(t){if(this.prev=0,this.next=0,this.sent=b,this.done=!1,this.delegate=null,this.tryEntries.forEach(g),!t)for(var e in this)"t"===e.charAt(0)&&_.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=b)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=_.call(i,"catchLoc"),s=_.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&_.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?this.next=i.finallyLoc:this.complete(o),L},complete:function(t,e){if("throw"===t.type)throw t.arg;"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=t.arg,this.next="end"):"normal"===t.type&&e&&(this.next=e)},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),g(n),L}},"catch":function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;g(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,
nextLoc:n},L}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:void 0)}).call(e,function(){return this}(),n(92))},function(t,e,n){"use strict";function r(t,e){for(var n=Math.floor((t.length-2)/2);n>=0;n--)o(t,e,n);return t}function i(t,e,n){for(var r=t[n];n>0;){var i=Math.floor((n-1)/2),o=t[i];if(!(e(r,o)<0))break;t[n]=o,n=i}return t[n]=r,n}function o(t,e,n){for(var r=t[n],i=t.length;i>2*n+1;){var o=2*n+1;if(i-1>o&&e(t[o+1],t[o])<0&&o++,e(r,t[o])<=0)break;t[n]=t[o],n=o}return t[n]=r,n}var u=n(5)["default"],s=n(4)["default"],a=n(33)["default"],c=n(48)["default"],f=n(32)["default"],l=n(34)["default"],h=n(89)["default"];Object.defineProperty(e,"__esModule",{value:!0});var p=a("data"),d=a("compareFunction"),v=function(){function t(e,n){if(s(this,t),"function"!=typeof e)throw new Error("PriorityQueue: no compareFunction defined");this[d]=e,void 0===n?this[p]=[]:this[p]=r(c(n),e)}return u(t,[{key:"add",value:function(t){return this[p].push(t),i(this[p],this[d],this.size-1),this}},{key:"peek",value:function(){return this[p][0]}},{key:"remove",value:function(){var t=this[p][0];return this.size>1?(this[p][0]=this[p].pop(),o(this[p],this[d],0)):this[p].pop(),t}},{key:"delete",value:function(t){for(var e=0;e<this.size-1;e++)if(0===this[d](t,this[p][e])){this[p][e]=this[p].pop();var n=i(this[p],this[d],e);return o(this[p],this[d],n),!0}return 0===this[d](this[p][this.size-1],t)?(this[p].pop(),!0):!1}},{key:"clear",value:function(){this[p]=[]}},{key:"has",value:function(t){for(var e=0;e<this.size;e++)if(0===this[d](t,this[p][e]))return!0;return!1}},{key:"forEach",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,u=f(this);!(n=(o=u.next()).done);n=!0){var s=o.value;t.call(e,s,this)}}catch(a){r=!0,i=a}finally{try{!n&&u["return"]&&u["return"]()}finally{if(r)throw i}}}},{key:l,value:h.mark(function e(){var t;return h.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.size)){e.next=7;break}return e.next=4,this[p][t];case 4:t++,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})},{key:"size",get:function(){return this[p].length}}],[{key:"newNaturalMin",value:function(e){return new t(function(t,e){return e>t?-1:t>e?1:0},e)}},{key:"newNaturalMax",value:function(e){return new t(function(t,e){return e>t?1:t>e?-1:0},e)}}]),t}();e["default"]=v,t.exports=e["default"]},function(t,e){function n(){c=!1,u.length?a=u.concat(a):f=-1,a.length&&r()}function r(){if(!c){var t=setTimeout(n);c=!0;for(var e=a.length;e;){for(u=a,a=[];++f<e;)u&&u[f].run();f=-1,e=a.length}u=null,c=!1,clearTimeout(t)}}function i(t,e){this.fun=t,this.array=e}function o(){}var u,s=t.exports={},a=[],c=!1,f=-1;s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new i(t,e)),1!==a.length||c||setTimeout(r,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}}]);
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.