var __awaiter=this&&this.__awaiter||function(n,t,i,a){function e(n){return n instanceof i?n:new i((function(t){t(n)}))}return new(i||(i=Promise))((function(i,r){function o(n){try{f(a.next(n))}catch(n){r(n)}}function c(n){try{f(a["throw"](n))}catch(n){r(n)}}function f(n){n.done?i(n.value):e(n.value).then(o,c)}f((a=a.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,e,r,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(n){return function(t){return f([n,t])}}function f(c){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(a=1,e&&(r=c[0]&2?e["return"]:c[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,c[1])).done)return r;if(e=0,r)c=[c[0]&2,r.value];switch(c[0]){case 0:case 1:r=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;e=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]