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