diff --git a/build/complexviewer.js b/build/complexviewer.js index df4c5fb..2703505 100644 --- a/build/complexviewer.js +++ b/build/complexviewer.js @@ -12953,7 +12953,7 @@ xiNET.Controller.prototype.setAnnotations = function(annotationChoice) { for (m = 0; m < molCount; m++) { var mol = mols[m]; for (var a = 0; a < mol.annotations.length; a++){ - categories.add(mol.annotations[a].name); + categories.add(mol.annotations[a].description); } } var catCount = categories.values().length; @@ -12961,7 +12961,7 @@ xiNET.Controller.prototype.setAnnotations = function(annotationChoice) { var colourScheme;// = null; if (catCount < 3){catCount = 3;} //~ if (catCount < 21) { - if (catCount < 6) { + if (catCount < 5) { //~ var reversed = colorbrewer.Accent[catCount].slice().reverse(); //~ colourScheme = d3.scale.ordinal().range(reversed); colourScheme = d3.scale.ordinal().range(colorbrewer.Set1[4]); @@ -16760,4 +16760,4 @@ module.exports = UnaryLink; },{"../../controller/Config":7,"./Link":22,"./SequenceLink":25}]},{},[8])(8) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9ncnVudC1icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvY29sb3JicmV3ZXIvY29sb3JicmV3ZXIuanMiLCJub2RlX21vZHVsZXMvY29sb3JicmV3ZXIvaW5kZXguanMiLCJub2RlX21vZHVsZXMvZDMvZDMuanMiLCJub2RlX21vZHVsZXMvaW50ZXJzZWN0aW9uanMvaW50ZXJzZWN0aW9uLmpzIiwibm9kZV9tb2R1bGVzL3BvaW50MmQvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc3Bpbi5qcy9zcGluLmpzIiwic3JjL2NvbnRyb2xsZXIvQ29uZmlnLmpzIiwic3JjL2NvbnRyb2xsZXIvQ29udHJvbGxlci5qcyIsInNyYy9jb250cm9sbGVyL0V4cGFuZC5qcyIsInNyYy9jb250cm9sbGVyL3hp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LmdldChrZXlWYWx1ZSA9IGtleS5jYWxsKGdyb3VwRGF0YSwgbm9kZURhdGEgPSBncm91cERhdGFbaV0sIGkpKSkpIHtcbiAgICAgICAgICAgIGVudGVyTm9kZXNbaV0gPSBkM19zZWxlY3Rpb25fZGF0YU5vZGUobm9kZURhdGEpO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm9kZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgICAgbm9kZS5fX2RhdGFfXyA9IG5vZGVEYXRhO1xuICAgICAgICAgIH1cbiAgICAgICAgICBub2RlQnlLZXlWYWx1ZS5zZXQoa2V5VmFsdWUsIHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoaSA9IC0xOyArK2kgPCBuOyApIHtcbiAgICAgICAgICBpZiAoaSBpbiBrZXlWYWx1ZXMgJiYgbm9kZUJ5S2V5VmFsdWUuZ2V0KGtleVZhbHVlc1tpXSkgIT09IHRydWUpIHtcbiAgICAgICAgICAgIGV4aXROb2Rlc1tpXSA9IGdyb3VwW2ldO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChpID0gLTE7ICsraSA8IG4wOyApIHtcbiAgICAgICAgICBub2RlID0gZ3JvdXBbaV07XG4gICAgICAgICAgbm9kZURhdGEgPSBncm91cERhdGFbaV07XG4gICAgICAgICAgaWYgKG5vZGUpIHtcbiAgICAgICAgICAgIG5vZGUuX19kYXRhX18gPSBub2RlRGF0YTtcbiAgICAgICAgICAgIHVwZGF0ZU5vZGVzW2ldID0gbm9kZTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShub2RlRGF0YSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAoO2kgPCBtOyArK2kpIHtcbiAgICA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AgICAgICAgICAgIH07XG4gICAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSkudHdlZW4oXCJ6b29tOnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgZHggPSBzaXplWzBdLCBkeSA9IHNpemVbMV0sIGN4ID0gY2VudGVyMCA/IGNlbnRlcjBbMF0gOiBkeCAvIDIsIGN5ID0gY2VudGVyMCA/IGNlbnRlcjBbMV0gOiBkeSAvIDIsIGkgPSBkMy5pbnRlcnBvbGF0ZVpvb20oWyAoY3ggLSB2aWV3LngpIC8gdmlldy5rLCAoY3kgLSB2aWV3LnkpIC8gdmlldy5rLCBkeCAvIHZpZXcuayBdLCBbIChjeCAtIHZpZXcxLngpIC8gdmlldzEuaywgKGN5IC0gdmlldzEueSkgLyB2aWV3MS5rLCBkeCAvIHZpZXcxLmsgXSk7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB2YXIgbCA9IGkodCksIGsgPSBkeCAvIGxbMl07XG4gICAgICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldyA9IHtcbiAgICAgICAgICAgICAgICB4OiBjeCAtIGxbMF0gKiBrLFxuICAgICAgICAgICAgICAgIHk6IGN5IC0gbFsxXSAqIGssXG4gICAgICAgICAgICAgICAgazoga1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiaW50ZXJydXB0Lnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3O1xuICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH07XG4gICAgem9vbS50cmFuc2xhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIHZpZXcueCwgdmlldy55IF07XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiArX1swXSxcbiAgICAgICAgeTogK19bMV0sXG4gICAgICAgIGs6IHZpZXcua1xuICAgICAgfTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZpZXcuaztcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6IHZpZXcueCxcbiAgICAgICAgeTogdmlldy55LFxuICAgICAgICBrOiBudWxsXG4gICAgICB9O1xuICAgICAgc2NhbGVUbygrXyk7XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGVFeHRlbnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZUV4dGVudDtcbiAgICAgIHNjYWxlRXh0ZW50ID0gXyA9PSBudWxsID8gZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5IDogWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjZW50ZXI7XG4gICAgICBjZW50ZXIgPSBfICYmIFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2l6ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7XG4gICAgICBzaXplID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLmR1cmF0aW9uID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZHVyYXRpb247XG4gICAgICBkdXJhdGlvbiA9ICtfO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnggPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgxID0gejtcbiAgICAgIHgwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnkgPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MTtcbiAgICAgIHkxID0gejtcbiAgICAgIHkwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICBmdW5jdGlvbiBsb2NhdGlvbihwKSB7XG4gICAgICByZXR1cm4gWyAocFswXSAtIHZpZXcueCkgLyB2aWV3LmssIChwWzFdIC0gdmlldy55KSAvIHZpZ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lKHJlcXVlc3QucmVzcG9uc2VUZXh0LCBmKTtcbiAgICAgIH07XG4gICAgfVxuICAgIGRzdi5wYXJzZSA9IGZ1bmN0aW9uKHRleHQsIGYpIHtcbiAgICAgIHZhciBvO1xuICAgICAgcmV0dXJuIGRzdi5wYXJzZVJvd3ModGV4dCwgZnVuY3Rpb24ocm93LCBpKSB7XG4gICAgICAgIGlmIChvKSByZXR1cm4gbyhyb3csIGkgLSAxKTtcbiAgICAgICAgdmFyIGEgPSBuZXcgRnVuY3Rpb24oXCJkXCIsIFwicmV0dXJuIHtcIiArIHJvdy5tYXAoZnVuY3Rpb24obmFtZSwgaSkge1xuICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShuYW1lKSArIFwiOiBkW1wiICsgaSArIFwiXVwiO1xuICAgICAgICB9KS5qb2luKFwiLFwiKSArIFwifVwiKTtcbiAgICAgICAgbyA9IGYgPyBmdW5jdGlvbihyb3csIGkpIHtcbiAgICAgICAgICByZXR1cm4gZihhKHJvdyksIGkpO1xuICAgICAgICB9IDogYTtcbiAgICAgIH0pO1xuICAgIH07XG4gICAgZHN2LnBhcnNlUm93cyA9IGZ1bmN0aW9uKHRleHQsIGYpIHtcbiAgICAgIHZhciBFT0wgPSB7fSwgRU9GID0ge30sIHJvd3MgPSBbXSwgTiA9IHRleHQubGVuZ3RoLCBJID0gMCwgbiA9IDAsIHQsIGVvbDtcbiAgICAgIGZ1bmN0aW9uIHRva2VuKCkge1xuICAgICAgICBpZiAoSSA+PSBOKSByZXR1cm4gRU9GO1xuICAgICAgICBpZiAoZW9sKSByZXR1cm4gZW9sID0gZmFsc2UsIEVPTDtcbiAgICAgICAgdmFyIGogPSBJO1xuICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGopID09PSAzNCkge1xuICAgICAgICAgIHZhciBpID0gajtcbiAgICAgICAgICB3aGlsZSAoaSsrIDwgTikge1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpKSA9PT0gMzQpIHtcbiAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhaztcbiAgICAgICAgICAgICAgKytpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBJID0gaSArIDI7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoaSArIDEpO1xuICAgICAgICAgIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDIpID09PSAxMCkgKytJO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyA9PT0gMTApIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGogKyAxLCBpKS5yZXBsYWNlKC9cIlwiL2csICdcIicpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChJIDwgTikge1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KEkrKyksIGsgPSAxO1xuICAgICAgICAgIGlmIChjID09PSAxMCkgZW9sID0gdHJ1ZTsgZWxzZSBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KEkpID09PSAxMCkgKytJLCArK2s7XG4gICAgICAgICAgfSBlbHNlIGlmIChjICE9PSBkZWxpbWl0ZXJDb2RlKSBjb250aW51ZTtcbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqLCBJIC0gayk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQuc2xpY2Uoaik7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKHQgPSB0b2tlbigpKSAhPT0gRU9GKSB7XG4gICAgICAgIHZhciBhID0gW107XG4gICAgICAgIHdoaWxlICh0ICE9PSBFT0wgJiYgdCAhPT0gRU9GKSB7XG4gICAgICAgICAgYS5wdXNoKHQpO1xuICAgICAgICAgIHQgPSB0b2tlbigpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmICYmIChhID0gZihhLCBuKyspKSA9PSBudWxsKSBjb250aW51ZTtcbiAgICAgICAgcm93cy5wdXNoKGEpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHJvd3M7XG4gICAgfTtcbiAgICBkc3YuZm9ybWF0ID0gZnVuY3Rpb24ocm93cykge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkocm93c1swXSkpIHJldHVybiBkc3YuZm9ybWF0Um93cyhyb3dzKTtcbiAgICAgIHZhciBmaWVsZFNldCA9IG5ldyBkM19TZXQoKSwgZmllbGRzID0gW107XG4gICAgICByb3dzLmZvckVhY2goZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIGZvciAodmFyIGZpZWxkIGluIHJvdykge1xuICAgICAgICAgIGlmICghZmllbGRTZXQuaGFzKGZpZWxkKSkge1xuICAgICAgICAgICAgZmllbGRzLnB1c2goZmllbGRTZXQuYWRkKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBbIGZpZWxkcy5tYXAoZm9ybWF0VmFsdWUpLmpvaW4oZGVsaW1pdGVyKSBdLmNvbmNhdChyb3dzLm1hcChmdW5jdGlvbihyb3cpIHtcbiAgICAgICAgcmV0dXJuIGZpZWxkcy5tYXAoZnVuY3Rpb24oZmllbGQpIHtcbiAgICAgICAgICByZXR1cm4gZm9ybWF0VmFsdWUocm93W2ZpZWxkXSk7XG4gICAgICAgIH0pLmpvaW4oZGVsaW1pdGVyKTtcbiAgICAgIH0pKS5qb2luKFwiXFxuXCIpO1xuICAgIH07XG4gICAgZHN2LmZvcm1hdFJvd3MgPSBmdW5jdGlvbihyb3dzKSB7XG4gICAgICByZXR1cm4gcm93cy5tYXAoZm9ybWF0Um93KS5qb2luKFwiXFxuXCIpO1x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kge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGQzX2RhdGUgPSBkM19kYXRlX3V0YztcbiAgICAgICAgICB2YXIgdXRjID0gbmV3IGQzX2RhdGUoKTtcbiAgICAgICAgICB1dGMuXyA9IGRhdGU7XG4gICAgICAgICAgcmV0dXJuIGxvY2FsKHV0Yyk7XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgZDNfZGF0ZSA9IERhdGU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGQzX2RhdGUgPSBkM19kYXRlX3V0YztcbiAgICAgICAgICB2YXIgZGF0ZSA9IGxvY2FsLnBhcnNlKHN0cmluZyk7XG4gICAgICAgICAgcmV0dXJuIGRhdGUgJiYgZGF0ZS5fO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIGQzX2RhdGUgPSBEYXRlO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZm9ybWF0LnRvU3RyaW5nID0gbG9jYWwudG9TdHJpbmc7XG4gICAgICByZXR1cm4gZm9ybWF0O1xuICAgIH07XG4gICAgZDNfdGltZV9mb3JtYXQubXVsdGkgPSBkM190aW1lX2Zvcm1hdC51dGMubXVsdGkgPSBkM190aW1lX2Zvcm1hdE11bHRpO1xuICAgIHZhciBkM190aW1lX3BlcmlvZExvb2t1cCA9IGQzLm1hcCgpLCBkM190aW1lX2RheVJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfZGF5cyksIGQzX3RpbWVfZGF5TG9va3VwID0gZDNfdGltZV9mb3JtYXRMb29rdXAobG9jYWxlX2RheXMpLCBkM190aW1lX2RheUFiYnJldlJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfc2hvcnREYXlzKSwgZDNfdGltZV9kYXlBYmJyZXZMb29rdXAgPSBkM190aW1lX2Zvcm1hdExvb2t1cChsb2NhbGVfc2hvcnREYXlzKSwgZDNfdGltZV9tb250aFJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfbW9udGhzKSwgZDNfdGltZV9tb250aExvb2t1cCA9IGQzX3RpbWVfZm9ybWF0TG9va3VwKGxvY2FsZV9tb250aHMpLCBkM190aW1lX21vbnRoQWJicmV2UmUgPSBkM190aW1lX2Zvcm1hdFJlKGxvY2FsZV9zaG9ydE1vbnRocyksIGQzX3RpbWVfbW9udGhBYmJyZXZMb29rdXAgPSBkM190aW1lX2Zvcm1hdExvb2t1cChsb2NhbGVfc2hvcnRNb250aHMpO1xuICAgIGxvY2FsZV9wZXJpb2RzLmZvckVhY2goZnVuY3Rpb24ocCwgaSkge1xuICAgICAgZDNfdGltZV9wZXJpb2RMb29rdXAuc2V0KHAudG9Mb3dlckNhc2UoKSwgaSk7XG4gICAgfSk7XG4gICAgdmFyIGQzX3RpbWVfZm9ybWF0cyA9IHtcbiAgICAgIGE6IGZ1bmN0aW9uKGQpIHtcbiAgICAgICAgcmV0dXJuIGxvY2FsZV9zaG9ydERheXNbZC5nZXREYXkoKV07XG4gICAgICB9LFxuICAgICAgQTogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gbG9jYWxlX2RheXNbZC5nZXREYXkoKV07XG4gICAgICB9LFxuICAgICAgYjogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gbG9jYWxlX3Nob3J0TW9udGhzW2QuZ2V0TW9udGgoKV07XG4gICAgICB9LFxuICAgICAgQjogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gbG9jYWxlX21vbnRoc1tkLmdldE1vbnRoKCldO1xuICAgICAgfSxcbiAgICAgIGM6IGQzX3RpbWVfZm9ybWF0KGxvY2FsZV9kYXRlVGltZSksXG4gICAgICBkOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldERhdGUoKSwgcCwgMik7XG4gICAgICB9LFx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gMTgwO1xuICAgICAgICBpZiAoYW50aW1lcmlkaWFuIF4gKHMgKiDOu18gPCDOu2kgJiYgzrtpIDwgcyAqIM67KSkge1xuICAgICAgICAgIHZhciDPhmkgPSBpbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpID4gz4YxKSDPhjEgPSDPhmk7XG4gICAgICAgIH0gZWxzZSBpZiAozrtpID0gKM67aSArIDM2MCkgJSAzNjAgLSAxODAsIGFudGltZXJpZGlhbiBeIChzICogzrtfIDwgzrtpICYmIM67aSA8IHMgKiDOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gLWluZmxlY3Rpb25bMV0gKiBkM19kZWdyZWVzO1xuICAgICAgICAgIGlmICjPhmkgPCDPhjApIM+GMCA9IM+GaTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoz4YgPCDPhjApIM+GMCA9IM+GO1xuICAgICAgICAgIGlmICjPhiA+IM+GMSkgz4YxID0gz4Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFudGltZXJpZGlhbikge1xuICAgICAgICAgIGlmICjOuyA8IM67Xykge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM67MSA+PSDOuzApIHtcbiAgICAgICAgICAgIGlmICjOuyA8IM67MCkgzrswID0gzrs7XG4gICAgICAgICAgICBpZiAozrsgPiDOuzEpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAozrsgPiDOu18pIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgcDAgPSBwLCDOu18gPSDOuztcbiAgICB9XG4gICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgYm91bmQucG9pbnQgPSBsaW5lUG9pbnQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVFbmQoKSB7XG4gICAgICByYW5nZVswXSA9IM67MCwgcmFuZ2VbMV0gPSDOuzE7XG4gICAgICBib3VuZC5wb2ludCA9IHBvaW50O1xuICAgICAgcDAgPSBudWxsO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nUG9pbnQozrssIM+GKSB7XG4gICAgICBpZiAocDApIHtcbiAgICAgICAgdmFyIGTOuyA9IM67IC0gzrtfO1xuICAgICAgICBkzrtTdW0gKz0gYWJzKGTOuykgPiAxODAgPyBkzrsgKyAoZM67ID4gMCA/IDM2MCA6IC0zNjApIDogZM67O1xuICAgICAgfSBlbHNlIM67X18gPSDOuywgz4ZfXyA9IM+GO1xuICAgICAgZDNfZ2VvX2FyZWEucG9pbnQozrssIM+GKTtcbiAgICAgIGxpbmVQb2ludCjOuywgz4YpO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nU3RhcnQoKSB7XG4gICAgICBkM19nZW9fYXJlYS5saW5lU3RhcnQoKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ0VuZCgpIHtcbiAgICAgIHJpbmdQb2ludCjOu19fLCDPhl9fKTtcbiAgICAgIGQzX2dlb19hcmVhLmxpbmVFbmQoKTtcbiAgICAgIGlmIChhYnMoZM67U3VtKSA+IM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A8IG47ICsraSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQubi54LCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGlzU3ViamVjdCkge1xuICAgICAgICAgICAgcG9pbnRzID0gY3VycmVudC5wLno7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gcG9pbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSBsaXN0ZW5lci5wb2ludCgocG9pbnQgPSBwb2ludHNbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGludGVycG9sYXRlKGN1cnJlbnQueCwgY3VycmVudC5wLngsIC0xLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LnA7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubztcbiAgICAgICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgICAgICBpc1N1YmplY3QgPSAhaXNTdWJqZWN0O1xuICAgICAgfSB3aGlsZSAoIWN1cnJlbnQudik7XG4gICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwUG9seWdvbkxpbmtDaXJjdWxhcihhcnJheSkge1xuICAgIGlmICghKG4gPSBhcnJheS5sZW5ndGgpKSByZXR1cm47XG4gICAgdmFyIG4sIGkgPSAwLCBhID0gYXJyYXlbMF0sIGI7XG4gICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgIGEubiA9IGIgPSBhcnJheVtpXT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SBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBzcGhlcmU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25TdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gcG9pbnQozrssIM+GKSB7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICBpZiAocG9pbnRWaXNpYmxlKM67ID0gcG9pbnRbMF0sIM+GID0gcG9pbnRbMV0pKSBsaXN0ZW5lci5wb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcG9pbnRMaW5lKM67LCDPhikge1xuICAgICAgICB2YXIgcG9pbnQgPSByb3RhdGUozrssIM+GKTtcbiAgICAgICAgbGluZS5wb2ludChwb2ludFswXSwgcG9pbnRbMV0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnRMaW5lO1xuICAgICAgICBsaW5lLmxpbmVTdGFydCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZUVuZCgpIHtcbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50O1xuICAgICAgICBsaW5lLmxpbmVFbmQoKTtcbiAgICAgIH1cbiAgICAgIHZhciBzZWdtZW50cztcbiAgICAgIHZhciBidWZmZXIgPSBkM19nZW9fY2xpcEJ1ZmZlckxpc3RlbmVyKCksIHJpbmdMaXN0ZW5lciA9IGNsaXBMaW5lKGJ1ZmZlciksIHBvbHlnb25TdGFydGVkID0gZmFsc2Us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DPhjAgPSAoz4YwICsgz4YxKSAvIDIgPiAwID8gaGFsZs+AIDogLWhhbGbPgCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MCwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MSwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHPOuzAgIT09IHPOuzEgJiYgZM67ID49IM+AKSB7XG4gICAgICAgICAgaWYgKGFicyjOuzAgLSBzzrswKSA8IM61KSDOuzAgLT0gc867MCAqIM61O1xuICAgICAgICAgIGlmIChhYnMozrsxIC0gc867MSkgPCDOtSkgzrsxIC09IHPOuzEgKiDOtTtcbiAgICAgICAgICDPhjAgPSBkM19nZW9fY2xpcEFudGltZXJpZGlhbkludGVyc2VjdCjOuzAsIM+GMCwgzrsxLCDPhjEpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGxpc3RlbmVyLnBvaW50KM67MCA9IM67MSwgz4YwID0gz4YxKTtcbiAgICAgICAgc867MCA9IHPOuzE7XG4gICAgICB9LFxuICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgzrswID0gz4YwID0gTmFOO1xuICAgICAgfSxcbiAgICAgIGNsZWFuOiBmdW5jdGlvbigpIHtcb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XJuIHtcbiAgICAgICAgbGluZVN0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2MDAgPSB2MCA9IGZhbHNlO1xuICAgICAgICAgIGNsZWFuID0gMTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9pbnQ6IGZ1bmN0aW9uKM67LCDPhikge1xuICAgICAgICAgIHZhciBwb2ludDEgPSBbIM67LCDPhiBdLCBwb2ludDIsIHYgPSB2aXNpYmxlKM67LCDPhiksIGMgPSBzbWFsbFJhZGl1cyA/IHYgPyAwIDogY29kZSjOuywgz4YpIDogdiA/IGNvZGUozrsgKyAozrsgPCAwID8gz4AgOiAtz4ApLCDPhikgOiAwO1xuICAgICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBpZiAoZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MCwgcG9pbnQyKSB8fCBkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQxLCBwb2ludDIpKSB7XG4gICAgICAgICAgICAgIHBvaW50MVswXSArPSDOtTtcbiAgICAgICAgICAgICAgcG9pbnQxWzFdICs9IM61O1xuICAgICAgICAgICAgICB2ID0gdmlzaWJsZShwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm90SGVtaXNwaGVyZSAmJiBwb2ludDAgJiYgc21hbGxSYWRpdXMgXiB2KSB7XG4gICAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICAgIGlmIChzbWFsbFJhZGl1cykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAg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dDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHgxIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkwIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkxIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgaWYgKHQwID4gMCkgbGluZS5hID0ge1xuICAgICAgICB4OiBheCArIHQwICogZHgsXG4gICAgICAgIHk6IGF5ICsgdDAgKiBkeVxuICAgICAgfTtcbiAgICAgIGlmICh0MSA8IDEpIGxpbmUuYiA9IHtcbiAgIC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AgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIGQzX2dlb19jbGlwUG9seWdvbihzZWdtZW50cywgY29tcGFyZSwgY2xpcFN0YXJ0SW5zaWRlLCBpbnRlcnBvbGF0ZSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSByaW5nID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGluc2lkZVBvbHlnb24ocCkge1xuICAgICAgICB2YXIgd24gPSAwLCBuID0gcG9seWdvbi5sZW5ndGgsIHkgPSBwWzFdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAxLCB2ID0gcG9seWdvbltpXSwgbSA9IHYubGVuZ3RoLCBhID0gdlswXSwgYjsgaiA8IG07ICsraikge1xuICAgICAgICAgICAgYiA9IHZbal07XG4gICAgICAgICAgICBpZiAoYVsxXSA8PSB5KSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdID4geSAmJiBkM19jcm9zczJkKGEsIGIsIHApID4gMCkgKyt3bjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdIDw9IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA8IDApIC0td247XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHduICE9PSAwO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW50ZXJwb2xhdGUoZnJvbSwgdG8sIGRpcmVjdGlvbiwgbGlzdGVuZXIpIHtcbiAgIC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cbiAgICAgICAgICAgICAgICB4OiB4XyxcbiAgICAgICAgICAgICAgICB5OiB5X1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBiOiB7XG4gICAgICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgICAgICB5OiB5XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY2xpcExpbmUobCkpIHtcbiAgICAgICAgICAgICAgaWYgKCF2Xykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYS54LCBsLmEueSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5iLngsIGwuYi55KTtcbiAgICAgICAgICAgICAgaWYgKCF2KSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB4XyA9IHgsIHlfID0geSwgdl8gPSB2O1xuICAgICAgfVxuICAgICAgcmV0dXJuIGNsaXA7XG4gICAgfTtcbiAgICBmdW5jdGlvbiBjb3JuZXIocCwgZGlyZWN0aW9uKSB7XG4gICAgICByZXR1cm4gYWJzKHBbMF0gLSB4MCkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAwIDogMyA6IGFicyhwWzBdIC0geDEpIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMiA6IDEgOiBhYnMocFsxXSAtIHkwKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDEgOiA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ICAgIHZhciB2YiA9IGVkZ2UuYjtcbiAgICBpZiAodmIpIHJldHVybiB0cnVlO1xuICAgIHZhciB2YSA9IGVkZ2UuYSwgeDAgPSBleHRlbnRbMF1bMF0sIHgxID0gZXh0ZW50WzFdWzBdLCB5MCA9IGV4dGVudFswXVsxXSwgeTEgPSBleHRlbnRbMV1bMV0sIGxTaXRlID0gZWRnZS5sLCByU2l0ZSA9IGVkZ2UuciwgbHggPSBsU2l0ZS54LCBseSA9IGxTaXRlLnksIHJ4ID0gclNpdGUueCwgcnkgPSByU2l0ZS55LCBmeCA9IChseCArIHJ4KSAvIDIsIGZ5ID0gKGx5ICsgcnkpIC8gMiwgZm0sIGZiO1xuICAgIGlmIChyeSA9PT0gbHkpIHtcbiAgICAgIGlmIChmeCA8IHgwIHx8IGZ4ID49IHgxKSByZXR1cm47XG4gICAgICBpZiAobHggPiByeCkge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MFxuICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgIHZiID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkxXG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MVxuICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgdmIgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTBcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZm0gPSAobHggLSByeCkgLyAocnkgLSBseSk7XG4gICAgICBmYiA9IGZ5IC0gZm0gKiBmeDtcbiAgICAgIGlmIChmbSA8IC0xIHx8IGZtID4gMSkge1xuICAgICAgICBpZiAobHggPiByeCkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPj0geTEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPCB5MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChseSA8IHJ5KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPj0geDEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA8IHgwKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgIC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IH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJlZCA9IG5vZGUuQztcbiAgICAgICAgbm9kZSA9IG5leHQ7XG4gICAgICB9XG4gICAgICBpZiAobm9kZSkgbm9kZS5VID0gcGFyZW50O1xuICAgICAgaWYgKHJlZCkgcmV0dXJuO1xuICAgICAgaWYgKG5vZGUgJiYgbm9kZS5DKSB7XG4gICAgICAgIG5vZGUuQyA9IGZhbHNlO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBkbyB7XG4gICAgICAgIGlmIChub2RlID09PSB0aGlzLl8pIGJyZWFrO1xuICAgICAgICBpZiAobm9kZSA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5SIHx8ICFzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuTCB8fCAhc2libGluZy5MLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTt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4MV8gPSB4MSwgeTFfID0geTEsIHgyXyA9IHgyLCB5Ml8gPSB5MjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgyXyA9IHkyXyA9IC0oeDFfID0geTFfID0gSW5maW5pdHkpO1xuICAgICAgICB4cyA9IFtdLCB5cyA9IFtdO1xuICAgICAgICBuID0gZGF0YS5sZW5ndGg7XG4gICAgICAgIGlmIChjb21wYXQpIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBkID0gZGF0YVtpXTtcbiAgICAgICAgICBpZiAoZC54IDwgeDFfKSB4MV8gPSBkLng7XG4gICAgICAgICAgaWYgKGQueSA8IHkxXykgeTFfID0gZC55O1xuICAgICAgICAgIGlmIChkLnggPiB4Ml8pIHgyXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55ID4geTJfKSB5Ml8gPSBkLnk7XG4gICAgICAgICAgeHMucHVzaChkLngpO1xuICAgICAgICAgIHlzLnB1c2goZC55KTtcbiAgICAgICAgfSBlbHNlIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICB2YXIgeF8gPSArZngoZCA9IGRhdGFbaV0sIGkpLCB5XyA9ICtmeShkLCBpKTtcbiAgICAgICAgICBpZiAoeF8gPCB4MV8pIHgxXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA8IHkxXykgeTFfID0geV87XG4gICAgICAgICAgaWYgKHhfID4geDJfKSB4Ml8gPSB4XztcbiAgICAgICAgICBpZiAoeV8gPiB5Ml8pIHkyXyA9IHlfO1xuICAgICAgICAgIHhzLnB1c2goeF8pO1xuICAgICAgICAgIHlzLnB1c2goeV8pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgZHggPSB4Ml8gLSB4MV8sIGR5ID0geTJfIC0geTFfO1xuICAgICAgaWYgKGR4ID4gZHkpIHkyXyA9IHkxXyArIGR4OyBlbHNlIHgyXyA9IHgxXyArIGR5O1xuICAgICAgZnVuY3Rpb24gaW5zZXJ0KG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKSB7XG4gICAgICAgIGlmIChpc05hTih4KSB8fCBpc05hTih5KSkgcmV0dXJuO1xuICAgICAgICBpZiAobi5sZWFmKSB7XG4gICAgICAgICAgdmFyIG54ID0gbi54LCBueSA9IG4ueTtcbiAgICAgICAgICBpZiAobnggIT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKGFicyhueCAtIHgpICsgYWJzKG55IC0geSkgPCAuMDEpIHtcbiAgICAgICAgICAgICAgaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIG5Qb2ludCA9IG4ucG9pbnQ7XG4gICAgICAgICAgICAgIG4ueCA9IG4ueSA9IG4ucG9pbnQgPSBudWxsO1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBuUG9pbnQsIG54LCBueSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG4ueCA9IHgsIG4ueSA9IHksIG4ucG9pbnQgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKSB7XG4gICAgICAgIHZhciB4bSA9ICh4MSArIHgyKSAqIC41LCB5bSA9ICh5MSArIHkyKSAqIC41LCByaWdodCA9IHggPj0geG0sIGJlbG93ID0geSA+PSB5bSwgaSA9IGJlbG93IDw8IDEgfCByaWdodDt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i5zbGljZShiaSwgYnMpO1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICAgIH1cbiAgICAgIGlmICgoYW0gPSBhbVswXSkgPT09IChibSA9IGJtWzBdKSkge1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBibTsgZWxzZSBzWysraV0gPSBibTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHNbKytpXSA9IG51bGw7XG4gICAgICAgIHEucHVzaCh7XG4gICAgICAgICAgaTogaSxcbiAgICAgICAgICB4OiBkM19pbnRlcnBvbGF0ZU51bWJlcihhbSwgYm0pXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgYmkgPSBkM19pbnRlcnBvbGF0ZV9udW1iZXJCLmxhc3RJbmRleDtcbiAgICB9XG4gICAgaWYgKGJpIDwgYi5sZW5ndGgpIHtcbiAgICAgIGJzID0gYi5zbGljZShiaSk7XG4gICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICB9XG4gICAgcmV0dXJuIHMubGVuZ3RoIDwgMiA/IHFbMF0gPyAoYiA9IHFbMF0ueCwgZnVuY3Rpb24odCkge1xuICAgICAgcmV0dXJuIGIodCkgKyBcIlwiO1xuICAgIH0pIDogZnVuY3Rpb24oKSB7XG4gICAgICByZXR1cm4gYjtcbiAgICB9IDogKGIgPSBxLmxlbmd0aCwgZnVuY3Rpb24odCkge1xuICAgICAgZm9yICh2YXIgaSA9IDAsIG87IGkgPCBiOyArK2kpIHNbKG8gPSBxW2ldKS5pXSA9IG8ueCh0KTtcbiAgICAgIHJldHVybiBzLmpvaW4oXCJcIik7XG4gICAgfSk7XG4gIH1cbiAgdmFyIGQzX2ludGVycG9sYXRlX251bWJlckEgPSAvWy0rXT8oPzpcXGQrXFwuP1xcZCp8XFwuP1xcZCspKD86W2VFXVstK10/XFxkKyk/L2csIGQzX2ludGVycG9sYXRlX251bWJlckIgPSBu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AgcmV0dXJuIHNoYXJlZE5vZGU7XG4gIH1cbiAgZDMubGF5b3V0LmNob3JkID0gZnVuY3Rpb24oKSB7XG4gICAgdmFyIGNob3JkID0ge30sIGNob3JkcywgZ3JvdXBzLCBtYXRyaXgsIG4sIHBhZGRpbmcgPSAwLCBzb3J0R3JvdXBzLCBzb3J0U3ViZ3JvdXBzLCBzb3J0Q2hvcmRzO1xuICAgIGZ1bmN0aW9uIHJlbGF5b3V0KCkge1xuICAgICAgdmFyIHN1Ymdyb3VwcyA9IHt9LCBncm91cFN1bXMgPSBbXSwgZ3JvdXBJbmRleCA9IGQzLnJhbmdlKG4pLCBzdWJncm91cEluZGV4ID0gW10sIGssIHgsIHgwLCBpLCBqO1xuICAgICAgY2hvcmRzID0gW107XG4gICAgICBncm91cHMgPSBbXTtcbiAgICAgIGsgPSAwLCBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICB4ID0gMCwgaiA9IC0xO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHggKz0gbWF0cml4W2ldW2pdO1xuICAgICAgICB9XG4gICAgICAgIGdyb3VwU3Vtcy5wdXNoKHgpO1xuICAgICAgICBzdWJncm91cEluZGV4LnB1c2goZDMucmFuZ2UobikpO1xuICAgICAgICBrICs9IHg7XG4gICAgICB9XG4gICAgICBpZiAoc29ydEdyb3Vwcykge1xuICAgICAgICBncm91cEluZGV4LnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgIHJldHVybiBzb3J0R3JvdXBzKGdyb3VwU3Vtc1thXSwgZ3JvdXBTdW1zW2JdKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBpZiAoc29ydFN1Ymdyb3Vwcykge1xuICAgICAgICBzdWJncm91cEluZGV4LmZvckVhY2goZnVuY3Rpb24oZCwgaSkge1xuICAgICAgICAgIGQuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gc29ydFN1Ymdyb3VwcyhtYXRyaXhbaV1bYV0sIG1hdHJpeFtpXVtiXSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgayA9ICjPhCAtIHBhZGRpbmcgKiBuKSAvIGs7XG4gICAgICB4ID0gMCwgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgeDAgPSB4LCBqID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIGRpID0gZ3JvdXBJbmRleFtpXSwgZGogPSBzdWJncm91cEluZGV4W2RpXVtqXSwgdiA9IG1hdHJpeFtkaV1bZGpdLCBhMCA9IHgsIGExID0geCArPSB2ICogaztcbiAgICAgICAgICBzdWJncm91cHNbZGkgKyBcIi1cIiArIGRqXSA9IHtcbiAgICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICAgIHN1YmluZGV4OiBkaixcbiAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGEwLFxuICAgICAgICAgICAgZW5kQW5nbGU6IGExLFxuICAgICAgICAgICAgdmFsdWU6IHZcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGdyb3Vwc1tkaV0gPSB7XG4gICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IHgwLFxuICAgICAgICAgIGVuZEFuZ2xlOiB4LFxuICAgICAgICAgIHZhbHVlOiBncm91cFN1bXNbZGldXG4gICAgICAgIH07XG4gICAgICAgIHggKz0gcGFkZGluZztcbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGogPSBpIC0gMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgc291cmNlID0gc3ViZ3JvdXBzW2kgKyBcIi1cIiArIGpdLCB0YXJnZXQgPSBzdWJncm91cHNbaiArIFwiL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mFyIGsgPSBxdWFkLnBvaW50Q2hhcmdlIC8gZG47XG4gICAgICAgICAgICBub2RlLnB4IC09IGR4ICogaztcbiAgICAgICAgICAgIG5vZGUucHkgLT0gZHkgKiBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gIXF1YWQuY2hhcmdlO1xuICAgICAgfTtcbiAgICB9XG4gICAgZm9yY2UudGljayA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKChhbHBoYSAqPSAuOTkpIDwgLjAwNSkge1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHZhciBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCBxLCBpLCBvLCBzLCB0LCBsLCBrLCB4LCB5O1xuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIHMgPSBvLnNvdXJjZTtcbiAgICAgICAgdCA9IG8udGFyZ2V0O1xuICAgICAgICB4ID0gdC54IC0gcy54O1xuICAgICAgICB5ID0gdC55IC0gcy55O1xuICAgICAgICBpZiAobCA9IHggKiB4ICsgeSAqIHkpIHtcbiAgICAgICAgICBsID0gYWxwaGEgKiBzdHJlbmd0aHNbaV0gKiAoKGwgPSBNYXRoLnNxcnQobCkpIC0gZGlzdGFuY2VzW2ldKSAvIGw7XG4gICAgICAgICAgeCAqPSBsO1xuICAgICAgICAgIHkgKj0gbDtcbiAgICAgICAgICB0LnggLT0geCAqIChrID0gcy53ZWlnaHQgKyB0LndlaWdodCA/IHMud2VpZ2h0IC8gKHMud2VpZ2h0ICsgdC53ZWlnaHQpIDogLjUpO1xuICAgICAgICAgIHQueSAtPSB5ICogaztcbiAgICAgICAgICBzLnggKz0geCAqIChrID0gMSAtIGspO1xuICAgICAgICAgIHMueSArPSB5ICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGsgPSBhbHBoYSAqIGdyYXZpdHkpIHtcbiAgICAgICAgeCA9IHNpemVbMF0gLyAyO1xuICAgICAgICB5ID0gc2l6ZVsxXSAvIDI7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgaWYgKGspIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICAgIG8ueCArPSAoeCAtIG8ueCkgKiBrO1xuICAgICAgICAgIG8ueSArPSAoeSAtIG8ueSkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoY2hhcmdlKSB7XG4gICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUocSA9IGQzLmdlb20ucXVhZHRyZWUobm9kZXMpLCBhbHBoYSwgY2hhcmdlcyk7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBpZiAoIShvID0gbm9kZXNbaV0pLmZpeGVkKSB7XG4gICAgICAgICAgICBxLnZpc2l0KHJlcHVsc2UobykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICBpZiAoby5maXhlZCkge1xuICAgICAgICAgIG8ueCA9IG8ucHg7XG4gICAgICAgICAgby55ID0gby5weTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvLnggLT0gKG8ucHggLSAoby5weCA9IG8ueCkpICogZnJpY3Rpb247XG4gICAgICAgICAgby55IC09IChvLnB5IC0gKG8ucHkgPSBvLnkpKSAqIGZyaWN0aW9uO1xuICAgICAgICB9XG4gICAgICB9XG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iAgICAgIHggPSAreDtcbiAgICAgIGlmIChhbHBoYSkge1xuICAgICAgICBpZiAoeCA+IDApIHtcbiAgICAgICAgICBhbHBoYSA9IHg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGltZXIuYyA9IG51bGwsIHRpbWVyLnQgPSBOYU4sIHRpbWVyID0gbnVsbDtcbiAgICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmICh4ID4gMCkge1xuICAgICAgICBldmVudC5zdGFydCh7XG4gICAgICAgICAgdHlwZTogXCJzdGFydFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IHhcbiAgICAgICAgfSk7XG4gICAgICAgIHRpbWVyID0gZDNfdGltZXIoZm9yY2UudGljayk7XG4gICAgICB9XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5zdGFydCA9IGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIGksIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHcgPSBzaXplWzBdLCBoID0gc2l6ZVsxXSwgbmVpZ2hib3JzLCBvO1xuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAobyA9IG5vZGVzW2ldKS5pbmRleCA9IGk7XG4gICAgICAgIG8ud2VpZ2h0ID0gMDtcbiAgICAgIH1cbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBpZiAodHlwZW9mIG8uc291cmNlID09IFwibnVtYmVyXCIpIG8uc291cmNlID0gbm9kZXNbby5zb3VyY2VdO1xuICAgICAgICBpZiAodHlwZW9mIG8udGFyZ2V0ID09IFwibnVtYmVyXCIpIG8udGFyZ2V0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kYXRhOiBkYXRhW2ldLFxuICAgICAgICAgIHZhbHVlOiB2ID0gdmFsdWVzW2ldLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IGEsXG4gICAgICAgICAgZW5kQW5nbGU6IGEgKz0gdiAqIGsgKyBwYSxcbiAgICAgICAgICBwYWRBbmdsZTogcFxuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gYXJjcztcbiAgICB9XG4gICAgcGllLnZhbHVlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdmFsdWU7XG4gICAgICB2YWx1ZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnNvcnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzb3J0O1xuICAgICAgc29ydCA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnN0YXJ0QW5nbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGFydEFuZ2xlO1xuICAgICAgc3RhcnRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLmVuZEFuZ2xlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZW5kQW5nbGU7XG4gICAgICBlbmRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnBhZEFuZ2xlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcGFkQW5nbGU7XG4gICAgICBwYWRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcmV0dXJuIHBpZTtcbiAgfTtcbiAgdmFyIGQzX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YXhbYl07XG4gICAgICB9KSwgdG9wID0gMCwgYm90dG9tID0gMCwgdG9wcyA9IFtdLCBib3R0b21zID0gW107XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIGogPSBpbmRleFtpXTtcbiAgICAgICAgaWYgKHRvcCA8IGJvdHRvbSkge1xuICAgICAgICAgIHRvcCArPSBzdW1zW2pdO1xuICAgICAgICAgIHRvcHMucHVzaChqKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBib3R0b20gKz0gc3Vtc1tqXTtcbiAgICAgICAgICBib3R0b21zLnB1c2goaik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBib3R0b21zLnJldmVyc2UoKS5jb25jYXQodG9wcyk7XG4gICAgfSxcbiAgICByZXZlcnNlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICByZXR1cm4gZDMucmFuZ2UoZGF0YS5sZW5ndGgpLnJldmVyc2UoKTtcbiAgICB9LFxuICAgIFwiZGVmYXVsdFwiOiBkM19sYXlvdXRfc3RhY2tPcmRlckRlZmF1bHRcbiAgfSk7XG4gIHZhciBkM19sYXlvdXRfc3RhY2tPZmZzZXRzID0gZDMubWFwKHtcbiAgICBzaWxob3VldHRlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICB2YXIgbiA9IGRhdGEubGVuZ3RoLCBtID0gZGF0YVswXS5sZW5ndGgsIHN1bXMgPSBbXSwgbWF4ID0gMCwgaSwgaiwgbywgeTAgPSBbXTtcbiAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHtcbiAgICAgICAgZm9yIChpID0gMCwgbyA9IDA7IGkgPCBuOyBpKyspIG8gKz0gZGF0YVtpXVtqXVsxXTtcbiAgICAgICAgaWYgKG8gPiBtYXgpIG1heCA9IG87XG4gICAgICAgIHN1bXMucHVzaChvKTtcbiAgICAgIH1cbiAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHtcbiAgICAg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3FydCA6IHR5cGVvZiByYWRpdXMgPT09IFwiZnVuY3Rpb25cIiA/IHJhZGl1cyA6IGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gcmFkaXVzO1xuICAgICAgfTtcbiAgICAgIHJvb3QueCA9IHJvb3QueSA9IDA7XG4gICAgICBkM19sYXlvdXRfaGllcmFyY2h5VmlzaXRBZnRlcihyb290LCBmdW5jdGlvbihkKSB7XG4gICAgICAgIGQuciA9ICtyKGQudmFsdWUpO1xuICAgICAgfSk7XG4gICAgICBkM19sYXlvdXRfaGllcmFyY2h5VmlzaXRBZnRlcihyb290LCBkM19sYXlvdXRfcGFja1NpYmxpbmdzKTtcbiAgICAgIGlmIChwYWRkaW5nKSB7XG4gICAgICAgIHZhciBkciA9IHBhZGRpbmcgKiAocmFkaXVzID8gMSA6IE1hdGgubWF4KDIgKiByb290LnIgLyB3LCAyICogcm9vdC5yIC8gaCkpIC8gMjtcbiAgICAgICAgZDNfbGF5b3V0X2hpZXJhcmNoeVZpc2l0QWZ0ZXIocm9vdCwgZnVuY3Rpb24oZCkge1xuICAgICAgICAgIGQuciArPSBkcjtcbiAgICAgICAgfSk7XG4gICAgICAgIGQzX2xheW91dF9oaWVyYXJjaHlWaXNpdEFmdGVyKHJvb3QsIGQzX2xheW91dF9wYWNrU2libGluZ3MpO1xuICAgICAgICBkM19sYXlvdXRfaGllcmFyY2h5VmlzaXRBZnRlcihyb290LCBmdW5jdGlvbihkKSB7XG4gICAgICAgICAgZC5yIC09IGRyO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGQzX2xheW91dF9wYWNrVHJhbnNmb3JtKHJvb3QsIHcgLyAyLCBoIC8gMiwgcmFkaXVzID8gMSA6IDEgLyBNYXRoLm1heCgyICogcm9vdC5yIC8gdywgMiAqIHJvb3QuciAvIGgpKTtcbiAgICAgIHJldHVybiBub2RlcztcbiAgICB9XG4gICAgcGFjay5zaXplID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCF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mFyIGR4ID0gYi54IC0gYS54LCBkeSA9IGIueSAtIGEueSwgZHIgPSBhLnIgKyBiLnI7XG4gICAgcmV0dXJuIC45OTkgKiBkciAqIGRyID4gZHggKiBkeCArIGR5ICogZHk7XG4gIH1cbiAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tTaWJsaW5ncyhub2RlKSB7XG4gICAgaWYgKCEobm9kZXMgPSBub2RlLmNoaWxkcmVuKSB8fCAhKG4gPSBub2Rlcy5sZW5ndGgpKSByZXR1cm47XG4gICAgdmFyIG5vZGVzLCB4TWluID0gSW5maW5pdHksIHhNYXggPSAtSW5maW5pdHksIHlNaW4gPSBJbmZpbml0eSwgeU1heCA9IC1JbmZpbml0eSwgYSwgYiwgYywgaSwgaiwgaywgbjtcbiAgICBmdW5jdGlvbiBib3VuZChub2RlKSB7XG4gICAgICB4TWluID0gTWF0aC5taW4obm9kZS54IC0gbm9kZS5yLCB4TWluKTtcbiAgICAgIHhNYXggPSBNYXRoLm1heChub2RlLnggKyBub2RlLnIsIHhNYXgpO1xuICAgICAgeU1pbiA9IE1hdGgubWluKG5vZGUueSAtIG5vZGUuciwgeU1pbik7XG4gICAgICB5TWF4ID0gTWF0aC5tYXgobm9kZS55ICsgbm9kZS5yLCB5TWF4KTtcbiAgICB9XG4gICAgbm9kZXMuZm9yRWFjaChkM19sYXlvdXRfcGFja0xpbmspO1xuICAgIGEgPSBub2Rlc1swXTtcbiAgICBhLnggPSAtYS5yO1xuICAgIGEueSA9IDA7XG4gICAgYm91bmQoYSk7XG4gICAgaWYgKG4gPiAxKSB7XG4gICAgICBiID0gbm9kZXNbMV07XG4gICAgICBiLnggPSBiLnI7XG4gICAgICBiLnkgPSAwO1xuICAgICAgYm91bmQoYik7XG4gICAgICBpZiAobiA+IDIpIHtcbiAgICAgICAgYyA9IG5vZGVzWzJdO1xuICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMpO1xuICAgICAgICBib3VuZChjKTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG4gICAgICAgIGEuX3BhY2tfcHJldiA9IGM7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGMsIGIpO1xuICAgICAgICBiID0gYS5fcGFja19uZXh0O1xuICAgICAgICBmb3IgKGkgPSAzOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjID0gbm9kZXNbaV0pO1xuICAgICAgICAgIHZhciBpc2VjdCA9IDAsIHMxID0gMSwgczIgPSAxO1xuICAgICAgICAgIGZvciAoaiA9IGIuX3BhY2tfbmV4dDsgaiAhPT0gYjsgaiA9IGouX3BhY2tfbmV4dCwgczErKykge1xuICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhqLCBjKSkge1xuICAgICAgICAgICAgICBpc2VjdCA9IDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QgPT0gMSkge1xuICAgICAgICAgICAgZm9yIChrID0gYS5fcGFja19wcmV2OyBrICE9PSBqLl9wYWNrX3ByZXY7IGsgPSBrLl9wYWNrX3ByZXYsIHMyKyspIHtcbiAgICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhrLCBjKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCkge1xuICAgICAgICAgICAgaWYgKHMxIDwgczIgfHwgczEgPT0gczIgJiYgYi5yIDwgYS5yKSBkM19sYXlvdXRfcGFja1NwbGljZShhLCBiID0gaik7IGVsc2UgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSA9IGssIGIpO1xuICAgICAgICAgICAgaS0tO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgYm91bmQoYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHZhciBjeCA9ICh4TWluICsgeE1heCkgLyAyLCBjeSA9ICh5TWluICsgeU1heCkgLyAyLCBjciA9IDA7XG4gICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgYyA9IG5vZGVzW2ldO1xuICAgICAgYy54IC09IGN4O1xuICAgICAgYy55IC09IGN5O1xuICAgICAgY3IgPSBNYXRoLm1heChjciwgYy5yICsgTWF0aC5zcXJ0KGMueCAqIGMueCArIGMueSAqIGMueSkpO1xuICAgIH1cbiAgICBub2RlLnIgPSBjcjtcbiAgICBub2Rlcy5mb3JFYWNoKGQzX2xheW91dF9wYWNrVW5saW5rKTtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja0xpbmsobm9kZSkge1xuICAgIG5vZGUuX3BhY2tfbmV4dCA9IG5vZGUuX3BhY2tfcHJldiA9IG5vZGU7XG4gIH1cbiAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tVbmxpbmsobm9kZSkge1xuICAgIGRlbGV0ZSBub2RlLl9wYWNrX25leHQ7XG4gICAgZGVsZXRlIG5vZGUuX3BhY2tfcHJldjtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja1RyYW5zZm9ybShub2RlLCB4LCB5LCBrKSB7XG4gICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcbiAgICBub2RlLnggPSB4ICs9IGsgKiBub2RlLng7XG4gICAgbm9kZS55ID0geSArPSBrICogbm9kZS55O1xuICAgIG5vZGUuciAqPSBrO1xuICAgIGlmIChjaGlsZHJlbikge1xuICAgICAgdmFyIGkgPSAtMSwgbiA9IGNoaWxkcmVuLmxlbmd0aDtcbiAgICAgIHdoa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HZvbSA9IGQzX2xheW91dF90cmVlTGVmdCh2b20pO1xuICAgICAgICAgIHZvcCA9IGQzX2xheW91dF90cmVlUmlnaHQodm9wKTtcbiAgICAgICAgICB2b3AuYSA9IHY7XG4gICAgICAgICAgc2hpZnQgPSB2aW0ueiArIHNpbSAtIHZpcC56IC0gc2lwICsgc2VwYXJhdGlvbih2aW0uXywgdmlwLl8pO1xuICAgICAgICAgIGlmIChzaGlmdCA+IDApIHtcbiAgICAgICAgICAgIGQzX2xheW91dF90cmVlTW92ZShkM19sYXlvdXRfdHJlZUFuY2VzdG9yKHZpbSwgdiwgYW5jZXN0b3IpLCB2LCBzaGlmdCk7XG4gICAgICAgICAgICBzaXAgKz0gc2hpZnQ7XG4gICAgICAgICAgICBzb3AgKz0gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpbSArPSB2aW0ubTtcbiAgICAgICAgICBzaXAgKz0gdmlwLm07XG4gICAgICAgICAgc29tICs9IHZvbS5tO1xuICAgICAgICAgIHNvcCArPSB2b3AubTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmltICYmICFkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCkpIHtcbiAgICAgICAgICB2b3AudCA9IHZpbTtcbiAgICAgICAgICB2b3AubSArPSBzaW0gLSBzb3A7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpcCAmJiAhZDNfbGF5b3V0X3RyZWVMZWZ0KHZvbSkpIHtcbiAgICAgICAgICB2b20udCA9IHZpcDtcbiAgICAgICAgICB2b20ubSArPSBzaXAgLSBzb207XG4gICAgICAgICAgYW5jZXN0b3IgPSB2O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gYW5jZXN0b3I7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNpemVOb2RlKG5vZGUpIHtcbiAgICAgIG5vZGUueCAqPSBzaXplWzBdO1xuICAgICAgbm9kZS55ID0gbm9kZS5kZXB0aCAqIHNpemVbMV07XG4gICAgfV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ICAgIHJvdy5hcmVhICs9IGNoaWxkLmFyZWE7XG4gICAgICAgICAgaWYgKG1vZGUgIT09IFwic3F1YXJpZnlcIiB8fCAoc2NvcmUgPSB3b3JzdChyb3csIHUpKSA8PSBiZXN0KSB7XG4gICAgICAgICAgICByZW1haW5pbmcucG9wKCk7XG4gICAgICAgICAgICBiZXN0ID0gc2NvcmU7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJvdy5hcmVhIC09IHJvdy5wb3AoKS5hcmVhO1xuICAgICAgICAgICAgcG9zaXRpb24ocm93LCB1LCByZWN0LCBmYWxzZSk7XG4gICAgICAgICAgICB1ID0gTWF0aC5taW4ocmVjdC5keCwgcmVjdC5keSk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgICAgYmVzdCA9IEluZmluaXR5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAocm93Lmxlbmd0aCkge1xuICAgICAgICAgIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgdHJ1ZSk7XG4gICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHNxdWFyaWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gc3RpY2tpZnkobm9kZSkge1xuICAgICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcbiAgICAgIGlmIChjaGlsZHJlbiAmJiBjaGlsZHJlbi5sZW5ndGgpIHtcbiAgICAgICAgdmFyIHJlY3QgPSBwYWQobm9kZSksIHJlbWFpbmluZyA9IGNoaWxkcmVuLnNsaWNlKCksIGNoaWxkLCByb3cgPSBbXTtcbiAgICAgICAgc2NhbGUocmVtYWluaW5nLCByZWN0LmR4ICogcmVjdC5keSAvIG5vZGUudmFsdWUpO1xuICAgICAgICByb3cuYXJlYSA9IDA7XG4gICAgICAgIHdoaWxlIChjaGlsZCA9IHJlbWFpbmluZy5wb3AoKSkge1xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkKTtcbiAgICAgICAgICByb3cuYXJlYSArPSBjaGlsZC5hcmVhO1xuICAgICAgICAgIGlmIChjaGlsZC56ICE9IG51bGwpIHtcbiAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgY2hpbGQueiA/IHJlY3QuZHggOiByZWN0LmR5LCByZWN0LCAhcmVtYWluaW5nLmxlbmd0aCk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHN0aWNraWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gd29yc3Qocm93LCB1KSB7XG4gICAgICB2YXIgcyA9IHJvdy5hcmVhLCByLCBybWF4ID0gMCwgcm1pbiA9IEluZmluaXR5LCBpID0gLTEsIG4gPSByb3cubGVuZ3RoO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKCEociA9IHJvd1tpXS5hcmVhKSkgY29udGludWU7XG4gICAgICAgIGlmIChyIDwgcm1pbikgcm1pbiA9IHI7XG4gICAgICAgIGlmIChyID4gcm1heCkgcm1heCA9IHI7XG4gICAgICB9XG4gICAgICBzICo9IHM7XG4gICAgICB1ICo9IHU7XG4gICAgICByZXR1cm4gcyA/IE1hdGgubWF4KHUgKiBybWF4ICogcmF0aW8gLyBzLCBzIC8gKHUgKiBybWluICogcmF0aW8pKSA6IEluZmluaXR5O1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZsdXNoKSB7XG4gICAgICB2YXIgaSA9IC0xLCBuID0gcm93Lmxlbmd0aCwgeCA9IHJlY3QueCwgeSA9IHJlY3QueSwgdiA9IHUgPyByb3VuZChyb3cuYXJlYSAvIHUpIDogMCwgbztcbiAgICAgIGlmICh1ID09IHJlY3QuZHgpIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR5KSB2ID0gcmVjdC5keTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR5ID0gdjtcbiAgICAgICAgICB4ICs9IG8uZHggPSBNYXRoLm1pbihyZWN0LnggKyByZWN0LmR4IC0geCwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gdHJ1ZTtcbiAgICAgICAgby5keCArPSByZWN0LnggKyByZWN0LmR4IC0geDtcbiAgICAgICAgcmVjdC55ICs9IHY7XG4gICAgICAgIHJlY3QuZHkgLT0gdjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keCkgdiA9IHJlY3QuZHg7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keCA9IHY7XG4gICAgICAgICAgeSArPSBvLmR5ID0gTWF0aC5taW4ocmVjdC55ICsgcmVjdC5keSAtIHksIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IGZhbHNlO1xuICAgICAgICBvLmR5ICs9IHJlY3QueSArIHJlY3QuZHkgLSB5O1xuICAgICAgICByZWN0LnggKz0gdjtcbiAgICAgICAgcmVjdC5keCAtPSB2O1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB0cmVlbWFwKGQpIHtcbiAgICAgIHZhciBub2RlcyA9IHN0aWNraWVzIHx8IGhpZXJhcmNoeShkKSwgcm9vdCA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sZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5lYWNoKFwic3RhcnQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MC5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDAuajtcbiAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQwLng7XG4gICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MC55O1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiYnJ1c2g6YnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgeGkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHhFeHRlbnQsIGV4dGVudDEueCksIHlpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh5RXh0ZW50LCBleHRlbnQxLnkpO1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IHlFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDEueCA9IHhpKHQpO1xuICAgICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MS55ID0geWkodCk7XG4gICAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MS5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDEuajtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIHJlZHJhdyhnKSB7XG4gICAgICBnLnNlbGVjdEFsbChcIi5yZXNpemVcIikuYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbihkKSB7XG4gICAgICAgIHJldHVybiBcInRyYW5zbGF0ZShcIiArIHhFeHRlbnRbKy9lJC8udGVzdChkKV0gKyBcIixcIiArIHlFeHRlbnRbKy9ecy8udGVzdChkKV0gKyBcIilcIjtcbiAgICAgIH0pO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWRyYXdYKGcpIHtcbiAgICAgIGcuc2VsZWN0KFwiLmV4dGVudFwiKS5hdHRyKFwieFwiLCB4RXh0ZW50WzBdKTtcbiAgICAgIGcuc2VsZWN0QWxsKFwiLmV4dGVudCwubj5yZWN0LC5zPnJlY3RcIikuYXR0cihcIndpZHRoXCIsIHhFeHRlbnRbMV0gLSB4RXh0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W9uIGtleWRvd24oKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyKSB7XG4gICAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgICAgY2VudGVyID0gbnVsbDtcbiAgICAgICAgICAgIG9yaWdpblswXSAtPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgb3JpZ2luWzFdIC09IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBkcmFnZ2luZyA9IDI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga2V5dXAoKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyICYmIGRyYWdnaW5nID09IDIpIHtcbiAgICAgICAgICBvcmlnaW5bMF0gKz0geEV4dGVudFsxXTtcbiAgICAgICAgICBvcmlnaW5bMV0gKz0geUV4dGVudFsxXTtcbiAgICAgICAgICBkcmFnZ2luZyA9IDA7XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaG1vdmUoKSB7XG4gICAgICAgIHZhciBwb2ludCA9IGQzLm1vdXNlKHRhcmdldCksIG1vdmVkID0gZmFsc2U7XG4gICAgICAgIGlmIChvZmZzZXQpIHtcbiAgICAgICAgICBwb2ludFswXSArPSBvZmZzZXRbMF07XG4gICAgICAgICAgcG9pbnRbMV0gKz0gb2Zmc2V0WzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICBpZiAoZDMuZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICBpZiAoIWNlbnRlcikgY2VudGVyID0gWyAoeEV4dGVudFswXSArIHhFeHRlbnRbMV0pIC8gMiwgKHlFeHRlbnRbMF0gKyB5RXh0ZW50WzFdKSAvIDIgXTtcbiAgICAgICAgICAgIG9yaWdpblswXSA9IHhFeHRlbnRbKyhwb2ludFswXSA8IGNlbnRlclswXSldO1xuICAgICAgICAgICAgb3JpZ2luWzFdID0geUV4dGVudFsrKHBvaW50WzFdIDwgY2VudGVyWzFdKV07XG4gICAgICAgICAgfSBlbHNlIGNlbnRlciA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlc2l6aW5nWCAmJiBtb3ZlMShwb2ludCwgeCwgMCkpIHtcbiAgICAgICAgICByZWRyYXdYKGcpO1xuICAgICAgICAgIG1vdmVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzaXppbmdZICYmIG1vdmUxKHBvaW50LCB5LCAxKSkge1xuICAgICAgICAgIHJlZHJhd1koZyk7XG4gICAgICAgICAgbW92ZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtb3ZlZCkge1xuICAgICAgICAgIHJlZHJhdyhnKTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgbW9kZTogZHJhZ2dpbmcgPyBcIm1vdmVcIiA6IFwicmVzaXplXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbW92ZTEocG9pbnQsIHNjYWxlLCBpKSB7XG4gICAgICAgIHZhciByYW5nZSA9IGQzX3NjYWxlUmFuZ2Uoc2NhbGUpLCByMCA9IHJhbmdlWzBdLCByMSA9IHJhbmdlWzFdLCBwb3NpdGlvbiA9IG9yaWdpbltpXSwgZXh0ZW50ID0gaSA/IHlFeHRlbnQgOiB4RXh0ZW50LCBzaXplID0gZXh0ZW50WzFdIC0gZXh0ZW50WzBdLCBtaW4sIG1heDtcbiAgICAgICAgaWYgKGRyYWdnaW5nKSB7XG4gICAgICAgICAgcjAgLT0gcG9zaXRpb247XG4gICAgICAgICAgcjEgLT0gc2l6ZSArIHBvc2l0aW9uO1xuICAgICAgICB9XG4gICAgICAgIG1pbiA9IChpID8geUNsYW1wIDogeENsYW1wKSA/IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgcG9pbnRbaV0pKSA6IHBvaW50W2ldO1xuICAgICAgICBpZiAoZHJhZ2dpbmcpIHtcbiAgICAgICAgICBtYXggPSAobWluICs9IHBvc2l0aW9uKSArIHNpemU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGNlbnRlcikgcG9zaXRpb24gPSBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIDIgKiBjZW50ZXJbaV0gLSBtaW4pKTtcbiAgICAgICAgICBpZiAocG9zaXRpb24gPCBtaW4pIHtcbiAgICAgICAgICAgIG1heCA9IG1pbjtcbiAgICAgICAgICAgIG1pbiA9IHBvc2l0aW9uO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtYXggPSBwb3NpdGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dGVudFswXSAhPSBtaW4gfHwgZXh0ZW50WzFdICE9IG1heCkge1xuICAgICAgICAgIGlmIChpKSB5RXh0ZW50RG9tYWluID0gbnVsbDsgZWxzZSB4RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICBleHRlbnRbMF0gPSBtaW47XG4gICAgICAgICAgZXh0ZW50WzFdID0gbWF4O1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaGVuZCgpIHtcbiAgICAgICAgYnJ1c2htb3ZlKCk7XG4gICAgICAgIGcuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcImFsbFwiKS5zZWxlY3RBbGwoXCIucmVzaXplXCIpLnN0eWxlKFwiZGlzcGxheVwiLCBicnVzaC5lbXB0eSgpID8gXCJub25lXCIgOiBudWxsKTtcbiAgICAgICAgZDMuc2VsZWN0KFw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bHNlIGlmICh4KSB4Q2xhbXAgPSAhIXo7IGVsc2UgaWYgKHkpIHlDbGFtcCA9ICEhejtcbiAgICAgIHJldHVybiBicnVzaDtcbiAgICB9O1xuICAgIGJydXNoLmV4dGVudCA9IGZ1bmN0aW9uKHopIHtcbiAgICAgIHZhciB4MCwgeDEsIHkwLCB5MSwgdDtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICBpZiAoeCkge1xuICAgICAgICAgIGlmICh4RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnREb21haW5bMF0sIHgxID0geEV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50WzBdLCB4MSA9IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geC5pbnZlcnQoeDApLCB4MSA9IHguaW52ZXJ0KHgxKTtcbiAgICAgICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHkpIHtcbiAgICAgICAgICBpZiAoeUV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50RG9tYWluWzBdLCB5MSA9IHlFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudFswXSwgeTEgPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHkuaW52ZXJ0KSB5MCA9IHkuaW52ZXJ0KHkwKSwgeTEgPSB5LmludmVydCh5MSk7XG4gICAgICAgICAgICBpZiAoeTEgPCB5MCkgdCA9IHkwLCB5MCA9IHkxLCB5MSA9IHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4ICYmIHkgPyBbIFsgeDAsIHkwIF0sIFsgeDE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SwgYzIwO1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBwb2x5O1xuXG4gICAgYSA9IGEyLm11bHRpcGx5KC0yKTtcbiAgICBjMTIgPSBhMS5hZGQoYS5hZGQoYTMpKTtcblxuICAgIGEgPSBhMS5tdWx0aXBseSgtMik7XG4gICAgYiA9IGEyLm11bHRpcGx5KDIpO1xuICAgIGMxMSA9IGEuYWRkKGIpO1xuXG4gICAgYzEwID0gbmV3IFBvaW50MkQoYTEueCwgYTEueSk7XG5cbiAgICBhID0gYjIubXVsdGlwbHkoLTIpO1xuICAgIGMyMiA9IGIxLmFkZChhLmFkZChiMykpO1xuXG4gICAgYSA9IGIxLm11bHRpcGx5KC0yKTtcbiAgICBiID0gYjIubXVsdGlwbHkoMik7XG4gICAgYzIxID0gYS5hZGQoYik7XG5cbiAgICBjMjAgPSBuZXcgUG9pbnQyRChiMS54LCBiMS55KTtcbiAgICBcbiAgICBpZiAoIGMxMi55ID09IDAgKSB7XG4gICAgICAgIHZhciB2MCA9IGMxMi54KihjMTAueSAtIGMyMC55KTtcbiAgICAgICAgdmFyIHYxID0gdjAgLSBjMTEueCpjMTEueTtcbiAgICAgICAgdmFyIHYyID0gdjAgKyB2MTtcbiAgICAgICAgdmFyIHYzID0gYzExLnkqYzExLnk7XG5cbiAgICAgICAgcG9seSA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEyLngqYzIyLnkqYzIyLnksXG4gICAgICAgICAgICAyKmMxMi54KmMyMS55KmMyMi55LFxuICAgICAgICAgICAgYzEyLngqYzIxLnkqYzIxLnkgLSBjMjIueCp2MyAtIGMyMi55KnYwIC0gYzIyLnkqdjEsXG4gICAgICAgICAgICAtYzIxLngqdjMgLSBjMjEueSp2MCAtIGMyMS55KnYxLFxuICAgICAgICAgICAgKGMxMC54IC0gYzIwLngpKnYzICsgKGMxMC55IC0gYzIwLnkpKnYxXG4gICAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHYwID0gYzEyLngqYzIyLnkgLSBjMTIueSpjMjIueDtcbiAgICAgICAgdmFyIHYxID0gYzEyLngqYzIxLnkgLSBjMjEueCpjMTIueTtcbiAgICAgICAgdmFyIHYyID0gYzExLngqYzEyLnkgLSBjMTEueSpjMTIueDtcbiAgICAgICAgdmFyIHYzID0gYzEwLnkgLSBjMjAueTtcbiAgICAgICAgdmFyIHY0ID0gYzEyLnkqKGMxMC54IC0gYzIwLngpIC0gYzEyLngqdjM7XG4gICAgICAgIHZhciB2NSA9IC1jMTEueSp2MiArIGMxMi55KnY0O1xuICAgICAgICB2YXIgdjYgPSB2Mip2MjtcblxuICAgICAgICBwb2x5ID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICB2MCp2MCxcbiAgICAgICAgICAgIDIqdjAqdjEsXG4gICAgICAgICAgICAoLWMyMi55KnY2ICsgYzEyLnkqdjEqdjEgKyBjMTIueSp2MCp2NCArIHYwKnY1KSAvIGMxMi55LFxuICAgICAgICAgICAgKC1jMjEueSp2NiArIGMxMi55KnYxKnY0ICsgdjEqdjUpIC8gYzEyLnksXG4gICAgICAgICAgICAodjMqdjYgKyB2NCp2NSkgLyBjMTIueVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHMoKTtcbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcblxuICAgICAgICBpZiAoIDAgPD0gcyAmJiBzIDw9IDEgKSB7XG4gICAgICAgICAgICB2YXIgeFJvb3RzID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICAgICAgYzEyLngsXG4gICAgICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICAgICAgYzEwLnggLSBjMjAueCAtIHMqYzIxLnggLSBzKnMqYzIyLnhcbiAgICAgICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgICAgIHZhciB5Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgICAgICBjMTIueSxcbiAgICAgICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgICAgICBjMTAueSAtIGMyMC55IC0gcypjMjEueSAtIHMqcypjMjIueVxuICAgICAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgICAgICBpZiAoIHhSb290cy5sZW5ndGggPiAwICYmIHlSb290cy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIHZhciBUT0xFUkFOQ0UgPSAxZS00O1xuXG4gICAgICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgICAgICBmb3IgKCB2YXIgaiA9IDA7IGogPCB4Um9vdHMubGVuZ3RoOyBqKysgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4Um9vdCA9IHhSb290c1tqXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIDAgPD0geFJvb3QgJiYgeFJvb3QgPD0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE1hdGguYWJzKCB4Um9vdCAtIHlSb290c1trXSApIDwgVE9MRVJBTkNFICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goIGMyMi5tdWx0aXBseShzKnMpLmFkZChjMjEubXVsdGlwbHkocykuYWRkKGMyMCkpICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgIC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gLSAyKmMxMi54KmMxMi55KmMyMS55KmMyMy54IC0gMipjMTIueCpjMTIueSpjMjIueCpjMjIueSArXG4gICAgICAgICAgICAyKmMyMS54KmMxMnkyKmMyMy54ICsgYzEyeTIqYzIyeDIgKyBjMTJ4MiooMipjMjEueSpjMjMueSArIGMyMnkyKSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjMueSArIDIqYzEwLnkqYzEyLngqYzEyLnkqYzIzLnggKyBjMTEueCpjMTEueSpjMTIueCpjMjMueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueSpjMjMueCAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIzLnkgLSAyKmMxMi54KmMyMC55KmMxMi55KmMyMy54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyLnkqYzIyLnkgLSAyKmMxMi54KmMxMi55KmMyMS55KmMyMi54IC0gMipjMTAueCpjMTJ5MipjMjMueCAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMyMy55ICsgMipjMjAueCpjMTJ5MipjMjMueCArIDIqYzIxLngqYzEyeTIqYzIyLnggLVxuICAgICAgICAgICAgYzExeTIqYzEyLngqYzIzLnggLSBjMTF4MipjMTIueSpjMjMueSArIGMxMngyKigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSksXG4gICAgICAgIDIqYzEwLngqYzEyLngqYzEyLnkqYzIyLnkgKyAyKmMxMC55KmMxMi54KmMxMi55KmMyMi54ICsgYzExLngqYzExLnkqYzEyLngqYzIyLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLnkqYzIyLnggLSAyKmMyMC54KmMxMi54KmMxMi55KmMyMi55IC0gMipjMTIueCpjMjAueSpjMTIueSpjMjIueCAtXG4gICAgICAgICAgICAyKmMxMi54KmMyMS54KmMxMi55KmMyMS55IC0gMipjMTAueCpjMTJ5MipjMjIueCAtIDIqYzEwLnkqYzEyeDIqYzIyLnkgK1xuICAgICAgICAgICAgMipjMjAueCpjMTJ5MipjMjIueCAtIGMxMXkyKmMxMi54KmMyMi54IC0gYzExeDIqYzEyLnkqYzIyLnkgKyBjMjF4MipjMTJ5MiArXG4gICAgICAgICAgICBjMTJ4MiooMipjMjAueSpjMjIueSArIGMyMXkyKSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjEueSArIDIqYzEwLnkqYzEyLngqYzIxLngqYzEyLnkgKyBjMTEueCpjMTEueSpjMTIueCpjMjEueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMjEueCpjMTIueSAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIxLnkgLSAyKmMxMi54KmMyMC55KmMyMS54KmMxMi55IC1cbiAgICAgICAgICAgIDIqYzEwLngqYzIxLngqYzEyeTIgLSAyKmMxMC55KmMxMngyKmMyMS55ICsgMipjMjAueCpjMjEueCpjMTJ5MiAtXG4gICAgICAgICAgICBjMTF5MipjMTIueCpjMjEueCAtIGMxMXgyKmMxMi55KmMyMS55ICsgMipjMTJ4MipjMjAueSpjMjEueSxcbiAgICAgICAgLTIqYzEwLngqYzEwLnkqYzEyLngqYzEyLnkgLSBjMTAueCpjMTEueCpjMTEueSpjMTIueSAtIGMxMC55KmMxMS54KmMxMS55KmMxMi54ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzIwLnkqYzEyLnkgKyAyKmMxMC55KmMyMC54KmMxMi54KmMxMi55ICsgYzExLngqYzIwLngqYzExLnkqYzEyLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzIwLnkgLSAyKmMyMC54KmMxMi54KmMyMC55KmMxMi55IC0gMipjMTAueCpjMjAueCpjMTJ5MiArXG4gICAgICAgICAgICBjMTAueCpjMTF5MipjMTIueCArIGMxMC55KmMxMXgyKmMxMi55IC0gMipjMTAueSpjMTJ4MipjMjAueSAtXG4gICAgICAgICAgICBjMjAueCpjMTF5MipjMTIueCAtIGMxMXgyKmMyMC55KmMxMi55ICsgYzEweDIqYzEyeTIgKyBjMTB5MipjMTJ4MiArXG4gICAgICAgICAgICBjMjB4MipjMTJ5MiArIGMxMngyKmMyMHkyXG4gICAgKTtcbiAgICB2YXIgcm9vdHMgPSBwb2x5LmdldFJvb3RzSW5JbnRlcnZhbCgwLDEpO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgcm9vdHMubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgIHZhciBzID0gcm9vdHNbaV07XG4gICAgICAgIHZhciB4Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIGMxMi54LFxuICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICBjMTAueCAtIGMyMC54IC0gcypjMjEueCAtIHMqcypjMjIueCAtIHMqcypzKmMyMy54XG4gICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgdmFyIHlSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEyLnksXG4gICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55IC0gcypzKnMqYzIzLnlcbiAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICB2YXIgVE9MRVJBTkNFID0gMWUtNDtcblxuICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICB2YXIgeFJvb3QgPSB4Um9vdHNbal07XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKCAwIDw9IHhSb290ICYmIHhSb290IDw9IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMjMubXVsdGlwbHkocypzKnMpLmFkZChjMjIubXVsdGlwbHkocypzKS5hZGQoYzIxLm11bHRpcGx5KHMpLmFkZChjMjApKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoIHJlc3VsdC5wb2ludHMubGVuZ3RoID4gMCApIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuXG4gICAgcmV0dXJuIHJlc3VsdDtcblxufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RCZXppZXIyQ2lyY2xlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyQ2lyY2xlID0gZnVuY3Rpb24ocDEsIHAyLCBwMywgYywgcikge1xuICAgIHJldHVybiBJbnRlcnNlY3Rpb24uaW50ZXJzZWN0QmV6aWVyMkVsbGlwc2UocDEsIHAyLCBwMywgYywgciwgcik7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllcjJFbGxpcHNlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyRWxsaXBzZSA9IGZ1bmN0aW9uKHAxLCBwMiwgcDMsIGVjLCByeCwgcnkpIHtcbiAgICB2YXIgYSwgYjsgICAgICAgLy8gdGVtcG9yYXJ5IHZhcmlhYmxlc1xuICAgIHZhciBjMiwgYzEsIGMwOyAvLyBjb2VmZmljaWVudHMgb2YgcXVhZHJhdGljXG4gICAgdmFyIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJObyBJbnRlcnNlY3Rpb25cIik7XG5cbiAgICBhID0gcDIubXVsdGlwbHkoLTIpO1xuICAgIGMyID0gcDEuYWRkKGEuYWRkKHAzKSk7XG5cbiAgICBhID0gcDEubXVsdGlwbHkoLTIpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgyKTtcbiAgICBjMSA9IGEuYWRkKGIpO1xuXG4gICAgYzAgPSBuZXcgUG9pbnQyRChwMS54LCBwMS55KTtcblxuICAgIHZhciByeHJ4ICA9IHJ4KnJ4O1xuICAgIHZhciByeXJ5ICA9IHJ5KnJ5O1xuICAgIHZhciByb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICByeXJ5KmMyLngqYzIueCArIHJ4cngqYzIueSpjMi55LFxuICAgICAgICAyKihyeXJ5KmMyLngqYzEueCArIHJ4cngqYzIueSpjMS55KSxcbiAgICAgICAgcnlyeSooMipjMi54KmMwLnggKyBjMS54KmMxLngpICsgcnhyeCooMipjMi55KmMwLnkrYzEueSpjMS55KSAtXG4gICAgICAgICAgICAyKihyeXJ5KmVjLngqYzIueCArIHJ4cngqZWMueSpjMi55KSxcbiAgICAgICAgMioocnlyeSpjMS54KihjMC54LWVjLngpICsgcnhyeCpjMS55KihjMC55LWVjLnkpKSxcbiAgICAgICAgcnlyeSooYzAueCpjMC54K2VjLngqZWMueCkgKyByeHJ4KihjMC55KmMwLnkgKyBlYy55KmVjLnkpIC1cbiAgICAgICAgICAgIDIqKHJ5cnkqZWMueCpjMC54ICsgcnhyeCplYy55KmMwLnkpIC0gcnhyeCpyeXJ5XG4gICAgKS5nZXRSb290cygpO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgcm9vdHMubGVuZ3RoOyBpKysgKS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aDsgaSsrICkge1xuICAgICAgICB2YXIgdCA9IHJvb3RzW2ldO1xuXG4gICAgICAgIGlmICggMCA8PSB0ICYmIHQgPD0gMSApIHtcbiAgICAgICAgICAgIC8vIFdlJ3JlIHdpdGhpbiB0aGUgQmV6aWVyIGN1cnZlXG4gICAgICAgICAgICAvLyBGaW5kIHBvaW50IG9uIEJlemllclxuICAgICAgICAgICAgdmFyIHA0ID0gcDEubGVycChwMiwgdCk7XG4gICAgICAgICAgICB2YXIgcDUgPSBwMi5sZXJwKHAzLCB0KTtcblxuICAgICAgICAgICAgdmFyIHA2ID0gcDQubGVycChwNSwgdCk7XG5cbiAgICAgICAgICAgIC8vIFNlZSBpZiBwb2ludCBpcyBvbiBsaW5lIHNlZ21lbnRcbiAgICAgICAgICAgIC8vIEhhZCB0byBtYWtlIHNwZWNpYWwgY2FzZXMgZm9yIHZlcnRpY2FsIGFuZCBob3Jpem9udGFsIGxpbmVzIGR1ZVxuICAgICAgICAgICAgLy8gdG8gc2xpZ2h0IGVycm9ycyBpbiBjYWxjdWxhdGlvbiBvZiBwNlxuICAgICAgICAgICAgaWYgKCBhMS54ID09IGEyLnggKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBtaW4ueSA8PSBwNi55ICYmIHA2LnkgPD0gbWF4LnkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIHA2ICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggYTEueSA9PSBhMi55ICkge1xuICAgICAgICAgICAgICAgIGlmICggbWluLnggPD0gcDYueCAmJiBwNi54IDw9IG1heC54ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBva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zeTIsXG4gICAgICAgIC02KmMxMy54KmMyMi54KmMxM3kyKmMyMy54KmMyMy55ICsgNipjMTN4MipjMTMueSpjMjIueSpjMjMueCpjMjMueSArIDMqYzIyLngqYzEzeTMqYzIzeDIgLVxuICAgICAgICAgICAgMypjMTN4MypjMjIueSpjMjN5MiAtIDMqYzEzLngqYzEzeTIqYzIyLnkqYzIzeDIgKyAzKmMxM3gyKmMyMi54KmMxMy55KmMyM3kyLFxuICAgICAgICAtNipjMjEueCpjMTMueCpjMTN5MipjMjMueCpjMjMueSAtIDYqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkqYzIzLnggKyA2KmMxM3gyKmMyMi54KmMxMy55KmMyMi55KmMyMy55ICtcbiAgICAgICAgICAgIDMqYzIxLngqYzEzeTMqYzIzeDIgKyAzKmMyMngyKmMxM3kzKmMyMy54ICsgMypjMjEueCpjMTN4MipjMTMueSpjMjN5MiAtIDMqYzEzLngqYzIxLnkqYzEzeTIqYzIzeDIgLVxuICAgICAgICAgICAgMypjMTMueCpjMjJ4MipjMTN5MipjMjMueSArIGMxM3gyKmMxMy55KmMyMy54Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgKyBjMTN4MyooLWMyMS55KmMyM3kyIC1cbiAgICAgICAgICAgIDIqYzIyeTIqYzIzLnkgLSBjMjMueSooMipjMjEueSpjMjMueSArIGMyMnkyKSksXG4gICAgICAgIGMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLngqYzIzLnkgKyA2KmMyMS54KmMyMi54KmMxM3kzKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIzeTIgKyA2KmMxMC54KmMxMy54KmMxM3kyKmMyMy54KmMyMy55IC0gMypjMTEueCpjMTIueCpjMTN5MipjMjMueCpjMjMueSAtXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyM3gyIC0gNipjMTAueSpjMTN4MipjMTMueSpjMjMueCpjMjMueSAtIDYqYzIwLngqYzEzLngqYzEzeTIqYzIzLngqYzIzLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMTIueSpjMTN4MipjMjMueCpjMjMueSAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIzLngqYzIzLnkgLSA2KmMyMS54KmMxMy54KmMyMi54KmMxM3kyKmMyMy55IC1cbiAgICAgICAgICAgIDYqYzIxLngqYzEzLngqYzEzeTIqYzIyLnkqYzIzLnggLSA2KmMxMy54KmMyMS55KmMyMi54KmMxM3kyKmMyMy54ICsgNipjMjEueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMxMy55KmMyMy54KmMyMy55ICsgYzIyeDMqYzEzeTMgLSAzKmMxMC54KmMxM3kzKmMyM3gyICsgMypjMTAueSpjMTN4MypjMjN5MiArXG4gICAgICAgICAgICAzKmMyMC54KmMxM3kzKmMyM3gyICsgYzEyeTMqYzEzLngqYzIzeDIgLSBjMTJ4MypjMTMueSpjMjN5MiAtIDMqYzEwLngqYzEzeDIqYzEzLnkqYzIzeTIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTMueCpjMTN5MipjMjN4MiAtIDIqYzExLngqYzEyLnkqYzEzeDIqYzIzeTIgKyBjMTEueCpjMTIueSpjMTN5MipjMjN4MiAtIGMxMS55KmMxMi54KmMxM3gyKmMyM3kyICtcbiAgICAgICAgICAgIDIqYzExLnkqYzEyLngqYzEzeTIqYzIzeDIgKyAzKmMyMC54KmMxM3gyKmMxMy55KmMyM3kyIC0gYzEyLngqYzEyeTIqYzEzLnkqYzIzeDIgLVxuICAgICAgICAgICAgMypjMjAueSpjMTMueCpjMTN5MipjMjN4MiArIGMxMngyKmMxMi55KmMxMy54KmMyM3kyIC0gMypjMTMueCpjMjJ4MipjMTN5MipjMjIueSArXG4gICAgICAgICAgICBjMTN4MipjMTMueSpjMjMueCooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEzeDIqYzIyLngqYzEzLnkqKDYqYzIxLnkqYzIzLnkgKyAzKmMyMnkyKSArXG4gICAgICAgICAgICBjMTN4MyooLTIqYzIxLnkqYzIyLnkqYzIzLnkgLSBjMjAueSpjMjN5MiAtIGMyMi55KigyKmMyMS55KmMyMy55ICsgYzIyeTIpIC0gYzIzLnkqKDIqYzIwLnkqYzIzLnkgKyAyKmMyMS55KmMyMi55KSksXG4gICAgICAgIDYqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjIueCpjMTMueSpjMjMueSArIGMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMi55KmMyMy54IC1cbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMxMy54KmMyMi54KmMxMy55KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnggLSA2KmMxMS55KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzIyLngqYzEzeTMqYzIzLnggKyA2KmMyMC54KmMyMi54KmMxM3kzKmMyMy54ICsgNipjMTAueSpjMTN4MypjMjIueSpjMjMueSArIDIqYzEyeTMqYzEzLngqYzIyLngqYzIzLnggLVxuICAgICAgICAgICAgMipjMTJ4MypjMTMueSpjMjIueSpjMjMueSArIDYqYzEwLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgKyA2KmMxMC54KmMxMy54KmMxM3kyKmMyMi55KmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLnkqYzEzLngqYzIyLngqYzEzeTIqYzIzLnggLSAzKmMxMS54KmMxMi54KmMyMi54KmMxM3kyKmMyMy55IC0gMypjMTEueCpjMTIueCpjMTN5MipjMjIueSpjMjMueCArXG4gICAgICAgICAgICAyKmMxMS54KmMxMi55KmMyMi54KmMxM3kyKmMyMy54ICsgNCpjMTEueSpjMTIueCpjMjIueCpjMTN5MipjMjMueCAtIDYqYzEwLngqYzEzeDIqYzEzLnkqYzIyLnkqYzIzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMTN4MipjMjIueCpjMTMueSpjMjMueSAtIDYqYzEwLnkqYzEzeDIqYzEzLnkqYzIyLnkqYzIzLnggLSA0KmMxMS54KmMxMi55KmMxM3gyKmMyMi55KmMyMy55IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgLSA2KmMyMC54KmMxMy54KmMxM3kyKmMyMi55KmMyMy54IC0gMipjMTEueSpjMTIueCpjMTN4MipjMjIueSpjMjMueSArXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxM3gyKmMyMi54KmMyMy55ICsgMypjMTEueSpjMTIueSpjMTN4MipjMjIueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIyLngqYzIzLnkgLVxuICAgICAgICAgICAgMipjMTIueCpjMTJ5MipjMTMueCpjMjIueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkqYzIzLnggLSA2KmMyMC55KmMxMy54KmMyMi54KmMxM3kyKmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIxLngqYzEzLngqYzIxLnkqYzEzeTIqYzIzLnggLSA2KmMyMS54KmMxMy54KmMyMi54KmMxM3kyKmMyMi55ICsgNipjMjAueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMxMy54KmMyMi55KmMyMy55ICsgMipjMTJ4MipjMTIueSpjMjIueCpjMTMueSpjMjMueSArIDIqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkqYzIzLnggK1xuICAgICAgICAgICAgMypjMjEueCpjMjJ4MipjMTN5MyArIDMqYzIxeDIqYzEzeTMqYzIzLnggLSAzKmMxMy54KmMyMS55KmMyMngyKmMxM3kyIC0gMypjMjF4MipjMTMueCpjMTN5MipjMjMueSArXG4gICAgICAgICAgICBjMTN4MipjMjIueCpjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEzeDIqYzEzLnkqYzIzLngqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMjEueCpjMTN4MipjMTMueSooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICsgYzEzeDMqKC0yKmMyMC55KmMyMi55KmMyMy55IC0gYzIzLnkqKDIqYzIwLnkqYzIyLnkgKyBjMjF5MikgLVxuICAgICAgICAgICAgYzIxLnkqKDIqYzIxLnkqYzIzLnkgKyBjMjJ5MikgLSBjMjIueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSpjMjMueCArIGMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMyMS54KmMxMy54KmMxMy55KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkqYzIzLnggLSBjMTEueSpjMTIueCpjMTMueCpjMjIueCpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICA2KmMxMS55KmMyMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC0gNipjMTAueCpjMjEueCpjMTN5MypjMjMueCArIDYqYzIwLngqYzIxLngqYzEzeTMqYzIzLnggK1xuICAgICAgICAgICAgMipjMjEueCpjMTJ5MypjMTMueCpjMjMueCArIDYqYzEwLngqYzIxLngqYzEzLngqYzEzeTIqYzIzLnkgKyA2KmMxMC54KmMxMy54KmMyMS55KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLngqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkgKyA2KmMxMC55KmMyMS54KmMxMy54KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjEueCpjMTN5MipjMjMueSAtXG4gICAgICAgICAgICAzKmMxMS54KmMxMi54KmMyMS55KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjIueCpjMTN5MipjMjIueSArIDIqYzExLngqYzIxLngqYzEyLnkqYzEzeTIqYzIzLnggK1xuICAgICAgICAgICAgNCpjMTEueSpjMTIueCpjMjEueCpjMTN5MipjMjMueCAtIDYqYzEwLnkqYzIxLngqYzEzeDIqYzEzLnkqYzIzLnkgLSA2KmMxMC55KmMxM3gyKmMyMS55KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzEzeDIqYzIyLngqYzEzLnkqYzIyLnkgLSA2KmMyMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMy55IC0gNipjMjAueCpjMTMueCpjMjEueSpjMTN5MipjMjMueCAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMy54KmMyMi54KmMxM3kyKmMyMi55ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjMueSAtIDMqYzExLnkqYzEyLnkqYzEzLngqYzIyeDIqYzEzLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMTIueSpjMTN4MipjMjEueSpjMjMueCArIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIyLngqYzIyLnkgLSAyKmMxMi54KmMyMS54KmMxMnkyKmMxMy54KmMyMy55IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLnkqYzIzLnggLSAyKmMxMi54KmMxMnkyKmMxMy54KmMyMS55KmMyMy54IC0gMipjMTIueCpjMTJ5MipjMTMueCpjMjIueCpjMjIueSAtXG4gICAgICAgICAgICA2KmMyMC55KmMyMS54KmMxMy54KmMxM3kyKmMyMy54IC0gNipjMjEueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArIDYqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgMipjMTJ4MipjMjEueCpjMTIueSpjMTMueSpjMjMueSArIDIqYzEyeDIqYzEyLnkqYzIxLnkqYzEzLnkqYzIzLnggKyAyKmMxMngyKmMxMi55KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIyeDIqYzEzeTMgKyAzKmMyMC54KmMyMngyKmMxM3kzICsgMypjMjF4MipjMjIueCpjMTN5MyArIGMxMnkzKmMxMy54KmMyMngyICtcbiAgICAgICAgICAgIDMqYzEwLnkqYzEzLngqYzIyeDIqYzEzeTIgKyBjMTEueCpjMTIueSpjMjJ4MipjMTN5MiArIDIqYzExLnkqYzEyLngqYzIyeDIqYzEzeTIgLVxuICAgICAgICAgICAgYzEyLngqYzEyeTIqYzIyeDIqYzEzLnkgLSAzKmMyMC55KmMxMy54KmMyMngyKmMxM3kyIC0gMypjMjF4MipjMTMueCpjMTN5MipjMjIueSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjEueSpjMjMueSArIGMyMnkyKSArIGMxMS54KmMxMi54KmMxMy54KmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgK1xuICAgICAgICAgICAgYzIxLngqYzEzeDIqYzEzLnkqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMngzKmMxMy55KigtMipjMjEueSpjMjMueSAtIGMyMnkyKSArXG4gICAgICAgICAgICBjMTAueSpjMTN4MyooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICsgYzExLnkqYzEyLngqYzEzeDIqKC0yKmMyMS55KmMyMy55IC0gYzIyeTIpICtcbiAgICAgICAgICAgIGMxMS54KmMxMi55KmMxM3gyKigtNCpjMjEueSpjMjMueSAtIDIqYzIyeTIpICsgYzEwLngqYzEzeDIqYzEzLnkqKC02KmMyMS55KmMyMy55IC0gMypjMjJ5MikgK1xuICAgICAgICAgICAgYzEzeDIqYzIyLngqYzEzLnkqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgK1xuICAgICAgICAgICAgYzEzeDMqKC0yKmMyMC55KmMyMS55KmMyMy55IC0gYzIyLnkqKDIqYzIwLnkqYzIyLnkgKyBjMjF5MikgLSBjMjAueSooMipjMjEueSpjMjMueSArIGMyMnkyKSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgLWMxMC54KmMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy55ICsgYzEwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgKyA2KmMxMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgLSBjMTAueSpjMTEueCpjMTIueSpjMTMueCpjMTMueSpjMjMueCArIGMxMC55KmMxMS55KmMxMi54KmMxMy54KmMxMy55KmMyMy54ICtcbiAgICAgICAgICAgIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54KmMyMy55IC0gYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkqYzIzLnggKyBjMTEueCpjMjAueCpjMTIueSpjMTMueCpjMTMueSpjMjMueSArXG4gICAgICAgICAgICBjMTEueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSpjMjMueCArIGMxMS54KmMyMS54KmMxMi55KmMxMy54KmMxMy55KmMyMi55ICsgYzExLngqYzEyLnkqYzEzLngqYzIxLnkqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgLSA2KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC0gYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgYzExLnkqYzEyLngqYzIxLngqYzEzLngqYzEzLnkqYzIyLnkgLSBjMTEueSpjMTIueCpjMTMueCpjMjEueSpjMjIueCpjMTMueSAtIDYqYzExLnkqYzIxLngqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueCpjMjAueCpjMTN5MypjMjMueCAtIDYqYzEwLngqYzIxLngqYzIyLngqYzEzeTMgLSAyKmMxMC54KmMxMnkzKmMxMy54KmMyMy54ICsgNipjMjAueCpjMjEueCpjMjIueCpjMTN5MyArXG4gICAgICAgICAgICAyKmMyMC54KmMxMnkzKmMxMy54KmMyMy54ICsgMipjMjEueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzEwLnkqYzEyeDMqYzEzLnkqYzIzLnkgLSA2KmMxMC54KmMxMC55KmMxMy54KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzEwLngqYzExLngqYzEyLngqYzEzeTIqYzIzLnkgLSAyKmMxMC54KmMxMS54KmMxMi55KmMxM3kyKmMyMy54IC0gNCpjMTAueCpjMTEueSpjMTIueCpjMTN5MipjMjMueCArXG4gICAgICAgICAgICAzKmMxMC55KmMxMS54KmMxMi54KmMxM3kyKmMyMy54ICsgNipjMTAueCpjMTAueSpjMTN4MipjMTMueSpjMjMueSArIDYqYzEwLngqYzIwLngqYzEzLngqYzEzeTIqYzIzLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMTEueSpjMTIueSpjMTN4MipjMjMueSArIDIqYzEwLngqYzEyLngqYzEyeTIqYzEzLngqYzIzLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy55KmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLngqYzIwLnkqYzEzLngqYzEzeTIqYzIzLnggKyA2KmMxMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMi55ICsgNipjMTAueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMy55ICsgNipjMTAueSpjMjAueCpjMTMueCpjMTN5MipjMjMueCArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIzLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMTIueSpjMTN4MipjMjMueCArIDIqYzEwLnkqYzEyLngqYzEyeTIqYzEzLngqYzIzLnggKyA2KmMxMC55KmMyMS54KmMxMy54KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzExLngqYzIwLngqYzEyLngqYzEzeTIqYzIzLnkgKyAyKmMxMS54KmMyMC54KmMxMi55KmMxM3kyKmMyMy54ICsgYzExLngqYzExLnkqYzEyeTIqYzEzLngqYzIzLnggLVxuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMjAueSpjMTN5MipjMjMueCAtIDMqYzExLngqYzEyLngqYzIxLngqYzEzeTIqYzIyLnkgLSAzKmMxMS54KmMxMi54KmMyMS55KmMyMi54KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzExLngqYzIxLngqYzEyLnkqYzIyLngqYzEzeTIgKyA0KmMyMC54KmMxMS55KmMxMi54KmMxM3kyKmMyMy54ICsgNCpjMTEueSpjMTIueCpjMjEueCpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICAyKmMxMC54KmMxMngyKmMxMi55KmMxMy55KmMyMy55IC0gNipjMTAueSpjMjAueCpjMTN4MipjMTMueSpjMjMueSAtIDYqYzEwLnkqYzIwLnkqYzEzeDIqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueSpjMjEueCpjMTN4MipjMTMueSpjMjIueSAtIDIqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLngqYzIzLnkgLSAyKmMxMC55KmMxMngyKmMxMi55KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzEzeDIqYzIxLnkqYzIyLngqYzEzLnkgLSBjMTEueCpjMTEueSpjMTJ4MipjMTMueSpjMjMueSAtIDIqYzExLngqYzExeTIqYzEzLngqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgMypjMjAueCpjMTEueSpjMTIueSpjMTN4MipjMjMueSAtIDIqYzIwLngqYzEyLngqYzEyeTIqYzEzLngqYzIzLnkgLSAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzIwLnkqYzEzLngqYzEzeTIqYzIzLnggLSA2KmMyMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMi55IC0gNipjMjAueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMS55KmMyMC55KmMxMi55KmMxM3gyKmMyMy54ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjIueSArIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIxLnkqYzIyLnggLVxuICAgICAgICAgICAgMipjMTIueCpjMjAueSpjMTJ5MipjMTMueCpjMjMueCAtIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIyLnkgLSAyKmMxMi54KmMyMS54KmMxMnkyKmMyMi54KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzEyeTIqYzEzLngqYzIxLnkqYzIyLnggLSA2KmMyMC55KmMyMS54KmMxMy54KmMyMi54KmMxM3kyIC0gYzExeTIqYzEyLngqYzEyLnkqYzEzLngqYzIzLnggK1xuICAgICAgICAgICAgMipjMjAueCpjMTJ4MipjMTIueSpjMTMueSpjMjMueSArIDYqYzIwLnkqYzEzeDIqYzIxLnkqYzIyLngqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMxMy54KmMxMy55KmMyMy55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMi54KmMxMi55KmMxMy55KmMyMy55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMTMueSpjMjMueCArIDIqYzEyeDIqYzIxLngqYzEyLnkqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgMipjMTJ4MipjMTIueSpjMjEueSpjMjIueCpjMTMueSArIGMyMXgzKmMxM3kzICsgMypjMTB4MipjMTN5MypjMjMueCAtIDMqYzEweTIqYzEzeDMqYzIzLnkgK1xuICAgICAgICAgICAgMypjMjB4MipjMTN5MypjMjMueCArIGMxMXkzKmMxM3gyKmMyMy54IC0gYzExeDMqYzEzeTIqYzIzLnkgLSBjMTEueCpjMTF5MipjMTN4MipjMjMueSArXG4gICAgICAgICAgICBjMTF4MipjMTEueSpjMTN5MipjMjMueCAtIDMqYzEweDIqYzEzLngqYzEzeTIqYzIzLnkgKyAzKmMxMHkyKmMxM3gyKmMxMy55KmMyMy54IC0gYzExeDIqYzEyeTIqYzEzLngqYzIzLnkgK1xuICAgICAgICAgICAgYzExeTIqYzEyeDIqYzEzLnkqYzIzLnggLSAzKmMyMXgyKmMxMy54KmMyMS55KmMxM3kyIC0gMypjMjB4MipjMTMueCpjMTN5MipjMjMueSArIDMqYzIweTIqYzEzeDIqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgYzExLngqYzEyLngqYzEzLngqYzEzLnkqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMngzKmMxMy55KigtMipjMjAueSpjMjMueSAtIDIqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMxMC55KmMxM3gzKig2KmMyMC55KmMyMy55ICsgNipjMjEueSpjMjIueSkgKyBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIwLnkqYzIzLnkgLSAyKmMyMS55KmMyMi55KSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpICsgYzExLngqYzEyLnkqYzEzeDIqKC00KmMyMC55KmMyMy55IC0gNCpjMjEueSpjMjIueSkgK1xuICAgICAgICAgICAgYzEwLngqYzEzeDIqYzEzLnkqKC02KmMyMC55KmMyMy55IC0gNipjMjEueSpjMjIueSkgKyBjMjAueCpjMTN4MipjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMyMS54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgKyBjMTN4MyooLTIqYzIwLnkqYzIxLnkqYzIyLnkgLSBjMjB5MipjMjMueSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjAueSpjMjIueSArIGMyMXkyKSAtIGMyMC55KigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSkpLFxuICAgICAgICAtYzEwLngqYzExLngqYzEyLnkqYzEzLngqYzEzLnkqYzIyLnkgKyBjMTAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSArIDYqYzEwLngqYzExLnkqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMTEueCpjMTIueCpjMTMueCpjMTMueSpjMjIueSAtIGMxMC55KmMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55ICsgYzEwLnkqYzExLnkqYzEyLngqYzEzLngqYzIyLngqYzEzLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLngqYzIyLnkgLSBjMTEueCpjMTEueSpjMTIueCpjMTIueSpjMjIueCpjMTMueSArIGMxMS54KmMyMC54KmMxMi55KmMxMy54KmMxMy55KmMyMi55ICtcbiAgICAgICAgICAgIGMxMS54KmMyMC55KmMxMi55KmMxMy54KmMyMi54KmMxMy55ICsgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzIxLnkqYzEzLnkgLSBjMjAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMyMi54KmMxMy55IC0gYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzIyLngqYzEzLnkgLSBjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMjEueSpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC54KmMyMC54KmMyMi54KmMxM3kzIC0gMipjMTAueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzIwLngqYzEyeTMqYzEzLngqYzIyLnggKyAyKmMxMC55KmMxMngzKmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzEwLnkqYzEzLngqYzIyLngqYzEzeTIgKyAzKmMxMC54KmMxMS54KmMxMi54KmMxM3kyKmMyMi55IC0gMipjMTAueCpjMTEueCpjMTIueSpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICA0KmMxMC54KmMxMS55KmMxMi54KmMyMi54KmMxM3kyICsgMypjMTAueSpjMTEueCpjMTIueCpjMjIueCpjMTN5MiArIDYqYzEwLngqYzEwLnkqYzEzeDIqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgNipjMTAueCpjMjAueCpjMTMueCpjMTN5MipjMjIueSAtIDMqYzEwLngqYzExLnkqYzEyLnkqYzEzeDIqYzIyLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMi55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkgKyA2KmMxMC54KmMyMC55KmMxMy54KmMyMi54KmMxM3kyICsgNipjMTAueCpjMjEueCpjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMi55ICsgNipjMTAueSpjMjAueCpjMTMueCpjMjIueCpjMTN5MiArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMTIueSpjMTN4MipjMjIueCArIDIqYzEwLnkqYzEyLngqYzEyeTIqYzEzLngqYzIyLnggLSAzKmMxMS54KmMyMC54KmMxMi54KmMxM3kyKmMyMi55ICtcbiAgICAgICAgICAgIDIqYzExLngqYzIwLngqYzEyLnkqYzIyLngqYzEzeTIgKyBjMTEueCpjMTEueSpjMTJ5MipjMTMueCpjMjIueCAtIDMqYzExLngqYzEyLngqYzIwLnkqYzIyLngqYzEzeTIgLVxuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMjEueCpjMjEueSpjMTN5MiArIDQqYzIwLngqYzExLnkqYzEyLngqYzIyLngqYzEzeTIgLSAyKmMxMC54KmMxMngyKmMxMi55KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzIwLngqYzEzeDIqYzEzLnkqYzIyLnkgLSA2KmMxMC55KmMyMC55KmMxM3gyKmMyMi54KmMxMy55IC0gNipjMTAueSpjMjEueCpjMTN4MipjMjEueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMxMi55KmMxMy54KmMyMi55IC0gMipjMTAueSpjMTJ4MipjMTIueSpjMjIueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDIqYzExLngqYzExeTIqYzEzLngqYzIyLngqYzEzLnkgKyAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMi55IC0gMipjMjAueCpjMTIueCpjMTJ5MipjMTMueCpjMjIueSAtXG4gICAgICAgICAgICAyKmMyMC54KmMxMi54KmMxMnkyKmMyMi54KmMxMy55IC0gNipjMjAueCpjMjAueSpjMTMueCpjMjIueCpjMTN5MiAtIDYqYzIwLngqYzIxLngqYzEzLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTEueSpjMjAueSpjMTIueSpjMTN4MipjMjIueCArIDMqYzExLnkqYzIxLngqYzEyLnkqYzEzeDIqYzIxLnkgLSAyKmMxMi54KmMyMC55KmMxMnkyKmMxMy54KmMyMi54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIxLnkgLSBjMTF5MipjMTIueCpjMTIueSpjMTMueCpjMjIueCArIDIqYzIwLngqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTEueSpjMjF4MipjMTIueSpjMTMueCpjMTMueSArIDYqYzIwLnkqYzIxLngqYzEzeDIqYzIxLnkqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMxMy54KmMxMy55KmMyMi55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMi54KmMxMi55KmMxMy55KmMyMi55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMjIueCpjMTMueSArIDIqYzEyeDIqYzIxLngqYzEyLnkqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMjF4MipjMTN5MyArIDMqYzIwLngqYzIxeDIqYzEzeTMgKyAzKmMxMHgyKmMyMi54KmMxM3kzIC0gMypjMTB5MipjMTN4MypjMjIueSArIDMqYzIweDIqYzIyLngqYzEzeTMgK1xuICAgICAgICAgICAgYzIxeDIqYzEyeTMqYzEzLnggKyBjMTF5MypjMTN4MipjMjIueCAtIGMxMXgzKmMxM3kyKmMyMi55ICsgMypjMTAueSpjMjF4MipjMTMueCpjMTN5MiAtXG4gICAgICAgICAgICBjMTEueCpjMTF5MipjMTN4MipjMjIueSArIGMxMS54KmMyMXgyKmMxMi55KmMxM3kyICsgMipjMTEueSpjMTIueCpjMjF4MipjMTN5MiArIGMxMXgyKmMxMS55KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMi54KmMyMXgyKmMxMnkyKmMxMy55IC0gMypjMjAueSpjMjF4MipjMTMueCpjMTN5MiAtIDMqYzEweDIqYzEzLngqYzEzeTIqYzIyLnkgKyAzKmMxMHkyKmMxM3gyKmMyMi54KmMxMy55IC1cbiAgICAgICAgICAgIGMxMXgyKmMxMnkyKmMxMy54KmMyMi55ICsgYzExeTIqYzEyeDIqYzIyLngqYzEzLnkgLSAzKmMyMHgyKmMxMy54KmMxM3kyKmMyMi55ICsgMypjMjB5MipjMTN4MipjMjIueCpjMTMueSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjAueSpjMjIueSArIGMyMXkyKSArIGMxMS54KmMxMi54KmMxMy54KmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgK1xuICAgICAgICAgICAgYzEyeDMqYzEzLnkqKC0yKmMyMC55KmMyMi55IC0gYzIxeTIpICsgYzEwLnkqYzEzeDMqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIwLnkqYzIyLnkgLSBjMjF5MikgKyBjMTEueCpjMTIueSpjMTN4MiooLTQqYzIwLnkqYzIyLnkgLSAyKmMyMXkyKSArXG4gICAgICAgICAgICBjMTAueCpjMTN4MipjMTMueSooLTYqYzIwLnkqYzIyLnkgLSAzKmMyMXkyKSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgK1xuICAgICAgICAgICAgYzEzeDMqKC0yKmMyMC55KmMyMXkyIC0gYzIweTIqYzIyLnkgLSBjMjAueSooMipjMjAueSpjMjIueSArIGMyMXkyKSksXG4gICAgICAgIC1jMTAueCpjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSArIGMxMC54KmMxMS55KmMxMi54KmMxMy54KmMyMS55KmMxMy55ICsgNipjMTAueCpjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC55KmMxMS54KmMxMi54KmMxMy54KmMyMS55KmMxMy55IC0gYzEwLnkqYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkgKyBjMTAueSpjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMTMueSAtXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueCpjMjEueCpjMTIueSpjMTMueSArIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54KmMyMS55ICsgYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzIxLnkqYzEzLnkgK1xuICAgICAgICAgICAgNipjMTEueCpjMTIueCpjMjAueSpjMTMueCpjMjEueSpjMTMueSArIGMxMS54KmMyMC55KmMyMS54KmMxMi55KmMxMy54KmMxMy55IC0gYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgNipjMjAueCpjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMTMueSAtIGMxMS55KmMxMi54KmMyMC55KmMyMS54KmMxMy54KmMxMy55IC0gNipjMTAueCpjMjAueCpjMjEueCpjMTN5MyAtXG4gICAgICAgICAgICAyKmMxMC54KmMyMS54KmMxMnkzKmMxMy54ICsgNipjMTAueSpjMjAueSpjMTN4MypjMjEueSArIDIqYzIwLngqYzIxLngqYzEyeTMqYzEzLnggKyAyKmMxMC55KmMxMngzKmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEyeDMqYzIwLnkqYzIxLnkqYzEzLnkgLSA2KmMxMC54KmMxMC55KmMyMS54KmMxMy54KmMxM3kyICsgMypjMTAueCpjMTEueCpjMTIueCpjMjEueSpjMTN5MiAtXG4gICAgICAgICAgICAyKmMxMC54KmMxMS54KmMyMS54KmMxMi55KmMxM3kyIC0gNCpjMTAueCpjMTEueSpjMTIueCpjMjEueCpjMTN5MiArIDMqYzEwLnkqYzExLngqYzEyLngqYzIxLngqYzEzeTIgK1xuICAgICAgICAgICAgNipjMTAueCpjMTAueSpjMTN4MipjMjEueSpjMTMueSArIDYqYzEwLngqYzIwLngqYzEzLngqYzIxLnkqYzEzeTIgLSAzKmMxMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMS55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzIxLngqYzEyeTIqYzEzLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMS55ICsgNipjMTAueCpjMjAueSpjMjEueCpjMTMueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMS55ICsgNipjMTAueSpjMjAueCpjMjEueCpjMTMueCpjMTN5MiArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIxLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMjEueCpjMTIueSpjMTN4MiArIDIqYzEwLnkqYzEyLngqYzIxLngqYzEyeTIqYzEzLnggLSAzKmMxMS54KmMyMC54KmMxMi54KmMyMS55KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzExLngqYzIwLngqYzIxLngqYzEyLnkqYzEzeTIgKyBjMTEueCpjMTEueSpjMjEueCpjMTJ5MipjMTMueCAtIDMqYzExLngqYzEyLngqYzIwLnkqYzIxLngqYzEzeTIgK1xuICAgICAgICAgICAgNCpjMjAueCpjMTEueSpjMTIueCpjMjEueCpjMTN5MiAtIDYqYzEwLngqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkgLSAyKmMxMC54KmMxMngyKmMxMi55KmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzIwLngqYzEzeDIqYzIxLnkqYzEzLnkgLSA2KmMxMC55KmMyMC55KmMyMS54KmMxM3gyKmMxMy55IC0gMipjMTAueSpjMTJ4MipjMjEueCpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMxMi55KmMxMy54KmMyMS55IC0gYzExLngqYzExLnkqYzEyeDIqYzIxLnkqYzEzLnkgLSA0KmMxMS54KmMyMC55KmMxMi55KmMxM3gyKmMyMS55IC1cbiAgICAgICAgICAgIDIqYzExLngqYzExeTIqYzIxLngqYzEzLngqYzEzLnkgKyAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMS55IC0gMipjMjAueCpjMTIueCpjMjEueCpjMTJ5MipjMTMueSAtXG4gICAgICAgICAgICAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMS55IC0gNipjMjAueCpjMjAueSpjMjEueCpjMTMueCpjMTN5MiAtIDIqYzExLnkqYzEyLngqYzIwLnkqYzEzeDIqYzIxLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMjAueSpjMjEueCpjMTIueSpjMTN4MiAtIDIqYzEyLngqYzIwLnkqYzIxLngqYzEyeTIqYzEzLnggLSBjMTF5MipjMTIueCpjMjEueCpjMTIueSpjMTMueCArXG4gICAgICAgICAgICA2KmMyMC54KmMyMC55KmMxM3gyKmMyMS55KmMxMy55ICsgMipjMjAueCpjMTJ4MipjMTIueSpjMjEueSpjMTMueSArIDIqYzExeDIqYzExLnkqYzEzLngqYzIxLnkqYzEzLnkgK1xuICAgICAgICAgICAgYzExeDIqYzEyLngqYzEyLnkqYzIxLnkqYzEzLnkgKyAyKmMxMngyKmMyMC55KmMyMS54KmMxMi55KmMxMy55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMTMueCpjMjEueSArXG4gICAgICAgICAgICAzKmMxMHgyKmMyMS54KmMxM3kzIC0gMypjMTB5MipjMTN4MypjMjEueSArIDMqYzIweDIqYzIxLngqYzEzeTMgKyBjMTF5MypjMjEueCpjMTN4MiAtIGMxMXgzKmMyMS55KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzIweTIqYzEzeDMqYzIxLnkgLSBjMTEueCpjMTF5MipjMTN4MipjMjEueSArIGMxMXgyKmMxMS55KmMyMS54KmMxM3kyIC0gMypjMTB4MipjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMHkyKmMyMS54KmMxM3gyKmMxMy55IC0gYzExeDIqYzEyeTIqYzEzLngqYzIxLnkgKyBjMTF5MipjMTJ4MipjMjEueCpjMTMueSAtIDMqYzIweDIqYzEzLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMypjMjB5MipjMjEueCpjMTN4MipjMTMueSxcbiAgICAgICAgYzEwLngqYzEwLnkqYzExLngqYzEyLnkqYzEzLngqYzEzLnkgLSBjMTAueCpjMTAueSpjMTEueSpjMTIueCpjMTMueCpjMTMueSArIGMxMC54KmMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54IC0gYzEwLngqYzExLngqYzIwLnkqYzEyLnkqYzEzLngqYzEzLnkgKyA2KmMxMC54KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMC54KmMxMS55KmMxMi54KmMyMC55KmMxMy54KmMxMy55IC0gYzEwLnkqYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzEzLnkgLSA2KmMxMC55KmMxMS54KmMxMi54KmMyMC55KmMxMy54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMC55KmMyMC54KmMxMS55KmMxMi54KmMxMy54KmMxMy55IC0gYzExLngqYzIwLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkgKyBjMTEueCpjMTEueSpjMTIueCpjMjAueSpjMTIueSpjMTMueCArXG4gICAgICAgICAgICBjMTEueCpjMjAueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSAtIGMyMC54KmMxMS55KmMxMi54KmMyMC55KmMxMy54KmMxMy55IC0gMipjMTAueCpjMjAueCpjMTJ5MypjMTMueCArXG4gICAgICAgICAgICAyKmMxMC55KmMxMngzKmMyMC55KmMxMy55IC0gMypjMTAueCpjMTAueSpjMTEueCpjMTIueCpjMTN5MiAtIDYqYzEwLngqYzEwLnkqYzIwLngqYzEzLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTAueCpjMTAueSpjMTEueSpjMTIueSpjMTN4MiAtIDIqYzEwLngqYzEwLnkqYzEyLngqYzEyeTIqYzEzLnggLSAyKmMxMC54KmMxMS54KmMyMC54KmMxMi55KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMC54KmMxMS54KmMxMS55KmMxMnkyKmMxMy54ICsgMypjMTAueCpjMTEueCpjMTIueCpjMjAueSpjMTN5MiAtIDQqYzEwLngqYzIwLngqYzExLnkqYzEyLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTEueCpjMjAueCpjMTIueCpjMTN5MiArIDYqYzEwLngqYzEwLnkqYzIwLnkqYzEzeDIqYzEzLnkgKyAyKmMxMC54KmMxMC55KmMxMngyKmMxMi55KmMxMy55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzExLngqYzExeTIqYzEzLngqYzEzLnkgKyAyKmMxMC54KmMyMC54KmMxMi54KmMxMnkyKmMxMy55ICsgNipjMTAueCpjMjAueCpjMjAueSpjMTMueCpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMC54KmMxMS55KmMyMC55KmMxMi55KmMxM3gyICsgMipjMTAueCpjMTIueCpjMjAueSpjMTJ5MipjMTMueCArIGMxMC54KmMxMXkyKmMxMi54KmMxMi55KmMxMy54ICtcbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMS55KmMxMngyKmMxMy55ICsgNCpjMTAueSpjMTEueCpjMjAueSpjMTIueSpjMTN4MiAtIDMqYzEwLnkqYzIwLngqYzExLnkqYzEyLnkqYzEzeDIgK1xuICAgICAgICAgICAgMipjMTAueSpjMjAueCpjMTIueCpjMTJ5MipjMTMueCArIDIqYzEwLnkqYzExLnkqYzEyLngqYzIwLnkqYzEzeDIgKyBjMTEueCpjMjAueCpjMTEueSpjMTJ5MipjMTMueCAtXG4gICAgICAgICAgICAzKmMxMS54KmMyMC54KmMxMi54KmMyMC55KmMxM3kyIC0gMipjMTAueCpjMTJ4MipjMjAueSpjMTIueSpjMTMueSAtIDYqYzEwLnkqYzIwLngqYzIwLnkqYzEzeDIqYzEzLnkgLVxuICAgICAgICAgICAgMipjMTAueSpjMjAueCpjMTJ4MipjMTIueSpjMTMueSAtIDIqYzEwLnkqYzExeDIqYzExLnkqYzEzLngqYzEzLnkgLSBjMTAueSpjMTF4MipjMTIueCpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMyMC55KmMxMi55KmMxMy54IC0gMipjMTEueCpjMjAueCpjMTF5MipjMTMueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMyMC55KmMxMy55ICtcbiAgICAgICAgICAgIDMqYzIwLngqYzExLnkqYzIwLnkqYzEyLnkqYzEzeDIgLSAyKmMyMC54KmMxMi54KmMyMC55KmMxMnkyKmMxMy54IC0gYzIwLngqYzExeTIqYzEyLngqYzEyLnkqYzEzLnggK1xuICAgICAgICAgICAgMypjMTB5MipjMTEueCpjMTIueCpjMTMueCpjMTMueSArIDMqYzExLngqYzEyLngqYzIweTIqYzEzLngqYzEzLnkgKyAyKmMyMC54KmMxMngyKmMyMC55KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIDMqYzEweDIqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMyMC55KmMxMy54KmMxMy55ICsgYzExeDIqYzEyLngqYzIwLnkqYzEyLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMjB4MipjMTEueSpjMTIueSpjMTMueCpjMTMueSAtIGMxMHgzKmMxM3kzICsgYzEweTMqYzEzeDMgKyBjMjB4MypjMTN5MyAtIGMyMHkzKmMxM3gzIC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIweDIqYzEzeTMgLSBjMTAueCpjMTF5MypjMTN4MiArIDMqYzEweDIqYzIwLngqYzEzeTMgKyBjMTAueSpjMTF4MypjMTN5MiArXG4gICAgICAgICAgICAzKmMxMC55KmMyMHkyKmMxM3gzICsgYzIwLngqYzExeTMqYzEzeDIgKyBjMTB4MipjMTJ5MypjMTMueCAtIDMqYzEweTIqYzIwLnkqYzEzeDMgLSBjMTB5MipjMTJ4MypjMTMueSArXG4gICAgICAgICAgICBjMjB4MipjMTJ5MypjMTMueCAtIGMxMXgzKmMyMC55KmMxM3kyIC0gYzEyeDMqYzIweTIqYzEzLnkgLSBjMTAueCpjMTF4MipjMTEueSpjMTN5MiArXG4gICAgICAgICAgICBjMTAueSpjMTEueCpjMTF5MipjMTN4MiAtIDMqYzEwLngqYzEweTIqYzEzeDIqYzEzLnkgLSBjMTAueCpjMTF5MipjMTJ4MipjMTMueSArIGMxMC55KmMxMXgyKmMxMnkyKmMxMy54IC1cbiAgICAgICAgICAgIGMxMS54KmMxMXkyKmMyMC55KmMxM3gyICsgMypjMTB4MipjMTAueSpjMTMueCpjMTN5MiArIGMxMHgyKmMxMS54KmMxMi55KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzEweDIqYzExLnkqYzEyLngqYzEzeTIgLSAyKmMxMHkyKmMxMS54KmMxMi55KmMxM3gyIC0gYzEweTIqYzExLnkqYzEyLngqYzEzeDIgKyBjMTF4MipjMjAueCpjMTEueSpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMC54KmMyMHkyKmMxM3gyKmMxMy55ICsgMypjMTAueSpjMjB4MipjMTMueCpjMTN5MiArIGMxMS54KmMyMHgyKmMxMi55KmMxM3kyIC0gMipjMTEueCpjMjB5MipjMTIueSpjMTN4MiArXG4gICAgICAgICAgICBjMjAueCpjMTF5MipjMTJ4MipjMTMueSAtIGMxMS55KmMxMi54KmMyMHkyKmMxM3gyIC0gYzEweDIqYzEyLngqYzEyeTIqYzEzLnkgLSAzKmMxMHgyKmMyMC55KmMxMy54KmMxM3kyICtcbiAgICAgICAgICAgIDMqYzEweTIqYzIwLngqYzEzeDIqYzEzLnkgKyBjMTB5MipjMTJ4MipjMTIueSpjMTMueCAtIGMxMXgyKmMyMC55KmMxMnkyKmMxMy54ICsgMipjMjB4MipjMTEueSpjMTIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMyMC54KmMyMHkyKmMxM3gyKmMxMy55IC0gYzIweDIqYzEyLngqYzEyeTIqYzEzLnkgLSAzKmMyMHgyKmMyMC55KmMxMy54KmMxM3kyICsgYzEyeDIqYzIweTIqYzEyLnkqYzEzLnhcbiAgICApO1xuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHNJbkludGVydmFsKDAsMSk7XG5cbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcbiAgICAgICAgdmFyIHhSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEzLngsXG4gICAgICAgICAgICBjMTIueCxcbiAgICAgICAgICAgIGMxMS54LFxuICAgICAgICAgICAgYzEwLnggLSBjMjAueCAtIHMqYzIxLnggLSBzKnMqYzIyLnggLSBzKnMqcypjMjMueFxuICAgICAgICApLmdldFJvb3RzKCk7XG4gICAgICAgIHZhciB5Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIGMxMy55LFxuICAgICAgICAgICAgYzEyLnksXG4gICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55IC0gcypzKnMqYzIzLnlcbiAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICB2YXIgVE9MRVJBTkNFID0gMWUtNDtcblxuICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICB2YXIgeFJvb3QgPSB4Um9vdHNbal07XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKCAwIDw9IHhSb290ICYmIHhSb290IDw9IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgIC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8vIEV4cGFuZCBhbmQgY29sbGVjdCB0ZXJtcyB0byBmb3JtIGxpbmVhciBjb21iaW5hdGlvbnMgb2Ygb3JpZ2luYWwgQmV6aWVyXG4gICAgLy8gY29udHJvbHMuICBUaGlzIGVuZHMgdXAgd2l0aCBhIHZlY3RvciBjdWJpYyBpbiB0OlxuICAgIC8vICAgICAoLVAxKzNQMi0zUDMrUDQpdF4zICsgKDNQMS02UDIrM1AzKXReMiArICgtM1AxKzNQMil0ICsgUDFcbiAgICAvLyAgICAgICAgICAgICAvXFwgICAgICAgICAgICAgICAgICAvXFwgICAgICAgICAgICAgICAgL1xcICAgICAgIC9cXFxuICAgIC8vICAgICAgICAgICAgIHx8ICAgICAgICAgICAgICAgICAgfHwgICAgICAgICAgICAgICAgfHwgICAgICAgfHxcbiAgICAvLyAgICAgICAgICAgICBjMyAgICAgICAgICAgICAgICAgIGMyICAgICAgICAgICAgICAgIGMxICAgICAgIGMwXG4gICAgXG4gICAgLy8gQ2FsY3VsYXRlIHRoZSBjb2VmZmljaWVudHNcbiAgICBhID0gcDEubXVsdGlwbHkoLTEpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgzKTtcbiAgICBjID0gcDMubXVsdGlwbHkoLTMpO1xuICAgIGQgPSBhLmFkZChiLmFkZChjLmFkZChwNCkpKTtcbiAgICBjMyA9IG5ldyBWZWN0b3IyRChkLngsIGQueSk7XG5cbiAgICBhID0gcDEubXVsdGlwbHkoMyk7XG4gICAgYiA9IHAyLm11bHRpcGx5KC02KTtcbiAgICBjID0gcDMubXVsdGlwbHkoMyk7XG4gICAgZCA9IGEuYWRkKGIuYWRkKGMpKTtcbiAgICBjMiA9IG5ldyBWZWN0b3IyRChkLngsIGQueSk7XG5cbiAgICBhID0gcDEubXVsdGlwbHkoLTMpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgzKTtcbiAgICBjID0gYS5hZGQoYik7XG4gICAgYzEgPSBuZXcgVmVjdG9yMkQoYy54LCBjLnkpO1xuXG4gIC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gICAgICAvLyBXZSdyZSB3aXRoaW4gdGhlIEJlemllciBjdXJ2ZVxuICAgICAgICAgICAgLy8gRmluZCBwb2ludCBvbiBCZXppZXJcbiAgICAgICAgICAgIHZhciBwNSA9IHAxLmxlcnAocDIsIHQpO1xuICAgICAgICAgICAgdmFyIHA2ID0gcDIubGVycChwMywgdCk7XG4gICAgICAgICAgICB2YXIgcDcgPSBwMy5sZXJwKHA0LCB0KTtcblxuICAgICAgICAgICAgdmFyIHA4ID0gcDUubGVycChwNiwgdCk7XG4gICAgICAgICAgICB2YXIgcDkgPSBwNi5sZXJwKHA3LCB0KTtcblxuICAgICAgICAgICAgdmFyIHAxMCA9IHA4LmxlcnAocDksIHQpO1xuXG4gICAgICAgICAgICAvLyBTZWUgaWYgcG9pbnQgaXMgb24gbGluZSBzZWdtZW50XG4gICAgICAgICAgICAvLyBIYWQgdG8gbWFrZSBzcGVjaWFsIGNhc2VzIGZvciB2ZXJ0aWNhbCBhbmQgaG9yaXpvbnRhbCBsaW5lcyBkdWVcbiAgICAgICAgICAgIC8vIHRvIHNsaWdodCBlcnJvcnMgaW4gY2FsY3VsYXRpb24gb2YgcDEwXG4gICAgICAgICAgICBpZiAoIGExLnggPT0gYTIueCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG1pbi55IDw9IHAxMC55ICYmIHAxMC55IDw9IG1heC55ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBwMTAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBhMS55ID09IGEyLnkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBtaW4ueCA8PSBwMTAueCAmJiBwMTAueCA8PSBtYXgueCApIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnN0YXR1cyA9IFwiSW50ZXJzZWN0a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yAoIDIqY19kaXN0ICk7XG4gICAgICAgIHZhciBoID0gTWF0aC5zcXJ0KHIxKnIxIC0gYSphKTtcbiAgICAgICAgdmFyIHAgPSBjMS5sZXJwKGMyLCBhL2NfZGlzdCk7XG4gICAgICAgIHZhciBiID0gaCAvIGNfZGlzdDtcblxuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBwLnggLSBiICogKGMyLnkgLSBjMS55KSxcbiAgICAgICAgICAgICAgICBwLnkgKyBiICogKGMyLnggLSBjMS54KVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBwLnggKyBiICogKGMyLnkgLSBjMS55KSxcbiAgICAgICAgICAgICAgICBwLnkgLSBiICogKGMyLnggLSBjMS54KVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdENpcmNsZUVsbGlwc2VcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdENpcmNsZUVsbGlwc2UgPSBmdW5jdGlvbihjYywgciwgZWMsIHJ4LCByeSkge1xuICAgIHJldHVybiBJbnRlcnNlY3Rpb24uaW50ZXJzZWN0RWxsaXBzZUVsbGlwc2UoY2MsIHIsIHIsIGVjLCByeCwgcnkpO1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RDaXJjbGVMaW5lXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RDaXJjbGVMaW5lID0gZnVuY3Rpb24oYywgciwgYTEsIGEyKSB7XG4gICAgdmFyIHJlc3VsdDtcbiAgICB2YXIgYSAgPSAoYTIueCAtIGExLngpICogKGEyLnggLSBhMS54KSArXG4gICAgICAgICAgICAgKGEyLnkgLSBhMS55KSAqIChhMi55IC0gYTEueSk7XG4gICAgdmFyIGIgID0gMiAqICggKGEyLnggLSBhMS54KSAqIChhMS54IC0gYy54KSArXG4gICAgICAgICAgICAgICAgICAgKGEyLnkgLSBhMS55KSAqIChhMS55IC0gYy55KSAgICk7XG4gICAgdmFyIGNjID0gYy54KmMueCArIGMueSpjLnkgKyBhMS54KmExLnggKyBhMS55KmExLnkgLVxuICAgICAgICAgICAgIDIgKiAoYy54ICogYTEueCArIGMueSAqIGExLnkpIC0gcipyO1xuICAgIHZhciBkZXRlciA9IGIqYiAtIDQqYSpjYztcblxuICAgIGlmICggZGV0ZXIgPCAwICkge1xuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICB9IGVsc2UgaWYgKCBkZXRlciA9PSAwICkge1xuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiVGFuZ2VudFwiKTtcbiAgICAgICAgLy8gTk9URTogc2hvdWxkIGNhbGN1bGF0ZSB0aGlzIHBvaW50XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIGUgID0gTWF0aC5zcXJ0KGRldGVyKTtcbiAgICAgICAgdmFyIHUxID0gKCAtYiArIGUgKSAvICggMiphICk7XG4gICAgICAgIHZhciB1MiA9ICggLWIgLSBlICkgLyAoIDIqYSApO1xuXG4gICAgICAgIGlmICggKHUxIDwgMCB8fCB1MSA+IDEpICYmICh1MiA8IDAgfHwgdTIgPiAxKSApIHtcbiAgICAgICAgICAgIGlmICggKHUxIDwgMCAmJiB1MiA8IDApIHx8ICh1MSA+IDEgJiYgdTIgPiAxKSApIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdG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Sp5Um9vdHNbeV0gKyBhWzNdICkgKiB4Um9vdHNbeF0gKyBcbiAgICAgICAgICAgICAgICAoIGFbMl0qeVJvb3RzW3ldICsgYVs0XSApICogeVJvb3RzW3ldICsgYVs1XTtcbiAgICAgICAgICAgIGlmICggTWF0aC5hYnModGVzdCkgPCBub3JtMCApIHtcbiAgICAgICAgICAgICAgICB0ZXN0ID1cbiAgICAgICAgICAgICAgICAgICAgKCBiWzBdKnhSb290c1t4XSArIGJbMV0qeVJvb3RzW3ldICsgYlszXSApICogeFJvb3RzW3hdICtcbiAgICAgICAgICAgICAgICAgICAgKCBiWzJdKnlSb290c1t5XSArIGJbNF0gKSAqIHlSb290c1t5XSArIGJbNV07XG4gICAgICAgICAgICAgICAgaWYgKCBNYXRoLmFicyh0ZXN0KSA8IG5vcm0xICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIG5ldyBQb2ludDJEKCB4Um9vdHNbeF0sIHlSb290c1t5XSApICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKCByZXN1bHQucG9pbnRzLmxlbmd0aCA+IDAgKSByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEVsbGlwc2VMaW5lXG4qICAgXG4qICAgTk9URTogUm90YXRpb24gd2lsbCBuZWVkIHRvIGJlIGFkZGVkIHRvIHRoaXMgZnVuY3Rpb25cbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdEVsbGlwc2VMaW5lID0gZnVuY3Rpb24oYywgcngsIHJ5LCBhMSwgYTIpIHtcbiAgICB2YXIgcmVzdWx0O1xuICAgIHZhciBvcmlnaW4gPSBuZXcgVmVjdG9yMkQoYTEueCwgYTEueSk7XG4gICAgdmFyIGRpciAgICA9IFZl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ICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkludGVyc2VjdGlvblwiKTtcbiAgICAgICAgICAgIGlmICggMCA8PSB0X2EgJiYgdF9hIDw9IDEgKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmRQb2ludCggYTEubGVycChhMiwgdF9hKSApO1xuICAgICAgICAgICAgaWYgKCAwIDw9IHRfYiAmJiB0X2IgPD0gMSApXG4gICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBhMS5sZXJwKGEyLCB0X2IpICk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgdCA9IC1iL2E7XG4gICAgICAgIGlmICggMCA8PSB0ICYmIHQgPD0gMSApIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnRlcnNlY3Rpb25cIik7XG4gICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIGExLmxlcnAoYTIsIHQpICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RFbGxpcHNlUG9seWdvblxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0RWxsaXBzZVBvbHlnb24gPSBmdW5jdGlvbihjLCByeCwgcnksIHBvaW50cykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBsZW5ndGggPSBwb2ludHMubGVuZ3RoO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKysgKSB7XG4gICAgICAgI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ICAgICAgICAgICAgbmV3IFBvaW50MkQoXG4gICAgICAgICAgICAgICAgYTEueCArIHVhICogKGEyLnggLSBhMS54KSxcbiAgICAgICAgICAgICAgICBhMS55ICsgdWEgKiAoYTIueSAtIGExLnkpXG4gICAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKCB1YV90ID09IDAgfHwgdWJfdCA9PSAwICkge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkNvaW5jaWRlbnRcIik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiUGFyYWxsZWxcIik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RSZWN0YW5nbGVSZWN0YW5nbGVcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdFJlY3RhbmdsZVJlY3RhbmdsZSA9IGZ1bmN0aW9uKGExLCBhMiwgYjEsIGIyKSB7XG4gICAgdmFyIG1pbiAgICAgICAgPSBhMS5taW4oYTIpO1xuICAgIHZhciBtYXggICAgICAgID0gYTEubWF4KGEyKTtcbiAgICB2YXIgdG9wUmlnaHQgICA9IG5ldyBQb2ludDJEKCBtYXgueCwgbWluLnkgKTtcbiAgICB2YXIgYm90dG9tTGVmdCA9IG5ldyBQb2ludDJEKCBtaW4ueCwgbWF4LnkgKTtcbiAgICBcbiAgICB2YXIgaW50ZXIxID0gSW50ZXJzZWN0aW9uLmludGVyc2VjdExpbmVSZWN0YW5nbGUobWluLCB0b3BSaWdodCwgYjEsIGIyKTtcbiAgICB2YXIgaW50ZXIyID0gSW50ZXJzZWN0aW9uLmludGVyc2VjdExpbmVSZWN0YW5nbGUodG9wUmlnaHQsIG1heCwgYjEsIGIyKTtcbiAgICB2YXIgaW50ZXIzID0gSW50Z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bpbm5lci5wcm90b3R5cGUubGluZXMgPSBmdW5jdGlvbiAoZWwsIG8pIHtcbiAgICAgIHZhciByID0gby5zY2FsZSAqIChvLmxlbmd0aCArIG8ud2lkdGgpXG4gICAgICAgICwgcyA9IG8uc2NhbGUgKiAyICogclxuXG4gICAgICBmdW5jdGlvbiBncnAgKCkge1xuICAgICAgICByZXR1cm4gY3NzKFxuICAgICAgICAgIHZtbCgnZ3JvdXAnLCB7XG4gICAgICAgICAgICBjb29yZHNpemU6IHMgKyAnICcgKyBzXG4gICAgICAgICAgLCBjb29yZG9yaWdpbjogLXIgKyAnICcgKyAtclxuICAgICAgICAgIH0pXG4gICAgICAgICwgeyB3aWR0aDogcywgaGVpZ2h0OiBzIH1cbiAgICAgICAgKVxuICAgICAgfVxuXG4gICAgICB2YXIgbWFyZ2luID0gLShvLndpZHRoICsgby5sZW5ndGgpICogby5zY2FsZSAqIDIgKyAncHgnXG4gICAgICAgICwgZyA9IGNzcyhncnAoKSwge3Bvc2l0aW9uOiAnYWJzb2x1dGUnLCB0b3A6IG1hcmdpbiwgbGVmdDogbWFyZ2lufSlcbiAgICAgICAgLCBpXG5cbiAgICAgIGZ1bmN0aW9uIHNlZyAoaSwgZHgsIGZpbHRlcikge1xuICAgICAgICBpbnMoXG4gICAgICAgICAgZ1xuICAgICAgICAsIGlucyhcbiAgICAgICAgICAgIGNzcyhncnAoKSwge3JvdGF0aW9uOiAzNjAgLyBvLmxpbmVzICogaSArICdkZWcnLCBsZWZ0OiB+fmR4fSlcbiAgICAgICAgICAsIGlucyhcbiAgICAgICAgICAgICAgY3NzKFxuICAgICAgICAgICAgICAgIHZtbCgncm91bmRyZWN0Jywge2FyY3NpemU6IG8uY29ybmVyc30pXG4gICAgICAgICAgICAgICwgeyB3aWR0aDogclxuICAgICAgICAgICAgICAgICwgaGVpZ2h0OiBvLnNjYWxlICogby53aWR0aFxuICAgICAgICAgICAgICAgICwgbGVmdDogby5zY2FsZSAqIG8ucmFkaXVzXG4gICA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pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmtlZEZlYXR1cmUgPSBzZWxmLmZlYXR1cmVzLmdldChsaW5rZWRGZWF0dXJlSURzW2xmaV0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcURhdGFDb3VudCA9IGxpbmtlZEZlYXR1cmUuc2VxdWVuY2VEYXRhLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBzID0gMDsgcyA8IHNlcURhdGFDb3VudDsgcysrKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcURhdGEgPSBsaW5rZWRGZWF0dXJlLnNlcXVlbmNlRGF0YVtzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5vZGVJZCA9IHNlcURhdGEuaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGFuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZUlkID0gbm9kZUlkICsgJygnICsgc2VxRGF0YS5wYXJ0aWNpcGFudFJlZiArICcpJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9TZXF1ZW5jZURhdGEgPSB0b1NlcXVlbmNlRGF0YV9pbmRleGVkQnlOb2RlSWQuZ2V0KG5vZGVJZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdG9TZXF1ZW5jZURhdGEgPT09ICd1bmRlZmluZWQnKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvU2VxdWVuY2VEYXRhID0gbmV3IEFycmF5KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b1NlcXVlbmNlRGF0YV9pbmRleGVkQnlOb2RlSWQuc2V0KG5vZGVJZCwgdG9TZXF1ZW5jZURhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvU2VxdWVuY2VEYXRhID0gdG9TZXF1ZW5jZURhdGEucHVzaChzZXFEYXRhKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb3VudEVuZE5vZGVzID0gdG9TZXF1ZW5jZURhdGFfaW5kZXhlZEJ5Tm9kZUlkLnZhbHVlcygpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBuID0gMDsgbiA8IGNvdW50RW5kTm9kZXM7IG4rKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b1NlcXVlbmNlRGF0YSA9IHRvU2VxdWVuY2VEYXRhX2luZGV4ZWRCeU5vZGVJZC52YWx1ZXMoKVtuXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21Nb2xlY3VsZSA9IGdldE5vZGUoZnJvbVNlcXVlbmNlRGF0YVswXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b01vbGVjdWxlID0gZ2V0Tm9kZSh0b1NlcXVlbmNlRGF0YVswXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJvbU1vbGVjdWxlID09PSB0b01vbGVjdWxlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsgPSBnZXRVbmFyeUxpbmsoZnJvbU1vbGVjdWxlLCBpbnRlcmFjdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rID0gZ2V0QmluYXJ5TGluayhmcm9tTW9sZWN1bGUsIHRvTW9sZWN1bGUsIGludGVyYWN0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VxdWVuY2VMaW5rID0gZ2V0RmVhdHVyZUxpbmsoZnJvbVNlcXVlbmNlRGF0YSwgdG9TZXF1ZW5jZURhdGEsIGludGVyYWN0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbU1vbGVjdWxlLnNlcXVlbmNlTGlua3Muc2V0KHNlcXVlbmNlTGluay5pZCwgc2VxdWVuY2VMaW5rKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9Nb2xlY3VsZS5zZXF1ZW5jZUxpbmtzLnNldChzZXF1ZW5jZUxpbmsuaWQsIHNlcXVlbmNlTGluayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsuc2VxdWVuY2VMaW5rcy5zZXQoc2VxdWVuY2VMaW5rLmlkLCBzZXF1ZW5jZUxpbmspO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgfS8vIGVuZCBmb3IgZWFjaCBsaW5rZWQgZmVhdHVyZVxuXG4gICAgICAgICAgICAgICAgICAgIH0vLyBlbmQgaWYgbGlua2VkIGZlYXR1cmVzXG4gICAgICAgICAgICAgICAgfS8vIGVuZCBmb3IgZWFjaCBmZWF0dXJlXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvL2luaXQgY29tcGxleGVzXG4gICAgdmFyIGNvbXBsZXhlcyA9IGNvbXBsZXhlcy52YWx1ZXMoKVxuICAgIGZvciAodmFyIGMgPSAwOyBjIDwgY29tcGxleGVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgIHZhciBpbnRlcmFjdGlvbklkO1xuICAgICAgICBpZiAoZXhwYW5kKSB7XG4gICAgICAgICAgICBpbnRlcmFjdGlvbklkID0gY29tcGxleGVzW2NdLmlkLnN1YnN0cmluZygwLCBjb21wbGV4ZXNbY10uaWQuaW5kZXhPZignKCcpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGludGVyYWN0aW9uSWQgPSBjb21wbGV4ZXNbY10uaWQ7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIG5hcnlMaW5rO1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGRhdGFFbGVtZW50Q291bnQ7IGwrKykge1xuICAgICAgICAgICAgdmFyIGludGVyYWN0aW9uID0gZGF0YVtsXTtcbiAgICAgICAgICAgIGlmIChpbnRlcmFjdGlvbi5pZCA9PSBpbnRlcmFjdGlvbklkKSB7XG4gICAgICAgICAgICAgICAgdmFyIG5MaW5rSWQgPSBnZXROYXJ5TGlua0lkRnJvbUludGVyYWN0aW9uKGludGVyYWN0aW9uKTtcbiAgICAgICAgICAgICAgICBuYXJ5TGluayA9IHNlbGYuYWxsTmFyeUxpbmtzLmdldChuTGlua0lkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb21wbGV4ZXNbY10uaW5pdE1vbGVjdWxlKG5hcnlMaW5rKTtcbiAgICAgICAgbmFyeUxpbmsuY29tcGxleCA9IGNvbXBsZXhlc1tjXTtcbiAgICB9XG4gICAgc2VsZi5jaGVja0xpbmtzKCk7XG4gICAgc2VsZi5pbml0TGF5b3V0KCk7XG5cbiAgICAvL21ha2UgbWkgZmVhdHVyZXMgaW50byBhbm5vdGF0aW9uc1xuICAgIHZhciBmZWF0dXJlcyA9IHNlbGYuZmVhdHVyZXMudmFsdWVzKCk7XG4gICAgdmFyIGZDb3VudCA9IGZlYXR1cmVzLmxlbmd0aDtcbiAgICBmb3IgKHZhciBmID0gMDsgZiA8IGZDb3VudDsgZisrKXtcbiAgICAgICAgdmFy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zZGkgPCBzZXFEYXRhQ291bnQ7IHNkaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlcURhdHVtID0gc2VxRGF0YVtzZGldO1xuICAgICAgICAgICAgICAgIHZhciBtSUQgPSBzZXFEYXR1bS5pbnRlcmFjdG9yUmVmO1xuICAgICAgICAgICAgICAgIGlmIChleHBhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgbUlEID0gbUlEICAgKyBcIihcIiArIHNlcURhdHVtLnBhcnRpY2lwYW50UmVmICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBtb2xlY3VsZSA9IHNlbGYubW9sZWN1bGVzLmdldChtSUQpO1xuICAgICAgICAgICAgICAgIHZhciBzZXF1ZW5jZVJlZ2V4ID0gLyguKyktKC4rKS87XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gc2VxdWVuY2VSZWdleC5leGVjKHNlcURhdHVtLnBvcyk7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0UmVzID0gbWF0Y2hbMV0gKiAxO1xuICAgICAgICAgICAgICAgIHZhciBlbmRSZXMgPSBtYXRjaFsyXSAqIDE7XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHN0YXJ0UmVzKSA9PT0gZmFsc2UgJiYgaXNOYU4oZW5kUmVzKSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFubm90YXRpb24gPSBuZXcgQW5ub3RhdGlvbihhbm5vdE5hbWUsIHN0YXJ0UmVzLCBlbmRSZXMpO1xuICAgICAgICAgICAgICAgICAgICBpZiAobW9sZWN1bGUubWlGZWF0dXJlcyA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2xlY3VsZS5taUZlYXR1cmVzID0gbmV3IEFycmF5KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbW9sZWN1bGUubWlGZWF0dXJlcy5wdXNoKGFubm90YXRpb24pO1xuICAgIC8vICAgICAgICAgICAgICBjb25zb2xlLmxvZyhtb2xlY3VsZS5pZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy9sb29rdXAgbWlzc2luZyBzZXF1ZW5jZXNcbiAgICB2YXIgbnNJZHMgPSBuZWVkc1NlcXVlbmNlLnZhbHVlcygpO1xuICAgIHZhciBuc0NvdW50ID0gbnNJZHMubGVuZ3RoO1xuICAgIGlmIChuc0NvdW50ID09PSAwKSB7XG4gICAgICAgIHNlbGYuaW5pdFBvbHltZXJzKCk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB2YXIgY291bnRTZXF1ZW5jZXMgPSAwO1xuICAgICAgICBmb3IgKHZhciBtID0gMDsgbSA8IG5zQ291bnQ7IG0rKyl7XG4gICAgICAgICAgICB4aU5FVF9TdG9yYWdlLmdldFNlcXVlbmNlKG5zSWRzW21dLCBmdW5jdGlvbihpZCwgc2VxKXtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5tb2xlY3VsZXMuZ2V0KGlkKS5zZXRTZXF1ZW5jZShzZXEpO1xuICAgICAgICAgICAgICAgICAgICBjb3VudFNlcXVlbmNlcysrO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY291bnRTZXF1ZW5jZXMgPT09IG5zQ291bnQpe1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5pbml0UG9seW1lcnMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWFkU3RvaWNoRXhwYW5kZWQoKXtcbiAgICAgICAgLy9nZXQgbWF4aW11bSBzdG9pY2hpb21ldHJ5XG4gICAgICAgIHZhciBtYXhTdG9pY2ggPSAwO1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGRhdGFFbGVtZW50Q291bnQ7IGwrKykge1xuICAgICAgICAgICAgdmFyIGludGVyYWN0aW9uID0gZGF0YVtsXTtcbiAgICAgICAgICAgIGlmIChpbnRlcmFjdGlvbi5vYmplY3QgPT09ICdpbnRlcmFjdGlvbicpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnRDb3VudCA9IGludGVyYWN0aW9uLnBhcnRpY2lwYW50cy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgcGkgPSAwOyBwaSA8IHBhcnRpY2lwYW50Q291bnQ7IHBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnRpY2lwYW50ID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzW3BpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnkgJiYgKHBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnktMCkgPiBtYXhTdG9pY2gpe1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF4U3RvaWNoID0gKHBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnktMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1heFN0b2ljaCA8IDMwKXtcbiAgICAgICAgICAgIG1pSnNvbiA9IEV4cGFuZC5tYXRyaXgobWlKc29uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGluZGV4RmVhdHVyZXMoKTtcblxuICAgICAgICAvL2FkZCBuYXJ5TGlua3MgYW5kIHBhcnRpY2lwYW50c1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGRhdGFFbGVtZW50Q291bnQ7IGwrKykge1xuICAgICAgICAgICAgdmFyIGludGVyYWN0aW9uID0gZGF0YVtsXTtcbiAgICAgICAgICAgIGlmIChpbnRlcmFjdGlvbi5vYmplY3QgPT09ICdpbnRlcmFjdGlvbicpIHtcbiAgICAgICAgICAgICAgICB2YXIganNvblBhcnRpY2lwYW50cyA9IGludGVyYWN0aW9uLnBhcnRpY2lwYW50cztcbiAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnRDb3VudCA9IGpzb25QYXJ0aWNpcGFudHMubGVuZ3RoXG5cbiAgICAgICAgICAgICAgICAvL2luaXQgbi1hcnkgbGlua1xuICAgICAgICAgICAgICAgIHZhciBuTGlua0lkID0gZ2V0TmFyeUxpbmtJZEZyb21JbnRlcmFjdGlvbihpbnRlcmFjdGlvbilcbiAgICAgICAgICAgICAgICB2YXIgbkxpbmsgPSBzZWxmLmFsbE5hcnlMaW5rcy5nZXQobkxpbmtJZCk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBuTGluayA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9kb2Vzbid0IGFscmVhZHkgZXhpc3QsIG1ha2UgbmV3IG5MaW5rXG4gICAgICAgICAgICAgICAgICAgIG5MaW5rID0gbmV3IE5hcnlMaW5rKG5MaW5rSWQsIHNlbGYpO1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmFsbE5hcnlMaW5rcy5zZXQobkxpbmtJZCwgbkxpbmspO1xuICAgICAgICAgICAgICAgICAgICAvL2Fsb3Qgb2YgdGltZSBpcyBiZWluZyBzcGVudCBvbiBjcmVhdGluZyB0aGVzZSBJRHMsIHN0YXNoIHRoZW0gaW4gdGhlIGludGVyYWN0aW9uIG9iamVjdD9cbiAgICAgICAgICAgICAgICAgICAgaW50ZXJhY3Rpb24ubmFyeUlkID0gIG5MaW5rSWQ7XG5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbkxpbmsuYWRkRXZpZGVuY2UoaW50ZXJhY3Rpb24pO1xuXG4gICAgICAgICAgICAgICAgLy9pbml0IHBhcnRpY2lwYW50c1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHBpID0gMDsgcGkgPCBwYXJ0aWNpcGFudENvdW50OyBwaSsrKXtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGpzb25QYXJ0aWNpcGFudCA9IGpzb25QYXJ0aWNpcGFudHNbcGldO1xuXG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRSZWYgPSBqc29uUGFydGljaXBhbnQuaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnRSZWYgPSBqc29uUGFydGljaXBhbnQuaWQ7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudElkID0gIGludFJlZiArIFwiKFwiICsgcGFydFJlZiArIFwiKVwiO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnQgPSBzZWxmLm1vbGVjdWxlcy5nZXQocGFydGljaXBhbnRJZCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGFydGljaXBhbnQgPT09ICd1bmRlZmluZWQnKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yID0gc2VsZi5pbnRlcmFjdG9ycy5nZXQoaW50UmVmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRpY2lwYW50ID0gbmV3TW9sZWN1bGUoaW50ZXJhY3RvciwgcGFydGljaXBhbnRJZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm1vbGVjdWxlcy5zZXQocGFydGljaXBhbnRJZCwgcGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQubmFyeUxpbmtzLnNldChuTGlua0lkLCBuTGluayk7XG4gICAgICAgICAgICAgICAgICAgIC8vVE9ETzogdGlkeSB1cCB3aGF0cyBoYXBwZW5pbmcgaW4gTmFyeUxpbmsgcmUgaW50ZXJhY3Rvci9wYXJ0aWNpcGFudCB0ZXJtaW5vbG9neVxuICAgICAgICAgICAgICAgICAgICBpZiAobkxpbmsuaW50ZXJhY3RvcnMuaW5kZXhPZihwYXJ0aWNpcGFudCkgPT09IC0xKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5MaW5rLmludGVyYWN0b3JzLnB1c2gocGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICYmIGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICE9PSBudWxsKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yID0gc2VsZi5tb2xlY3VsZXMuZ2V0KHBhcnRpY2lwYW50SWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJhY3Rvci5hZGRTdG9pY2hpb21ldHJ5TGFiZWwoanNvblBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIG5ld01vbGVjdWxlKGludGVyYWN0b3IsIHBhcnRpY2lwYW50SWQpe1xuICAgICAgICB2YXIgcGFydGljaXBhbnQ7XG4gICAgICAgIGlmICh0eXBlb2YgaW50ZXJhY3RvciA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIC8vbXVzdCBiZSBhIHByZXZpb3VzbHkgdW5lbmNvdW50ZXJlZCBjb21wbGV4IC1cbiAgICAgICAgICAgIC8vIE1JOjAzMTQgLSBpbnRlcmFjdGlvbj8sIE1JOjAzMTcgLSBjb21wbGV4PyBhbmQgaXRzIG1hbnkgc3ViY2xhc3Nlc1xuICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgQ29tcGxleChwYXJ0aWNpcGFudElkLCBzZWxmKTtcbiAgICAgICAgICAgIGNvbXBsZXhlcy5zZXQocGFydGljaXBhbnRJZCwgcGFydGljaXBh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ZCwgc2VsZiwgaW50ZXJhY3RvciwgaW50ZXJhY3Rvci5sYWJlbCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gcHJvdGVpbnMsIHBlcHRpZGVzXG4gICAgICAgIGVsc2UgaWYgKGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjAzMjYnIHx8IGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjAzMjcnKSB7XG4gICAgICAgICAgICBwYXJ0aWNpcGFudCA9IG5ldyBQcm90ZWluKHBhcnRpY2lwYW50SWQsIHNlbGYsIGludGVyYWN0b3IsIGludGVyYWN0b3IubGFiZWwpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBpbnRlcmFjdG9yLnNlcXVlbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHBhcnRpY2lwYW50LnNldFNlcXVlbmNlKGludGVyYWN0b3Iuc2VxdWVuY2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy9zaG91bGQgbG9vayBpdCB1cCB1c2luZyBhY2Nlc3Npb24gbnVtYmVyXG4gICAgICAgICAgICAgICAgaWYgKHBhcnRpY2lwYW50SWQuaW5kZXhPZigndW5pcHJvdGtiJykgPT09IDApe1xuICAgICAgICAgICAgICAgICAgICBuZWVkc1NlcXVlbmNlLmFkZChwYXJ0aWNpcGFudElkKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwYXJ0aWNpcGFudC5zZXRTZXF1ZW5jZShcIlNFUVVFTkNFTUlTU0lOR1wiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy9nZW5lc1xuICAgICAgICBlbHNlIGlmIChpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdOSTowMjUwJykge1xuICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgR2VuZShwYXJ0aWN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aW50ZXJhY3Rvci50eXBlLmlkID09PSAnTUk6MDYwNycgLy8gUk5BIC0gc21hbGwgbnVjbGVhclxuICAgICAgICAgICAgICAgIHx8IGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjA2MDknIC8vIFJOQSAtIHNtYWxsIG51Y2xlb2xhclxuICAgICAgICAgICAgICAgIHx8IGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjAzMjUnIC8vIFJOQSAtIHRyYW5zZmVyXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgIHBhcnRpY2lwYW50ID0gbmV3IFJOQShwYXJ0aWNpcGFudElkLCBzZWxmLCBpbnRlcmFjdG9yLCBpbnRlcmFjdG9yLmxhYmVsKTtcbiAgICAgICAgfVxuICAgICAgICAvL0ROQVxuICAgICAgICBlbHNlIGlmIChpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdNSTowMzE5JyAvLyBETkFcbiAgICAgICAgICAgICAgICB8fCBpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdNSTowNjgxJyAvLyBETkEgLSBkb3VibGUgc3RyYW5kZWRcbiAgICAgICAgICAgICAgICB8fCBpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdNSTowNjgwJyAvLyBETkEgLSBzaW5nbGUgc3RyYW5kZWRcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgRE5BKHBhcnRpY2lwYW50SWQsIHNlbGYsIGludGVyYWN0b3IsIGludGVyYWN0b3IubGFiZWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gTUk6MDMyOSAtIHVua25vd24gcGFydGljaXBhbnQgP1xuICAgICAgICAgICAgLy8gTUk6MDM4MyAtIGJpb3BvbHltZXIgP1xuICAgICAgICAgICAgYWxlcnQoXCJVbnJlY29nbmlzZWQgdHlwZTpcIiArIGludGVyYWN0b3IudHlwZS5uYW1lKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFydGljaXBhbnQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaW5kZXhGZWF0dXJlcygpe1xuICAgICAgICAvL2NyZWF0ZSBpbmRleGVkIGNvbGxlY3Rpb24gb2YgYWxsIGZlYXR1cmVzIGZyb20gaW50ZXJhY3Rpb25zXG4gICAgICAgIC8vIC0gc3RpbGwgc2VlbXMgbGlrZSBhIGdvb2Qgc3RhcnRpbmcgcG9pbnQ/XG4gICAgICAgIGZvciAodmFyIGwgPSAwOyBsIDwgZGF0YUVsZW1lbnRDb3VudDsgbCsrKSB7XG4gICAgICAgICAgICB2YXIgaW50ZXJhY3Rpb24gPSBkYXRhW2xdO1xuICAgICAgICAgICAgaWYgKGludGVyYWN0aW9uLm9iamVjdCA9PT0gJ2ludGVyYWN0aW9uJykge1xuICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudENvdW50ID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwaSA9IDA7IHBpIDwgcGFydGljaXBhbnRDb3VudDsgcGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnQgPSBpbnRlcmFjdGlvbi5wYXJ0aWNpcGFudHNbcGldO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmVhdHVyZXMgPSBuZXcgQXJyYXkoMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWNpcGFudC5mZWF0dXJlcykgZmVhdHVyZXMgPSBwYXJ0aWNpcGFudC5mZWF0dXJlcztcblxuICAgICAgICAgICAgICAgICAgICB2YXIgZkNvdW50ID0gZmVhdHVyZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBmID0gMDsgZiA8IGZDb3VudDsgZisrKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gZmVhdHVyZXNbZl07XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmZlYXR1cmVzLnNldChmZWF0dXJlLmlkLCBmZWF0dXJlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlYWRTdG9pY2hVbmV4cGFuZGVkKCl7XG4gICAgICAgIC8vZ2V0IGludGVyYWN0b3JzXG4gICAgICAgIHZhciBpbnRlcmFjdG9ycyA9IHNlbGYuaW50ZXJhY3RvcnMudmFsdWVzKCk7XG4gICAgICAgIHZhciBpbnRlcmFjdG9yQ291bnQgPSBpbnRlcmFjdG9ycy5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgaW50ZXJhY3RvckNvdW50OyBpKyspIHtcbiAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yID0gaW50ZXJhY3RvcnNbaV07XG4gICAgICAgICAgICB2YXIgcGFydGljaXBhbnQ7XG4gICAgICAgICAgICB2YXIgcGFydGljaXBhbnRJZCA9IGludGVyYWN0b3IuaWQ7XG4gICAgICAgICAgICBwYXJ0aWNpcGFudCA9IG5ld01vbGVjdWxlIChpbnRlcmFjdG9yLCBwYXJ0aWNpcGFudElkKTtcbiAgICAgICAgICAgIHNlbGYubW9sZWN1bGVzLnNldChwYXJ0aWNpcGFudElkLCBwYXJ0aWNpcGFudCk7XG4gICAgICAgIH1cblxuICAgICAgICBpbmRleEZlYXR1cmVzKCk7XG5cbiAgICAgICAgLy9hZGQgbmFyeUxpbmtzXG4gICAgICAgIGZvciAodmFyIGwgPSAwOyBsIDwgZGF0YUVsZW1lbnRDb3VudDsgbCsrKSB7XG4gICAgICAgICAgICB2YXIgaW50ZXJhY3Rpb24gPSBkYXRhW2xdO1xuICAgICAgICAgICAgaWYgKGludGVyYWN0aW9uLm9iamVjdCA9PT0gJ2ludGVyYWN0aW9uJykge1xuICAgICAgICAgICAgICAgIHZhciBqc29uUGFydGljaXBhbnRzID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzO1xuICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudENvdW50ID0ganNvblBhcnRpY2lwYW50cy5sZW5ndGhcblxuICAgICAgICAgICAgICAgIC8vaW5pdCBuLWFyeSBsaW5rXG4gICAgICAgICAgICAgICAgdmFyIG5MaW5rSWQgPSBnZXROYXJ5TGlua0lkRnJvbUludGVyYWN0aW9uKGludGVyYWN0aW9uKVxuICAgICAgICAgICAgICAgIHZhciBuTGluayA9IHNlbGYuYWxsTmFyeUxpbmtzLmdldChuTGlua0lkKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG5MaW5rID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAvL2RvZXNuJ3QgYWxyZWFkeSBleGlzdCwgbWFrZSBuZXcgbkxpbmtcbiAgICAgICAgICAgICAgICAgICAgbkxpbmsgPSBuZXcgTmFyeUxpbmsobkxpbmtJZCwgc2VsZik7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuYWxsTmFyeUxpbmtzLnNldChuTGlua0lkLCBuTGluayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5MaW5rLmFkZEV2aWRlbmNlKGludGVyYWN0aW9uKTtcblxuICAgICAgICAgICAgICAgIC8vfiAvL2luaXQgcGFydGljaXBhbnRzXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgcGkgPSAwOyBwaSA8IHBhcnRpY2lwYW50Q291bnQ7IHBpKyspe1xuICAgICAgICAgICAgICAgICAgICB2YXIganNvblBhcnRpY2lwYW50ID0ganNvblBhcnRpY2lwYW50c1twaV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRSZWYgPSBqc29uUGFydGljaXBhbnQuaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnRpY2lwYW50SWQgPSAgaW50UmVmOy8vICsgXCIoXCIgKyBwYXJ0UmVmICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudCA9IHNlbGYubW9sZWN1bGVzLmdldChwYXJ0aWNpcGFudElkKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhcnRpY2lwYW50ID09PSAndW5kZWZpbmVkJyl7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL211c3QgYmUgYSBwcmV2aW91c2x5IHVuZW5jb3VudGVyZWQgY29tcGxleFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgQ29tcGxleChwYXJ0aWNpcGFudElkLCBzZWxmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXhlcy5zZXQocGFydGljaXBhbnRJZCwgcGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5tb2xlY3VsZXMuc2V0KHBhcnRpY2lwYW50SWQsIHBhcnRpY2lwYW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG5cbiAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQubmFyeUxpbmtzLnNldChuTGlua0lkLCBuTGluayk7XG4gICAgICAgICAgICAgICAgICAgIC8vVE9ETzogdGlkeSB1cCB3aGF0cyBoYXBwZW5pbmcgaW4gTmFyeUxpbmsgcmUgaW50ZXJhY3Rvci9wYXJ0aWNpcGFudCB0ZXJtaW5vbG9neVxuICAgICAgICAgICAgICAgICAgICBpZiAobkxpbmsuaW50ZXJhY3RvcnMuaW5kZXhPZihwYXJ0aWNpcGFudCkgPT09IC0xKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5MaW5rLmludGVyYWN0b3JzLnB1c2gocGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vdGVtcCAtIHRvIGdpdmUgc2Vuc2libGUgaW5mbyB3aGVuIHN0b2ljaCBjb2xsYXBzZWRcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVyYWN0b3IgPSBzZWxmLm1vbGVjdWxlcy5nZXQocGFydGljaXBhbnRJZCk7XG4gICAgICAgICAgICAgICAgICAgIGludGVyYWN0b3Iuc3RvaWNoID0gaW50ZXJhY3Rvci5zdG9pY2g/IGludGVyYWN0b3Iuc3RvaWNoIDogMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICYmIGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICE9PSBudWxsKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVyYWN0b3Iuc3RvaWNoID0gaW50ZXJhY3Rvci5zdG9pY2ggKyAranNvblBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcmFjdG9yLnN0b2ljaCA9IGludGVyYWN0b3Iuc3RvaWNoICsgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yQXJyID0gc2VsZi5tb2xlY3VsZXMudmFsdWVzKCk7XG4gICAgICAgICAgICAgICAgdmFyIGlDb3VudCA9IGludGVyYWN0b3JBcnIubGVuZ3RoXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaWkgPSAwOyBpaSA8IGlDb3VudDsgaWkrKyl7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnQgPSBpbnRlcmFjdG9yQXJyW2lpXTtcbiAgICAgICAgICAgICAgICAgICAgaW50LmFkZFN0b2ljaGlvbWV0cnlMYWJlbChpbnQuc3RvaWNoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgfTtcblxuXG4gICAgZnVuY3Rpb24gZ2V0TmFyeUxpbmtJZEZyb21JbnRlcmFjdGlvbihpbnRlcmFjdGlvbikge1xuICAgICAgICBpZiAoaW50ZXJhY3Rpb24ubmFyeUlkKSB7XG4gICAgICAgICAgICByZXR1cm4gaW50ZXJhY3Rpb24ubmFyeUlkO1xuICAgICAgICB9XG4gICAgICAgIHZhciBqc29uUGFydGljaXBhbnRzID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzO1xuICAgICAgICB2YXIgcGFydGljaXBhbnRDb3VudCA9IGpzb25QYXJ0aWNpcGFudHMubGVuZ3RoXG5cbiAgICAgICAgdmFyIHBJRHMgPSBkMy5zZXQoKTsvL3VzZWQgdG8gZWxpbWluYXRlIGR1cGxpY2F0ZXNcbiAgICAgICAgLy9tYWtlIGlkXG4gICAgICAgIGZvciAodmFyIHBpID0gMDsgcGkgPCBwYXJ0aWNpcGFudENvdW50OyBwaSsrKSB7XG4gICAgICAgICAgICB2YXIgcElEID0ganNvblBhcnRpY2lwYW50c1twaV0uaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgIGlmIChleHBhbmQpIHtcbiAgICAgICAgICAgICAgICBwSUQgPSBwSUQgICArIFwiKFwiICsganNvblBhcnRpY2lwYW50c1twaV0uaWQgKyBcIilcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBJRHMuYWRkKHBJRCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcElEcy52YWx1ZXMoKS5zb3J0KCkuam9pbignLScpO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBnZXROb2RlKHNlcURhdHVtKXtcbiAgICAgICAgdmFyIGlkID0gc2VxRGF0dW0uaW50ZXJhY3RvclJlZjtcbiAgICAgICAgaWYgKGV4cGFuZCl7XG4gICAgICAgICAgICBpZCA9IGlkICsgJygnICsgc2VxRGF0dW0ucGFydGljaXBhbnRSZWYgKyAnKSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNlbGYubW9sZWN1bGVzLmdldChpZCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RmVhdHVyZUxpbmsoZnJvbVNlcURhdGEsIHRvU2VxRGF0YSwgaW50ZXJhY3Rpb24pe1xuICAgICAgICBmdW5jdGlvbiBzZXFEYXRhVG9TdHJpbmcoc2VxRGF0YSl7XG4gICAgICAgICAgICB2YXIgbm9kZUlkcyA9IGQzLnNldCgpOy8vdXNlZCB0byBlbGltaW5hdGUgZHVwbGljYXRlc1xuICAgICAgICAgICAgLy9tYWtlIGlkXG4gICAgICAgICAgICBmb3IgKHZhciBzID0gMDsgcyA8IHNlcURhdGEubGVuZ3RoOyBzKyspe1xuICAgICAgICAgICAgICAgIHZhciBzZXEgPSBzZXFEYXRhW3NdO1xuICAgICAgICAgICAgICAgIHZhciBpZCA9IHNlcS5pbnRlcmFjdG9yUmVmO1xuICAgICAgICAgICAgICAgIGlmIChleHBhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZCArICcoJyArIHNlcS5wYXJ0aWNpcGFudFJlZiArICcpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWQgPSBpZCArICc6JyArIHNlcS5wb3M7XG4gICAgICAgICAgICAgICAgbm9kZUlkcy5hZGQoaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy9zb3J0IGlkc1xuICAgICAgICAgICAgcmV0dXJuIG5vZGVJZHMudmFsdWVzKCkuc29ydCgpLmpvaW4oJzsnKTtcbiAgICAgICAgfVxuXG5cbiAgICAgICAgdmFyIHN0YXJ0ID0gIHNlcURhdGFUb1N0cmluZyhmcm9tU2VxdWVuY2VEYXRhKTtcbiAgICAgICAgdmFyIGVuZCA9ICBzZXFEYXRhVG9TdHJpbmcodG9TZXF1ZW5jZURhdGEpO1xuICAgICAgICB2YXIgc2VxTGlua0lkLCBlbmRzU3dhcHBlZDtcbiAgICAgICAgaWYgKHN0YXJ0IDwgZW5kKXtcbiAgICAgICAgICAgIHNlcUxpbmtJZCAgPSAgc3RhcnQg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G4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvL2RvIGZvcmNlIGRpcmVjdGVkIGxheW91dFxuICAgIHZhciBsYXlvdXRPYmogPSB7fTtcbiAgICBsYXlvdXRPYmoubm9kZXMgPSBbXTtcbiAgICBsYXlvdXRPYmoubGlua3MgPSBbXTtcbiAgICB2YXIgbW9sTG9va1VwID0ge307XG4gICAgdmFyIG1pID0gMDtcblxuICAgIGZvciAodmFyIG4gPSAwOyBuIDwgbm9kZUNvdW50OyBuKyspIHtcbiAgICAgICAgdmFyIG1vbCA9IG5vZGVzW25dO1xuICAgICAgICBtb2xMb29rVXBbbW9sLmlkXSA9IG1pO1xuICAgICAgICBtaSsrO1xuICAgICAgICB2YXIgbm9kZU9iaiA9IHt9O1xuICAgICAgICBub2RlT2JqLmlkID0gbW9sLmlkO1xuICAgICAgICBub2RlT2JqLnggPSBtb2wueDtcbiAgICAgICAgbm9kZU9iai55ID0gbW9sLnk7XG4gICAgICAgIG5vZGVPYmoucHggPSBtb2wueDtcbiAgICAgICAgbm9kZU9iai5weSA9IG1vbC55O1xuICAgICAgICBsYXlvdXRPYmoubm9kZXMucHVzaChub2RlT2JqKTtcbiAgICB9XG4gICAgdmFyIGxpbmtzID0gdGhpcy5hbGxCaW5hcnlMaW5rcy52YWx1ZXMoKTtcbiAgICB2YXIgbGlua0NvdW50ID0gbGlua3MubGVuZ3RoO1xuICAgIGZvciAodmFyIGwgPSAwOyBsIDwgbGlua0NvdW50OyBsKyspIHtcbiAgICAgICAgdmFyIGxpbmsgPSBsaW5rc1tsXTtcbiAgICAgICAgICAgIHZhciBmcm9tTW9sID0gbGluay5pbnRlcmFjdG9yc1swXTtcbiAgICAgICAgICAgIHZhciB0b01vbCA9IGxpbmsuaW50ZXJhY3RvcnNbMV07XG4gICAgICAgICAgICB2YXIgc291cmNlID0gbW9sTG9va1VwW2Zyb21Nb2wuaWRdO1xuICAgICAgICAgICAgdmFyIHRhcmdldCA9IG1vbExvb2tVcFt0b01vbC5pZF07XG5cbiAgICAgICAgICAgIGlmIChzb3VyY2UgIT09IHRhcmdldCkge1xuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzb3VyY2UgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiB0YXJnZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsaW5rT2JqID0ge307XG4gICAgICAgICAgICAgICAgICAgIGxpbmtPYmouc291cmNlID0gc291cmNlO1xuICAgICAgICAgICAgICAgICAgICBsaW5rT2JqLnRhcmdldCA9IHRhcmdldDtcbiAgICAgICAgICAgICAgICAgICAgbGlua09iai5pZCA9IGxpbmsuaWQ7XG4gICAgICAgICAgICAgICAgICAgIGxheW91dE9iai5saW5rcy5wdXNoKGxpbmtPYmopO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYWxlcnQoXCJOT1QgUklHSFRcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBrID0gTWF0aC5zcXJ0KGxheW91dE9iai5ub2Rlcy5sZW5ndGggLyAod2lkdGggKiBoZWlnaHQpKTtcbiAgICAvLyBtaWtlIHN1Z2dlc3RzOlxuICAgIC8vICAgIC5jaGFyZ2UoLTEwIC8gaylcbiAgICAvLyAgICAuZ3Jhdml0eSgxMDAgKiBrKVxuICAgIC8vZm9sbG93aW5nIGFyZSB0aGUgcGFyYW1ldGVycyBmb3IgdGhlIGxheW91dCB5b3UgY2FuIHBsYXkgYXJvdW5kIHdpdGhcbiAgICAvL3NlZSB0aGUgZG9jdW1lbnRhdGlvbiBhdCBodHRwczovL2dpdGh1Yi5jb20vbWJvc3RvY2svZDMvd2lraS9Gb3JjZS1MYXlvdXRcbiAgICB0aGlzLmZvcmNlID0gZDMubGF5b3V0LmZvcmNlKClcbiAgICAgICAgICAgIC5ub2RlcyhsYXlvdXRPYmoubm9kZ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WF0dXJlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2hvb3NlQ29sb3VycygpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGFubm90YXRpb25DaG9pY2UudG9VcHBlckNhc2UoKSA9PT0gXCJJTlRFUkFDVE9SXCIpIHtcbiAgICAgICAgICAgIGlmIChzZWxmLnByb3RlaW5Db3VudCA8IDIxKSB7XG4gICAgICAgICAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1vbCA9IG1vbHNbbV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChtb2wuaWQuaW5kZXhPZigndW5pcHJvdGtiXycpID09PSAwKSB7Ly9MSU1JVCBJVCBUTyBQUk9URUlOUyAvL3RvZG86Zml4XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYW5ub3RhdGlvbiA9IG5ldyBBbm5vdGF0aW9uIChtb2wuanNvbi5sYWJlbCwgMSwgbW9sLnNpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9sLnNldFBvc2l0aW9uYWxGZWF0dXJlcyhbYW5ub3RhdGlvbl0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNob29zZUNvbG91cnMoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYWxlcnQoXCJUb28gbWFueSB0eXBlcyBvZiBwcm90ZWluICg+IDIwKSAtIGNhbid0IGNvbG91ciBieSBpbnRlcmFjdG9yLlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhbm5vdGF0aW9uQ2hvaWNlLnRvVXBwZXJDYXNlKCkgPT09IFwiU1VQRVJGQU1cIiB8fCBhbm5vdGF0aW9uQ2hvaWNlLnRvVXBwZXJDYXNlKCkgPT09IFwiU1VQRVJGQU1JTFlcIil7XG4gICAgICAgICAgICB2YXIgbW9sc0Fubm90YXRlZCA9IDA7XG4gICAgICAgICAgICBmb3IgKG0gPSAwOyBtIDwgbW9sQ291bnQ7IG0rKykge1xuICAgICAgICAgICAgICAgIHZhciBtb2wgPSBtb2xzW21dO1xuICAgICAgICAgICAgICAgIGlmIChtb2wuaWQuaW5kZXhPZigndW5pcHJvdGtiXycpID09PSAwKSB7Ly9MSU1JVCBJVCBUTyBQUk9URUlOUyAvL3RvZG86Zml4XG4gICAgICAgICAgICAgICAgICAgIHhpTkVUX1N0b3JhZ2UuZ2V0U3VwZXJGYW1GZWF0dXJlcyhtb2wuaWQsIGZ1bmN0aW9uIChpZCwgZnRzKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtID0gc2VsZi5tb2xlY3VsZXMuZ2V0KGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0uc2V0UG9zaXRpb25hbEZlYXR1cmVzKGZ0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2xzQW5ub3RhdGVkKys7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VDb2xvdXJzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbW9sc0Fubm90YXRlZCsrO1xuICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZUNvbG91cnMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhbm5vdGF0aW9uQ2hvaWNlLnRvVXBwZXJDYXNlKCkgPT09IFwiVU5JUFJPVFwiIHx8IGFubm90YXRpb25DaG9pY2UudG9VcHBlckNhc2UoKSA9PT0gXCJVTklQUk9US0JcIikge1xuICAgICAgICAgICAgdmFyIG1vbHNBbm5vdGF0ZWQgPSAwO1xuICAgICAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgbW9sID0gbW9sc1ttXTtcbiAgICAgICAgICAgICAgICBpZiAobW9sLmlkLmluZGV4T2YoJ3VuaXByb3RrYl8nKSA9PT0gMCkgey8vTElNSVQgSVQgVE8gUFJPVEVJTlMgLy90b2RvOmZpeFxuICAgICAgICAgICAgICAgICAgICB4aU5FVF9TdG9yYWdlLmdldFVuaVByb3RGZWF0dXJlcyhtb2wuaWQsIGZ1bmN0aW9uIChpZCwgZnRzKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtID0gc2VsZi5tb2xlY3VsZXMuZ2V0KGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0uc2V0UG9zaXRpb25hbEZlYXR1cmVzKGZ0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2xzQW5ub3RhdGVkKys7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VDb2xvdXJzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbW9sc0Fubm90YXRlZCsrO1xuICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZUNvbG91cnMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNob29zZUNvbG91cnMoKXtcbiAgICAgICAgdmFyIGNhdGVnb3JpZXMgPSBkMy5zZXQoKTtcbiAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgIHZhciBtb2wgPSBtb2xzW21dO1xuICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBtb2wuYW5ub3RhdGlvbnMubGVuZ3RoOyBhKyspe1xuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMuYWRkKG1vbC5hbm5vdGF0aW9uc1thXS5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgY2F0Q291bnQgPSBjYXRlZ29yaWVzLnZhbHVlcygpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgdmFyIGNvbG91clNjaGVtZTsvLyA9IG51bGw7XG4gICAgICAgIGlmIChjYXRDb3VudCA8IDMpe2NhdENvdW50ID0gMzt9XG4gICAgICAgIC8vfiBpZiAoY2F0Q291bnQgPCAyMSkge1xuICAgICAgICAgICAgaWYgKGNhdENvdW50IDwgNikge1xuXHRcdFx0XHQvL34gdmFyIHJldmVyc2VkID0gY29sb3JicmV3ZXIuQWNjZW50W2NhdENvdW50XS5zbGljZSgpLnJldmVyc2UoKTtcbiAgICAgICAgICAgICAgICAvL34gY29sb3VyU2NoZW1lID0gZDMuc2NhbGUub3JkaW5hbCgpLnJhbmdlKHJldmVyc2VkKTtcbiAgICAgICAgICAgICAgICBjb2xvdXJTY2hlbWUgPSBkMy5zY2FsZS5vcmRpbmFsKCkucmFuZ2UoY29sb3JicmV3ZXIuU2V0MVs0XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChjYXRDb3VudCA8IDEzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldmVyc2VkID0gY29sb3JicmV3ZXIuU2V0M1tjYXRDb3VudF0uc2xpY2UoKS5yZXZlcnNlKCk7XG4gICAgICAgICAgICAgICAgY29sb3VyU2NoZW1lID0gZDMuc2NhbGUub3JkaW5hbCgpLnJhbmdlKHJldmVyc2VkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbG91clNjaGVtZSA9IGQzLnNjYWxlLmNhdGVnb3J5MjAoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9+IGNvbnNvbGUubG9nKFwiQ09McyBcIiwgY29sb3VyU2NoZW1lKTtcblxuICAgICAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgbW9sID0gbW9sc1ttXTtcbiAgICAgICAgICAgICAgICBmb3IgKGEgPSAwOyBhIDwgbW9sLmFubm90YXRpb25zLmxlbmd0aDsgYSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhbm5vID0gbW9sLmFubm90YXRpb25zW2FdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5uby5kZXNjcmlwdGlvbiA9PSBcIk5vIGFubm90YXRpb25zXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjID0gXCIjY2NjY2NjXCI7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdFx0XHRcdFx0XHRjb25zb2xlLmxvZyhcIj5cIiArIGFubm8uZGVzY3JpcHRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGMgPSBjb2xvdXJTY2hlbWUoYW5uby5kZXNjcmlwdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYW5uby5waWVTbGljZS5zZXRBdHRyaWJ1dGUoXCJmaWxsXCIsIGMp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IHdlIGFyZSBjdXJyZW50bHkgZHJhZ2dpbmcgdGhpbmdzIGFyb3VuZFxuICAgICAgICAgICAgdmFyIG94LCBveSwgbngsIG55O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLmRyYWdFbGVtZW50LnggPT09ICd1bmRlZmluZWQnKSB7IC8vIGlmIG5vdCBhbiBNb2xlY3VsZVxuICAgICAgICAgICAgICAgIHZhciBub2RlcyA9IHRoaXMuZHJhZ0VsZW1lbnQuaW50ZXJhY3RvcnM7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGVDb3VudCA9IG5vZGVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG5vZGVDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm90ZWluID0gbm9kZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIG94ID0gcHJvdGVpbi54O1xuICAgICAgICAgICAgICAgICAgICBveSA9IHByb3RlaW4ueTtcbiAgICAgICAgICAgICAgICAgICAgbnggPSBveCAtIGR4O1xuICAgICAgICAgICAgICAgICAgICBueSA9IG95IC0gZHk7XG4gICAgICAgICAgICAgICAgICAgIHByb3RlaW4uc2V0UG9zaXRpb24obngsIG55KTtcbiAgICAgICAgICAgICAgICAgICAgcHJvdGVpbi5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5vZGVDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGVzW2ldLnNldEFsbExpbmtDb29yZGluYXRlcygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy9pdHMgYSBwcm90ZWluIC0gZHJhZyBpdCBUT0RPOiBEUkFHIFNFTEVDVEVEXG4gICAgICAgICAgICAgICAgb3ggPSB0aGlzLmRyYWdFbGVtZW50Lng7XG4gICAgICAgICAgICAgICAgb3kgPSB0aGlzLmRyYWdFbGVtZW50Lnk7XG4gICAgICAgICAgICAgICAgbnggPSBveCAtIGR4O1xuICAgICAgICAgICAgICAgIG55ID0gb3kgLSBkeTtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldFBvc2l0aW9uKG54LCBueSk7XG4gICAgICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZHJhZ1N0YXJ0ID0gYztcbiAgICAgICAgfVxuXG4gICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhdGUgPT09IE1vdXNlRXZlbnRDb2Rlcy5ST1RBVElORykge1xuICAgICAgICAgICAgLy8gRGlzdGFuY2UgZnJvbSBtb3VzZSB4IGFuZCBjZW50ZXIgb2Ygc3RpY2suXG4gICAgICAgICAgICB2YXIgX2R4ID0gYy54IC0gdGhpcy5kcmFnRWxlbWVudC54XG4gICAgICAgICAgICAvLyBEaXN0YW5jZSBmcm9tIG1vdXNlIHkgYW5kIGNlbnRlciBvZiBzdGljay5cbiAgICAgICAgICAgIHZhciBfZHkgPSBjLnkgLSB0aGlzLmRyYWdFbGVtZW50Lnk7XG4gICAgICAgICAgICAvL3NlZSBodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL0F0YW4yI01vdGl2YXRpb25cbiAgICAgICAgICAgIHZhciBjZW50cmVUb01vdXNlQW5nbGVSYWRzID0gTWF0aC5hdGFuMihfZHksIF9keCk7XG4gICAgICAgICAgICBpZiAodGhpcy53aGljaFJvdGF0b3IgPT09IDApIHtcbiAgICAgICAgICAgICAgICBjZW50cmVUb01vdXNlQW5nbGVSYWRzID0gY2VudHJlVG9Nb3VzZUFuZ2xlUmFkcyArIE1hdGguUEk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgY2VudHJlV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0VsZW1lbnQuc3dpdGNoU3RpY2tTY2FsZShjKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNlcXVlbmNlSW5pdENvbXBsZXRlID09PSB0cnVlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5kcmFnRWxlbWVudC5mb3JtID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0Rm9ybSgxLCBjKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldEZvcm0oMCwgYyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vfiB0aGlzLmNoZWNrTGlua3MoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhdGUgPT09IE1vdXNlRXZlbnRDb2Rlcy5ST1RBVElORykge1xuICAgICAgICAgICAgICAgIC8vcm91bmQgcHJvdGVpbiByb3RhdGlvbiB0byBuZWFyZXN0IDUgZGVncmVlcyAobG9va3MgbmVhdGVyKVxuICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0Um90YXRpb24oTWF0aC5yb3VuZCh0aGlzLmRyYWdFbGVtZW50LnJvdGF0aW9uIC8gNSkgKiA1KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgfSAvL2VuZCBvZiBwcm90ZWluIGRyYWc7IGRvIG5vdGhpbmdcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChyaWdodGNsaWNr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ORykge1xuICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBjdXJyZW50bHkgZHJhZ2dpbmcgdGhpbmdzIGFyb3VuZFxuICAgICAgICAgICAgICAgIHZhciBveCwgb3ksIG54LCBueTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRoaXMuZHJhZ0VsZW1lbnQueCA9PT0gJ3VuZGVmaW5lZCcpIHsgLy8gaWYgbm90IGFuIE1vbGVjdWxlXG4gICAgICAgICAgICAgICAgICAgIHZhciBub2RlcyA9IHRoaXMuZHJhZ0VsZW1lbnQuaW50ZXJhY3RvcnM7XG4gICAgICAgICAgICAgICAgICAgIHZhciBub2RlQ291bnQgPSBub2Rlcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbm9kZUNvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcm90ZWluID0gbm9kZXNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBveCA9IHByb3RlaW4ueDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG95ID0gcHJvdGVpbi55O1xuICAgICAgICAgICAgICAgICAgICAgICAgbnggPSBveCAtIGR4O1xuICAgICAgICAgICAgICAgICAgICAgICAgbnkgPSBveSAtIGR5O1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvdGVpbi5zZXRQb3NpdGlvbihueCwgbnkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvdGVpbi5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbm9kZUNvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzW2ldLnNldEFsbExpbmtDb29yZGluYXRlcygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy9pdHMgYSBwcm90ZWluIC0gZHJhZyBpdCBUT0RPOiBEUkFHIFNFTEVDVEVEXG4gICAgICAgICAgICAgICAgICAgIG94ID0gdGhpcy5kcmFnRWxlbWVudC54O1xuICAgICAgICAgICAgICAgICAgICBveSA9IHRoaXMuZHJhZ0VsZW1lbnQueTtcbiAgICAgICAgICAgICAgICAgICAgbnggPSBveCAtIGR4O1xuICAgICAgICAgICAgICAgICAgICBueSA9IG95IC0gZHk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0UG9zaXRpb24obngsIG55KTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5kcmFnU3RhcnQgPSBjO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXRlID09PSBNb3VzZUV2ZW50Q29kZXMuUk9UQVRJTkcpIHtcbiAgICAgICAgICAgICAgICAvLyBEaXN0YW5jZSBmcm9tIG1vdXNlIHggYW5kIGNlbnRlciBvZiBzdGljay5cbiAgICAgICAgICAgICAgICB2YXIgX2R4ID0gYy54IC0gdGhpcy5kcmFnRWxlbWVudC54XG4gICAgICAgICAgICAgICAgLy8gRGlzdGFuY2UgZnJvbSBtb3VzZSB5IGFuZCBjZW50ZXIgb2Ygc3RpY2suXG4gICAgICAgICAgICAgICAgdmFyIF9keSA9IGMueSAtIHRoaXMuZHJhZ0VsZW1lbnQueTtcbiAgICAgICAgICAgICAgICAvL3NlZSBodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL0F0YW4yI01vdGl2YXRpb25cbiAgICAgICAgICAgICAgICB2YXIgY2VudHJlVG9Nb3VzZUFuZ2xlUmFkcyA9IE1hdGguYXRhbjIoX2R5LCBfZHgpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLndoaWNoUm90YXRvciA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBjZW50cmVUb01vdXNlQW5nbGVSYWRzID0gY2VudHJlVG9Nb3VzZUFuZ2xlUmFkcyArIE1hdGguUEk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBjZW50cmVUb01vdXNlQW5nbGVEZWdyZWVzID0gY2VudHJlVG9Nb3VzZUFuZ2xlUmFkcyAqICgzNjAgLyAoMiAqIE1hdGguUEkpKTtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldFJvdGF0aW9uKGNlbnRyZVRvTW91c2VBbmdsZURlZ3JlZXMpO1xuICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHsgLy9ub3QgZHJhZ2dpbmcgb3Igcm90YXRpbmcgeWV0LCBtYXliZSB3ZSBzaG91bGQgc3RhcnRcbiAgICAgICAgICAgICAgICAvLyBkb24ndCBzdGFydCBkcmFnZ2luZyBqdXN0IG9uIGEgY2xpY2sgLSB3ZSBuZWVkIHRvIG1vdmUgdGhlIG1vdXNlIGEgYml0IGZpcnN0XG4gICAgICAgICAgICAgICAgaWYgKE1hdGguc3FydChkeCAqIGR4ICsgZHkgKiBkeSkgPiAoNSAqIHRoaXMueikpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zdGF0ZSA9IE1vdXNlRXZlbnRDb2Rlcy5EUkFHR0lORztcblxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4vLyAgICBlbHNlIGlmICh0aGlzLnN0YXRlID09PSAgTW91c2VFdmVudENvZGVzLlNFTEVDVElORykge1xuLy8gICAgICAgIHRoaXMudXBkYXRlTWFycXVlZSh0aGlzLm1hcnF1ZWUsIGMpO1xuLy8gICAgfVxuICAgIC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gICAgICAgICAgIGlmICh0aGlzLmRyYWdFbGVtZW50LmZvcm0gPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0Rm9ybSgxKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0Rm9ybSgwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vfiB0aGlzLmNoZWNrTGlua3MoKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXRlID09PSBNb3VzZUV2ZW50Q29kZXMuUk9UQVRJTkcpIHtcbiAgICAgICAgICAgIC8vcm91bmQgcHJvdGVpbiByb3RhdGlvbiB0byBuZWFyZXN0IDUgZGVncmVlcyAobG9va3MgbmVhdGVyKVxuICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRSb3RhdGlvbihNYXRoLnJvdW5kKHRoaXMuZHJhZ0VsZW1lbnQucm90YXRpb24gLyA1KSAqIDUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICB9IC8vZW5kIG9mIHByb3RlaW4gZHJhZzsgZG8gbm90aGluZ1xuICAgIH1cbiAgICAvL34gZWxzZSBpZiAoLyp0aGlzLnN0YXRlICE9PSB4aU5FVC5Db250cm9sbGVyLlBBTk5JTkcgJiYqLyBldnQuY3RybEtleSA9PT0gZmFsc2UpIHtcbiAgICAgICAgLy9+IHRoaXMuY2xlYXJTZWxlY3Rpb24oKTtcbiAgICAvL34gfVxuLy9+XG4gICAgLy9+IGlmICh0aGlzLnN0YXRlID09PSB4aU5FVC5Db250cm9sbGVyLlNFTEVDVElORykge1xuICAgICAgICAvL34gY2xlYXJJbnRlcnZhbCh0aGlzLm1hcmNoZXIpO1xuICAgICAgICAvL34gdGhpcy5zdmdFbGVtZW50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ZCwganNvbil7XHJcbiAgICAgICAgICAgIC8vfiB2YXIgc2VxdWVuY2UgPSBcIlwiO1xyXG4gICAgICAgICAgICAvL34gdmFyIGxpbmVzID0gdHh0LnNwbGl0KCdcXG4nKTtcclxuICAgICAgICAgICAgLy9+IHZhciBsaW5lQ291bnQgPSBsaW5lcy5sZW5ndGg7XHJcbiAgICAgICAgICAgIC8vfiBmb3IgKHZhciBsID0gMDsgbCA8IGxpbmVDb3VudDsgbCsrKXtcclxuICAgICAgICAgICAgICAgIC8vfiB2YXIgbGluZSA9IGxpbmVzW2xdO1xyXG4gICAgICAgICAgICAgICAgLy9+IGlmIChsaW5lLmluZGV4T2YoXCJTUVwiKSA9PT0gMCl7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9+IC8vc2VxdWVuY2UgPSBsaW5lO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vfiBsKys7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9+IGZvciAobDsgbCA8IGxpbmVDb3VudDsgbCsrKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9+IGxpbmUgPSBsaW5lc1tsXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9+IHNlcXVlbmNlICs9IGxpbmU7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9+IH1cclxuICAgICAgICAgICAgICAgIC8vfiB9XHJcbiAgICAgICAgICAgIC8vfiB9XHJcbiAgICAgICAgICAgIGNhbGxiYWNrKGlkLCBqc29uLnNlcXVlbmNlLnJlcGxhY2UoL1teQS1aXS9nLCAnJykpO1xyXG4gICAgICAgIH1cclxuICAgICk7XHJcbn1cclxuXHJcbnhpTkVUX1N0b3JhZ2UuZ2V0VW5pUHJvdEZlYXR1cmVzID0gZnVuY3Rpb24gKGlkLCBjYWxsYmFjayl7XHJcbiAgICB2YXIgYWNjZXNzaW9uID0geGlORVRfU3RvcmFnZS5hY2Nlc3Npb25Gcm9tSWQoaWQpO1xyXG5cdHhpTkVUX1N0b3JhZ2UuZ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mIChwaXhQZXJSZXMgPiA4KSB7XG4gICAgICAgICAgICB0aGlzLnN0aWNrWm9vbSA9IDAuNTsvL3RoaXMgbG9va3MgbGlrZSBhIGhhY2tcbiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24oc3ZnUC54LCBzdmdQLnkpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5zdGlja1pvb20gPSB0aGlzLnN0aWNrWm9vbSAqIDM7XG4gICAgICAgICAgICAvL21vdmUgc3RpY2sgc28gc2FtZSByZXNpZHVlIGlzIHVuZGVyIG1vdXNlXG4gICAgICAgICAgICB2YXIgZHggPSB0aGlzLnggLSAoc3ZnUC54KTtcbiAgICAgICAgICAgIHZhciBkeSA9IHRoaXMueSAtIChzdmdQLnkpO1xuICAgICAgICAgICAgaWYgKHRoaXMucm90YXRpb24gPT09IDAgfHwgdGhpcy5yb3RhdGlvbiA9PT0gMTgwKSB7XG4gICAgICAgICAgICAgICAgZHkgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gICAgICAgICAgICBjb25zb2xlLmxvZyhkeCArICcsJyArIGR5KTtcbiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24odGhpcy54ICsgKGR4ICogMiksIHRoaXMueSArIChkeSAqIDIpKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICAvLyB3aGVuIHNldHRpbmcgdGhlIGZvcm0gb2YgcHJvdCdzLFxuICAgIC8vIHJlbWVtYmVyIGZvbGxvd2luZyBkb2Vzbid0IGhhcHBlbiB3aGVuIHlvdSBqdXN0IGNhbGwgdG9TdGljaygpO1xuICAgIHRoaXMuc2NhbGUoKTtcbiAgICB0aGlzLnNldEFsbExpbmtDb29yZGluYXRlcygpO1xufTtcblxuUG9seW1lci5wcm90b3R5cGUuc2NhbGUgPSBmdW5jdGlvbigpIHtcbiAgICB2YXIgcHJvdExlbmd0aCA9ICh0aGlzLnNpemUpICogUG9seW1lci5VTklUU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gIHZhciBtb2RzID0gdGhpcy5saW5rZXJNb2RpZmljYXRpb25zLnJlc2lkdWVMaW5rcy52YWx1ZXMoKTtcbiAgICAgICAgICAgIHZhciBpTW9kQ291bnQgPSBtb2RzLmxlbmd0aDtcbiAgICAgICAgICAgIGZvciAodmFyIG0gPSAwOyBtIDwgaU1vZENvdW50OyBtKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgbW9kID0gbW9kc1ttXTtcbiAgICAgICAgICAgICAgICBpZiAobW9kLnNob3duKSB7XG4gICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSB0aGlzLmdldFJlc2lkdWVMaW5rUGF0aChtb2QpO1xuICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdChtb2QubGluZSkuYXR0cihcImRcIiwgcGF0aCk7XG4gICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KG1vZC5oaWdobGlnaHRMaW5lKS5hdHRyKFwiZFwiLCBwYXRoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0qL1xuICAgICAgICB0aGlzLnNldFNjYWxlR3JvdXAoKTtcbiAgICAgICAgdGhpcy5zZXRSb3RhdGlvbih0aGlzLnJvdGF0aW9uKTsgLy8gcGxhY2VzIHRpY2tzIGFuZCByb3RhdG9yc1xuICAgIH1cbn07XG5cblBvbHltZXIucHJvdG90eXBlLnNldFNjYWxlR3JvdXAgPSBmdW5jdGlvbigpIHtcbiAgICB0aGlzLmNvbnRyb2xsZXIuZW1wdHlFbGVtZW50KHRoaXMudGlja3MpO1xuICAgIHRoaXMudXBwZXJHcm91cC5hcHBlbmRDaGlsZCh0aGlzLnRpY2tzKTsvL3dpbGwgZG8gbm90aGluZyBpZiB0aGlzLnRpY2tzIGFscmVhZHkgYXBwZW5kZWQgdG8gdGhpcy51cHBlcmdyb3VwXG5cbiAgICB0aGlzLnNjYWxlTGFiZWxzID0gbmV3IEFycmF5KCk7XG4gICAgdmFyIFNjYWxlTWFqVGljayA9IDEwMDtcbiAgICB2YXIgU2NhbGVUaWNrc1BlckxhYmVsID0gMjsgLy8gdmFyaWVzIHdpdGggc2NhbGU/XG4gICAgdmFyIHBpeFBlclJlcyA9IFBvbHltZXIuVU5JVFNfUEVSX1JFU0lEVUUgKiB0aGlzLnN0aWNrWm9vbTsgLy8gLyB0aGlzLmNvbnRyb2xsZXIuejtcbiAgICB2YXIgdGljayA9IC0xO1xuICAgIHZhciBsYXN0VGlja1ggPSB0aGlzLmdldFJlc1h3aXRoU3RpY2tab29tKHRoaXMuc2l6ZSk7XG5cbiAgICBmb3IgKHZhciByZXMgPSAxOyByZXMgPD0gdGhpcy5zaXplOyByZXMrKykge1xuICAgICAgICBpZiAocmVzID09PSAxIHx8XG4gICAgICAgICAgICAgICAgKChyZXMgJSAxMDAgPT09IDApICYmICgyMDAgKiBwaXhQZXJSZXMgPiBQb2x5bWVyLm1pblhEaXN0KSkgfHxcbiAgICAgICAgICAgICAgICAoKHJlcyAlIDEwID09PSAwKSAmJiAoMjAgKiBwaXhQZXJSZXMgPiBQb2x5bWVyLm1pblhEaXN0KSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgIHZhciB0eCA9IHRoaXMuZ2V0UmVzWHdpdGhTdGlja1pvb20ocmVzKTtcbiAgICAgICAgICAgIGlmIChwaXhQZXJSZXMgPj0gOCB8fCByZXMgIT09IDEpIHtcbiAgICAgICAgICAgICAgICB0aWNrQXQodGhpcywgdHgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGljayA9ICh0aWNrICsgMSkgJSBTY2FsZVRpY2tzUGVyTGFiZWw7XG4gICAgICAgICAgICAvLyBkb2VzIHRoaXMgb25lIGdldCBhIGxhYmVsP1xuICAgICAgICAgICAgaWYgKHRpY2sgPT09IDApIHsvLyAmJiB0eCA+IDIwKSB7XG4gICAgICAgICAgICAgICAgaWYgKCh0eCArIFBvbHltZXIubWluWERpc3QpIDwgbGFzdFRpY2tYKSB7XG4gICAgICAgICAgICAg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WYgKGZvcm0gPT0gMSkge1xuICAgICAgICAgICAgdGhpcy50b1N0aWNrKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnRvQ2lyY2xlKHN2Z1ApO1xuICAgICAgICAgICAgdmFyIHIgPSB0aGlzLmdldEJsb2JSYWRpdXMoKTtcbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzLmJhY2tncm91bmQpLnRyYW5zaXRpb24oKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCAtcikuYXR0cihcInlcIiwgLXIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCByICogMikuYXR0cihcImhlaWdodFwiLCByICogMilcbiAgICAgICAgICAgICAgICAuYXR0cihcInJ4XCIsIHIpLmF0dHIoXCJyeVwiLCByKVxuICAgICAgICAgICAgICAgIC5kdXJhdGlvbihQb2x5bWVyLnRyYW5zaXRpb25UaW1lKTtcbiAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzLm91dGxpbmUpLnRyYW5zaXRpb24oKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCAtcikuYXR0cihcInlcIiwgLXIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCByICogMikuYXR0cihcImhlaWdodFwiLCByICogMilcbiAgICAgICAgICAgICAgICAuYXR0cihcInJ4XCIsIHIpLmF0dHIoXCJyeVwiLCByKVxuICAgICAgICAgICAgICAgIC5kdXJhdGlvbihQb2x5bWVyLnRyYW5zaXRpb25UaW1lKTtcbiAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzLmFubm90YXRpb25zU3ZnR3JvdXApLnRyYW5zaXRpb24oKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwidHJhbnNmb3JtXCIsIFwic2NhbGUoMSwgMSlcIilcbiAgICAgICAgICAgICAgICAuZHVyYXRpb24oUG9seW1lci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bnQ7IG0rKykge1xuICAgICAgICAgICAgdmFyIG1vZCA9IG1vZHNbbV07XG4gICAgICAgICAgICBpZiAobW9kLnNob3duKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlbGVjdExpbmUgPSBkMy5zZWxlY3QobW9kLmxpbmUpO1xuICAgICAgICAgICAgICAgIHNlbGVjdExpbmUuYXR0cihcImZpbGxcIiwgXCJub25lXCIpO1xuICAgICAgICAgICAgICAgIHNlbGVjdExpbmUuYXR0cihcImRcIiwgXCJNIDAsMCBMIDAsMFwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0qL1xuXG4gICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgIGlmICh0aGlzLmFubm90YXRpb25zKSB7XG4gICAgICAgIHZhciBhbm5vdHMgPSB0aGlzLmFubm90YXRpb25zO1xuICAgICAgICB2YXIgY2EgPSBhbm5vdHMubGVuZ3RoO1xuICAgICAgICBmb3IgKHZhciBhID0gMDsgYSA8IGNhOyBhKyspIHtcbiAgICAgICAgICAgIHZhciBhbm5vID0gYW5ub3RzW2FdO1xuICAgICAgICAgICAgdmFyIHBpZVNsaWNlID0gYW5uby5waWVTbGljZTtcbiAgICAgICAgICAgIGQzLnNlbGVjdChwaWVTbGljZSkudHJhbnNpdGlvbigpLmF0dHIoXCJkXCIsIHRoaXMuZ2V0QW5ub3RhdGlvblBpZVNsaWNlQXBwcm94aW1hdGVQYXRoKGFubm8pKVxuICAgICAgICAgICAgICAgIC5kdXJhdGlvbihQb2x5bWVyLnRyYW5zaXRpb25UaW1lKS5lYWNoKFwiZW5kXCIsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGIgPSAwOyBiIDwgY2E7IGIrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhbm5vQiA9IHNlbGYuYW5ub3RhdGlvbnNbYl07XG4gICAgICAgICAgICAgICAgICAg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FNWRy50cmFuc2Zvcm0uYmFzZVZhbC5pbml0aWFsaXplKHNlbGYuY29udHJvbGxlci5zdmdFbGVtZW50LmNyZWF0ZVNWR1RyYW5zZm9ybUZyb21NYXRyaXgoaykpO1xuICAgICAgICAvL35cbiAgICAgICAgaWYgKHhJbnRlcnBvbCAhPT0gbnVsbCl7XG4gICAgICAgICAgICBzZWxmLnNldFBvc2l0aW9uKHhJbnRlcnBvbChjdWJpY0luT3V0KGludGVycCkpLCB5SW50ZXJwb2woY3ViaWNJbk91dChpbnRlcnApKSk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgcm90ID0gcm90YXRpb25JbnRlcnBvbChjdWJpY0luT3V0KGludGVycCkpO1xuICAgICAgICBzZWxmLnN0aWNrWm9vbSA9IHN0aWNrWm9vbUludGVycG9sKGN1YmljSW5PdXQoaW50ZXJwKSlcbiAgICAgICAgc2VsZi5zZXRSb3RhdGlvbihyb3QpO1xuICAgICAgICBzZWxmLnNldEFsbExpbmtDb29yZGluYXRlcygpO1xuXG4gICAgICAgIGlmIChpbnRlcnAgPT09ICAxKXsgLy8gZmluaXNoZWQgLSB0aWR5IHVwXG4gICAgICAgICAgICBzZWxmLmZvcm0gPSAwO1xuICAgICAgICAgICAgc2VsZi5jaGVja0xpbmtzKCk7XG4gICAgICAgICAgICBzZWxmLnN0aWNrWm9vbSA9IG9yaWdpbmFsU3RpY2tab29tO1xuICAgICAgICAgICAgc2VsZi5yb3RhdGlvbiA9IG9yaWdpbmFsUm90YXRpb247XG4gICAgICAgICAgICBzZWxmLmJ1c3kgPSBmYWxzZTtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKGludGVycCA+IDEpe1xuICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZSgxKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cblBvbHltZXIucHJvdG90eXB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1xuICAgICAgICB2YXIgbW9kcyA9IHRoaXMubGlua2VyTW9kaWZpY2F0aW9ucy5yZXNpZHVlTGlua3MudmFsdWVzKCk7XG4gICAgICAgIHZhciBpTW9kQ291bnQgPSBtb2RzLmxlbmd0aDtcbiAgICAgICAgZm9yICh2YXIgbSA9IDA7IG0gPCBpTW9kQ291bnQ7IG0rKykge1xuICAgICAgICAgICAgdmFyIG1vZCA9IG1vZHNbbV07XG4gICAgICAgICAgICBpZiAobW9kLnNob3duKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSB0aGlzLmdldFJlc2lkdWVMaW5rUGF0aChtb2QpO1xuICAgICAgICAgICAgICAgIGQzLnNlbGVjdChtb2QubGluZSkuYXR0cihcImRcIixcIk0gMCwwIEwgMCwwIEwgMCwwIEwgMCwwXCIpO1xuICAgICAgICAgICAgICAgIGQzLnNlbGVjdChtb2QubGluZSkudHJhbnNpdGlvbigpLmF0dHIoXCJkXCIscGF0aClcbiAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKFBvbHltZXIudHJhbnNpdGlvblRpbWUpO1xuICAgICAgICAgICAgICAgIGQzLnNlbGVjdChtb2QuaGlnaGxpZ2h0TGluZSkuYXR0cihcImRcIixcIk0gMCwwIEwgMCwwXCIpO1xuICAgICAgICAgICAgICAgIGQzLnNlbGVjdChtb2QuaGlnaGxpZ2h0TGluZSkudHJhbnNpdGlvbigpLmF0dHIoXCJkXCIscGF0aClcbiAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKFBvbHltZXIudHJhbnNpdGlvblRpbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSovXG4gICAgaWYgKHRoaXMuYW5ub3RhdGlvbnMpIHtcbiAgICAgICAgdmFyIGFubm90cyA9IHRoaXMuYW5ub3RhdGlvbnM7XG4gICAgICAgIHZhciBjYSA9IGFubm90cy5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIGEgPSAwOyBhIDwgY2E7IGErKykge1x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BdHRyaWJ1dGUoXCJmaWxsXCIsIHRoaXMuY29sb3VyLnRvU3RyaW5nKCkpO1xyXG4gICAgICAgIH1cclxuXHJcblx0XHQvL3NldCB0aGUgZXZlbnRzIGZvciBpdFxyXG4gICAgICAgIHZhciBzZWxmID0gdGhpcztcclxuICAgICAgICB0aGlzLnVuY2VydGFpbkdseXBoLm9ubW91c2Vkb3duID0gZnVuY3Rpb24oZXZ0KSB7XHJcbiAgICAgICAgICAgIHNlbGYubW91c2VEb3duKGV2dCk7XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLnVuY2VydGFpbkdseXBoLm9ubW91c2VvdmVyID0gZnVuY3Rpb24oZXZ0KSB7XHJcbiAgICAgICAgICAgIHNlbGYubW91c2VPdmVyKGV2dCk7XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLnVuY2VydGFpbkdseXBoLm9ubW91c2VvdXQgPSBmdW5jdGlvbihldnQpIHtcclxuICAgICAgICAgICAgc2VsZi5tb3VzZU91dChldnQpO1xyXG4gICAgICAgIH07XHJcbiAgICAgICAgdGhpcy5nbHlwaC5vbm1vdXNlZG93biA9IGZ1bmN0aW9uKGV2dCkge1xyXG4gICAgICAgICAgICBzZWxmLm1vdXNlRG93bihldnQpO1xyXG4gICAgICAgIH07XHJcbiAgICAgICAgdGhpcy5nbHlwaC5vbm1vdXNlb3ZlciA9IGZ1bmN0aW9uKGV2dCkge1xyXG4gICAgICAgICAgICBzZWxmLm1vdXNlT3ZlcihldnQpO1xyXG4gICAgICAgIH07XHJcbiAgICAgICAgdGhpcy5nbHlwaC5vbm1vdXNlb3V0ID0gZnVuY3Rpb24oZXZ0KSB7XHJcbiAgICAgICAgICAgIHNlbGYubW91c2VPdXQoZXZ0KTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuaGlnaGxpZ2h0R2x5cGgub25tb3VzZWRvd24gPSBmdW5jdGlvbihldnQpIHtcclxuICAgICAgICAgICAgc2VsZi5tb3VzZURvd24oZ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b250cm9sUG9pbnRbMF0gKyAnLCcgKyBjb250cm9sUG9pbnRbMV0gKyAnICcgKyBzdGFydFBvaW50WzBdICsgJywnICsgc3RhcnRQb2ludFsxXSArXHJcbiAgICAgICAgICAgICAgICAgICAgJyBMJyArIGVuZFBvaW50WzBdICsgJywnICsgZW5kUG9pbnRbMV0gK1xyXG4gICAgICAgICAgICAgICAgICAgICcgUScgKyBjb250cm9sUG9pbnRbMF0gKyAnLCcgKyBjb250cm9sUG9pbnRbMV0gKyAnICcgKyBtaWRQb2ludFswXSArICcsJyArIG1pZFBvaW50WzFdO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgZnVuY3Rpb24gc2VxdWVuY2VEYXRhTWlkUG9pbnQoc2VxdWVuY2VEYXRhLCBpbnRlcmFjdG9yKSB7XHJcblx0XHQvL2dldCB0aGUgc21hbGxlc3Qgc3RhcnQgYW5kIHRoZSBiaWdnZXN0IGVuZFxyXG4gICAgICAgICAgICB2YXIgbG93ZXN0TGlua2VkUmVzID0gbnVsbCwgaGlnaGVzdExpbmtlZFJlcyA9IG51bGw7XHJcbiAgICAgICAgICAgIHZhciBzZENvdW50ID0gc2VxdWVuY2VEYXRhLmxlbmd0aDtcclxuICAgICAgICAgICAgZm9yICh2YXIgcyA9IDA7IHMgPCBzZENvdW50OyBzKyspIHtcclxuICAgICAgICAgICAgICAgIHZhciBzZXFEYXR1bSA9IHNlcXVlbmNlRGF0YVtzXTtcclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS5zdGFydCkpICYmIGlzRmluaXRlKHNlcURhdHVtLnN0YXJ0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBzdGFydCA9IHNlcURhdHVtLnN0YXJ0ICogMTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobG93ZXN0TGlua2VkUmVzID09PSBudWxsIHx8IHN0YXJ0IDwgbG93ZXN0TGlua2VkUmVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VzdExpbmtlZFJlcyA9IHN0YXJ0O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS51bmNlcnRhaW5TdGFydCkpICYmIGlzRmluaXRlKHNlcURhdHVtLnVuY2VydGFpblN0YXJ0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB1bmNlcnRhaW5TdGFydCA9IHNlcURhdHVtLnVuY2VydGFpblN0YXJ0ICogMTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobG93ZXN0TGlua2VkUmVzID09PSBudWxsIHx8IHVuY2VydGFpblN0YXJ0IDwgbG93ZXN0TGlua2VkUmVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VzdExpbmtlZFJlcyA9IHVuY2VydGFpblN0YXJ0O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS5lbmQpKSAmJiBpc0Zpbml0ZShzZXFEYXR1bS5lbmQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVuZCA9IHNlcURhdHVtLmVuZCAqIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpZ2hlc3RMaW5rZWRSZXMgPT09IG51bGwgfHwgZW5kID4gaGlnaGVzdExpbmtlZFJlcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoaWdoZXN0TGlua2VkUmVzID0gZW5kO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS51bmNlcnRhaW5FbmQpKSAmJiBpc0Zpbml0ZShzZXFEYXR1bS51bmNlcnRh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XG4gICAgICAgIGlmIChvdXQgPCAwKSB7XHJcbiAgICAgICAgICAgIG91dCArPSAzNjA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciBmeU9mZnNldCA9IDEwO1xyXG4gICAgICAgIGlmIChvdXQgPCAxODApIHtcclxuICAgICAgICAgICAgZnlPZmZzZXQgPSAtMTA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciBmUm90UmFkID0gKGZyb21Nb2xlY3VsZS5yb3RhdGlvbiAvIDM2MCkgKiBNYXRoLlBJICogMjtcclxuICAgICAgICBpZiAob3V0ID4gMTgwKSB7XHJcbiAgICAgICAgICAgIGZSb3RSYWQgPSBmUm90UmFkIC0gTWF0aC5QSTtcclxuICAgICAgICB9XHJcblx0XHQvL25vdyBmb3IgJ3RvJyBpbnRlcmFjdG9yXHJcbiAgICAgICAgb3V0ID0gKGFibXBEZWcgLSB0b01vbGVjdWxlLnJvdGF0aW9uKTtcclxuICAgICAgICBpZiAob3V0IDwgMCkge1xyXG4gICAgICAgICAgICBvdXQgKz0gMzYwO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgdHlPZmZzZXQgPSAxMDtcclxuICAgICAgICBpZiAob3V0ID4gMTgwKSB7XHJcbiAgICAgICAgICAgIHR5T2Zmc2V0ID0gLTEwO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgdFJvdFJhZCA9ICh0b01vbGVjdWxlLnJvdGF0aW9uIC8gMzYwKSAqIE1hdGguUEkgKiAyO1xyXG4gICAgICAgIGlmIChvdXQgPCAxODApIHtcclxuICAgICAgICAgICAgdFJvdFJhZCA9IHRSb3RSYWQgLSBNYXRoLlBJO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdmFyIGZ0TWlkID0gW2ZNaWRbMF0gKyAoMzAgKiBNYXRoLnNpbihmUm90UmFkKSAqIHRoaXMuY29udHJvbGxlci56KSxcclxuICAgICAgICAgICAgZk1pZFsxXSAtICgzMCAqIE1hdGguY29zKG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gICAgIHk6IDAsXG4gICAgICAgICAgICAgIGs6IDFcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSkudHdlZW4oXCJ6b29tOnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgZHggPSBzaXplWzBdLCBkeSA9IHNpemVbMV0sIGN4ID0gY2VudGVyMCA/IGNlbnRlcjBbMF0gOiBkeCAvIDIsIGN5ID0gY2VudGVyMCA/IGNlbnRlcjBbMV0gOiBkeSAvIDIsIGkgPSBkMy5pbnRlcnBvbGF0ZVpvb20oWyAoY3ggLSB2aWV3LngpIC8gdmlldy5rLCAoY3kgLSB2aWV3LnkpIC8gdmlldy5rLCBkeCAvIHZpZXcuayBdLCBbIChjeCAtIHZpZXcxLngpIC8gdmlldzEuaywgKGN5IC0gdmlldzEueSkgLyB2aWV3MS5rLCBkeCAvIHZpZXcxLmsgXSk7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB2YXIgbCA9IGkodCksIGsgPSBkeCAvIGxbMl07XG4gICAgICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldyA9IHtcbiAgICAgICAgICAgICAgICB4OiBjeCAtIGxbMF0gKiBrLFxuICAgICAgICAgICAgICAgIHk6IGN5IC0gbFsxXSAqIGssXG4gICAgICAgICAgICAgICAgazoga1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiaW50ZXJydXB0Lnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3O1xuICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH07XG4gICAgem9vbS50cmFuc2xhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIHZpZXcueCwgdmlldy55IF07XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiArX1swXSxcbiAgICAgICAgeTogK19bMV0sXG4gICAgICAgIGs6IHZpZXcua1xuICAgICAgfTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZpZXcuaztcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6IHZpZXcueCxcbiAgICAgICAgeTogdmlldy55LFxuICAgICAgICBrOiBudWxsXG4gICAgICB9O1xuICAgICAgc2NhbGVUbygrXyk7XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGVFeHRlbnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZUV4dGVudDtcbiAgICAgIHNjYWxlRXh0ZW50ID0gXyA9PSBudWxsID8gZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5IDogWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjZW50ZXI7XG4gICAgICBjZW50ZXIgPSBfICYmIFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2l6ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7XG4gICAgICBzaXplID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLmR1cmF0aW9uID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZHVyYXRpb247XG4gICAgICBkdXJhdGlvbiA9ICtfO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnggPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgxID0gejtcbiAgICAgIHgwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnkgPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MTtcbiAgICAgIHkxID0gejtcbiAgICAgIHkwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICBmdW5jdGlvbiBsb2NhdGlvbihwKSB7XG4gICAgICByZXR1cm4gWyAocFswXSAtIHZpZXcueCk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dWVzdCkge1xuICAgICAgICByZXR1cm4gZHN2LnBhcnNlKHJlcXVlc3QucmVzcG9uc2VUZXh0LCBmKTtcbiAgICAgIH07XG4gICAgfVxuICAgIGRzdi5wYXJzZSA9IGZ1bmN0aW9uKHRleHQsIGYpIHtcbiAgICAgIHZhciBvO1xuICAgICAgcmV0dXJuIGRzdi5wYXJzZVJvd3ModGV4dCwgZnVuY3Rpb24ocm93LCBpKSB7XG4gICAgICAgIGlmIChvKSByZXR1cm4gbyhyb3csIGkgLSAxKTtcbiAgICAgICAgdmFyIGEgPSBuZXcgRnVuY3Rpb24oXCJkXCIsIFwicmV0dXJuIHtcIiArIHJvdy5tYXAoZnVuY3Rpb24obmFtZSwgaSkge1xuICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShuYW1lKSArIFwiOiBkW1wiICsgaSArIFwiXVwiO1xuICAgICAgICB9KS5qb2luKFwiLFwiKSArIFwifVwiKTtcbiAgICAgICAgbyA9IGYgPyBmdW5jdGlvbihyb3csIGkpIHtcbiAgICAgICAgICByZXR1cm4gZihhKHJvdyksIGkpO1xuICAgICAgICB9IDogYTtcbiAgICAgIH0pO1xuICAgIH07XG4gICAgZHN2LnBhcnNlUm93cyA9IGZ1bmN0aW9uKHRleHQsIGYpIHtcbiAgICAgIHZhciBFT0wgPSB7fSwgRU9GID0ge30sIHJvd3MgPSBbXSwgTiA9IHRleHQubGVuZ3RoLCBJID0gMCwgbiA9IDAsIHQsIGVvbDtcbiAgICAgIGZ1bmN0aW9uIHRva2VuKCkge1xuICAgICAgICBpZiAoSSA+PSBOKSByZXR1cm4gRU9GO1xuICAgICAgICBpZiAoZW9sKSByZXR1cm4gZW9sID0gZmFsc2UsIEVPTDtcbiAgICAgICAgdmFyIGogPSBJO1xuICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGopID09PSAzNCkge1xuICAgICAgICAgIHZhciBpID0gajtcbiAgICAgICAgICB3aGlsZSAoaSsrIDwgTikge1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpKSA9PT0gMzQpIHtcbiAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhaztcbiAgICAgICAgICAgICAgKytpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBJID0gaSArIDI7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoaSArIDEpO1xuICAgICAgICAgIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDIpID09PSAxMCkgKytJO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyA9PT0gMTApIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGogKyAxLCBpKS5yZXBsYWNlKC9cIlwiL2csICdcIicpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChJIDwgTikge1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KEkrKyksIGsgPSAxO1xuICAgICAgICAgIGlmIChjID09PSAxMCkgZW9sID0gdHJ1ZTsgZWxzZSBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KEkpID09PSAxMCkgKytJLCArK2s7XG4gICAgICAgICAgfSBlbHNlIGlmIChjICE9PSBkZWxpbWl0ZXJDb2RlKSBjb250aW51ZTtcbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqLCBJIC0gayk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQuc2xpY2Uoaik7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKHQgPSB0b2tlbigpKSAhPT0gRU9GKSB7XG4gICAgICAgIHZhciBhID0gW107XG4gICAgICAgIHdoaWxlICh0ICE9PSBFT0wgJiYgdCAhPT0gRU9GKSB7XG4gICAgICAgICAgYS5wdXNoKHQpO1xuICAgICAgICAgIHQgPSB0b2tlbigpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmICYmIChhID0gZihhLCBuKyspKSA9PSBudWxsKSBjb250aW51ZTtcbiAgICAgICAgcm93cy5wdXNoKGEpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHJvd3M7XG4gICAgfTtcbiAgICBkc3YuZm9ybWF0ID0gZnVuY3Rpb24ocm93cykge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkocm93c1swXSkpIHJldHVybiBkc3YuZm9ybWF0Um93cyhyb3dzKTtcbiAgICAgIHZhciBmaWVsZFNldCA9IG5ldyBkM19TZXQoKSwgZmllbGRzID0gW107XG4gICAgICByb3dzLmZvckVhY2goZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIGZvciAodmFyIGZpZWxkIGluIHJvdykge1xuICAgICAgICAgIGlmICghZmllbGRTZXQuaGFzKGZpZWxkKSkge1xuICAgICAgICAgICAgZmllbGRzLnB1c2goZmllbGRTZXQuYWRkKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBbIGZpZWxkcy5tYXAoZm9ybWF0VmFsdWUpLmpvaW4oZGVsaW1pdGVyKSBdLmNvbmNhdChyb3dzLm1hcChmdW5jdGlvbihyb3cpIHtcbiAgICAgICAgcmV0dXJuIGZpZWxkcy5tYXAoZnVuY3Rpb24oZmllbGQpIHtcbiAgICAgICAgICByZXR1cm4gZm9ybWF0VmFsdWUocm93W2ZpZWxkXSk7XG4gICAgICAgIH0pLmpvaW4oZGVsaW1pdGVyKTtcbiAgICAgIH0pKS5qb2luKFwiXFxuXCIpO1xuICAgIH07XG4gICAgZHN2LmZvcm1hdFJvd3MgPSBmdW5jdGlvbihyb3dzKSB7XG4gICAgICByZXR1cm4gcm93cy5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7XG4gICAgICBmdW5jdGlvbiBmb3JtYXQoZGF0ZSkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGQzX2RhdGUgPSBkM19kYXRlX3V0YztcbiAgICAgICAgICB2YXIgdXRjID0gbmV3IGQzX2RhdGUoKTtcbiAgICAgICAgICB1dGMuXyA9IGRhdGU7XG4gICAgICAgICAgcmV0dXJuIGxvY2FsKHV0Yyk7XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgZDNfZGF0ZSA9IERhdGU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGQzX2RhdGUgPSBkM19kYXRlX3V0YztcbiAgICAgICAgICB2YXIgZGF0ZSA9IGxvY2FsLnBhcnNlKHN0cmluZyk7XG4gICAgICAgICAgcmV0dXJuIGRhdGUgJiYgZGF0ZS5fO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIGQzX2RhdGUgPSBEYXRlO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZm9ybWF0LnRvU3RyaW5nID0gbG9jYWwudG9TdHJpbmc7XG4gICAgICByZXR1cm4gZm9ybWF0O1xuICAgIH07XG4gICAgZDNfdGltZV9mb3JtYXQubXVsdGkgPSBkM190aW1lX2Zvcm1hdC51dGMubXVsdGkgPSBkM190aW1lX2Zvcm1hdE11bHRpO1xuICAgIHZhciBkM190aW1lX3BlcmlvZExvb2t1cCA9IGQzLm1hcCgpLCBkM190aW1lX2RheVJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfZGF5cyksIGQzX3RpbWVfZGF5TG9va3VwID0gZDNfdGltZV9mb3JtYXRMb29rdXAobG9jYWxlX2RheXMpLCBkM190aW1lX2RheUFiYnJldlJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfc2hvcnREYXlzKSwgZDNfdGltZV9kYXlBYmJyZXZMb29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hZChkLmdldERhdGUoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgZTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXREYXRlKCksIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIEg6IGZ1bmN0aW9uKGQsIHApIHtcbiAgICAgICAgcmV0dXJuIGQzX3RpbWVfZm9ybWF0UGFkKGQuZ2V0SG91cnMoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgSTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRIb3VycygpICUgMTIgfHwgMTIsIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIGo6IGZ1bmN0aW9uKGQsIHApIHtcbiAgICAgICAgcmV0dXJuIGQzX3RpbWVfZm9ybWF0UGFkKDEgKyBkM190aW1lLmRheU9mWWVhcihkKSwgcCwgMyk7XG4gICAgICB9LFxuICAgICAgTDogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNaWxsaXNlY29uZHMoKSwgcCwgMyk7XG4gICAgICB9LFxuICAgICAgbTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNb250aCgpICsgMSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgTTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNaW51dGVzKCksIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIHA6IGZ1bmN0aW9uKGQpIHtcbiAgICAgICAgcmV0dXJuIGxvY2FsZV9wZXJpb2RzWysoZC5nZXRIb3VycygpID49IDEyKV07XG4gICAgICB9LFxuICAgICAgUzogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfd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cyAqIHMsIGFudGltZXJpZGlhbiA9IGFicyhkzrspID4gMTgwO1xuICAgICAgICBpZiAoYW50aW1lcmlkaWFuIF4gKHMgKiDOu18gPCDOu2kgJiYgzrtpIDwgcyAqIM67KSkge1xuICAgICAgICAgIHZhciDPhmkgPSBpbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpID4gz4YxKSDPhjEgPSDPhmk7XG4gICAgICAgIH0gZWxzZSBpZiAozrtpID0gKM67aSArIDM2MCkgJSAzNjAgLSAxODAsIGFudGltZXJpZGlhbiBeIChzICogzrtfIDwgzrtpICYmIM67aSA8IHMgKiDOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gLWluZmxlY3Rpb25bMV0gKiBkM19kZWdyZWVzO1xuICAgICAgICAgIGlmICjPhmkgPCDPhjApIM+GMCA9IM+GaTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoz4YgPCDPhjApIM+GMCA9IM+GO1xuICAgICAgICAgIGlmICjPhiA+IM+GMSkgz4YxID0gz4Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFudGltZXJpZGlhbikge1xuICAgICAgICAgIGlmICjOuyA8IM67Xykge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM67MSA+PSDOuzApIHtcbiAgICAgICAgICAgIGlmICjOuyA8IM67MCkgzrswID0gzrs7XG4gICAgICAgICAgICBpZiAozrsgPiDOuzEpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAozrsgPiDOu18pIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgcDAgPSBwLCDOu18gPSDOuztcbiAgICB9XG4gICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgYm91bmQucG9pbnQgPSBsaW5lUG9pbnQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVFbmQoKSB7XG4gICAgICByYW5nZVswXSA9IM67MCwgcmFuZ2VbMV0gPSDOuzE7XG4gICAgICBib3VuZC5wb2ludCA9IHBvaW50O1xuICAgICAgcDAgPSBudWxsO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nUG9pbnQozrssIM+GKSB7XG4gICAgICBpZiAocDApIHtcbiAgICAgICAgdmFyIGTOuyA9IM67IC0gzrtfO1xuICAgICAgICBkzrtTdW0gKz0gYWJzKGTOuykgPiAxODAgPyBkzrsgKyAoZM67ID4gMCA/IDM2MCA6IC0zNjApIDogZM67O1xuICAgICAgfSBlbHNlIM67X18gPSDOuywgz4ZfXyA9IM+GO1xuICAgICAgZDNfZ2VvX2FyZWEucG9pbnQozrssIM+GKTtcbiAgICAgIGxpbmVQb2ludCjOuywgz4YpO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nU3RhcnQoKSB7XG4gICAgICBkM19nZW9fYXJlYS5saW5lU3RhcnQoKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ0VuZCgpIHtcbiAgICAgIHJpbmdQb2ludCjOu19fLCDPhl9fKTtcbiAgICAgIGQzX2dlb19hcmVhLmxpbmVFb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yIGkgPSAwLCBuID0gcG9pbnRzLmxlbmd0aDsgaSA8IG47ICsraSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQubi54LCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGlzU3ViamVjdCkge1xuICAgICAgICAgICAgcG9pbnRzID0gY3VycmVudC5wLno7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gcG9pbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSBsaXN0ZW5lci5wb2ludCgocG9pbnQgPSBwb2ludHNbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGludGVycG9sYXRlKGN1cnJlbnQueCwgY3VycmVudC5wLngsIC0xLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LnA7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubztcbiAgICAgICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgICAgICBpc1N1YmplY3QgPSAhaXNTdWJqZWN0O1xuICAgICAgfSB3aGlsZSAoIWN1cnJlbnQudik7XG4gICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwUG9seWdvbkxpbmtDaXJjdWxhcihhcnJheSkge1xuICAgIGlmICghKG4gPSBhcnJheS5sZW5ndGgpKSByZXR1cm47XG4gICAgdmFyIG4sIGkgPSAwLCBhID0gYXJyYXlbMF0sIGI7XG4gICAgd2hpbGUgKCsraSA8I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tcbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBzcGhlcmU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25TdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gcG9pbnQozrssIM+GKSB7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICBpZiAocG9pbnRWaXNpYmxlKM67ID0gcG9pbnRbMF0sIM+GID0gcG9pbnRbMV0pKSBsaXN0ZW5lci5wb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcG9pbnRMaW5lKM67LCDPhikge1xuICAgICAgICB2YXIgcG9pbnQgPSByb3RhdGUozrssIM+GKTtcbiAgICAgICAgbGluZS5wb2ludChwb2ludFswXSwgcG9pbnRbMV0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnRMaW5lO1xuICAgICAgICBsaW5lLmxpbmVTdGFydCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZUVuZCgpIHtcbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50O1xuICAgICAgICBsaW5lLmxpbmVFbmQoKTtcbiAgICAgIH1cbiAgICAgIHZhciBzZWdtZW50cztcbiAgICAgIHZhciBidWZmZXIgPSBkM19nZW9fY2xpcEJ1ZmZlckxpc3RlbmVyKCksIHJpbmdMaXN0ZW5lciA9IGNsaXBMaW5lKGJ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B7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrswLCDPhjAgPSAoz4YwICsgz4YxKSAvIDIgPiAwID8gaGFsZs+AIDogLWhhbGbPgCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MCwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MSwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHPOuzAgIT09IHPOuzEgJiYgZM67ID49IM+AKSB7XG4gICAgICAgICAgaWYgKGFicyjOuzAgLSBzzrswKSA8IM61KSDOuzAgLT0gc867MCAqIM61O1xuICAgICAgICAgIGlmIChhYnMozrsxIC0gc867MSkgPCDOtSkgzrsxIC09IHPOuzEgKiDOtTtcbiAgICAgICAgICDPhjAgPSBkM19nZW9fY2xpcEFudGltZXJpZGlhbkludGVyc2VjdCjOuzAsIM+GMCwgzrsxLCDPhjEpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGxpc3RlbmVyLnBvaW50KM67MCA9IM67MSwgz4YwID0gz4YxKTtcbiAgICAgICAgc867MCA9IHPOuzE7XG4gICAgICB9LFxuICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgzrswID0gz4YwID0gTmFOO1xuICAgICAgf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zAsIHYwLCB2MDAsIGNsZWFuO1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgbGluZVN0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2MDAgPSB2MCA9IGZhbHNlO1xuICAgICAgICAgIGNsZWFuID0gMTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9pbnQ6IGZ1bmN0aW9uKM67LCDPhikge1xuICAgICAgICAgIHZhciBwb2ludDEgPSBbIM67LCDPhiBdLCBwb2ludDIsIHYgPSB2aXNpYmxlKM67LCDPhiksIGMgPSBzbWFsbFJhZGl1cyA/IHYgPyAwIDogY29kZSjOuywgz4YpIDogdiA/IGNvZGUozrsgKyAozrsgPCAwID8gz4AgOiAtz4ApLCDPhikgOiAwO1xuICAgICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBpZiAoZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MCwgcG9pbnQyKSB8fCBkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQxLCBwb2ludDIpKSB7XG4gICAgICAgICAgICAgIHBvaW50MVswXSArPSDOtTtcbiAgICAgICAgICAgICAgcG9pbnQxWzFdICs9IM61O1xuICAgICAgICAgICAgICB2ID0gdmlzaWJsZShwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm90SGVtaXNwaGVyZSAmJiBwb2ludDAgJiYgc21hbGxSYWRpdXMgXiB2KSB7XG4gICAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICAgIGlmIChzbWFsbFJhZGl1cykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICA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EpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHgxIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkwIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkxIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgaWYgKHQwID4gMCkgbGluZS5hID0ge1xuICAgICAgICB4OiBheCArIHQwICogZHgsXG4gICAgICAgIHk6IGF5ICsgdDAgKiBkeVxuICAgICAgfTtcbiAgIC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WxsLCBudWxsLCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIGQzX2dlb19jbGlwUG9seWdvbihzZWdtZW50cywgY29tcGFyZSwgY2xpcFN0YXJ0SW5zaWRlLCBpbnRlcnBvbGF0ZSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSByaW5nID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGluc2lkZVBvbHlnb24ocCkge1xuICAgICAgICB2YXIgd24gPSAwLCBuID0gcG9seWdvbi5sZW5ndGgsIHkgPSBwWzFdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAxLCB2ID0gcG9seWdvbltpXSwgbSA9IHYubGVuZ3RoLCBhID0gdlswXSwgYjsgaiA8IG07ICsraikge1xuICAgICAgICAgICAgYiA9IHZbal07XG4gICAgICAgICAgICBpZiAoYVsxXSA8PSB5KSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdID4geSAmJiBkM19jcm9zczJkKGEsIGIsIHApID4gMCkgKyt3bjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdIDw9IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA8IDApIC0td247XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHduICE9PSAwO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW50ZXJwb2xhdGUoZnJvbSwgdG8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ICAgdmFyIGwgPSB7XG4gICAgICAgICAgICAgIGE6IHtcbiAgICAgICAgICAgICAgICB4OiB4XyxcbiAgICAgICAgICAgICAgICB5OiB5X1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBiOiB7XG4gICAgICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgICAgICB5OiB5XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY2xpcExpbmUobCkpIHtcbiAgICAgICAgICAgICAgaWYgKCF2Xykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYS54LCBsLmEueSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5iLngsIGwuYi55KTtcbiAgICAgICAgICAgICAgaWYgKCF2KSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB4XyA9IHgsIHlfID0geSwgdl8gPSB2O1xuICAgICAgfVxuICAgICAgcmV0dXJuIGNsaXA7XG4gICAgfTtcbiAgICBmdW5jdGlvbiBjb3JuZXIocCwgZGlyZWN0aW9uKSB7XG4gICAgICByZXR1cm4gYWJzKHBbMF0gLSB4MCkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAwIDogMyA6IGFicyhwWzBdIC0geDEpIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMiA6IDEgOiBhYnMocFsxXSAtIHk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HVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIM67ICogZDNfZGVncmVlcywgz4YgKiBkM19kZWdyZWVzIF07XG4gICAgICDOuyA9IF9bMF0gJSAzNjAgKiBkM19yYWRpYW5zO1xuICAgICAgz4YgPSBfWzFdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIHJldHVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi5yb3RhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIM60zrsgKiBkM19kZWdyZWVzLCDOtM+GICogZDNfZGVncmVlcywgzrTOsyAqIGQzX2RlZ3JlZXMgXTtcbiAgICAgIM60zrsgPSBfWzBdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM60z4YgPSBfWzFdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM60zrMgPSBfLmxlbmd0aCA+IDIgPyBfWzJdICUgMzYwICogZDNfcmFkaWFucyA6IDA7XG4gICAgICByZXR1cm4gcmVzZXQoKTtcbiAgICB9O1xuICAgIGQzLnJlYmluZChwcm9qZWN0aW9uLCBwcm9qZWN0UmVzYW1wbGUsIFwicHJlY2lzaW9uXCIpO1xuICAgIGZ1bmN0aW9uIHJlc2V0KCkge1xuICAgICAgcHJvamVjdFJvdGF0ZSA9IGQzX2dlb19jb21wb3NlKHJvdGF0ZSA9IGQzX2dlb19yb3RhdGlvbijOtM67LCDOtM+GLCDOtM6zKSwgcHJvamVjdCk7XG4gICAgICB2YXIgY2VudGVyID0gcHJvamVjdCjOuywgz4YpO1xuICAgICAgzrR4ID0geCAtIGNlbnRlclswXSAqIGs7XG4gICAgICDOtHkgPSB5ICsgY2VudGVyWzFdICogaztcbiAgICAgIHJldHVybiBpbnZhbGlkYXRl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SBhYnMoKM67ICo9IGQzX3JhZGlhbnMpIC0gzrswKSwgY29zzpTOuyA9IE1hdGguY29zKHQpO1xuICAgICAgZDNfZ2VvX2xlbmd0aFN1bSArPSBNYXRoLmF0YW4yKE1hdGguc3FydCgodCA9IGNvc8+GICogTWF0aC5zaW4odCkpICogdCArICh0ID0gY29zz4YwICogc2luz4YgLSBzaW7PhjAgKiBjb3PPhiAqIGNvc86UzrspICogdCksIHNpbs+GMCAqIHNpbs+GICsgY29zz4YwICogY29zz4YgKiBjb3POlM67KTtcbiAgICAgIM67MCA9IM67LCBzaW7PhjAgPSBzaW7PhiwgY29zz4YwID0gY29zz4Y7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19hemltdXRoYWwoc2NhbGUsIGFuZ2xlKSB7XG4gICAgZnVuY3Rpb24gYXppbXV0aGFsKM67LCDPhikge1xuICAgICAgdmFyIGNvc867ID0gTWF0aC5jb3MozrspLCBjb3PPhiA9IE1hdGguY29zKM+GKSwgayA9IHNjYWxlKGNvc867ICogY29zz4YpO1xuICAgICAgcmV0dXJuIFsgayAqIGNvc8+GICogTWF0aC5zaW4ozrspLCBrICogTWF0aC5zaW4oz4YpIF07XG4gICAgfVxuICAgIGF6aW11dGhhbC5pbnZlcnQgPSBmdW5jdGlvbih4LCB5KSB7XG4gICAgICB2YXIgz4EgPSBNYXRoLnNxcnQoeCAqIHggKyB5ICogeSksIGMgPSBhbmdsZSjPgSksIHNpbmMgPSBNYXRoLnNpbihjKSwgY29zYyA9IE1hdGguY29zKGMpO1xuICAgICAgcmV0dXJuIFsgTWF0aC5hdGFuMih4ICogc2luYywgz4EgKiBjb3NjKSwgTWF0aC5hc2luKM+BICYmIHkgKiBzaW5jIC8gz4EpIF07XG4gICAgfTtcbiAgICByZXR1cm4gYXppbXV0aGFsO1xuICB9XG4gIHZhciBkM19nZW9fYXppbXV0aGFsRXF1YWxBcmVhID0gZDNfZ2VvX2F6aW11dGhhbChmdW5jdGlvbihjb3PO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UNvbm5lY3RFZGdlKGVkZ2UsIGV4dGVudCkge1xuICAgIHZhciB2YiA9IGVkZ2UuYjtcbiAgICBpZiAodmIpIHJldHVybiB0cnVlO1xuICAgIHZhciB2YSA9IGVkZ2UuYSwgeDAgPSBleHRlbnRbMF1bMF0sIHgxID0gZXh0ZW50WzFdWzBdLCB5MCA9IGV4dGVudFswXVsxXSwgeTEgPSBleHRlbnRbMV1bMV0sIGxTaXRlID0gZWRnZS5sLCByU2l0ZSA9IGVkZ2UuciwgbHggPSBsU2l0ZS54LCBseSA9IGxTaXRlLnksIHJ4ID0gclNpdGUueCwgcnkgPSByU2l0ZS55LCBmeCA9IChseCArIHJ4KSAvIDIsIGZ5ID0gKGx5ICsgcnkpIC8gMiwgZm0sIGZiO1xuICAgIGlmIChyeSA9PT0gbHkpIHtcbiAgICAgIGlmIChmeCA8IHgwIHx8IGZ4ID49IHgxKSByZXR1cm47XG4gICAgICBpZiAobHggPiByeCkge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MFxuICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgIHZiID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkxXG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MVxuICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgdmIgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTBcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZm0gPSAobHggLSByeCkgLyAocnkgLSBseSk7XG4gICAgICBmYiA9IGZ5IC0gZm0gKiBmeDtcbiAgICAgIGlmIChmbSA8IC0xIHx8IGZtID4gMSkge1xuICAgICAgICBpZiAobHggPiByeCkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPj0geTEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPCB5MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChseSA8IHJ5KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPj0geDEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA8IHgwKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiB4MCxcb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ICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIGdyYW5kcGEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB1bmNsZSA9IGdyYW5kcGEuTDtcbiAgICAgICAgICBpZiAodW5jbGUgJiYgdW5jbGUuQykge1xuICAgICAgICAgICAgcGFyZW50LkMgPSB1bmNsZS5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgYWZ0ZXIgPSBncmFuZHBhO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYWZ0ZXIgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgICAgYWZ0ZXIgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBncmFuZHBhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgIH1cbiAgICAgIHRoaXMuXy5DID0gZmFsc2U7XG4gICAgfSxcbiAgICByZW1vdmU6IGZ1bmN0aW9uKG5vZGUpIH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AgICAgICAgIG5vZGUgPSBuZXh0LlI7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJlZCA9IG5vZGUuQztcbiAgICAgICAgbm9kZSA9IG5leHQ7XG4gICAgICB9XG4gICAgICBpZiAobm9kZSkgbm9kZS5VID0gcGFyZW50O1xuICAgICAgaWYgKHJlZCkgcmV0dXJuO1xuICAgICAgaWYgKG5vZGUgJiYgbm9kZS5DKSB7XG4gICAgICAgIG5vZGUuQyA9IGZhbHNlO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBkbyB7XG4gICAgICAgIGlmIChub2RlID09PSB0aGlzLl8pIGJyZWFrO1xuICAgICAgICBpZiAobm9kZSA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5SIHx8ICFzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuTCB8fCAhc2libGluZy5MLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZ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gICAgICBpZiAoeDEgIT0gbnVsbCkge1xuICAgICAgICB4MV8gPSB4MSwgeTFfID0geTEsIHgyXyA9IHgyLCB5Ml8gPSB5MjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgyXyA9IHkyXyA9IC0oeDFfID0geTFfID0gSW5maW5pdHkpO1xuICAgICAgICB4cyA9IFtdLCB5cyA9IFtdO1xuICAgICAgICBuID0gZGF0YS5sZW5ndGg7XG4gICAgICAgIGlmIChjb21wYXQpIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBkID0gZGF0YVtpXTtcbiAgICAgICAgICBpZiAoZC54IDwgeDFfKSB4MV8gPSBkLng7XG4gICAgICAgICAgaWYgKGQueSA8IHkxXykgeTFfID0gZC55O1xuICAgICAgICAgIGlmIChkLnggPiB4Ml8pIHgyXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55ID4geTJfKSB5Ml8gPSBkLnk7XG4gICAgICAgICAgeHMucHVzaChkLngpO1xuICAgICAgICAgIHlzLnB1c2goZC55KTtcbiAgICAgICAgfSBlbHNlIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICB2YXIgeF8gPSArZngoZCA9IGRhdGFbaV0sIGkpLCB5XyA9ICtmeShkLCBpKTtcbiAgICAgICAgICBpZiAoeF8gPCB4MV8pIHgxXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA8IHkxXykgeTFfID0geV87XG4gICAgICAgICAgaWYgKHhfID4geDJfKSB4Ml8gPSB4XztcbiAgICAgICAgICBpZiAoeV8gPiB5Ml8pIHkyXyA9IHlfO1xuICAgICAgICAgIHhzLnB1c2goeF8pO1xuICAgICAgICAgIHlzLnB1c2goeV8pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgZHggPSB4Ml8gLSB4MV8sIGR5ID0geTJfIC0geTFfO1xuICAgICAgaWYgKGR4ID4gZHkpIHkyXyA9IHkxXyArIGR4OyBlbHNlIHgyXyA9IHgxXyArIGR5O1xuICAgICAgZnVuY3Rpb24gaW5zZXJ0KG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKSB7XG4gICAgICAgIGlmIChpc05hTih4KSB8fCBpc05hTih5KSkgcmV0dXJuO1xuICAgICAgICBpZiAobi5sZWFmKSB7XG4gICAgICAgICAgdmFyIG54ID0gbi54LCBueSA9IG4ueTtcbiAgICAgICAgICBpZiAobnggIT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKGFicyhueCAtIHgpICsgYWJzKG55IC0geSkgPCAuMDEpIHtcbiAgICAgICAgICAgICAgaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIG5Qb2ludCA9IG4ucG9pbnQ7XG4gICAgICAgICAgICAgIG4ueCA9IG4ueSA9IG4ucG9pbnQgPSBudWxsO1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBuUG9pbnQsIG54LCBueSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG4ueCA9IHgsIG4ueSA9IHksIG4ucG9pbnQgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKSB7XG4gICAgICAgIHZhciB4bSA9ICh4MSArIHgyKSAqIC41LCB5bSA9ICh5MSArIHkyKSAqIC41LCByaWdodCA9IHggPj0geG0sIGJlbG93ID0geS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tLmluZGV4KSA+IGJpKSB7XG4gICAgICAgIGJzID0gYi5zbGljZShiaSwgYnMpO1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICAgIH1cbiAgICAgIGlmICgoYW0gPSBhbVswXSkgPT09IChibSA9IGJtWzBdKSkge1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBibTsgZWxzZSBzWysraV0gPSBibTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHNbKytpXSA9IG51bGw7XG4gICAgICAgIHEucHVzaCh7XG4gICAgICAgICAgaTogaSxcbiAgICAgICAgICB4OiBkM19pbnRlcnBvbGF0ZU51bWJlcihhbSwgYm0pXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgYmkgPSBkM19pbnRlcnBvbGF0ZV9udW1iZXJCLmxhc3RJbmRleDtcbiAgICB9XG4gICAgaWYgKGJpIDwgYi5sZW5ndGgpIHtcbiAgICAgIGJzID0gYi5zbGljZShiaSk7XG4gICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICB9XG4gICAgcmV0dXJuIHMubGVuZ3RoIDwgMiA/IHFbMF0gPyAoYiA9IHFbMF0ueCwgZnVuY3Rpb24odCkge1xuICAgICAgcmV0dXJuIGIodCkgKyBcIlwiO1xuICAgIH0pIDogZnVuY3Rpb24oKSB7XG4gICAgICByZXR1cm4gYjtcbiAgICB9IDogKGIgPSBxLmxlbmd0aCwgZnVuY3Rpb24odCkge1xuICAgICAgZm9yICh2YXIgaSA9IDAsIG87IGkgPCBiOyArK2kpIHNbKG8gPSBxW2ldKS5pXSA9IG8ueCh0KTtcbiAgICAgIHJldHVybiBzLmpvaW4oXCJcIik7XG4gICAgfSk7XG4gIH1cbiAgdmFyIGQzX2ludGVycG9sYXRlX251bWJlckEgPSAvWy0rXT8oPzpcXGQrXFwuP1xcZCp8XFwuP1xcZCspKD86W2VFXVstK10/XFxk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ihhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gc29ydFN1Ymdyb3VwcyhtYXRyaXhbaV1bYV0sIG1hdHJpeFtpXVtiXSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgayA9ICjPhCAtIHBhZGRpbmcgKiBuKSAvIGs7XG4gICAgICB4ID0gMCwgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgeDAgPSB4LCBqID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIGRpID0gZ3JvdXBJbmRleFtpXSwgZGogPSBzdWJncm91cEluZGV4W2RpXVtqXSwgdiA9IG1hdHJpeFtkaV1bZGpdLCBhMCA9IHgsIGExID0geCArPSB2ICogaztcbiAgICAgICAgICBzdWJncm91cHNbZGkgKyBcIi1cIiArIGRqXSA9IHtcbiAgICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICAgIHN1YmluZGV4OiBkaixcbiAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGEwLFxuICAgICAgICAgICAgZW5kQW5nbGU6IGExLFxuICAgICAgICAgICAgdmFsdWU6IHZcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGdyb3Vwc1tkaV0gPSB7XG4gICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IHgwLFxuICAgICAgICAgIGVuZEFuZ2xlOiB4LFxuICAgICAgICAgIHZhbHVlOiBncm91cFN1bXNbZGldXG4gICAgICAgIH07XG4gICAgICAgIHggKz0gcGFkZGluZztcbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGogPSBpIC0gMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgc291cmNlID0gc3ViZ3JvdXBzW2kgKyBcIi1cIiAr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IGNoYXJnZURpc3RhbmNlMikge1xuICAgICAgICAgICAgdmFyIGsgPSBxdWFkLnBvaW50Q2hhcmdlIC8gZG47XG4gICAgICAgICAgICBub2RlLnB4IC09IGR4ICogaztcbiAgICAgICAgICAgIG5vZGUucHkgLT0gZHkgKiBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gIXF1YWQuY2hhcmdlO1xuICAgICAgfTtcbiAgICB9XG4gICAgZm9yY2UudGljayA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKChhbHBoYSAqPSAuOTkpIDwgLjAwNSkge1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHZhciBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCBxLCBpLCBvLCBzLCB0LCBsLCBrLCB4LCB5O1xuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIHMgPSBvLnNvdXJjZTtcbiAgICAgICAgdCA9IG8udGFyZ2V0O1xuICAgICAgICB4ID0gdC54IC0gcy54O1xuICAgICAgICB5ID0gdC55IC0gcy55O1xuICAgICAgICBpZiAobCA9IHggKiB4ICsgeSAqIHkpIHtcbiAgICAgICAgICBsID0gYWxwaGEgKiBzdHJlbmd0aHNbaV0gKiAoKGwgPSBNYXRoLnNxcnQobCkpIC0gZGlzdGFuY2VzW2ldKSAvIGw7XG4gICAgICAgICAgeCAqPSBsO1xuICAgICAgICAgIHkgKj0gbDtcbiAgICAgICAgICB0LnggLT0geCAqIChrID0gcy53ZWlnaHQgKyB0LndlaWdodCA/IHMud2VpZ2h0IC8gKHMud2VpZ2h0ICsgdC53ZWlnaHQpIDogLjUpO1xuICAgICAgICAgIHQueSAtPSB5ICogaztcbiAgICAgICAgICBzLnggKz0geCAqIChrID0gMSAtIGspO1xuICAgICAgICAgIHMueSArPSB5ICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGsgPSBhbHBoYSAqIGdyYXZpdHkpIHtcbiAgICAgICAgeCA9IHNpemVbMF0gLyAyO1xuICAgICAgICB5ID0gc2l6ZVsxXSAvIDI7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgaWYgKGspIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICAgIG8ueCArPSAoeCAtIG8ueCkgKiBrO1xuICAgICAgICAgIG8ueSArPSAoeSAtIG8ueSkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoY2hhcmdlKSB7XG4gICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUocSA9IGQzLmdlb20ucXVhZHRyZWUobm9kZXMpLCBhbHBoYSwgY2hhcmdlcyk7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBpZiAoIShvID0gbm9kZXNbaV0pLmZpeGVkKSB7XG4gICAgICAgICAgICBxLnZpc2l0KHJlcHVsc2UobykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICBpZiAoby5maXhlZCkge1xuICAgICAgICAgIG8ueCA9IG8ucHg7XG4gICAgICAgICAgby55ID0gby5weTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvLnggLT0gKG8ucHggLSAoby5weCA9IG8ueCkpICogZnJpY3Rpb247XG4gICAgICAgICAgby55IC09IChvLnB5IC0gKG8ucHkgPSBvLnkpKSA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3VtZW50cy5sZW5ndGgpIHJldHVybiBhbHBoYTtcbiAgICAgIHggPSAreDtcbiAgICAgIGlmIChhbHBoYSkge1xuICAgICAgICBpZiAoeCA+IDApIHtcbiAgICAgICAgICBhbHBoYSA9IHg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGltZXIuYyA9IG51bGwsIHRpbWVyLnQgPSBOYU4sIHRpbWVyID0gbnVsbDtcbiAgICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmICh4ID4gMCkge1xuICAgICAgICBldmVudC5zdGFydCh7XG4gICAgICAgICAgdHlwZTogXCJzdGFydFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IHhcbiAgICAgICAgfSk7XG4gICAgICAgIHRpbWVyID0gZDNfdGltZXIoZm9yY2UudGljayk7XG4gICAgICB9XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5zdGFydCA9IGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIGksIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHcgPSBzaXplWzBdLCBoID0gc2l6ZVsxXSwgbmVpZ2hib3JzLCBvO1xuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAobyA9IG5vZGVzW2ldKS5pbmRleCA9IGk7XG4gICAgICAgIG8ud2VpZ2h0ID0gMDtcbiAgICAgIH1cbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBpZiAodHlwZW9mIG8uc291cmNlID09IFwibnVtYmVyXCIpIG8uc291cmNlID0gbm9kZXNbby5zb3VyY2VdO1xuICAgICAgICBpZiAodHlwZW9mIG8ud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biAgICAgICAgYXJjc1tpXSA9IHtcbiAgICAgICAgICBkYXRhOiBkYXRhW2ldLFxuICAgICAgICAgIHZhbHVlOiB2ID0gdmFsdWVzW2ldLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IGEsXG4gICAgICAgICAgZW5kQW5nbGU6IGEgKz0gdiAqIGsgKyBwYSxcbiAgICAgICAgICBwYWRBbmdsZTogcFxuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gYXJjcztcbiAgICB9XG4gICAgcGllLnZhbHVlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdmFsdWU7XG4gICAgICB2YWx1ZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnNvcnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzb3J0O1xuICAgICAgc29ydCA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnN0YXJ0QW5nbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGFydEFuZ2xlO1xuICAgICAgc3RhcnRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLmVuZEFuZ2xlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZW5kQW5nbGU7XG4gICAgICBlbmRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnBhZEFuZ2xlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcGFkQW5nbGU7XG4gICAgICBwYWRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICA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BiKSB7XG4gICAgICAgIHJldHVybiBtYXhbYV0gLSBtYXhbYl07XG4gICAgICB9KSwgdG9wID0gMCwgYm90dG9tID0gMCwgdG9wcyA9IFtdLCBib3R0b21zID0gW107XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIGogPSBpbmRleFtpXTtcbiAgICAgICAgaWYgKHRvcCA8IGJvdHRvbSkge1xuICAgICAgICAgIHRvcCArPSBzdW1zW2pdO1xuICAgICAgICAgIHRvcHMucHVzaChqKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBib3R0b20gKz0gc3Vtc1tqXTtcbiAgICAgICAgICBib3R0b21zLnB1c2goaik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBib3R0b21zLnJldmVyc2UoKS5jb25jYXQodG9wcyk7XG4gICAgfSxcbiAgICByZXZlcnNlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICByZXR1cm4gZDMucmFuZ2UoZGF0YS5sZW5ndGgpLnJldmVyc2UoKTtcbiAgICB9LFxuICAgIFwiZGVmYXVsdFwiOiBkM19sYXlvdXRfc3RhY2tPcmRlckRlZmF1bHRcbiAgfSk7XG4gIHZhciBkM19sYXlvdXRfc3RhY2tPZmZzZXRzID0gZDMubWFwKHtcbiAgICBzaWxob3VldHRlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICB2YXIgbiA9IGRhdGEubGVuZ3RoLCBtID0gZGF0YVswXS5sZW5ndGgsIHN1bXMgPSBbXSwgbWF4ID0gMCwgaSwgaiwgbywgeTAgPSBbXTtcbiAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHtcbiAgICAgICAgZm9yIChpID0gMCwgbyA9IDA7IGkgPCBuOyBpKyspIG8gKz0gZGF0YVtpXVtqXVsxXTtcbiAgICAgICAgaWYgKG8gPiBtYXgpIG1heCA9IG87XG4gICAgICAgIHN1bXMucHVzaChvKTtcbiAgICAgIH1cbiAgICAgI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GIsIGMpO1xuICAgICAgICBib3VuZChjKTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG4gICAgICAgIGEuX3BhY2tfcHJldiA9IGM7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGMsIGIpO1xuICAgICAgICBiID0gYS5fcGFja19uZXh0O1xuICAgICAgICBmb3IgKGkgPSAzOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjID0gbm9kZXNbaV0pO1xuICAgICAgICAgIHZhciBpc2VjdCA9IDAsIHMxID0gMSwgczIgPSAxO1xuICAgICAgICAgIGZvciAoaiA9IGIuX3BhY2tfbmV4dDsgaiAhPT0gYjsgaiA9IGouX3BhY2tfbmV4dCwgczErKykge1xuICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhqLCBjKSkge1xuICAgICAgICAgICAgICBpc2VjdCA9IDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QgPT0gMSkge1xuICAgICAgICAgICAgZm9yIChrID0gYS5fcGFja19wcmV2OyBrICE9PSBqLl9wYWNrX3ByZXY7IGsgPSBrLl9wYWNrX3ByZXYsIHMyKyspIHtcbiAgICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhrLCBjKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCkge1xuICAgICAgICAgICAgaWYgKHMxIDwgczIgfHwgczEgPT0gczIgJiYgYi5yIDwgYS5yKSBkM19sYXlvdXRfcGFja1NwbGljZShhLCBiID0gaik7IGVsc2UgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSA9IGssIGIpO1xuICAgICAgICAgICAgaS0tO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgYm91bmQoYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHZhciBjeCA9ICh4TWluICsgeE1heCkgLyAyLCBjeSA9ICh5TWluICsgeU1heCkgLyAyLCBjciA9IDA7XG4gICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgYyA9IG5vZGVzW2ldO1xuICAgICAgYy54IC09IGN4O1xuICAgICAgYy55IC09IGN5O1xuICAgICAgY3IgPSBNYXRoLm1heChjciwgYy5yICsgTWF0aC5zcXJ0KGMueCAqIGMueCArIGMueSAqIGMueSkpO1xuICAgIH1cbiAgICBub2RlLnIgPSBjcjtcbiAgICBub2Rlcy5mb3JFYWNoKGQzX2xheW91dF9wYWNrVW5saW5rKTtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja0xpbmsobm9kZSkge1xuICAgIG5vZGUuX3BhY2tfbmV4dCA9IG5vZGUuX3BhY2tfcHJldiA9IG5vZGU7XG4gIH1cbiAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tVbmxpbmsobm9kZSkge1xuICAgIGRlbGV0ZSBub2RlLl9wYWNrX25leHQ7XG4gICAgZGVsZXRlIG5vZGUuX3BhY2tfcHJldjtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja1RyYW5zZm9ybShub2RlLCB4LCB5LCBrKSB7XG4gICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcbiAgICBub2RlLnggPSB4ICs9IGsgKiBub2RlLng7XG4gICAgbm9kZS55ID0geSArPSBrICogbm9kZS55O1xuICAgIG5vZGUuciAqPSBrO1xuICAgIGlmIChjaGlsZHJlbikge1xuICAgICAgdmFyIGkgPSAtMSwgbi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ZnQodmlwKSwgdmltICYmIHZpcCkge1xuICAgICAgICAgIHZvbSA9IGQzX2xheW91dF90cmVlTGVmdCh2b20pO1xuICAgICAgICAgIHZvcCA9IGQzX2xheW91dF90cmVlUmlnaHQodm9wKTtcbiAgICAgICAgICB2b3AuYSA9IHY7XG4gICAgICAgICAgc2hpZnQgPSB2aW0ueiArIHNpbSAtIHZpcC56IC0gc2lwICsgc2VwYXJhdGlvbih2aW0uXywgdmlwLl8pO1xuICAgICAgICAgIGlmIChzaGlmdCA+IDApIHtcbiAgICAgICAgICAgIGQzX2xheW91dF90cmVlTW92ZShkM19sYXlvdXRfdHJlZUFuY2VzdG9yKHZpbSwgdiwgYW5jZXN0b3IpLCB2LCBzaGlmdCk7XG4gICAgICAgICAgICBzaXAgKz0gc2hpZnQ7XG4gICAgICAgICAgICBzb3AgKz0gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpbSArPSB2aW0ubTtcbiAgICAgICAgICBzaXAgKz0gdmlwLm07XG4gICAgICAgICAgc29tICs9IHZvbS5tO1xuICAgICAgICAgIHNvcCArPSB2b3AubTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmltICYmICFkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCkpIHtcbiAgICAgICAgICB2b3AudCA9IHZpbTtcbiAgICAgICAgICB2b3AubSArPSBzaW0gLSBzb3A7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpcCAmJiAhZDNfbGF5b3V0X3RyZWVMZWZ0KHZvbSkpIHtcbiAgICAgICAgICB2b20udCA9IHZpcDtcbiAgICAgICAgICB2b20ubSArPSBzaXAgLSBzb207XG4gICAgICAgICAgYW5jZXN0b3IgPSB2O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gYW5jZXN0b3I7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNpemVOb2RlKG5vZGUpIHtcbiAgICAgIG5vZGUueCAqPSBzaXplWzBdO1xuICAgICAgbm9kZS55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mFsdWUpO1xuICAgICAgICByb3cuYXJlYSA9IDA7XG4gICAgICAgIHdoaWxlIChjaGlsZCA9IHJlbWFpbmluZy5wb3AoKSkge1xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkKTtcbiAgICAgICAgICByb3cuYXJlYSArPSBjaGlsZC5hcmVhO1xuICAgICAgICAgIGlmIChjaGlsZC56ICE9IG51bGwpIHtcbiAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgY2hpbGQueiA/IHJlY3QuZHggOiByZWN0LmR5LCByZWN0LCAhcmVtYWluaW5nLmxlbmd0aCk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHN0aWNraWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gd29yc3Qocm93LCB1KSB7XG4gICAgICB2YXIgcyA9IHJvdy5hcmVhLCByLCBybWF4ID0gMCwgcm1pbiA9IEluZmluaXR5LCBpID0gLTEsIG4gPSByb3cubGVuZ3RoO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKCEociA9IHJvd1tpXS5hcmVhKSkgY29udGludWU7XG4gICAgICAgIGlmIChyIDwgcm1pbikgcm1pbiA9IHI7XG4gICAgICAgIGlmIChyID4gcm1heCkgcm1heCA9IHI7XG4gICAgICB9XG4gICAgICBzICo9IHM7XG4gICAgICB1ICo9IHU7XG4gICAgICByZXR1cm4gcyA/IE1hdGgubWF4KHUgKiBybWF4ICogcmF0aW8gLyBzLCBzIC8gKHUgKiBybWluICogcmF0aW8pKSA6IEluZmluaXR5O1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZsdXNoKSB7XG4gICAgICB2YXIgaSA9IC0xLCBuID0gcm93Lmxlbmd0aCwgeCA9IHJlY3QueCwgeSA9IHJlY3QueSwgdiA9IHUgPyByb3VuZChyb3cuYXJlYSAvIHUpIDogMCwgbztcbiAgICAgIGlmICh1ID09IHJlY3QuZHgpIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR5KSB2ID0gcmVjdC5keTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR5ID0gdjtcbiAgICAgICAgICB4ICs9IG8uZHggPSBNYXRoLm1pbihyZWN0LnggKyByZWN0LmR4IC0geCwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gdHJ1ZTtcbiAgICAgICAgby5keCArPSByZWN0LnggKyByZWN0LmR4IC0geDtcbiAgICAgICAgcmVjdC55ICs9IHY7XG4gICAgICAgIHJlY3QuZHkgLT0gdjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keCkgdiA9IHJlY3QuZHg7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keCA9IHY7XG4gICAgICAgICAgeSArPSBvLmR5ID0gTWF0aC5taW4ocmVjdC55ICsgcmVjdC5keSAtIHksIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IGZhbHNlO1xuICAgICAgICBvLmR5ICs9IHJlY3QueSArIHJlY3QuZHkgLSB5O1xuICAgICAgICByZWN0LnggKz0gdjtcbiAgICAgICAgcmVjdC5keCAtPSB2O1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB0cmVlbWFwKGQpIHtcbiAgICAgIHZhciBub2RlcyA9IHN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W9uSW5oZXJpdElkKSB7XG4gICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5lYWNoKFwic3RhcnQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MC5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDAuajtcbiAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQwLng7XG4gICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MC55O1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiYnJ1c2g6YnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgeGkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHhFeHRlbnQsIGV4dGVudDEueCksIHlpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh5RXh0ZW50LCBleHRlbnQxLnkpO1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IHlFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDEueCA9IHhpKHQpO1xuICAgICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MS55ID0geWkodCk7XG4gICAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MS5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDEuajtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIHJlZHJhdyhnKSB7XG4gICAgICBnLnNlbGVjdEFsbChcIi5yZXNpemVcIikuYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbihkKSB7XG4gICAgICAgIHJldHVybiBcInRyYW5zbGF0ZShcIiArIHhFeHRlbnRbKy9lJC8udGVzdChkKV0gKyBcIixcIiArIHlFeHRlbnRbKy9ecy8udGVzdChkKV0gKyBcIilcIjtcbiAgICAgIH0pO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWRyYXdYKGcpIHtcbiAgICAgIGcuc2VsZWN0KFwiLmV4dGVudFwiKS5hdHRyKFwieFwiLCB4RXh0ZW50WzBdKTtcbiAgICAgIGcuc2VsZWN0QWxsKFwiLmV4dGVudCwubj5yZWN0LC5zPnJlY3RcIikuYXR0c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ICAgICBicnVzaG1vdmUoKTtcbiAgICAgIGZ1bmN0aW9uIGtleWRvd24oKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyKSB7XG4gICAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgICAgY2VudGVyID0gbnVsbDtcbiAgICAgICAgICAgIG9yaWdpblswXSAtPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgb3JpZ2luWzFdIC09IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBkcmFnZ2luZyA9IDI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga2V5dXAoKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyICYmIGRyYWdnaW5nID09IDIpIHtcbiAgICAgICAgICBvcmlnaW5bMF0gKz0geEV4dGVudFsxXTtcbiAgICAgICAgICBvcmlnaW5bMV0gKz0geUV4dGVudFsxXTtcbiAgICAgICAgICBkcmFnZ2luZyA9IDA7XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaG1vdmUoKSB7XG4gICAgICAgIHZhciBwb2ludCA9IGQzLm1vdXNlKHRhcmdldCksIG1vdmVkID0gZmFsc2U7XG4gICAgICAgIGlmIChvZmZzZXQpIHtcbiAgICAgICAgICBwb2ludFswXSArPSBvZmZzZXRbMF07XG4gICAgICAgICAgcG9pbnRbMV0gKz0gb2Zmc2V0WzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICBpZiAoZDMuZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICBpZiAoIWNlbnRlcikgY2VudGVyID0gWyAoeEV4dGVudFswXSArIHhFeHRlbnRbMV0pIC8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G9zaXRpb247XG4gICAgICAgICAgcjEgLT0gc2l6ZSArIHBvc2l0aW9uO1xuICAgICAgICB9XG4gICAgICAgIG1pbiA9IChpID8geUNsYW1wIDogeENsYW1wKSA/IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgcG9pbnRbaV0pKSA6IHBvaW50W2ldO1xuICAgICAgICBpZiAoZHJhZ2dpbmcpIHtcbiAgICAgICAgICBtYXggPSAobWluICs9IHBvc2l0aW9uKSArIHNpemU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGNlbnRlcikgcG9zaXRpb24gPSBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIDIgKiBjZW50ZXJbaV0gLSBtaW4pKTtcbiAgICAgICAgICBpZiAocG9zaXRpb24gPCBtaW4pIHtcbiAgICAgICAgICAgIG1heCA9IG1pbjtcbiAgICAgICAgICAgIG1pbiA9IHBvc2l0aW9uO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtYXggPSBwb3NpdGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dGVudFswXSAhPSBtaW4gfHwgZXh0ZW50WzFdICE9IG1heCkge1xuICAgICAgICAgIGlmIChpKSB5RXh0ZW50RG9tYWluID0gbnVsbDsgZWxzZSB4RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICBleHRlbnRbMF0gPSBtaW47XG4gICAgICAgICAgZXh0ZW50WzFdID0gbWF4O1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaGVuZCgpIHtcbiAgICAgICAgYnJ1c2htb3ZlKCk7XG4gICAgICAgIGcuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcImFsbFwiKS5zZWxlY3RBbGwoXCIucmVzaXplXCIpLnN0eWxlKFwiZGlzcGxheVwiLCBicnVzaC5lbXB0eSgpID8gXCJub25lXC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FtcCA9ICEhelswXSwgeUNsYW1wID0gISF6WzFdOyBlbHNlIGlmICh4KSB4Q2xhbXAgPSAhIXo7IGVsc2UgaWYgKHkpIHlDbGFtcCA9ICEhejtcbiAgICAgIHJldHVybiBicnVzaDtcbiAgICB9O1xuICAgIGJydXNoLmV4dGVudCA9IGZ1bmN0aW9uKHopIHtcbiAgICAgIHZhciB4MCwgeDEsIHkwLCB5MSwgdDtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICBpZiAoeCkge1xuICAgICAgICAgIGlmICh4RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnREb21haW5bMF0sIHgxID0geEV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50WzBdLCB4MSA9IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geC5pbnZlcnQoeDApLCB4MSA9IHguaW52ZXJ0KHgxKTtcbiAgICAgICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHkpIHtcbiAgICAgICAgICBpZiAoeUV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50RG9tYWluWzBdLCB5MSA9IHlFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudFswXSwgeTEgPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHkuaW52ZXJ0KSB5MCA9IHkuaW52ZXJ0KHkwKSwgeTEgPSB5LmludmVydCh5MSk7XG4gICAgICAgICAgICBpZiAoeTEgPCB5MCkgdCA9IHkwLCB5MCA9IHkxLCB5MSA9IHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVyb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54IC0gYzIwLngpKnYzICsgKGMxMC55IC0gYzIwLnkpKnYxXG4gICAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHYwID0gYzEyLngqYzIyLnkgLSBjMTIueSpjMjIueDtcbiAgICAgICAgdmFyIHYxID0gYzEyLngqYzIxLnkgLSBjMjEueCpjMTIueTtcbiAgICAgICAgdmFyIHYyID0gYzExLngqYzEyLnkgLSBjMTEueSpjMTIueDtcbiAgICAgICAgdmFyIHYzID0gYzEwLnkgLSBjMjAueTtcbiAgICAgICAgdmFyIHY0ID0gYzEyLnkqKGMxMC54IC0gYzIwLngpIC0gYzEyLngqdjM7XG4gICAgICAgIHZhciB2NSA9IC1jMTEueSp2MiArIGMxMi55KnY0O1xuICAgICAgICB2YXIgdjYgPSB2Mip2MjtcblxuICAgICAgICBwb2x5ID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICB2MCp2MCxcbiAgICAgICAgICAgIDIqdjAqdjEsXG4gICAgICAgICAgICAoLWMyMi55KnY2ICsgYzEyLnkqdjEqdjEgKyBjMTIueSp2MCp2NCArIHYwKnY1KSAvIGMxMi55LFxuICAgICAgICAgICAgKC1jMjEueSp2NiArIGMxMi55KnYxKnY0ICsgdjEqdjUpIC8gYzEyLnksXG4gICAgICAgICAgICAodjMqdjYgKyB2NCp2NSkgLyBjMTIueVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHMoKTtcbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcblxuICAgICAgICBpZiAoIDAgPD0gcyAmJiBzIDw9IDEgKSB7XG4gICAgICAgICAgICB2YXIgeFJvb3RzID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICAgICAgYzEyLngsXG4gICAgICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICAgICAgYzEwLnggLSBjMjAueCAtIHMqYzIxLnggLSBzKnMqYzIyLnhcbiAgICAgICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgICAgIHZhciB5Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgICAgICBjMTIueSxcbiAgICAgICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgICAgICBjMTAueSAtIGMyMC55IC0gcypjMjEueSAtIHMqcypjMjIueVxuICAgICAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgICAgICBpZiAoIHhSb290cy5sZW5ndGggPiAwICYmIHlSb290cy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIHZhciBUT0xFUkFOQ0UgPSAxZS00O1xuXG4gICAgICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgICAgICBmb3IgKCB2YXIgaiA9IDA7IGogPCB4Um9vdHMubGVuZ3RoOyBqKysgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4Um9vdCA9IHhSb290c1tqXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIDAgPD0geFJvb3QgJiYgeFJvb3QgPD0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE1hdGguYWJzKCB4Um9vdCAtIHlSb290c1trXSApIDwgVE9MRVJBTkNFICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goIGMyMi5tdWx0aXBseShzKnMpLmFkZChjMjEubXVsdGlwbHkocykuYWRkKGMyMCkpICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC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AgICAgLTIqYzEyLngqYzIxLngqYzEyLnkqYzIzLnkgLSAyKmMxMi54KmMxMi55KmMyMS55KmMyMy54IC0gMipjMTIueCpjMTIueSpjMjIueCpjMjIueSArXG4gICAgICAgICAgICAyKmMyMS54KmMxMnkyKmMyMy54ICsgYzEyeTIqYzIyeDIgKyBjMTJ4MiooMipjMjEueSpjMjMueSArIGMyMnkyKSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjMueSArIDIqYzEwLnkqYzEyLngqYzEyLnkqYzIzLnggKyBjMTEueCpjMTEueSpjMTIueCpjMjMueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueSpjMjMueCAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIzLnkgLSAyKmMxMi54KmMyMC55KmMxMi55KmMyMy54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyLnkqYzIyLnkgLSAyKmMxMi54KmMxMi55KmMyMS55KmMyMi54IC0gMipjMTAueCpjMTJ5MipjMjMueCAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMyMy55ICsgMipjMjAueCpjMTJ5MipjMjMueCArIDIqYzIxLngqYzEyeTIqYzIyLnggLVxuICAgICAgICAgICAgYzExeTIqYzEyLngqYzIzLnggLSBjMTF4MipjMTIueSpjMjMueSArIGMxMngyKigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSksXG4gICAgICAgIDIqYzEwLngqYzEyLngqYzEyLnkqYzIyLnkgKyAyKmMxMC55KmMxMi54KmMxMi55KmMyMi54ICsgYzExLngqYzExLnkqYzEyLngqYzIyLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLnkqYzIyLnggLSAyKmMyMC54KmMxMi54KmMxMi55KmMyMi55IC0gMipjMTIueCpjMjAueSpjMTIueSpjMjIueCAtXG4gICAgICAgICAgICAyKmMxMi54KmMyMS54KmMxMi55KmMyMS55IC0gMipjMTAueCpjMTJ5MipjMjIueCAtIDIqYzEwLnkqYzEyeDIqYzIyLnkgK1xuICAgICAgICAgICAgMipjMjAueCpjMTJ5MipjMjIueCAtIGMxMXkyKmMxMi54KmMyMi54IC0gYzExeDIqYzEyLnkqYzIyLnkgKyBjMjF4MipjMTJ5MiArXG4gICAgICAgICAgICBjMTJ4MiooMipjMjAueSpjMjIueSArIGMyMXkyKSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjEueSArIDIqYzEwLnkqYzEyLngqYzIxLngqYzEyLnkgKyBjMTEueCpjMTEueSpjMTIueCpjMjEueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMjEueCpjMTIueSAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIxLnkgLSAyKmMxMi54KmMyMC55KmMyMS54KmMxMi55IC1cbiAgICAgICAgICAgIDIqYzEwLngqYzIxLngqYzEyeTIgLSAyKmMxMC55KmMxMngyKmMyMS55ICsgMipjMjAueCpjMjEueCpjMTJ5MiAtXG4gICAgICAgICAgICBjMTF5MipjMTIueCpjMjEueCAtIGMxMXgyKmMxMi55KmMyMS55ICsgMipjMTJ4MipjMjAueSpjMjEueSxcbiAgICAgICAgLTIqYzEwLngqYzEwLnkqYzEyLngqYzEyLnkgLSBjMTAueCpjMTEueCpjMTEueSpjMTIueSAtIGMxMC55KmMxMS54KmMxMS55KmMxMi54ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzIwLnkqYzEyLnkgKyAyKmMxMC55KmMyMC54KmMxMi54KmMxMi55ICsgYzExLngqYzIwLngqYzExLnkqYzEyLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzIwLnkgLSAyKmMyMC54KmMxMi54KmMyMC55KmMxMi55IC0gMipjMTAueCpjMjAueCpjMTJ5MiArXG4gICAgICAgICAgICBjMTAueCpjMTF5MipjMTIueCArIGMxMC55KmMxMXgyKmMxMi55IC0gMipjMTAueSpjMTJ4MipjMjAueSAtXG4gICAgICAgICAgICBjMjAueCpjMTF5MipjMTIueCAtIGMxMXgyKmMyMC55KmMxMi55ICsgYzEweDIqYzEyeTIgKyBjMTB5MipjMTJ4MiArXG4gICAgICAgICAgICBjMjB4MipjMTJ5MiArIGMxMngyKmMyMHkyXG4gICAgKTtcbiAgICB2YXIgcm9vdHMgPSBwb2x5LmdldFJvb3RzSW5JbnRlcnZhbCgwLDEpO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgcm9vdHMubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgIHZhciBzID0gcm9vdHNbaV07XG4gICAgICAgIHZhciB4Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIGMxMi54LFxuICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICBjMTAueCAtIGMyMC54IC0gcypjMjEueCAtIHMqcypjMjIueCAtIHMqcypzKmMyMy54XG4gICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgdmFyIHlSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEyLnksXG4gICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55IC0gcypzKnMqYzIzLnlcbiAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICB2YXIgVE9MRVJBTkNFID0gMWUtNDtcblxuICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICB2YXIgeFJvb3QgPSB4Um9vdHNbal07XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKCAwIDw9IHhSb290ICYmIHhSb290IDw9IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMjMubXVsdGlwbHkocypzKnMpLmFkZChjMjIubXVsdGlwbHkocypzKS5hZGQoYzIxLm11bHRpcGx5KHMpLmFkZChjMjApKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoIHJlc3VsdC5wb2ludHMubGVuZ3RoID4gMCApIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuXG4gICAgcmV0dXJuIHJlc3VsdDtcblxufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RCZXppZXIyQ2lyY2xlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyQ2lyY2xlID0gZnVuY3Rpb24ocDEsIHAyLCBwMywgYywgcikge1xuICAgIHJldHVybiBJbnRlcnNlY3Rpb24uaW50ZXJzZWN0QmV6aWVyMkVsbGlwc2UocDEsIHAyLCBwMywgYywgciwgcik7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllcjJFbGxpcHNlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyRWxsaXBzZSA9IGZ1bmN0aW9uKHAxLCBwMiwgcDMsIGVjLCByeCwgcnkpIHtcbiAgICB2YXIgYSwgYjsgICAgICAgLy8gdGVtcG9yYXJ5IHZhcmlhYmxlc1xuICAgIHZhciBjMiwgYzEsIGMwOyAvLyBjb2VmZmljaWVudHMgb2YgcXVhZHJhdGljXG4gICAgdmFyIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJObyBJbnRlcnNlY3Rpb25cIik7XG5cbiAgICBhID0gcDIubXVsdGlwbHkoLTIpO1xuICAgIGMyID0gcDEuYWRkKGEuYWRkKHAzKSk7XG5cbiAgICBhID0gcDEubXVsdGlwbHkoLTIpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgyKTtcbiAgICBjMSA9IGEuYWRkKGIpO1xuXG4gICAgYzAgPSBuZXcgUG9pbnQyRChwMS54LCBwMS55KTtcblxuICAgIHZhciByeHJ4ICA9IHJ4KnJ4O1xuICAgIHZhciByeXJ5ICA9IHJ5KnJ5O1xuICAgIHZhciByb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICByeXJ5KmMyLngqYzIueCArIHJ4cngqYzIueSpjMi55LFxuICAgICAgICAyKihyeXJ5KmMyLngqYzEueCArIHJ4cngqYzIueSpjMS55KSxcbiAgICAgICAgcnlyeSooMipjMi54KmMwLnggKyBjMS54KmMxLngpICsgcnhyeCooMipjMi55KmMwLnkrYzEueSpjMS55KSAtXG4gICAgICAgICAgICAyKihyeXJ5KmVjLngqYzIueCArIHJ4cngqZWMueSpjMi55KSxcbiAgICAgICAgMioocnlyeSpjMS54KihjMC54LWVjLngpICsgcnhyeCpjMS55KihjMC55LWVjLnkpKSxcbiAgICAgICAgcnlyeSooYzAueCpjMC54K2VjLngqZWMueCkgKyByeHJ4KihjMC55KmMwLnkgKyBlYy55KmVjLnkpIC1cbiAgICAgICAgICAgIDIqKHJ5cnkqZWMueCpjMC54ICsgcnhyeCplYy55KmMwLnkpIC0gcnhyeCpyeXJ5XG4gICAgKS5nZXRSb290cygpO1xuXG4gICAgZm9yICggdmFyIGk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vciAoIHZhciBpID0gMDsgaSA8IHJvb3RzLmxlbmd0aDsgaSsrICkge1xuICAgICAgICB2YXIgdCA9IHJvb3RzW2ldO1xuXG4gICAgICAgIGlmICggMCA8PSB0ICYmIHQgPD0gMSApIHtcbiAgICAgICAgICAgIC8vIFdlJ3JlIHdpdGhpbiB0aGUgQmV6aWVyIGN1cnZlXG4gICAgICAgICAgICAvLyBGaW5kIHBvaW50IG9uIEJlemllclxuICAgICAgICAgICAgdmFyIHA0ID0gcDEubGVycChwMiwgdCk7XG4gICAgICAgICAgICB2YXIgcDUgPSBwMi5sZXJwKHAzLCB0KTtcblxuICAgICAgICAgICAgdmFyIHA2ID0gcDQubGVycChwNSwgdCk7XG5cbiAgICAgICAgICAgIC8vIFNlZSBpZiBwb2ludCBpcyBvbiBsaW5lIHNlZ21lbnRcbiAgICAgICAgICAgIC8vIEhhZCB0byBtYWtlIHNwZWNpYWwgY2FzZXMgZm9yIHZlcnRpY2FsIGFuZCBob3Jpem9udGFsIGxpbmVzIGR1ZVxuICAgICAgICAgICAgLy8gdG8gc2xpZ2h0IGVycm9ycyBpbiBjYWxjdWxhdGlvbiBvZiBwNlxuICAgICAgICAgICAgaWYgKCBhMS54ID09IGEyLnggKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBtaW4ueSA8PSBwNi55ICYmIHA2LnkgPD0gbWF4LnkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIHA2ICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggYTEueSA9PSBhMi55ICkge1xuICAgICAgICAgICAgICAgIGlmICggbWluLnggPD0gcDYueCAmJiBwNi54IDw9IG1heC54ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgIC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AgICAgICAgIDMqYzEzeDIqYzEzLnkqYzIzLngqYzIzeTIsXG4gICAgICAgIC02KmMxMy54KmMyMi54KmMxM3kyKmMyMy54KmMyMy55ICsgNipjMTN4MipjMTMueSpjMjIueSpjMjMueCpjMjMueSArIDMqYzIyLngqYzEzeTMqYzIzeDIgLVxuICAgICAgICAgICAgMypjMTN4MypjMjIueSpjMjN5MiAtIDMqYzEzLngqYzEzeTIqYzIyLnkqYzIzeDIgKyAzKmMxM3gyKmMyMi54KmMxMy55KmMyM3kyLFxuICAgICAgICAtNipjMjEueCpjMTMueCpjMTN5MipjMjMueCpjMjMueSAtIDYqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkqYzIzLnggKyA2KmMxM3gyKmMyMi54KmMxMy55KmMyMi55KmMyMy55ICtcbiAgICAgICAgICAgIDMqYzIxLngqYzEzeTMqYzIzeDIgKyAzKmMyMngyKmMxM3kzKmMyMy54ICsgMypjMjEueCpjMTN4MipjMTMueSpjMjN5MiAtIDMqYzEzLngqYzIxLnkqYzEzeTIqYzIzeDIgLVxuICAgICAgICAgICAgMypjMTMueCpjMjJ4MipjMTN5MipjMjMueSArIGMxM3gyKmMxMy55KmMyMy54Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgKyBjMTN4MyooLWMyMS55KmMyM3kyIC1cbiAgICAgICAgICAgIDIqYzIyeTIqYzIzLnkgLSBjMjMueSooMipjMjEueSpjMjMueSArIGMyMnkyKSksXG4gICAgICAgIGMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLngqYzIzLnkgKyA2KmMyMS54KmMyMi54KmMxM3kzKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIzeTIgKyA2KmMxMC54KmMxMy54KmMxM3kyKmMyMy54KmMyMy55IC0gMypjMTEueCpjMTIueCpjMTN5MipjMjMueCpjMjMueSAtXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyM3gyIC0gNipjMTAueSpjMTN4MipjMTMueSpjMjMueCpjMjMueSAtIDYqYzIwLngqYzEzLngqYzEzeTIqYzIzLngqYzIzLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMTIueSpjMTN4MipjMjMueCpjMjMueSAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIzLngqYzIzLnkgLSA2KmMyMS54KmMxMy54KmMyMi54KmMxM3kyKmMyMy55IC1cbiAgICAgICAgICAgIDYqYzIxLngqYzEzLngqYzEzeTIqYzIyLnkqYzIzLnggLSA2KmMxMy54KmMyMS55KmMyMi54KmMxM3kyKmMyMy54ICsgNipjMjEueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMxMy55KmMyMy54KmMyMy55ICsgYzIyeDMqYzEzeTMgLSAzKmMxMC54KmMxM3kzKmMyM3gyICsgMypjMTAueSpjMTN4MypjMjN5MiArXG4gICAgICAgICAgICAzKmMyMC54KmMxM3kzKmMyM3gyICsgYzEyeTMqYzEzLngqYzIzeDIgLSBjMTJ4MypjMTMueSpjMjN5MiAtIDMqYzEwLngqYzEzeDIqYzEzLnkqYzIzeTIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTMueCpjMTN5MipjMjN4MiAtIDIqYzExLngqYzEyLnkqYzEzeDIqYzIzeTIgKyBjMTEueCpjMTIueSpjMTN5MipjMjN4MiAtIGMxMS55KmMxMi54KmMxM3gyKmMyM3kyICtcbiAgICAgICAgICAgIDIqYzExLnkqYzEyLngqYzEzeTIqYzIzeDIgKyAzKmMyMC54KmMxM3gyKmMxMy55KmMyM3kyIC0gYzEyLngqYzEyeTIqYzEzLnkqYzIzeDIgLVxuICAgICAgICAgICAgMypjMjAueSpjMTMueCpjMTN5MipjMjN4MiArIGMxMngyKmMxMi55KmMxMy54KmMyM3kyIC0gMypjMTMueCpjMjJ4MipjMTN5MipjMjIueSArXG4gICAgICAgICAgICBjMTN4MipjMTMueSpjMjMueCooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEzeDIqYzIyLngqYzEzLnkqKDYqYzIxLnkqYzIzLnkgKyAzKmMyMnkyKSArXG4gICAgICAgICAgICBjMTN4MyooLTIqYzIxLnkqYzIyLnkqYzIzLnkgLSBjMjAueSpjMjN5MiAtIGMyMi55KigyKmMyMS55KmMyMy55ICsgYzIyeTIpIC0gYzIzLnkqKDIqYzIwLnkqYzIzLnkgKyAyKmMyMS55KmMyMi55KSksXG4gICAgICAgIDYqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjIueCpjMTMueSpjMjMueSArIGMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMi55KmMyMy54IC1cbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMxMy54KmMyMi54KmMxMy55KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnggLSA2KmMxMS55KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzIyLngqYzEzeTMqYzIzLnggKyA2KmMyMC54KmMyMi54KmMxM3kzKmMyMy54ICsgNipjMTAueSpjMTN4MypjMjIueSpjMjMueSArIDIqYzEyeTMqYzEzLngqYzIyLngqYzIzLnggLVxuICAgICAgICAgICAgMipjMTJ4MypjMTMueSpjMjIueSpjMjMueSArIDYqYzEwLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgKyA2KmMxMC54KmMxMy54KmMxM3kyKmMyMi55KmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLnkqYzEzLngqYzIyLngqYzEzeTIqYzIzLnggLSAzKmMxMS54KmMxMi54KmMyMi54KmMxM3kyKmMyMy55IC0gMypjMTEueCpjMTIueCpjMTN5MipjMjIueSpjMjMueCArXG4gICAgICAgICAgICAyKmMxMS54KmMxMi55KmMyMi54KmMxM3kyKmMyMy54ICsgNCpjMTEueSpjMTIueCpjMjIueCpjMTN5MipjMjMueCAtIDYqYzEwLngqYzEzeDIqYzEzLnkqYzIyLnkqYzIzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMTN4MipjMjIueCpjMTMueSpjMjMueSAtIDYqYzEwLnkqYzEzeDIqYzEzLnkqYzIyLnkqYzIzLnggLSA0KmMxMS54KmMxMi55KmMxM3gyKmMyMi55KmMyMy55IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgLSA2KmMyMC54KmMxMy54KmMxM3kyKmMyMi55KmMyMy54IC0gMipjMTEueSpjMTIueCpjMTN4MipjMjIueSpjMjMueSArXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxM3gyKmMyMi54KmMyMy55ICsgMypjMTEueSpjMTIueSpjMTN4MipjMjIueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIyLngqYzIzLnkgLVxuICAgICAgICAgICAgMipjMTIueCpjMTJ5MipjMTMueCpjMjIueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkqYzIzLnggLSA2KmMyMC55KmMxMy54KmMyMi54KmMxM3kyKmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIxLngqYzEzLngqYzIxLnkqYzEzeTIqYzIzLnggLSA2KmMyMS54KmMxMy54KmMyMi54KmMxM3kyKmMyMi55ICsgNipjMjAueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMxMy54KmMyMi55KmMyMy55ICsgMipjMTJ4MipjMTIueSpjMjIueCpjMTMueSpjMjMueSArIDIqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkqYzIzLnggK1xuICAgICAgICAgICAgMypjMjEueCpjMjJ4MipjMTN5MyArIDMqYzIxeDIqYzEzeTMqYzIzLnggLSAzKmMxMy54KmMyMS55KmMyMngyKmMxM3kyIC0gMypjMjF4MipjMTMueCpjMTN5MipjMjMueSArXG4gICAgICAgICAgICBjMTN4MipjMjIueCpjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEzeDIqYzEzLnkqYzIzLngqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMjEueCpjMTN4MipjMTMueSooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICsgYzEzeDMqKC0yKmMyMC55KmMyMi55KmMyMy55IC0gYzIzLnkqKDIqYzIwLnkqYzIyLnkgKyBjMjF5MikgLVxuICAgICAgICAgICAgYzIxLnkqKDIqYzIxLnkqYzIzLnkgKyBjMjJ5MikgLSBjMjIueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSpjMjMueCArIGMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMyMS54KmMxMy54KmMxMy55KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkqYzIzLnggLSBjMTEueSpjMTIueCpjMTMueCpjMjIueCpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICA2KmMxMS55KmMyMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC0gNipjMTAueCpjMjEueCpjMTN5MypjMjMueCArIDYqYzIwLngqYzIxLngqYzEzeTMqYzIzLnggK1xuICAgICAgICAgICAgMipjMjEueCpjMTJ5MypjMTMueCpjMjMueCArIDYqYzEwLngqYzIxLngqYzEzLngqYzEzeTIqYzIzLnkgKyA2KmMxMC54KmMxMy54KmMyMS55KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLngqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkgKyA2KmMxMC55KmMyMS54KmMxMy54KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjEueCpjMTN5MipjMjMueSAtXG4gICAgICAgICAgICAzKmMxMS54KmMxMi54KmMyMS55KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjIueCpjMTN5MipjMjIueSArIDIqYzExLngqYzIxLngqYzEyLnkqYzEzeTIqYzIzLnggK1xuICAgICAgICAgICAgNCpjMTEueSpjMTIueCpjMjEueCpjMTN5MipjMjMueCAtIDYqYzEwLnkqYzIxLngqYzEzeDIqYzEzLnkqYzIzLnkgLSA2KmMxMC55KmMxM3gyKmMyMS55KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzEzeDIqYzIyLngqYzEzLnkqYzIyLnkgLSA2KmMyMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMy55IC0gNipjMjAueCpjMTMueCpjMjEueSpjMTN5MipjMjMueCAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMy54KmMyMi54KmMxM3kyKmMyMi55ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjMueSAtIDMqYzExLnkqYzEyLnkqYzEzLngqYzIyeDIqYzEzLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMTIueSpjMTN4MipjMjEueSpjMjMueCArIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIyLngqYzIyLnkgLSAyKmMxMi54KmMyMS54KmMxMnkyKmMxMy54KmMyMy55IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLnkqYzIzLnggLSAyKmMxMi54KmMxMnkyKmMxMy54KmMyMS55KmMyMy54IC0gMipjMTIueCpjMTJ5MipjMTMueCpjMjIueCpjMjIueSAtXG4gICAgICAgICAgICA2KmMyMC55KmMyMS54KmMxMy54KmMxM3kyKmMyMy54IC0gNipjMjEueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArIDYqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgMipjMTJ4MipjMjEueCpjMTIueSpjMTMueSpjMjMueSArIDIqYzEyeDIqYzEyLnkqYzIxLnkqYzEzLnkqYzIzLnggKyAyKmMxMngyKmMxMi55KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIyeDIqYzEzeTMgKyAzKmMyMC54KmMyMngyKmMxM3kzICsgMypjMjF4MipjMjIueCpjMTN5MyArIGMxMnkzKmMxMy54KmMyMngyICtcbiAgICAgICAgICAgIDMqYzEwLnkqYzEzLngqYzIyeDIqYzEzeTIgKyBjMTEueCpjMTIueSpjMjJ4MipjMTN5MiArIDIqYzExLnkqYzEyLngqYzIyeDIqYzEzeTIgLVxuICAgICAgICAgICAgYzEyLngqYzEyeTIqYzIyeDIqYzEzLnkgLSAzKmMyMC55KmMxMy54KmMyMngyKmMxM3kyIC0gMypjMjF4MipjMTMueCpjMTN5MipjMjIueSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjEueSpjMjMueSArIGMyMnkyKSArIGMxMS54KmMxMi54KmMxMy54KmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgK1xuICAgICAgICAgICAgYzIxLngqYzEzeDIqYzEzLnkqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMngzKmMxMy55KigtMipjMjEueSpjMjMueSAtIGMyMnkyKSArXG4gICAgICAgICAgICBjMTAueSpjMTN4MyooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICsgYzExLnkqYzEyLngqYzEzeDIqKC0yKmMyMS55KmMyMy55IC0gYzIyeTIpICtcbiAgICAgICAgICAgIGMxMS54KmMxMi55KmMxM3gyKigtNCpjMjEueSpjMjMueSAtIDIqYzIyeTIpICsgYzEwLngqYzEzeDIqYzEzLnkqKC02KmMyMS55KmMyMy55IC0gMypjMjJ5MikgK1xuICAgICAgICAgICAgYzEzeDIqYzIyLngqYzEzLnkqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgK1xuICAgICAgICAgICAgYzEzeDMqKC0yKmMyMC55KmMyMS55KmMyMy55IC0gYzIyLnkqKDIqYzIwLnkqYzIyLnkgKyBjMjF5MikgLSBjMjAueSooMipjMjEueSpjMjMueSArIGMyMnkyKSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgLWMxMC54KmMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy55ICsgYzEwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgKyA2KmMxMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgLSBjMTAueSpjMTEueCpjMTIueSpjMTMueCpjMTMueSpjMjMueCArIGMxMC55KmMxMS55KmMxMi54KmMxMy54KmMxMy55KmMyMy54ICtcbiAgICAgICAgICAgIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54KmMyMy55IC0gYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkqYzIzLnggKyBjMTEueCpjMjAueCpjMTIueSpjMTMueCpjMTMueSpjMjMueSArXG4gICAgICAgICAgICBjMTEueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSpjMjMueCArIGMxMS54KmMyMS54KmMxMi55KmMxMy54KmMxMy55KmMyMi55ICsgYzExLngqYzEyLnkqYzEzLngqYzIxLnkqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgLSA2KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC0gYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgYzExLnkqYzEyLngqYzIxLngqYzEzLngqYzEzLnkqYzIyLnkgLSBjMTEueSpjMTIueCpjMTMueCpjMjEueSpjMjIueCpjMTMueSAtIDYqYzExLnkqYzIxLngqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueCpjMjAueCpjMTN5MypjMjMueCAtIDYqYzEwLngqYzIxLngqYzIyLngqYzEzeTMgLSAyKmMxMC54KmMxMnkzKmMxMy54KmMyMy54ICsgNipjMjAueCpjMjEueCpjMjIueCpjMTN5MyArXG4gICAgICAgICAgICAyKmMyMC54KmMxMnkzKmMxMy54KmMyMy54ICsgMipjMjEueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzEwLnkqYzEyeDMqYzEzLnkqYzIzLnkgLSA2KmMxMC54KmMxMC55KmMxMy54KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzEwLngqYzExLngqYzEyLngqYzEzeTIqYzIzLnkgLSAyKmMxMC54KmMxMS54KmMxMi55KmMxM3kyKmMyMy54IC0gNCpjMTAueCpjMTEueSpjMTIueCpjMTN5MipjMjMueCArXG4gICAgICAgICAgICAzKmMxMC55KmMxMS54KmMxMi54KmMxM3kyKmMyMy54ICsgNipjMTAueCpjMTAueSpjMTN4MipjMTMueSpjMjMueSArIDYqYzEwLngqYzIwLngqYzEzLngqYzEzeTIqYzIzLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMTEueSpjMTIueSpjMTN4MipjMjMueSArIDIqYzEwLngqYzEyLngqYzEyeTIqYzEzLngqYzIzLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy55KmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLngqYzIwLnkqYzEzLngqYzEzeTIqYzIzLnggKyA2KmMxMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMi55ICsgNipjMTAueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMy55ICsgNipjMTAueSpjMjAueCpjMTMueCpjMTN5MipjMjMueCArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIzLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMTIueSpjMTN4MipjMjMueCArIDIqYzEwLnkqYzEyLngqYzEyeTIqYzEzLngqYzIzLnggKyA2KmMxMC55KmMyMS54KmMxMy54KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzExLngqYzIwLngqYzEyLngqYzEzeTIqYzIzLnkgKyAyKmMxMS54KmMyMC54KmMxMi55KmMxM3kyKmMyMy54ICsgYzExLngqYzExLnkqYzEyeTIqYzEzLngqYzIzLnggLVxuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMjAueSpjMTN5MipjMjMueCAtIDMqYzExLngqYzEyLngqYzIxLngqYzEzeTIqYzIyLnkgLSAzKmMxMS54KmMxMi54KmMyMS55KmMyMi54KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzExLngqYzIxLngqYzEyLnkqYzIyLngqYzEzeTIgKyA0KmMyMC54KmMxMS55KmMxMi54KmMxM3kyKmMyMy54ICsgNCpjMTEueSpjMTIueCpjMjEueCpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICAyKmMxMC54KmMxMngyKmMxMi55KmMxMy55KmMyMy55IC0gNipjMTAueSpjMjAueCpjMTN4MipjMTMueSpjMjMueSAtIDYqYzEwLnkqYzIwLnkqYzEzeDIqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueSpjMjEueCpjMTN4MipjMTMueSpjMjIueSAtIDIqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLngqYzIzLnkgLSAyKmMxMC55KmMxMngyKmMxMi55KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzEzeDIqYzIxLnkqYzIyLngqYzEzLnkgLSBjMTEueCpjMTEueSpjMTJ4MipjMTMueSpjMjMueSAtIDIqYzExLngqYzExeTIqYzEzLngqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgMypjMjAueCpjMTEueSpjMTIueSpjMTN4MipjMjMueSAtIDIqYzIwLngqYzEyLngqYzEyeTIqYzEzLngqYzIzLnkgLSAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzIwLnkqYzEzLngqYzEzeTIqYzIzLnggLSA2KmMyMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMi55IC0gNipjMjAueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMS55KmMyMC55KmMxMi55KmMxM3gyKmMyMy54ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjIueSArIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIxLnkqYzIyLnggLVxuICAgICAgICAgICAgMipjMTIueCpjMjAueSpjMTJ5MipjMTMueCpjMjMueCAtIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIyLnkgLSAyKmMxMi54KmMyMS54KmMxMnkyKmMyMi54KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzEyeTIqYzEzLngqYzIxLnkqYzIyLnggLSA2KmMyMC55KmMyMS54KmMxMy54KmMyMi54KmMxM3kyIC0gYzExeTIqYzEyLngqYzEyLnkqYzEzLngqYzIzLnggK1xuICAgICAgICAgICAgMipjMjAueCpjMTJ4MipjMTIueSpjMTMueSpjMjMueSArIDYqYzIwLnkqYzEzeDIqYzIxLnkqYzIyLngqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMxMy54KmMxMy55KmMyMy55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMi54KmMxMi55KmMxMy55KmMyMy55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMTMueSpjMjMueCArIDIqYzEyeDIqYzIxLngqYzEyLnkqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgMipjMTJ4MipjMTIueSpjMjEueSpjMjIueCpjMTMueSArIGMyMXgzKmMxM3kzICsgMypjMTB4MipjMTN5MypjMjMueCAtIDMqYzEweTIqYzEzeDMqYzIzLnkgK1xuICAgICAgICAgICAgMypjMjB4MipjMTN5MypjMjMueCArIGMxMXkzKmMxM3gyKmMyMy54IC0gYzExeDMqYzEzeTIqYzIzLnkgLSBjMTEueCpjMTF5MipjMTN4MipjMjMueSArXG4gICAgICAgICAgICBjMTF4MipjMTEueSpjMTN5MipjMjMueCAtIDMqYzEweDIqYzEzLngqYzEzeTIqYzIzLnkgKyAzKmMxMHkyKmMxM3gyKmMxMy55KmMyMy54IC0gYzExeDIqYzEyeTIqYzEzLngqYzIzLnkgK1xuICAgICAgICAgICAgYzExeTIqYzEyeDIqYzEzLnkqYzIzLnggLSAzKmMyMXgyKmMxMy54KmMyMS55KmMxM3kyIC0gMypjMjB4MipjMTMueCpjMTN5MipjMjMueSArIDMqYzIweTIqYzEzeDIqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgYzExLngqYzEyLngqYzEzLngqYzEzLnkqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMngzKmMxMy55KigtMipjMjAueSpjMjMueSAtIDIqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMxMC55KmMxM3gzKig2KmMyMC55KmMyMy55ICsgNipjMjEueSpjMjIueSkgKyBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIwLnkqYzIzLnkgLSAyKmMyMS55KmMyMi55KSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpICsgYzExLngqYzEyLnkqYzEzeDIqKC00KmMyMC55KmMyMy55IC0gNCpjMjEueSpjMjIueSkgK1xuICAgICAgICAgICAgYzEwLngqYzEzeDIqYzEzLnkqKC02KmMyMC55KmMyMy55IC0gNipjMjEueSpjMjIueSkgKyBjMjAueCpjMTN4MipjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMyMS54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgKyBjMTN4MyooLTIqYzIwLnkqYzIxLnkqYzIyLnkgLSBjMjB5MipjMjMueSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjAueSpjMjIueSArIGMyMXkyKSAtIGMyMC55KigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSkpLFxuICAgICAgICAtYzEwLngqYzExLngqYzEyLnkqYzEzLngqYzEzLnkqYzIyLnkgKyBjMTAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSArIDYqYzEwLngqYzExLnkqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMTEueCpjMTIueCpjMTMueCpjMTMueSpjMjIueSAtIGMxMC55KmMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55ICsgYzEwLnkqYzExLnkqYzEyLngqYzEzLngqYzIyLngqYzEzLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLngqYzIyLnkgLSBjMTEueCpjMTEueSpjMTIueCpjMTIueSpjMjIueCpjMTMueSArIGMxMS54KmMyMC54KmMxMi55KmMxMy54KmMxMy55KmMyMi55ICtcbiAgICAgICAgICAgIGMxMS54KmMyMC55KmMxMi55KmMxMy54KmMyMi54KmMxMy55ICsgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzIxLnkqYzEzLnkgLSBjMjAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMyMi54KmMxMy55IC0gYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzIyLngqYzEzLnkgLSBjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMjEueSpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC54KmMyMC54KmMyMi54KmMxM3kzIC0gMipjMTAueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzIwLngqYzEyeTMqYzEzLngqYzIyLnggKyAyKmMxMC55KmMxMngzKmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzEwLnkqYzEzLngqYzIyLngqYzEzeTIgKyAzKmMxMC54KmMxMS54KmMxMi54KmMxM3kyKmMyMi55IC0gMipjMTAueCpjMTEueCpjMTIueSpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICA0KmMxMC54KmMxMS55KmMxMi54KmMyMi54KmMxM3kyICsgMypjMTAueSpjMTEueCpjMTIueCpjMjIueCpjMTN5MiArIDYqYzEwLngqYzEwLnkqYzEzeDIqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgNipjMTAueCpjMjAueCpjMTMueCpjMTN5MipjMjIueSAtIDMqYzEwLngqYzExLnkqYzEyLnkqYzEzeDIqYzIyLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMi55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkgKyA2KmMxMC54KmMyMC55KmMxMy54KmMyMi54KmMxM3kyICsgNipjMTAueCpjMjEueCpjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMi55ICsgNipjMTAueSpjMjAueCpjMTMueCpjMjIueCpjMTN5MiArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMTIueSpjMTN4MipjMjIueCArIDIqYzEwLnkqYzEyLngqYzEyeTIqYzEzLngqYzIyLnggLSAzKmMxMS54KmMyMC54KmMxMi54KmMxM3kyKmMyMi55ICtcbiAgICAgICAgICAgIDIqYzExLngqYzIwLngqYzEyLnkqYzIyLngqYzEzeTIgKyBjMTEueCpjMTEueSpjMTJ5MipjMTMueCpjMjIueCAtIDMqYzExLngqYzEyLngqYzIwLnkqYzIyLngqYzEzeTIgLVxuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMjEueCpjMjEueSpjMTN5MiArIDQqYzIwLngqYzExLnkqYzEyLngqYzIyLngqYzEzeTIgLSAyKmMxMC54KmMxMngyKmMxMi55KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzIwLngqYzEzeDIqYzEzLnkqYzIyLnkgLSA2KmMxMC55KmMyMC55KmMxM3gyKmMyMi54KmMxMy55IC0gNipjMTAueSpjMjEueCpjMTN4MipjMjEueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMxMi55KmMxMy54KmMyMi55IC0gMipjMTAueSpjMTJ4MipjMTIueSpjMjIueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDIqYzExLngqYzExeTIqYzEzLngqYzIyLngqYzEzLnkgKyAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMi55IC0gMipjMjAueCpjMTIueCpjMTJ5MipjMTMueCpjMjIueSAtXG4gICAgICAgICAgICAyKmMyMC54KmMxMi54KmMxMnkyKmMyMi54KmMxMy55IC0gNipjMjAueCpjMjAueSpjMTMueCpjMjIueCpjMTN5MiAtIDYqYzIwLngqYzIxLngqYzEzLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTEueSpjMjAueSpjMTIueSpjMTN4MipjMjIueCArIDMqYzExLnkqYzIxLngqYzEyLnkqYzEzeDIqYzIxLnkgLSAyKmMxMi54KmMyMC55KmMxMnkyKmMxMy54KmMyMi54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIxLnkgLSBjMTF5MipjMTIueCpjMTIueSpjMTMueCpjMjIueCArIDIqYzIwLngqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTEueSpjMjF4MipjMTIueSpjMTMueCpjMTMueSArIDYqYzIwLnkqYzIxLngqYzEzeDIqYzIxLnkqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMxMy54KmMxMy55KmMyMi55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMi54KmMxMi55KmMxMy55KmMyMi55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMjIueCpjMTMueSArIDIqYzEyeDIqYzIxLngqYzEyLnkqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMjF4MipjMTN5MyArIDMqYzIwLngqYzIxeDIqYzEzeTMgKyAzKmMxMHgyKmMyMi54KmMxM3kzIC0gMypjMTB5MipjMTN4MypjMjIueSArIDMqYzIweDIqYzIyLngqYzEzeTMgK1xuICAgICAgICAgICAgYzIxeDIqYzEyeTMqYzEzLnggKyBjMTF5MypjMTN4MipjMjIueCAtIGMxMXgzKmMxM3kyKmMyMi55ICsgMypjMTAueSpjMjF4MipjMTMueCpjMTN5MiAtXG4gICAgICAgICAgICBjMTEueCpjMTF5MipjMTN4MipjMjIueSArIGMxMS54KmMyMXgyKmMxMi55KmMxM3kyICsgMipjMTEueSpjMTIueCpjMjF4MipjMTN5MiArIGMxMXgyKmMxMS55KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMi54KmMyMXgyKmMxMnkyKmMxMy55IC0gMypjMjAueSpjMjF4MipjMTMueCpjMTN5MiAtIDMqYzEweDIqYzEzLngqYzEzeTIqYzIyLnkgKyAzKmMxMHkyKmMxM3gyKmMyMi54KmMxMy55IC1cbiAgICAgICAgICAgIGMxMXgyKmMxMnkyKmMxMy54KmMyMi55ICsgYzExeTIqYzEyeDIqYzIyLngqYzEzLnkgLSAzKmMyMHgyKmMxMy54KmMxM3kyKmMyMi55ICsgMypjMjB5MipjMTN4MipjMjIueCpjMTMueSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjAueSpjMjIueSArIGMyMXkyKSArIGMxMS54KmMxMi54KmMxMy54KmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgK1xuICAgICAgICAgICAgYzEyeDMqYzEzLnkqKC0yKmMyMC55KmMyMi55IC0gYzIxeTIpICsgYzEwLnkqYzEzeDMqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIwLnkqYzIyLnkgLSBjMjF5MikgKyBjMTEueCpjMTIueSpjMTN4MiooLTQqYzIwLnkqYzIyLnkgLSAyKmMyMXkyKSArXG4gICAgICAgICAgICBjMTAueCpjMTN4MipjMTMueSooLTYqYzIwLnkqYzIyLnkgLSAzKmMyMXkyKSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgK1xuICAgICAgICAgICAgYzEzeDMqKC0yKmMyMC55KmMyMXkyIC0gYzIweTIqYzIyLnkgLSBjMjAueSooMipjMjAueSpjMjIueSArIGMyMXkyKSksXG4gICAgICAgIC1jMTAueCpjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSArIGMxMC54KmMxMS55KmMxMi54KmMxMy54KmMyMS55KmMxMy55ICsgNipjMTAueCpjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC55KmMxMS54KmMxMi54KmMxMy54KmMyMS55KmMxMy55IC0gYzEwLnkqYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkgKyBjMTAueSpjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMTMueSAtXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueCpjMjEueCpjMTIueSpjMTMueSArIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54KmMyMS55ICsgYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzIxLnkqYzEzLnkgK1xuICAgICAgICAgICAgNipjMTEueCpjMTIueCpjMjAueSpjMTMueCpjMjEueSpjMTMueSArIGMxMS54KmMyMC55KmMyMS54KmMxMi55KmMxMy54KmMxMy55IC0gYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgNipjMjAueCpjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMTMueSAtIGMxMS55KmMxMi54KmMyMC55KmMyMS54KmMxMy54KmMxMy55IC0gNipjMTAueCpjMjAueCpjMjEueCpjMTN5MyAtXG4gICAgICAgICAgICAyKmMxMC54KmMyMS54KmMxMnkzKmMxMy54ICsgNipjMTAueSpjMjAueSpjMTN4MypjMjEueSArIDIqYzIwLngqYzIxLngqYzEyeTMqYzEzLnggKyAyKmMxMC55KmMxMngzKmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEyeDMqYzIwLnkqYzIxLnkqYzEzLnkgLSA2KmMxMC54KmMxMC55KmMyMS54KmMxMy54KmMxM3kyICsgMypjMTAueCpjMTEueCpjMTIueCpjMjEueSpjMTN5MiAtXG4gICAgICAgICAgICAyKmMxMC54KmMxMS54KmMyMS54KmMxMi55KmMxM3kyIC0gNCpjMTAueCpjMTEueSpjMTIueCpjMjEueCpjMTN5MiArIDMqYzEwLnkqYzExLngqYzEyLngqYzIxLngqYzEzeTIgK1xuICAgICAgICAgICAgNipjMTAueCpjMTAueSpjMTN4MipjMjEueSpjMTMueSArIDYqYzEwLngqYzIwLngqYzEzLngqYzIxLnkqYzEzeTIgLSAzKmMxMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMS55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzIxLngqYzEyeTIqYzEzLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMS55ICsgNipjMTAueCpjMjAueSpjMjEueCpjMTMueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMS55ICsgNipjMTAueSpjMjAueCpjMjEueCpjMTMueCpjMTN5MiArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIxLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMjEueCpjMTIueSpjMTN4MiArIDIqYzEwLnkqYzEyLngqYzIxLngqYzEyeTIqYzEzLnggLSAzKmMxMS54KmMyMC54KmMxMi54KmMyMS55KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzExLngqYzIwLngqYzIxLngqYzEyLnkqYzEzeTIgKyBjMTEueCpjMTEueSpjMjEueCpjMTJ5MipjMTMueCAtIDMqYzExLngqYzEyLngqYzIwLnkqYzIxLngqYzEzeTIgK1xuICAgICAgICAgICAgNCpjMjAueCpjMTEueSpjMTIueCpjMjEueCpjMTN5MiAtIDYqYzEwLngqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkgLSAyKmMxMC54KmMxMngyKmMxMi55KmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzIwLngqYzEzeDIqYzIxLnkqYzEzLnkgLSA2KmMxMC55KmMyMC55KmMyMS54KmMxM3gyKmMxMy55IC0gMipjMTAueSpjMTJ4MipjMjEueCpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMxMi55KmMxMy54KmMyMS55IC0gYzExLngqYzExLnkqYzEyeDIqYzIxLnkqYzEzLnkgLSA0KmMxMS54KmMyMC55KmMxMi55KmMxM3gyKmMyMS55IC1cbiAgICAgICAgICAgIDIqYzExLngqYzExeTIqYzIxLngqYzEzLngqYzEzLnkgKyAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMS55IC0gMipjMjAueCpjMTIueCpjMjEueCpjMTJ5MipjMTMueSAtXG4gICAgICAgICAgICAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMS55IC0gNipjMjAueCpjMjAueSpjMjEueCpjMTMueCpjMTN5MiAtIDIqYzExLnkqYzEyLngqYzIwLnkqYzEzeDIqYzIxLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMjAueSpjMjEueCpjMTIueSpjMTN4MiAtIDIqYzEyLngqYzIwLnkqYzIxLngqYzEyeTIqYzEzLnggLSBjMTF5MipjMTIueCpjMjEueCpjMTIueSpjMTMueCArXG4gICAgICAgICAgICA2KmMyMC54KmMyMC55KmMxM3gyKmMyMS55KmMxMy55ICsgMipjMjAueCpjMTJ4MipjMTIueSpjMjEueSpjMTMueSArIDIqYzExeDIqYzExLnkqYzEzLngqYzIxLnkqYzEzLnkgK1xuICAgICAgICAgICAgYzExeDIqYzEyLngqYzEyLnkqYzIxLnkqYzEzLnkgKyAyKmMxMngyKmMyMC55KmMyMS54KmMxMi55KmMxMy55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMTMueCpjMjEueSArXG4gICAgICAgICAgICAzKmMxMHgyKmMyMS54KmMxM3kzIC0gMypjMTB5MipjMTN4MypjMjEueSArIDMqYzIweDIqYzIxLngqYzEzeTMgKyBjMTF5MypjMjEueCpjMTN4MiAtIGMxMXgzKmMyMS55KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzIweTIqYzEzeDMqYzIxLnkgLSBjMTEueCpjMTF5MipjMTN4MipjMjEueSArIGMxMXgyKmMxMS55KmMyMS54KmMxM3kyIC0gMypjMTB4MipjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMHkyKmMyMS54KmMxM3gyKmMxMy55IC0gYzExeDIqYzEyeTIqYzEzLngqYzIxLnkgKyBjMTF5MipjMTJ4MipjMjEueCpjMTMueSAtIDMqYzIweDIqYzEzLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMypjMjB5MipjMjEueCpjMTN4MipjMTMueSxcbiAgICAgICAgYzEwLngqYzEwLnkqYzExLngqYzEyLnkqYzEzLngqYzEzLnkgLSBjMTAueCpjMTAueSpjMTEueSpjMTIueCpjMTMueCpjMTMueSArIGMxMC54KmMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54IC0gYzEwLngqYzExLngqYzIwLnkqYzEyLnkqYzEzLngqYzEzLnkgKyA2KmMxMC54KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMC54KmMxMS55KmMxMi54KmMyMC55KmMxMy54KmMxMy55IC0gYzEwLnkqYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzEzLnkgLSA2KmMxMC55KmMxMS54KmMxMi54KmMyMC55KmMxMy54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMC55KmMyMC54KmMxMS55KmMxMi54KmMxMy54KmMxMy55IC0gYzExLngqYzIwLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkgKyBjMTEueCpjMTEueSpjMTIueCpjMjAueSpjMTIueSpjMTMueCArXG4gICAgICAgICAgICBjMTEueCpjMjAueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSAtIGMyMC54KmMxMS55KmMxMi54KmMyMC55KmMxMy54KmMxMy55IC0gMipjMTAueCpjMjAueCpjMTJ5MypjMTMueCArXG4gICAgICAgICAgICAyKmMxMC55KmMxMngzKmMyMC55KmMxMy55IC0gMypjMTAueCpjMTAueSpjMTEueCpjMTIueCpjMTN5MiAtIDYqYzEwLngqYzEwLnkqYzIwLngqYzEzLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTAueCpjMTAueSpjMTEueSpjMTIueSpjMTN4MiAtIDIqYzEwLngqYzEwLnkqYzEyLngqYzEyeTIqYzEzLnggLSAyKmMxMC54KmMxMS54KmMyMC54KmMxMi55KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMC54KmMxMS54KmMxMS55KmMxMnkyKmMxMy54ICsgMypjMTAueCpjMTEueCpjMTIueCpjMjAueSpjMTN5MiAtIDQqYzEwLngqYzIwLngqYzExLnkqYzEyLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTEueCpjMjAueCpjMTIueCpjMTN5MiArIDYqYzEwLngqYzEwLnkqYzIwLnkqYzEzeDIqYzEzLnkgKyAyKmMxMC54KmMxMC55KmMxMngyKmMxMi55KmMxMy55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzExLngqYzExeTIqYzEzLngqYzEzLnkgKyAyKmMxMC54KmMyMC54KmMxMi54KmMxMnkyKmMxMy55ICsgNipjMTAueCpjMjAueCpjMjAueSpjMTMueCpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMC54KmMxMS55KmMyMC55KmMxMi55KmMxM3gyICsgMipjMTAueCpjMTIueCpjMjAueSpjMTJ5MipjMTMueCArIGMxMC54KmMxMXkyKmMxMi54KmMxMi55KmMxMy54ICtcbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMS55KmMxMngyKmMxMy55ICsgNCpjMTAueSpjMTEueCpjMjAueSpjMTIueSpjMTN4MiAtIDMqYzEwLnkqYzIwLngqYzExLnkqYzEyLnkqYzEzeDIgK1xuICAgICAgICAgICAgMipjMTAueSpjMjAueCpjMTIueCpjMTJ5MipjMTMueCArIDIqYzEwLnkqYzExLnkqYzEyLngqYzIwLnkqYzEzeDIgKyBjMTEueCpjMjAueCpjMTEueSpjMTJ5MipjMTMueCAtXG4gICAgICAgICAgICAzKmMxMS54KmMyMC54KmMxMi54KmMyMC55KmMxM3kyIC0gMipjMTAueCpjMTJ4MipjMjAueSpjMTIueSpjMTMueSAtIDYqYzEwLnkqYzIwLngqYzIwLnkqYzEzeDIqYzEzLnkgLVxuICAgICAgICAgICAgMipjMTAueSpjMjAueCpjMTJ4MipjMTIueSpjMTMueSAtIDIqYzEwLnkqYzExeDIqYzExLnkqYzEzLngqYzEzLnkgLSBjMTAueSpjMTF4MipjMTIueCpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMyMC55KmMxMi55KmMxMy54IC0gMipjMTEueCpjMjAueCpjMTF5MipjMTMueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMyMC55KmMxMy55ICtcbiAgICAgICAgICAgIDMqYzIwLngqYzExLnkqYzIwLnkqYzEyLnkqYzEzeDIgLSAyKmMyMC54KmMxMi54KmMyMC55KmMxMnkyKmMxMy54IC0gYzIwLngqYzExeTIqYzEyLngqYzEyLnkqYzEzLnggK1xuICAgICAgICAgICAgMypjMTB5MipjMTEueCpjMTIueCpjMTMueCpjMTMueSArIDMqYzExLngqYzEyLngqYzIweTIqYzEzLngqYzEzLnkgKyAyKmMyMC54KmMxMngyKmMyMC55KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIDMqYzEweDIqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMyMC55KmMxMy54KmMxMy55ICsgYzExeDIqYzEyLngqYzIwLnkqYzEyLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMjB4MipjMTEueSpjMTIueSpjMTMueCpjMTMueSAtIGMxMHgzKmMxM3kzICsgYzEweTMqYzEzeDMgKyBjMjB4MypjMTN5MyAtIGMyMHkzKmMxM3gzIC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIweDIqYzEzeTMgLSBjMTAueCpjMTF5MypjMTN4MiArIDMqYzEweDIqYzIwLngqYzEzeTMgKyBjMTAueSpjMTF4MypjMTN5MiArXG4gICAgICAgICAgICAzKmMxMC55KmMyMHkyKmMxM3gzICsgYzIwLngqYzExeTMqYzEzeDIgKyBjMTB4MipjMTJ5MypjMTMueCAtIDMqYzEweTIqYzIwLnkqYzEzeDMgLSBjMTB5MipjMTJ4MypjMTMueSArXG4gICAgICAgICAgICBjMjB4MipjMTJ5MypjMTMueCAtIGMxMXgzKmMyMC55KmMxM3kyIC0gYzEyeDMqYzIweTIqYzEzLnkgLSBjMTAueCpjMTF4MipjMTEueSpjMTN5MiArXG4gICAgICAgICAgICBjMTAueSpjMTEueCpjMTF5MipjMTN4MiAtIDMqYzEwLngqYzEweTIqYzEzeDIqYzEzLnkgLSBjMTAueCpjMTF5MipjMTJ4MipjMTMueSArIGMxMC55KmMxMXgyKmMxMnkyKmMxMy54IC1cbiAgICAgICAgICAgIGMxMS54KmMxMXkyKmMyMC55KmMxM3gyICsgMypjMTB4MipjMTAueSpjMTMueCpjMTN5MiArIGMxMHgyKmMxMS54KmMxMi55KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzEweDIqYzExLnkqYzEyLngqYzEzeTIgLSAyKmMxMHkyKmMxMS54KmMxMi55KmMxM3gyIC0gYzEweTIqYzExLnkqYzEyLngqYzEzeDIgKyBjMTF4MipjMjAueCpjMTEueSpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMC54KmMyMHkyKmMxM3gyKmMxMy55ICsgMypjMTAueSpjMjB4MipjMTMueCpjMTN5MiArIGMxMS54KmMyMHgyKmMxMi55KmMxM3kyIC0gMipjMTEueCpjMjB5MipjMTIueSpjMTN4MiArXG4gICAgICAgICAgICBjMjAueCpjMTF5MipjMTJ4MipjMTMueSAtIGMxMS55KmMxMi54KmMyMHkyKmMxM3gyIC0gYzEweDIqYzEyLngqYzEyeTIqYzEzLnkgLSAzKmMxMHgyKmMyMC55KmMxMy54KmMxM3kyICtcbiAgICAgICAgICAgIDMqYzEweTIqYzIwLngqYzEzeDIqYzEzLnkgKyBjMTB5MipjMTJ4MipjMTIueSpjMTMueCAtIGMxMXgyKmMyMC55KmMxMnkyKmMxMy54ICsgMipjMjB4MipjMTEueSpjMTIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMyMC54KmMyMHkyKmMxM3gyKmMxMy55IC0gYzIweDIqYzEyLngqYzEyeTIqYzEzLnkgLSAzKmMyMHgyKmMyMC55KmMxMy54KmMxM3kyICsgYzEyeDIqYzIweTIqYzEyLnkqYzEzLnhcbiAgICApO1xuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHNJbkludGVydmFsKDAsMSk7XG5cbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcbiAgICAgICAgdmFyIHhSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEzLngsXG4gICAgICAgICAgICBjMTIueCxcbiAgICAgICAgICAgIGMxMS54LFxuICAgICAgICAgICAgYzEwLnggLSBjMjAueCAtIHMqYzIxLnggLSBzKnMqYzIyLnggLSBzKnMqcypjMjMueFxuICAgICAgICApLmdldFJvb3RzKCk7XG4gICAgICAgIHZhciB5Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIGMxMy55LFxuICAgICAgICAgICAgYzEyLnksXG4gICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55IC0gcypzKnMqYzIzLnlcbiAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICB2YXIgVE9MRVJBTkNFID0gMWUtNDtcblxuICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICB2YXIgeFJvb3QgPSB4Um9vdHNbal07XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKCAwIDw9IHhSb290ICYmIHhSb290IDw9IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMjMubXVsdGlwbHkocypzKnMpLmFkZChjMjIubXVsdGlwbHkocypzKS5hZGQoYzIxLm11bHRpcGx5KHMpLmFkZChjMjApKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoIHJlc3VsdC5wb2ludHMubGVuZ3RoID4gMCApIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0QmV6aWVyM0NpcmNsZVxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0QmV6aWVyM0NpcmNsZSA9IGZ1bmN0aW9uKHAxLCBwMiwgcDMsIHA0LCBjLCByKSB7XG4gICAgcmV0dXJuIEludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIzRWxsaXBzZShwMSwgcDIsIHAzLCBwNCwgYywgciwgcik7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllcjNFbGxpcHNlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIzRWxsaXBzZSA9IGZ1bmN0aW9uKHAxLCBwMiwgcDMsIHA0LCBlYywgcngsIHJ5KSB7XG4gICAgdmFyIGEsIGIsIGMsIGQ7ICAgICAgIC8vIHRlbXBvcmFyeSB2YXJpYWJsZXNcbiAgICB2YXIgYzMsIGMyLCBjMSwgYzA7ICAgLy8gY29lZmZpY2llbnRzIG9mIGN1YmljXG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XjIoMS10KVAzICsgdF4zUDRcbiAgICAvL1xuICAgIC8vIEV4cGFuZCBhbmQgY29sbGVjdCB0ZXJtcyB0byBmb3JtIGxpbmVhciBjb21iaW5hdGlvbnMgb2Ygb3JpZ2luYWwgQmV6aWVyXG4gICAgLy8gY29udHJvbHMuICBUaGlzIGVuZHMgdXAgd2l0aCBhIHZlY3RvciBjdWJpYyBpbiB0OlxuICAgIC8vICAgICAoLVAxKzNQMi0zUDMrUDQpdF4zICsgKDNQMS02UDIrM1AzKXReMiArICgtM1AxKzNQMil0ICsgUDFcbiAgICAvLyAgICAgICAgICAgICAvXFwgICAgICAgICAgICAgICAgICAvXFwgICAgICAgICAgICAgICAgL1xcICAgICAgIC9cXFxuICAgIC8vICAgICAgICAgICAgIHx8ICAgICAgICAgICAgICAgICAgfHwgICAgICAgICAgICAgICAgfHwgICAgICAgfHxcbiAgICAvLyAgICAgICAgICAgICBjMyAgICAgICAgICAgICAgICAgIGMyICAgICAgICAgICAgICAgIGMxICAgICAgIGMwXG4gICAgXG4gICAgLy8gQ2FsY3VsYXRlIHRoZSBjb2VmZmljaWVudHNcbiAgICBhID0gcDEubXVsdGlwbHkoLTEpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgzKTtcbiAgICBjID0gcDMubXVsdGlwbHkoLTMpO1xuICAgIGQgPSBhLmFkZChiLmFkZChjLmFkZChwNCkpKTtcbiAgICBjMyA9IG5ldyBWZWN0b3IyRChkLngsIGQueSk7XG5cbiAgICBhID0gcDEubXVsdGlwbHkoMyk7XG4gICAgYiA9IHAyLm11bHRpcGx5KC02KTtcbiAgICBjID0gcDMubXVsdGlwbHkoMyk7XG4gICAgZCA9IGEuYWRkKGIuYWRkKGMpKTtcbiAgICBjMiA9IG5ldyBWZWN0b3IyRChkLngsIGQueSk7XG5cbiAgICBhID0gcDEubXVsdGlwbHkoLTMpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgzKTtcbiAgICBjID0gYS5hZGQoYik7XG4gICAgYzEgPS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oIDAgPD0gdCAmJiB0IDw9IDEgKSB7XG4gICAgICAgICAgICAvLyBXZSdyZSB3aXRoaW4gdGhlIEJlemllciBjdXJ2ZVxuICAgICAgICAgICAgLy8gRmluZCBwb2ludCBvbiBCZXppZXJcbiAgICAgICAgICAgIHZhciBwNSA9IHAxLmxlcnAocDIsIHQpO1xuICAgICAgICAgICAgdmFyIHA2ID0gcDIubGVycChwMywgdCk7XG4gICAgICAgICAgICB2YXIgcDcgPSBwMy5sZXJwKHA0LCB0KTtcblxuICAgICAgICAgICAgdmFyIHA4ID0gcDUubGVycChwNiwgdCk7XG4gICAgICAgICAgICB2YXIgcDkgPSBwNi5sZXJwKHA3LCB0KTtcblxuICAgICAgICAgICAgdmFyIHAxMCA9IHA4LmxlcnAocDksIHQpO1xuXG4gICAgICAgICAgICAvLyBTZWUgaWYgcG9pbnQgaXMgb24gbGluZSBzZWdtZW50XG4gICAgICAgICAgICAvLyBIYWQgdG8gbWFrZSBzcGVjaWFsIGNhc2VzIGZvciB2ZXJ0aWNhbCBhbmQgaG9yaXpvbnRhbCBsaW5lcyBkdWVcbiAgICAgICAgICAgIC8vIHRvIHNsaWdodCBlcnJvcnMgaW4gY2FsY3VsYXRpb24gb2YgcDEwXG4gICAgICAgICAgICBpZiAoIGExLnggPT0gYTIueCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG1pbi55IDw9IHAxMC55ICYmIHAxMC55IDw9IG1heC55ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBwMTAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBhMS55ID09IGEyLnkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBtaW4ueCA8PSBwMTAueCAmJiBwMTAueCA8PSBtYXgueCApIHtcbiAgICAgICAgICAgICAgICAgICA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SpyMSAtIHIyKnIyICsgY19kaXN0KmNfZGlzdCkgLyAoIDIqY19kaXN0ICk7XG4gICAgICAgIHZhciBoID0gTWF0aC5zcXJ0KHIxKnIxIC0gYSphKTtcbiAgICAgICAgdmFyIHAgPSBjMS5sZXJwKGMyLCBhL2NfZGlzdCk7XG4gICAgICAgIHZhciBiID0gaCAvIGNfZGlzdDtcblxuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBwLnggLSBiICogKGMyLnkgLSBjMS55KSxcbiAgICAgICAgICAgICAgICBwLnkgKyBiICogKGMyLnggLSBjMS54KVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBwLnggKyBiICogKGMyLnkgLSBjMS55KSxcbiAgICAgICAgICAgICAgICBwLnkgLSBiICogKGMyLnggLSBjMS54KVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdENpcmNsZUVsbGlwc2VcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdENpcmNsZUVsbGlwc2UgPSBmdW5jdGlvbihjYywgciwgZWMsIHJ4LCByeSkge1xuICAgIHJldHVybiBJbnRlcnNlY3Rpb24uaW50ZXJzZWN0RWxsaXBzZUVsbGlwc2UoY2MsIHIsIHIsIGVjLCByeCwgcnkpO1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RDaXJjbGVMaW5lXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RDaXJjbGVMaW5lID0gZnVuY3Rpb24oYywgciwgYTEsIGEyKSB7XG4gICAgdmFyIHJlc3VsdDtcbiAgICB2YXIgYSAgPSAoYTIueCAtIGExLngpICogKGEyLnggLSBhMS54KSArXG4gICAgICAgICAgICAgKGEyLnkgLSBhMS55KSAqIChhMi55IC0gYTEueSk7XG4gICAgdmFyIGIgID0gMiAqICggKGEyLnggLSBhMS54KSAqIChhMS54IC0gYy54KSArXG4gICAgICAgICAgICAgICAgICAgKGEyLnkgLSBhMS55KSAqIChhMS55IC0gYy55KSAgICk7XG4gICAgdmFyIGNjID0gYy54KmMueCArIGMueSpjLnkgKyBhMS54KmExLnggKyBhMS55KmExLnkgLVxuICAgICAgICAgICAgIDIgKiAoYy54ICogYTEueCArIGMueSAqIGExLnkpIC0gcipyO1xuICAgIHZhciBkZXRlciA9IGIqYiAtIDQqYSpjYztcblxuICAgIGlmICggZGV0ZXIgPCAwICkge1xuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICB9IGVsc2UgaWYgKCBkZXRlciA9PSAwICkge1xuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiVGFuZ2VudFwiKTtcbiAgICAgICAgLy8gTk9URTogc2hvdWxkIGNhbGN1bGF0ZSB0aGlzIHBvaW50XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIGUgID0gTWF0aC5zcXJ0KGRldGVyKTtcbiAgICAgICAgdmFyIHUxID0gKCAtYiArIGUgKSAvICggMiphICk7XG4gICAgICAgIHZhciB1MiA9ICggLWIgLSBlICkgLyAoIDIqYSApO1xuXG4gICAgICAgIGlmICggKHUxIDwgMCB8fCB1MSA+IDEpICYmICh1MiA8IDAgfHwgdTIgPiAxKSApIHtcbiAgICAgICAgICAgIGlmICggKHUxIDwgMCAmJiB1MiA8IDApIHx8ICh1MSA+IDEgJiYgdTIgPiAxKSApIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkluc2lkZVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnRlcnNlY3Rpb25cIik7XG5cbiAgICAgICAgICAgIGlmICggMCA8PSB1MSAmJiB1MSA8PSAxKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5wb2ludHMucHVzaCggYTEubGVycChhMiwgdTEpICk7XG5cbiAgICAgICAgICAgIGlmICggMCA8PSB1MiAmJiB1MiA8PSAxKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5wb2ludHMucHVzaCggYTEubGVycChhMiwgdTIpICk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0Q2lyY2xlUG9seWdvblxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0Q2lyY2xlUG9seWdvbiA9IGZ1bmN0aW9uKGMsIHIsIHBvaW50cykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBsZW5ndGggPSBwb2ludHMubGVuZ3RoO1xuICAgIHZhciBpbnRlcjtcblxuICAgIGZvciAoIHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrICkge1xuICAgICAgICB2YXIgYTEgPSBwb2ludHNbaV07XG4gICAgICAgIHZhciBhMiA9IHBvaW50c1soaSsxKSAlIGxlbmd0aF07XG5cbiAgICAgICAgaW50ZXIgPSBJbnRlcnNlY3Rpb24uaW50ZXJzZWN0Q2lyY2xlTGluZShjLCByLCBhMSwgYTIpO1xuICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnRzKGludGVyLnBvaW50cyk7XG4gICAgfVxuXG4gICAgaWY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gICAgICAgICAoIGFbMF0qeFJvb3RzW3hdICsgYVsxXSp5Um9vdHNbeV0gKyBhWzNdICkgKiB4Um9vdHNbeF0gKyBcbiAgICAgICAgICAgICAgICAoIGFbMl0qeVJvb3RzW3ldICsgYVs0XSApICogeVJvb3RzW3ldICsgYVs1XTtcbiAgICAgICAgICAgIGlmICggTWF0aC5hYnModGVzdCkgPCBub3JtMCApIHtcbiAgICAgICAgICAgICAgICB0ZXN0ID1cbiAgICAgICAgICAgICAgICAgICAgKCBiWzBdKnhSb290c1t4XSArIGJbMV0qeVJvb3RzW3ldICsgYlszXSApICogeFJvb3RzW3hdICtcbiAgICAgICAgICAgICAgICAgICAgKCBiWzJdKnlSb290c1t5XSArIGJbNF0gKSAqIHlSb290c1t5XSArIGJbNV07XG4gICAgICAgICAgICAgICAgaWYgKCBNYXRoLmFicyh0ZXN0KSA8IG5vcm0xICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIG5ldyBQb2ludDJEKCB4Um9vdHNbeF0sIHlSb290c1t5XSApICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKCByZXN1bHQucG9pbnRzLmxlbmd0aCA+IDAgKSByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEVsbGlwc2VMaW5lXG4qICAgXG4qICAgTk9URTogUm90YXRpb24gd2lsbCBuZWVkIHRvIGJlIGFkZGVkIHRvIHRoaXMgZnVuY3Rpb25cbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdEVsbGlwc2VMaW5lID0gZnVuY3Rpb24oYywgcngsIHJ5LCBhMSwgYTIpIHtcbiAgICB2YXIgcmVzdWx0O1xuICAgIHZhciBvcmlnaW4gPSBuZXcgVmVjdG9yMkQoY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W50ZXJzZWN0aW9uKFwiSW5zaWRlXCIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkludGVyc2VjdGlvblwiKTtcbiAgICAgICAgICAgIGlmICggMCA8PSB0X2EgJiYgdF9hIDw9IDEgKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmRQb2ludCggYTEubGVycChhMiwgdF9hKSApO1xuICAgICAgICAgICAgaWYgKCAwIDw9IHRfYiAmJiB0X2IgPD0gMSApXG4gICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBhMS5sZXJwKGEyLCB0X2IpICk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgdCA9IC1iL2E7XG4gICAgICAgIGlmICggMCA8PSB0ICYmIHQgPD0gMSApIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnRlcnNlY3Rpb25cIik7XG4gICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIGExLmxlcnAoYTIsIHQpICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RFbGxpcHNlUG9seWdvblxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0RWxsaXBzZVBvbHlnb24gPSBmdW5jdGlvbihjLCByeCwgcnksIHBvaW50cykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBsZW5ndGggPSBwb2ludHMubGVuZ3RoO1xuXG4gICAgZm9yICggdmFyIGkgPSAwO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gKCB1X2IgIT0gMCApIHtcbiAgICAgICAgdmFyIHVhID0gdWFfdCAvIHVfYjtcbiAgICAgICAgdmFyIHViID0gdWJfdCAvIHVfYjtcblxuICAgICAgICBpZiAoIDAgPD0gdWEgJiYgdWEgPD0gMSAmJiAwIDw9IHViICYmIHViIDw9IDEgKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiSW50ZXJzZWN0aW9uXCIpO1xuICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgIG5ldyBQb2ludDJEKFxuICAgICAgICAgICAgICAgICAgICBhMS54ICsgdWEgKiAoYTIueCAtIGExLngpLFxuICAgICAgICAgICAgICAgICAgICBhMS55ICsgdWEgKiAoYTIueSAtIGExLnkpXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJObyBJbnRlcnNlY3Rpb25cIik7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIHVhX3QgPT0gMCB8fCB1Yl90ID09IDAgKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiQ29pbmNpZGVudFwiKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJQYXJhbGxlbFwiKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdExpbmVQb2x5Z29uXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RMaW5lUG9seWdvbiA9IGZ1bmN0aW9uKGExLCBhMiwgcG9pbnRzKSB7XG4gICAgdmFyIHJlc3VsdCA9IG5ldyBJbn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cbiAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgbmV3IFBvaW50MkQoXG4gICAgICAgICAgICAgICAgYTEueCArIHVhICogKGEyLnggLSBhMS54KSxcbiAgICAgICAgICAgICAgICBhMS55ICsgdWEgKiAoYTIueSAtIGExLnkpXG4gICAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKCB1YV90ID09IDAgfHwgdWJfdCA9PSAwICkge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkNvaW5jaWRlbnRcIik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiUGFyYWxsZWxcIik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RSZWN0YW5nbGVSZWN0YW5nbGVcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdFJlY3RhbmdsZVJlY3RhbmdsZSA9IGZ1bmN0aW9uKGExLCBhMiwgYjEsIGIyKSB7XG4gICAgdmFyIG1pbiAgICAgICAgPSBhMS5taW4oYTIpO1xuICAgIHZhciBtYXggICAgICAgID0gYTEubWF4KGEyKTtcbiAgICB2YXIgdG9wUmlnaHQgICA9IG5ldyBQb2ludDJEKCBtYXgueCwgbWluLnkgKTtcbiAgICB2YXIgYm90dG9tTGVmdCA9IG5ldyBQb2ludDJEKCBtaW4ueCwgbWF4LnkgKTtcbiAgICBcbiAgICB2YXIgaW50ZXIxID0gSW50ZXJzZWN0aW9uLmludGVyc2VjdExpbmVSZWN0YW5nbGUobWluLCB0b3BSaWdodCwgYjEsIGIyKTtcbiAgICB2YXIgaW50ZXIyID0gSW50ZXJzZWN0aW9uLmludGVyc2VjdExpbmVSZWN0YW5nbGUodG9wUmlnaHQsIG1heCwgY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dXJsKCNkZWZhdWx0I1ZNTCknKVxuXG4gICAgU3Bpbm5lci5wcm90b3R5cGUubGluZXMgPSBmdW5jdGlvbiAoZWwsIG8pIHtcbiAgICAgIHZhciByID0gby5zY2FsZSAqIChvLmxlbmd0aCArIG8ud2lkdGgpXG4gICAgICAgICwgcyA9IG8uc2NhbGUgKiAyICogclxuXG4gICAgICBmdW5jdGlvbiBncnAgKCkge1xuICAgICAgICByZXR1cm4gY3NzKFxuICAgICAgICAgIHZtbCgnZ3JvdXAnLCB7XG4gICAgICAgICAgICBjb29yZHNpemU6IHMgKyAnICcgKyBzXG4gICAgICAgICAgLCBjb29yZG9yaWdpbjogLXIgKyAnICcgKyAtclxuICAgICAgICAgIH0pXG4gICAgICAgICwgeyB3aWR0aDogcywgaGVpZ2h0OiBzIH1cbiAgICAgICAgKVxuICAgICAgfVxuXG4gICAgICB2YXIgbWFyZ2luID0gLShvLndpZHRoICsgby5sZW5ndGgpICogby5zY2FsZSAqIDIgKyAncHgnXG4gICAgICAgICwgZyA9IGNzcyhncnAoKSwge3Bvc2l0aW9uOiAnYWJzb2x1dGUnLCB0b3A6IG1hcmdpbiwgbGVmdDogbWFyZ2lufSlcbiAgICAgICAgLCBpXG5cbiAgICAgIGZ1bmN0aW9uIHNlZyAoaSwgZHgsIGZpbHRlcikge1xuICAgICAgICBpbnMoXG4gICAgICAgICAgZ1xuICAgICAgICAsIGlucyhcbiAgICAgICAgICAgIGNzcyhncnAoKSwge3JvdGF0aW9uOiAzNjAgLyBvLmxpbmVzICogaSArICdkZWcnLCBsZWZ0OiB+fmR4fSlcbiAgICAgICAgICAsIGlucyhcbiAgICAgICAgICAgICAgY3NzKFxuICAgICAgICAgICAgICAgIHZtbCgncm91bmRyZWN0Jywge2FyY3NpemU6IG8uY29ybmVyc30pXG4gICAgICAgICAgICAgICwgeyB3aWR0aDogclxuICAgICAgICAgICAgICAgICwgaGVpZ2h0OiBvLnNjYWxlICogby53aWR0aFxuICAgICAgICAgICAgICAgIC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A9IGZlYXR1cmVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBmID0gMDsgZiA8IGZDb3VudDsgZisrKXsvLyBmb3IgZWFjaCBmZWF0dXJlXG4gICAgICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gZmVhdHVyZXNbZl07XG4gICAgICAgICAgICAgICAgICAgIHZhciBmcm9tU2VxdWVuY2VEYXRhID0gZmVhdHVyZS5zZXF1ZW5jZURhdGE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWF0dXJlLmxpbmtlZEZlYXR1cmVzKSB7IC8vIGlmIGxpbmtlZCBmZWF0dXJlc1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmtlZEZlYXR1cmVJRHMgPSBmZWF0dXJlLmxpbmtlZEZlYXR1cmVzO1xuXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rZWRGZWF0dXJlQ291bnQgPSBsaW5rZWRGZWF0dXJlSURzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGxmaSA9IDA7IGxmaSA8IGxpbmtlZEZlYXR1cmVDb3VudDsgbGZpKyspeyAvL2ZvciBlYWNoIGxpbmtlZCBmZWF0dXJlXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAhISBmb2xsb3dpbmcgaXMgYSBoYWNrLCBjb2RlIGNhbid0IGRlYWwgd2l0aFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICEhIGNvbXBvc2l0ZSBiaW5kaW5nIHJlZ2lvbiBhY3Jvc3MgdHdvIGRpZmZlcmVudCBpbnRlcmFjdG9yc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJyZWFrIGZlYXR1cmUgbGlua3MgdG8gZGlmZmVyZW50IG5vZGVzIGludG8gc2VwZXJhdGUgYmluYXJ5IGxpbmtzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvU2VxdWVuY2VEYXRhX2luZGV4ZWRCeU5vZGVJZCA9IGQzLm1hcCgpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmtlZEZlYXR1cmUgPSBzZWxmLmZlYXR1cmVzLmdldChsaW5rZWRGZWF0dXJlSURzW2xmaV0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcURhdGFDb3VudCA9IGxpbmtlZEZlYXR1cmUuc2VxdWVuY2VEYXRhLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBzID0gMDsgcyA8IHNlcURhdGFDb3VudDsgcysrKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcURhdGEgPSBsaW5rZWRGZWF0dXJlLnNlcXVlbmNlRGF0YVtzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5vZGVJZCA9IHNlcURhdGEuaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGFuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZUlkID0gbm9kZUlkICsgJygnICsgc2VxRGF0YS5wYXJ0aWNpcGFudFJlZiArICcpJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9TZXF1ZW5jZURhdGEgPSB0b1NlcXVlbmNlRGF0YV9pbmRleGVkQnlOb2RlSWQuZ2V0KG5vZGVJZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdG9TZXF1ZW5jZURhdGEgPT09ICd1bmRlZmluZWQnKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvU2VxdWVuY2VEYXRhID0gbmV3IEFycmF5KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b1NlcXVlbmNlRGF0YV9pbmRleGVkQnlOb2RlSWQuc2V0KG5vZGVJZCwgdG9TZXF1ZW5jZURhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvU2VxdWVuY2VEYXRhID0gdG9TZXF1ZW5jZURhdGEucHVzaChzZXFEYXRhKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb3VudEVuZE5vZGVzID0gdG9TZXF1ZW5jZURhdGFfaW5kZXhlZEJ5Tm9kZUlkLnZhbHVlcygpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBuID0gMDsgbiA8IGNvdW50RW5kTm9kZXM7IG4rKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b1NlcXVlbmNlRGF0YSA9IHRvU2VxdWVuY2VEYXRhX2luZGV4ZWRCeU5vZGVJZC52YWx1ZXMoKVtuXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21Nb2xlY3VsZSA9IGdldE5vZGUoZnJvbVNlcXVlbmNlRGF0YVswXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b01vbGVjdWxlID0gZ2V0Tm9kZSh0b1NlcXVlbmNlRGF0YVswXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJvbU1vbGVjdWxlID09PSB0b01vbGVjdWxlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsgPSBnZXRVbmFyeUxpbmsoZnJvbU1vbGVjdWxlLCBpbnRlcmFjdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rID0gZ2V0QmluYXJ5TGluayhmcm9tTW9sZWN1bGUsIHRvTW9sZWN1bGUsIGludGVyYWN0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VxdWVuY2VMaW5rID0gZ2V0RmVhdHVyZUxpbmsoZnJvbVNlcXVlbmNlRGF0YSwgdG9TZXF1ZW5jZURhdGEsIGludGVyYWN0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbU1vbGVjdWxlLnNlcXVlbmNlTGlua3Muc2V0KHNlcXVlbmNlTGluay5pZCwgc2VxdWVuY2VMaW5rKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9Nb2xlY3VsZS5zZXF1ZW5jZUxpbmtzLnNldChzZXF1ZW5jZUxpbmsuaWQsIHNlcXVlbmNlTGluayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsuc2VxdWVuY2VMaW5rcy5zZXQoc2VxdWVuY2VMaW5rLmlkLCBzZXF1ZW5jZUxpbmspO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgfS8vIGVuZCBmb3IgZWFjaCBsaW5rZWQgZmVhdHVyZVxuXG4gICAgICAgICAgICAgICAgICAgIH0vLyBlbmQgaWYgbGlua2VkIGZlYXR1cmVzXG4gICAgICAgICAgICAgICAgfS8vIGVuZCBmb3IgZWFjaCBmZWF0dXJlXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvL2luaXQgY29tcGxleGVzXG4gICAgdmFyIGNvbXBsZXhlcyA9IGNvbXBsZXhlcy52YWx1ZXMoKVxuICAgIGZvciAodmFyIGMgPSAwOyBjIDwgY29tcGxleGVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgIHZhciBpbnRlcmFjdGlvbklkO1xuICAgICAgICBpZiAoZXhwYW5kKSB7XG4gICAgICAgICAgICBpbnRlcmFjdGlvbklkID0gY29tcGxleGVzW2NdLmlkLnN1YnN0cmluZygwLCBjb21wbGV4ZXNbY10uaWQuaW5kZXhPZignKCcpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGludGVyYWN0aW9uSWQgPSBjb21wbGV4ZXNbY10uaWQ7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIG5hcnlMaW5rO1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGRhdGFFbGVtZW50Q291bnQ7IGwrKykge1xuICAgICAgICAgICAgdmFyIGludGVyYWN0aW9uID0gZGF0YVtsXTtcbiAgICAgICAgICAgIGlmIChpbnRlcmFjdGlvbi5pZCA9PSBpbnRlcmFjdGlvbklkKSB7XG4gICAgICAgICAgICAgICAgdmFyIG5MaW5rSWQgPSBnZXROYXJ5TGlua0lkRnJvbUludGVyYWN0aW9uKGludGVyYWN0aW9uKTtcbiAgICAgICAgICAgICAgICBuYXJ5TGluayA9IHNlbGYuYWxsTmFyeUxpbmtzLmdldChuTGlua0lkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb21wbGV4ZXNbY10uaW5pdE1vbGVjdWxlKG5hcnlMaW5rKTtcbiAgICAgICAgbmFyeUxpbmsuY29tcGxleCA9IGNvbXBsZXhlc1tjXTtcbiAgICB9XG4gICAgc2VsZi5jaGVja0xpbmtzKCk7XG4gICAgc2VsZi5pbml0TGF5b3V0KCk7XG5cbiAgICAvL21ha2UgbWkgZmVhdHVyZXMgaW50byBhbm5vdGF0aW9uc1xuICAgIHZhciBmZWF0dXJlcyA9IHNlbGYuZmVhdHVyZXMudmFsdWVzKCk7XG4gICAgdmFyIGZDb3VudCA9IGZlYXR1cmVzLmxlbmd0aDtcbiAgICBmb3IgKHZhciBmID0gMD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XG4gICAgICAgICAgICBmb3IgKHZhciBzZGkgPSAwOyBzZGkgPCBzZXFEYXRhQ291bnQ7IHNkaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlcURhdHVtID0gc2VxRGF0YVtzZGldO1xuICAgICAgICAgICAgICAgIHZhciBtSUQgPSBzZXFEYXR1bS5pbnRlcmFjdG9yUmVmO1xuICAgICAgICAgICAgICAgIGlmIChleHBhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgbUlEID0gbUlEICAgKyBcIihcIiArIHNlcURhdHVtLnBhcnRpY2lwYW50UmVmICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBtb2xlY3VsZSA9IHNlbGYubW9sZWN1bGVzLmdldChtSUQpO1xuICAgICAgICAgICAgICAgIHZhciBzZXF1ZW5jZVJlZ2V4ID0gLyguKyktKC4rKS87XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gc2VxdWVuY2VSZWdleC5leGVjKHNlcURhdHVtLnBvcyk7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0UmVzID0gbWF0Y2hbMV0gKiAxO1xuICAgICAgICAgICAgICAgIHZhciBlbmRSZXMgPSBtYXRjaFsyXSAqIDE7XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHN0YXJ0UmVzKSA9PT0gZmFsc2UgJiYgaXNOYU4oZW5kUmVzKSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFubm90YXRpb24gPSBuZXcgQW5ub3RhdGlvbihhbm5vdE5hbWUsIHN0YXJ0UmVzLCBlbmRSZXMpO1xuICAgICAgICAgICAgICAgICAgICBpZiAobW9sZWN1bGUubWlGZWF0dXJlcyA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2xlY3VsZS5taUZlYXR1cmVzID0gbmV3IEFycmF5KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbW9sZWN1bGUubWlGZWF0dXJlcy5wdXNoKGFubm90YXRpb24pO1xuICAgIC8vICAgICAgICAgICAgICBjb25zb2xlLmxvZyhtb2xlY3VsZS5pZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy9sb29rdXAgbWlzc2luZyBzZXF1ZW5jZXNcbiAgICB2YXIgbnNJZHMgPSBuZWVkc1NlcXVlbmNlLnZhbHVlcygpO1xuICAgIHZhciBuc0NvdW50ID0gbnNJZHMubGVuZ3RoO1xuICAgIGlmIChuc0NvdW50ID09PSAwKSB7XG4gICAgICAgIHNlbGYuaW5pdFBvbHltZXJzKCk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB2YXIgY291bnRTZXF1ZW5jZXMgPSAwO1xuICAgICAgICBmb3IgKHZhciBtID0gMDsgbSA8IG5zQ291bnQ7IG0rKyl7XG4gICAgICAgICAgICB4aU5FVF9TdG9yYWdlLmdldFNlcXVlbmNlKG5zSWRzW21dLCBmdW5jdGlvbihpZCwgc2VxKXtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5tb2xlY3VsZXMuZ2V0KGlkKS5zZXRTZXF1ZW5jZShzZXEpO1xuICAgICAgICAgICAgICAgICAgICBjb3VudFNlcXVlbmNlcysrO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY291bnRTZXF1ZW5jZXMgPT09IG5zQ291bnQpe1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5pbml0UG9seW1lcnMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWFkU3RvaWNoRXhwYW5kZWQoKXtcbiAgICAgICAgLy9nZXQgbWF4aW11bSBzdG9pY2hpb21ldHJ5XG4gICAgICAgIHZhciBtYXhTdG9pY2ggPSAwO1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGRhdGFFbGVtZW50Q291bnQ7IGwrKykge1xuICAgICAgICAgICAgdmFyIGludGVyYWN0aW9uID0gZGF0YVtsXTtcbiAgICAgICAgICAgIGlmIChpbnRlcmFjdGlvbi5vYmplY3QgPT09ICdpbnRlcmFjdGlvbicpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnRDb3VudCA9IGludGVyYWN0aW9uLnBhcnRpY2lwYW50cy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgcGkgPSAwOyBwaSA8IHBhcnRpY2lwYW50Q291bnQ7IHBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnRpY2lwYW50ID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzW3BpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnkgJiYgKHBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnktMCkgPiBtYXhTdG9pY2gpe1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF4U3RvaWNoID0gKHBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnktMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1heFN0b2ljaCA8IDMwKXtcbiAgICAgICAgICAgIG1pSnNvbiA9IEV4cGFuZC5tYXRyaXgobWlKc29uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGluZGV4RmVhdHVyZXMoKTtcblxuICAgICAgICAvL2FkZCBuYXJ5TGlua3MgYW5kIHBhcnRpY2lwYW50c1xuICAgICAgICBmb3IgKHZhciBsID0gMDsgbCA8IGRhdGFFbGVtZW50Q291bnQ7IGwrKykge1xuICAgICAgICAgICAgdmFyIGludGVyYWN0aW9uID0gZGF0YVtsXTtcbiAgICAgICAgICAgIGlmIChpbnRlcmFjdGlvbi5vYmplY3QgPT09ICdpbnRlcmFjdGlvbicpIHtcbiAgICAgICAgICAgICAgICB2YXIganNvblBhcnRpY2lwYW50cyA9IGludGVyYWN0aW9uLnBhcnRpY2lwYW50cztcbiAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnRDb3VudCA9IGpzb25QYXJ0aWNpcGFudHMubGVuZ3RoXG5cbiAgICAgICAgICAgICAgICAvL2luaXQgbi1hcnkgbGlua1xuICAgICAgICAgICAgICAgIHZhciBuTGlua0lkID0gZ2V0TmFyeUxpbmtJZEZyb21JbnRlcmFjdGlvbihpbnRlcmFjdGlvbilcbiAgICAgICAgICAgICAgICB2YXIgbkxpbmsgPSBzZWxmLmFsbE5hcnlMaW5rcy5nZXQobkxpbmtJZCk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBuTGluayA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9kb2Vzbid0IGFscmVhZHkgZXhpc3QsIG1ha2UgbmV3IG5MaW5rXG4gICAgICAgICAgICAgICAgICAgIG5MaW5rID0gbmV3IE5hcnlMaW5rKG5MaW5rSWQsIHNlbGYpO1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmFsbE5hcnlMaW5rcy5zZXQobkxpbmtJZCwgbkxpbmspO1xuICAgICAgICAgICAgICAgICAgICAvL2Fsb3Qgb2YgdGltZSBpcyBiZWluZyBzcGVudCBvbiBjcmVhdGluZyB0aGVzZSBJRHMsIHN0YXNoIHRoZW0gaW4gdGhlIGludGVyYWN0aW9uIG9iamVjdD9cbiAgICAgICAgICAgICAgICAgICAgaW50ZXJhY3Rpb24ubmFyeUlkID0gIG5MaW5rSWQ7XG5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbkxpbmsuYWRkRXZpZGVuY2UoaW50ZXJhY3Rpb24pO1xuXG4gICAgICAgICAgICAgICAgLy9pbml0IHBhcnRpY2lwYW50c1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHBpID0gMDsgcGkgPCBwYXJ0aWNpcGFudENvdW50OyBwaSsrKXtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGpzb25QYXJ0aWNpcGFudCA9IGpzb25QYXJ0aWNpcGFudHNbcGldO1xuXG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRSZWYgPSBqc29uUGFydGljaXBhbnQuaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnRSZWYgPSBqc29uUGFydGljaXBhbnQuaWQ7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudElkID0gIGludFJlZiArIFwiKFwiICsgcGFydFJlZiArIFwiKVwiO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnQgPSBzZWxmLm1vbGVjdWxlcy5nZXQocGFydGljaXBhbnRJZCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGFydGljaXBhbnQgPT09ICd1bmRlZmluZWQnKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yID0gc2VsZi5pbnRlcmFjdG9ycy5nZXQoaW50UmVmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRpY2lwYW50ID0gbmV3TW9sZWN1bGUoaW50ZXJhY3RvciwgcGFydGljaXBhbnRJZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm1vbGVjdWxlcy5zZXQocGFydGljaXBhbnRJZCwgcGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQubmFyeUxpbmtzLnNldChuTGlua0lkLCBuTGluayk7XG4gICAgICAgICAgICAgICAgICAgIC8vVE9ETzogdGlkeSB1cCB3aGF0cyBoYXBwZW5pbmcgaW4gTmFyeUxpbmsgcmUgaW50ZXJhY3Rvci9wYXJ0aWNpcGFudCB0ZXJtaW5vbG9neVxuICAgICAgICAgICAgICAgICAgICBpZiAobkxpbmsuaW50ZXJhY3RvcnMuaW5kZXhPZihwYXJ0aWNpcGFudCkgPT09IC0xKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5MaW5rLmludGVyYWN0b3JzLnB1c2gocGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICYmIGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICE9PSBudWxsKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yID0gc2VsZi5tb2xlY3VsZXMuZ2V0KHBhcnRpY2lwYW50SWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJhY3Rvci5hZGRTdG9pY2hpb21ldHJ5TGFiZWwoanNvblBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIG5ld01vbGVjdWxlKGludGVyYWN0b3IsIHBhcnRpY2lwYW50SWQpe1xuICAgICAgICB2YXIgcGFydGljaXBhbnQ7XG4gICAgICAgIGlmICh0eXBlb2YgaW50ZXJhY3RvciA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIC8vbXVzdCBiZSBhIHByZXZpb3VzbHkgdW5lbmNvdW50ZXJlZCBjb21wbGV4IC1cbiAgICAgICAgICAgIC8vIE1JOjAzMTQgLSBpbnRlcmFjdGlvbj8sIE1JOjAzMTcgLSBjb21wbGV4PyBhbmQgaXRzIG1hbnkgc3ViY2xhc3Nlc1xuICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgQ29tcGxleChwYXJ0aWNpcGFudElkLCBzZWxmKTtcbiAgICAgICAgICAgIGNvbXBsZ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ldyBCaW9hY3RpdmVFbnRpdHkocGFydGljaXBhbnRJZCwgc2VsZiwgaW50ZXJhY3RvciwgaW50ZXJhY3Rvci5sYWJlbCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gcHJvdGVpbnMsIHBlcHRpZGVzXG4gICAgICAgIGVsc2UgaWYgKGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjAzMjYnIHx8IGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjAzMjcnKSB7XG4gICAgICAgICAgICBwYXJ0aWNpcGFudCA9IG5ldyBQcm90ZWluKHBhcnRpY2lwYW50SWQsIHNlbGYsIGludGVyYWN0b3IsIGludGVyYWN0b3IubGFiZWwpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBpbnRlcmFjdG9yLnNlcXVlbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHBhcnRpY2lwYW50LnNldFNlcXVlbmNlKGludGVyYWN0b3Iuc2VxdWVuY2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy9zaG91bGQgbG9vayBpdCB1cCB1c2luZyBhY2Nlc3Npb24gbnVtYmVyXG4gICAgICAgICAgICAgICAgaWYgKHBhcnRpY2lwYW50SWQuaW5kZXhPZigndW5pcHJvdGtiJykgPT09IDApe1xuICAgICAgICAgICAgICAgICAgICBuZWVkc1NlcXVlbmNlLmFkZChwYXJ0aWNpcGFudElkKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwYXJ0aWNpcGFudC5zZXRTZXF1ZW5jZShcIlNFUVVFTkNFTUlTU0lOR1wiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy9nZW5lc1xuICAgICAgICBlbHNlIGlmIChpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdOSTowMjUwJykge1xuICAgICAgICAgICA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sIGludGVyZmVyaW5nXG4gICAgICAgICAgICAgICAgfHwgaW50ZXJhY3Rvci50eXBlLmlkID09PSAnTUk6MDYwNycgLy8gUk5BIC0gc21hbGwgbnVjbGVhclxuICAgICAgICAgICAgICAgIHx8IGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjA2MDknIC8vIFJOQSAtIHNtYWxsIG51Y2xlb2xhclxuICAgICAgICAgICAgICAgIHx8IGludGVyYWN0b3IudHlwZS5pZCA9PT0gJ01JOjAzMjUnIC8vIFJOQSAtIHRyYW5zZmVyXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgIHBhcnRpY2lwYW50ID0gbmV3IFJOQShwYXJ0aWNpcGFudElkLCBzZWxmLCBpbnRlcmFjdG9yLCBpbnRlcmFjdG9yLmxhYmVsKTtcbiAgICAgICAgfVxuICAgICAgICAvL0ROQVxuICAgICAgICBlbHNlIGlmIChpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdNSTowMzE5JyAvLyBETkFcbiAgICAgICAgICAgICAgICB8fCBpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdNSTowNjgxJyAvLyBETkEgLSBkb3VibGUgc3RyYW5kZWRcbiAgICAgICAgICAgICAgICB8fCBpbnRlcmFjdG9yLnR5cGUuaWQgPT09ICdNSTowNjgwJyAvLyBETkEgLSBzaW5nbGUgc3RyYW5kZWRcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgRE5BKHBhcnRpY2lwYW50SWQsIHNlbGYsIGludGVyYWN0b3IsIGludGVyYWN0b3IubGFiZWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gTUk6MDMyOSAtIHVua25vd24gcGFydGljaXBhbnQgP1xuICAgICAgICAgICAgLy8gTUk6MDM4MyAtIGJpb3BvbHltZXIgP1xuICAgICAgICAgICAgYWxlcnQoXCJVbnJlY29nbmlzZWQgdHlwZTpcIiArIGludGVyYWN0b3IudHlwZS5uYW1lKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFydGljaXBhbnQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaW5kZXhGZWF0dXJlcygpe1xuICAgICAgICAvL2NyZWF0ZSBpbmRleGVkIGNvbGxlY3Rpb24gb2YgYWxsIGZlYXR1cmVzIGZyb20gaW50ZXJhY3Rpb25zXG4gICAgICAgIC8vIC0gc3RpbGwgc2VlbXMgbGlrZSBhIGdvb2Qgc3RhcnRpbmcgcG9pbnQ/XG4gICAgICAgIGZvciAodmFyIGwgPSAwOyBsIDwgZGF0YUVsZW1lbnRDb3VudDsgbCsrKSB7XG4gICAgICAgICAgICB2YXIgaW50ZXJhY3Rpb24gPSBkYXRhW2xdO1xuICAgICAgICAgICAgaWYgKGludGVyYWN0aW9uLm9iamVjdCA9PT0gJ2ludGVyYWN0aW9uJykge1xuICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudENvdW50ID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwaSA9IDA7IHBpIDwgcGFydGljaXBhbnRDb3VudDsgcGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGFydGljaXBhbnQgPSBpbnRlcmFjdGlvbi5wYXJ0aWNpcGFudHNbcGldO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmVhdHVyZXMgPSBuZXcgQXJyYXkoMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWNpcGFudC5mZWF0dXJlcykgZmVhdHVyZXMgPSBwYXJ0aWNpcGFudC5mZWF0dXJlcztcblxuICAgICAgICAgICAgICAgICAgICB2YXIgZkNvdW50ID0gZmVhdHVyZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBmID0gMDsgZiA8IGZDb3VudDsgZisrKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gZmVhdHVyZXNbZl07XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmZlYXR1cmVzLnNldChmZWF0dXJlLmlkLCBmZWF0dXJlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlYWRTdG9pY2hVbmV4cGFuZGVkKCl7XG4gICAgICAgIC8vZ2V0IGludGVyYWN0b3JzXG4gICAgICAgIHZhciBpbnRlcmFjdG9ycyA9IHNlbGYuaW50ZXJhY3RvcnMudmFsdWVzKCk7XG4gICAgICAgIHZhciBpbnRlcmFjdG9yQ291bnQgPSBpbnRlcmFjdG9ycy5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgaW50ZXJhY3RvckNvdW50OyBpKyspIHtcbiAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yID0gaW50ZXJhY3RvcnNbaV07XG4gICAgICAgICAgICB2YXIgcGFydGljaXBhbnQ7XG4gICAgICAgICAgICB2YXIgcGFydGljaXBhbnRJZCA9IGludGVyYWN0b3IuaWQ7XG4gICAgICAgICAgICBwYXJ0aWNpcGFudCA9IG5ld01vbGVjdWxlIChpbnRlcmFjdG9yLCBwYXJ0aWNpcGFudElkKTtcbiAgICAgICAgICAgIHNlbGYubW9sZWN1bGVzLnNldChwYXJ0aWNpcGFudElkLCBwYXJ0aWNpcGFudCk7XG4gICAgICAgIH1cblxuICAgICAgICBpbmRleEZlYXR1cmVzKCk7XG5cbiAgICAgICAgLy9hZGQgbmFyeUxpbmtzXG4gICAgICAgIGZvciAodmFyIGwgPSAwOyBsIDwgZGF0YUVsZW1lbnRDb3VudDsgbCsrKSB7XG4gICAgICAgICAgICB2YXIgaW50ZXJhY3Rpb24gPSBkYXRhW2xdO1xuICAgICAgICAgICAgaWYgKGludGVyYWN0aW9uLm9iamVjdCA9PT0gJ2ludGVyYWN0aW9uJykge1xuICAgICAgICAgICAgICAgIHZhciBqc29uUGFydGljaXBhbnRzID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzO1xuICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudENvdW50ID0ganNvblBhcnRpY2lwYW50cy5sZW5ndGhcblxuICAgICAgICAgICAgICAgIC8vaW5pdCBuLWFyeSBsaW5rXG4gICAgICAgICAgICAgICAgdmFyIG5MaW5rSWQgPSBnZXROYXJ5TGlua0lkRnJvbUludGVyYWN0aW9uKGludGVyYWN0aW9uKVxuICAgICAgICAgICAgICAgIHZhciBuTGluayA9IHNlbGYuYWxsTmFyeUxpbmtzLmdldChuTGlua0lkKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG5MaW5rID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAvL2RvZXNuJ3QgYWxyZWFkeSBleGlzdCwgbWFrZSBuZXcgbkxpbmtcbiAgICAgICAgICAgICAgICAgICAgbkxpbmsgPSBuZXcgTmFyeUxpbmsobkxpbmtJZCwgc2VsZik7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuYWxsTmFyeUxpbmtzLnNldChuTGlua0lkLCBuTGluayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5MaW5rLmFkZEV2aWRlbmNlKGludGVyYWN0aW9uKTtcblxuICAgICAgICAgICAgICAgIC8vfiAvL2luaXQgcGFydGljaXBhbnRzXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgcGkgPSAwOyBwaSA8IHBhcnRpY2lwYW50Q291bnQ7IHBpKyspe1xuICAgICAgICAgICAgICAgICAgICB2YXIganNvblBhcnRpY2lwYW50ID0ganNvblBhcnRpY2lwYW50c1twaV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRSZWYgPSBqc29uUGFydGljaXBhbnQuaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnRpY2lwYW50SWQgPSAgaW50UmVmOy8vICsgXCIoXCIgKyBwYXJ0UmVmICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJ0aWNpcGFudCA9IHNlbGYubW9sZWN1bGVzLmdldChwYXJ0aWNpcGFudElkKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhcnRpY2lwYW50ID09PSAndW5kZWZpbmVkJyl7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL211c3QgYmUgYSBwcmV2aW91c2x5IHVuZW5jb3VudGVyZWQgY29tcGxleFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQgPSBuZXcgQ29tcGxleChwYXJ0aWNpcGFudElkLCBzZWxmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXhlcy5zZXQocGFydGljaXBhbnRJZCwgcGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5tb2xlY3VsZXMuc2V0KHBhcnRpY2lwYW50SWQsIHBhcnRpY2lwYW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG5cbiAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQubmFyeUxpbmtzLnNldChuTGlua0lkLCBuTGluayk7XG4gICAgICAgICAgICAgICAgICAgIC8vVE9ETzogdGlkeSB1cCB3aGF0cyBoYXBwZW5pbmcgaW4gTmFyeUxpbmsgcmUgaW50ZXJhY3Rvci9wYXJ0aWNpcGFudCB0ZXJtaW5vbG9neVxuICAgICAgICAgICAgICAgICAgICBpZiAobkxpbmsuaW50ZXJhY3RvcnMuaW5kZXhPZihwYXJ0aWNpcGFudCkgPT09IC0xKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5MaW5rLmludGVyYWN0b3JzLnB1c2gocGFydGljaXBhbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vdGVtcCAtIHRvIGdpdmUgc2Vuc2libGUgaW5mbyB3aGVuIHN0b2ljaCBjb2xsYXBzZWRcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVyYWN0b3IgPSBzZWxmLm1vbGVjdWxlcy5nZXQocGFydGljaXBhbnRJZCk7XG4gICAgICAgICAgICAgICAgICAgIGludGVyYWN0b3Iuc3RvaWNoID0gaW50ZXJhY3Rvci5zdG9pY2g/IGludGVyYWN0b3Iuc3RvaWNoIDogMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICYmIGpzb25QYXJ0aWNpcGFudC5zdG9pY2hpb21ldHJ5ICE9PSBudWxsKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVyYWN0b3Iuc3RvaWNoID0gaW50ZXJhY3Rvci5zdG9pY2ggKyAranNvblBhcnRpY2lwYW50LnN0b2ljaGlvbWV0cnk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcmFjdG9yLnN0b2ljaCA9IGludGVyYWN0b3Iuc3RvaWNoICsgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBpbnRlcmFjdG9yQXJyID0gc2VsZi5tb2xlY3VsZXMudmFsdWVzKCk7XG4gICAgICAgICAgICAgICAgdmFyIGlDb3VudCA9IGludGVyYWN0b3JBcnIubGVuZ3RoXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaWkgPSAwOyBpaSA8IGlDb3VudDsgaWkrKyl7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnQgPSBpbnRlcmFjdG9yQXJyW2lpXTtcbiAgICAgICAgICAgICAgICAgICAgaW50LmFkZFN0b2ljaGlvbWV0cnlMYWJlbChpbnQuc3RvaWNoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgfTtcblxuXG4gICAgZnVuY3Rpb24gZ2V0TmFyeUxpbmtJZEZyb21JbnRlcmFjdGlvbihpbnRlcmFjdGlvbikge1xuICAgICAgICBpZiAoaW50ZXJhY3Rpb24ubmFyeUlkKSB7XG4gICAgICAgICAgICByZXR1cm4gaW50ZXJhY3Rpb24ubmFyeUlkO1xuICAgICAgICB9XG4gICAgICAgIHZhciBqc29uUGFydGljaXBhbnRzID0gaW50ZXJhY3Rpb24ucGFydGljaXBhbnRzO1xuICAgICAgICB2YXIgcGFydGljaXBhbnRDb3VudCA9IGpzb25QYXJ0aWNpcGFudHMubGVuZ3RoXG5cbiAgICAgICAgdmFyIHBJRHMgPSBkMy5zZXQoKTsvL3VzZWQgdG8gZWxpbWluYXRlIGR1cGxpY2F0ZXNcbiAgICAgICAgLy9tYWtlIGlkXG4gICAgICAgIGZvciAodmFyIHBpID0gMDsgcGkgPCBwYXJ0aWNpcGFudENvdW50OyBwaSsrKSB7XG4gICAgICAgICAgICB2YXIgcElEID0ganNvblBhcnRpY2lwYW50c1twaV0uaW50ZXJhY3RvclJlZjtcbiAgICAgICAgICAgIGlmIChleHBhbmQpIHtcbiAgICAgICAgICAgICAgICBwSUQgPSBwSUQgICArIFwiKFwiICsganNvblBhcnRpY2lwYW50c1twaV0uaWQgKyBcIilcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBJRHMuYWRkKHBJRCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcElEcy52YWx1ZXMoKS5zb3J0KCkuam9pbignLScpO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBnZXROb2RlKHNlcURhdHVtKXtcbiAgICAgICAgdmFyIGlkID0gc2VxRGF0dW0uaW50ZXJhY3RvclJlZjtcbiAgICAgICAgaWYgKGV4cGFuZCl7XG4gICAgICAgICAgICBpZCA9IGlkICsgJygnICsgc2VxRGF0dW0ucGFydGljaXBhbnRSZWYgKyAnKSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNlbGYubW9sZWN1bGVzLmdldChpZCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RmVhdHVyZUxpbmsoZnJvbVNlcURhdGEsIHRvU2VxRGF0YSwgaW50ZXJhY3Rpb24pe1xuICAgICAgICBmdW5jdGlvbiBzZXFEYXRhVG9TdHJpbmcoc2VxRGF0YSl7XG4gICAgICAgICAgICB2YXIgbm9kZUlkcyA9IGQzLnNldCgpOy8vdXNlZCB0byBlbGltaW5hdGUgZHVwbGljYXRlc1xuICAgICAgICAgICAgLy9tYWtlIGlkXG4gICAgICAgICAgICBmb3IgKHZhciBzID0gMDsgcyA8IHNlcURhdGEubGVuZ3RoOyBzKyspe1xuICAgICAgICAgICAgICAgIHZhciBzZXEgPSBzZXFEYXRhW3NdO1xuICAgICAgICAgICAgICAgIHZhciBpZCA9IHNlcS5pbnRlcmFjdG9yUmVmO1xuICAgICAgICAgICAgICAgIGlmIChleHBhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZCArICcoJyArIHNlcS5wYXJ0aWNpcGFudFJlZiArICcpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWQgPSBpZCArICc6JyArIHNlcS5wb3M7XG4gICAgICAgICAgICAgICAgbm9kZUlkcy5hZGQoaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy9zb3J0IGlkc1xuICAgICAgICAgICAgcmV0dXJuIG5vZGVJZHMudmFsdWVzKCkuc29ydCgpLmpvaW4oJzsnKTtcbiAgICAgICAgfVxuXG5cbiAgICAgICAgdmFyIHN0YXJ0ID0gIHNlcURhdGFUb1N0cmluZyhmcm9tU2VxdWVuY2VEYXRhKTtcbiAgICAgICAgdmFyIGVuZCA9ICBzZXFEYXRhVG9TdHJpbmcodG9TZXF1ZW5jZURhdGEpO1xuICAgICAgICB2YXIgc2VxTGlua0lkLCBlbmRzU3dhcHBlZDtcbiAgICAgICAgaWYgKHN0YXJ0IDwgZW5kKXtcbiA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WR0aCwgTWF0aC5yYW5kb20oKSAqIGhlaWdodCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvL2RvIGZvcmNlIGRpcmVjdGVkIGxheW91dFxuICAgIHZhciBsYXlvdXRPYmogPSB7fTtcbiAgICBsYXlvdXRPYmoubm9kZXMgPSBbXTtcbiAgICBsYXlvdXRPYmoubGlua3MgPSBbXTtcbiAgICB2YXIgbW9sTG9va1VwID0ge307XG4gICAgdmFyIG1pID0gMDtcblxuICAgIGZvciAodmFyIG4gPSAwOyBuIDwgbm9kZUNvdW50OyBuKyspIHtcbiAgICAgICAgdmFyIG1vbCA9IG5vZGVzW25dO1xuICAgICAgICBtb2xMb29rVXBbbW9sLmlkXSA9IG1pO1xuICAgICAgICBtaSsrO1xuICAgICAgICB2YXIgbm9kZU9iaiA9IHt9O1xuICAgICAgICBub2RlT2JqLmlkID0gbW9sLmlkO1xuICAgICAgICBub2RlT2JqLnggPSBtb2wueDtcbiAgICAgICAgbm9kZU9iai55ID0gbW9sLnk7XG4gICAgICAgIG5vZGVPYmoucHggPSBtb2wueDtcbiAgICAgICAgbm9kZU9iai5weSA9IG1vbC55O1xuICAgICAgICBsYXlvdXRPYmoubm9kZXMucHVzaChub2RlT2JqKTtcbiAgICB9XG4gICAgdmFyIGxpbmtzID0gdGhpcy5hbGxCaW5hcnlMaW5rcy52YWx1ZXMoKTtcbiAgICB2YXIgbGlua0NvdW50ID0gbGlua3MubGVuZ3RoO1xuICAgIGZvciAodmFyIGwgPSAwOyBsIDwgbGlua0NvdW50OyBsKyspIHtcbiAgICAgICAgdmFyIGxpbmsgPSBsaW5rc1tsXTtcbiAgICAgICAgICAgIHZhciBmcm9tTW9sID0gbGluay5pbnRlcmFjdG9yc1swXTtcbiAgICAgICAgICAgIHZhciB0b01vbCA9IGxpbmsuaW50ZXJhY3RvcnNbMV07XG4gICAgICAgICAgICB2YXIgc291cmNlID0gbW9sTG9va1VwW2Zyb21Nb2wuaWRdO1xuICAgICAgICAgICAgdmFyIHRhcmdldCA9IG1vbExvb2tVcFt0b01vbC5pZF07XG5cbiAgICAgICAgICAgIGlmIChzb3VyY2UgIT09IHRhcmdldCkge1xuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzb3VyY2UgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiB0YXJnZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsaW5rT2JqID0ge307XG4gICAgICAgICAgICAgICAgICAgIGxpbmtPYmouc291cmNlID0gc291cmNlO1xuICAgICAgICAgICAgICAgICAgICBsaW5rT2JqLnRhcmdldCA9IHRhcmdldDtcbiAgICAgICAgICAgICAgICAgICAgbGlua09iai5pZCA9IGxpbmsuaWQ7XG4gICAgICAgICAgICAgICAgICAgIGxheW91dE9iai5saW5rcy5wdXNoKGxpbmtPYmopO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYWxlcnQoXCJOT1QgUklHSFRcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBrID0gTWF0aC5zcXJ0KGxheW91dE9iai5ub2Rlcy5sZW5ndGggLyAod2lkdGggKiBoZWlnaHQpKTtcbiAgICAvLyBtaWtlIHN1Z2dlc3RzOlxuICAgIC8vICAgIC5jaGFyZ2UoLTEwIC8gaylcbiAgICAvLyAgICAuZ3Jhdml0eSgxMDAgKiBrKVxuICAgIC8vZm9sbG93aW5nIGFyZSB0aGUgcGFyYW1ldGVycyBmb3IgdGhlIGxheW91dCB5b3UgY2FuIHBsYXkgYXJvdW5kIHdpdGhcbiAgICAvL3NlZSB0aGUgZG9jdW1lbnRhdGlvbiBhdCBodHRwczovL2dpdGh1Yi5jb20vbWJvc3RvY2svZDMvd2lraS9Gb3JjZS1MYXlvdXRcbiAgICB0aGlzLmZvcmNlID0gZDMubGF5b3V0LmZvcmNlKClcbiA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nNldFBvc2l0aW9uYWxGZWF0dXJlcyhtb2wubWlGZWF0dXJlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2hvb3NlQ29sb3VycygpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGFubm90YXRpb25DaG9pY2UudG9VcHBlckNhc2UoKSA9PT0gXCJJTlRFUkFDVE9SXCIpIHtcbiAgICAgICAgICAgIGlmIChzZWxmLnByb3RlaW5Db3VudCA8IDIxKSB7XG4gICAgICAgICAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1vbCA9IG1vbHNbbV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChtb2wuaWQuaW5kZXhPZigndW5pcHJvdGtiXycpID09PSAwKSB7Ly9MSU1JVCBJVCBUTyBQUk9URUlOUyAvL3RvZG86Zml4XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYW5ub3RhdGlvbiA9IG5ldyBBbm5vdGF0aW9uIChtb2wuanNvbi5sYWJlbCwgMSwgbW9sLnNpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9sLnNldFBvc2l0aW9uYWxGZWF0dXJlcyhbYW5ub3RhdGlvbl0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNob29zZUNvbG91cnMoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYWxlcnQoXCJUb28gbWFueSB0eXBlcyBvZiBwcm90ZWluICg+IDIwKSAtIGNhbid0IGNvbG91ciBieSBpbnRlcmFjdG9yLlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhbm5vdGF0aW9uQ2hvaWNlLnRvVXBwZXJDYXNlKCkgPT09IFwiU1VQRVJGQU1cIiB8fCBhbm5vdGF0aW9uQ2hvaWNlLnRvVXBwZXJDYXNlKCkgPT09IFwiU1VQRVJGQU1JTFlcIil7XG4gICAgICAgICAgICB2YXIgbW9sc0Fubm90YXRlZCA9IDA7XG4gICAgICAgICAgICBmb3IgKG0gPSAwOyBtIDwgbW9sQ291bnQ7IG0rKykge1xuICAgICAgICAgICAgICAgIHZhciBtb2wgPSBtb2xzW21dO1xuICAgICAgICAgICAgICAgIGlmIChtb2wuaWQuaW5kZXhPZigndW5pcHJvdGtiXycpID09PSAwKSB7Ly9MSU1JVCBJVCBUTyBQUk9URUlOUyAvL3RvZG86Zml4XG4gICAgICAgICAgICAgICAgICAgIHhpTkVUX1N0b3JhZ2UuZ2V0U3VwZXJGYW1GZWF0dXJlcyhtb2wuaWQsIGZ1bmN0aW9uIChpZCwgZnRzKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtID0gc2VsZi5tb2xlY3VsZXMuZ2V0KGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0uc2V0UG9zaXRpb25hbEZlYXR1cmVzKGZ0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2xzQW5ub3RhdGVkKys7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VDb2xvdXJzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbW9sc0Fubm90YXRlZCsrO1xuICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZUNvbG91cnMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhbm5vdGF0aW9uQ2hvaWNlLnRvVXBwZXJDYXNlKCkgPT09IFwiVU5JUFJPVFwiIHx8IGFubm90YXRpb25DaG9pY2UudG9VcHBlckNhc2UoKSA9PT0gXCJVTklQUk9US0JcIikge1xuICAgICAgICAgICAgdmFyIG1vbHNBbm5vdGF0ZWQgPSAwO1xuICAgICAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgbW9sID0gbW9sc1ttXTtcbiAgICAgICAgICAgICAgICBpZiAobW9sLmlkLmluZGV4T2YoJ3VuaXByb3RrYl8nKSA9PT0gMCkgey8vTElNSVQgSVQgVE8gUFJPVEVJTlMgLy90b2RvOmZpeFxuICAgICAgICAgICAgICAgICAgICB4aU5FVF9TdG9yYWdlLmdldFVuaVByb3RGZWF0dXJlcyhtb2wuaWQsIGZ1bmN0aW9uIChpZCwgZnRzKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtID0gc2VsZi5tb2xlY3VsZXMuZ2V0KGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0uc2V0UG9zaXRpb25hbEZlYXR1cmVzKGZ0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2xzQW5ub3RhdGVkKys7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VDb2xvdXJzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbW9sc0Fubm90YXRlZCsrO1xuICAgICAgICAgICAgICAgICAgICBpZiAobW9sc0Fubm90YXRlZCA9PT0gbW9sQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZUNvbG91cnMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNob29zZUNvbG91cnMoKXtcbiAgICAgICAgdmFyIGNhdGVnb3JpZXMgPSBkMy5zZXQoKTtcbiAgICAgICAgZm9yIChtID0gMDsgbSA8IG1vbENvdW50OyBtKyspIHtcbiAgICAgICAgICAgIHZhciBtb2wgPSBtb2xzW21dO1xuICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBtb2wuYW5ub3RhdGlvbnMubGVuZ3RoOyBhKyspe1xuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMuYWRkKG1vbC5hbm5vdGF0aW9uc1thXS5kZXNjcmlwdGlvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGNhdENvdW50ID0gY2F0ZWdvcmllcy52YWx1ZXMoKS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgIHZhciBjb2xvdXJTY2hlbWU7Ly8gPSBudWxsO1xuICAgICAgICBpZiAoY2F0Q291bnQgPCAzKXtjYXRDb3VudCA9IDM7fVxuICAgICAgICAvL34gaWYgKGNhdENvdW50IDwgMjEpIHtcbiAgICAgICAgICAgIGlmIChjYXRDb3VudCA8IDUpIHtcblx0XHRcdFx0Ly9+IHZhciByZXZlcnNlZCA9IGNvbG9yYnJld2VyLkFjY2VudFtjYXRDb3VudF0uc2xpY2UoKS5yZXZlcnNlKCk7XG4gICAgICAgICAgICAgICAgLy9+IGNvbG91clNjaGVtZSA9IGQzLnNjYWxlLm9yZGluYWwoKS5yYW5nZShyZXZlcnNlZCk7XG4gICAgICAgICAgICAgICAgY29sb3VyU2NoZW1lID0gZDMuc2NhbGUub3JkaW5hbCgpLnJhbmdlKGNvbG9yYnJld2VyLlNldDFbNF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY2F0Q291bnQgPCAxMykge1xuICAgICAgICAgICAgICAgIHZhciByZXZlcnNlZCA9IGNvbG9yYnJld2VyLlNldDNbY2F0Q291bnRdLnNsaWNlKCkucmV2ZXJzZSgpO1xuICAgICAgICAgICAgICAgIGNvbG91clNjaGVtZSA9IGQzLnNjYWxlLm9yZGluYWwoKS5yYW5nZShyZXZlcnNlZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb2xvdXJTY2hlbWUgPSBkMy5zY2FsZS5jYXRlZ29yeTIwKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vfiBjb25zb2xlLmxvZyhcIkNPTHMgXCIsIGNvbG91clNjaGVtZSk7XG5cbiAgICAgICAgICAgIGZvciAobSA9IDA7IG0gPCBtb2xDb3VudDsgbSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1vbCA9IG1vbHNbbV07XG4gICAgICAgICAgICAgICAgZm9yIChhID0gMDsgYSA8IG1vbC5hbm5vdGF0aW9ucy5sZW5ndGg7IGErKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYW5ubyA9IG1vbC5hbm5vdGF0aW9uc1thXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFubm8uZGVzY3JpcHRpb24gPT0gXCJObyBhbm5vdGF0aW9uc1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IFwiI2NjY2NjY1wiO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHRcdFx0XHRcdFx0Y29uc29sZS5sb2coXCI+XCIgKyBhbm5vLmRlc2NyaXB0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjID0gY29sb3VyU2NoZW1lKGFubm8uZGVzY3JpcHRpb24pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC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xuICAgICAgICBpZiAodGhpcy5zdGF0ZSA9PT0gTW91c2VFdmVudENvZGVzLkRSQUdHSU5HKSB7XG4gICAgICAgICAgICAvLyB3ZSBhcmUgY3VycmVudGx5IGRyYWdnaW5nIHRoaW5ncyBhcm91bmRcbiAgICAgICAgICAgIHZhciBveCwgb3ksIG54LCBueTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5kcmFnRWxlbWVudC54ID09PSAndW5kZWZpbmVkJykgeyAvLyBpZiBub3QgYW4gTW9sZWN1bGVcbiAgICAgICAgICAgICAgICB2YXIgbm9kZXMgPSB0aGlzLmRyYWdFbGVtZW50LmludGVyYWN0b3JzO1xuICAgICAgICAgICAgICAgIHZhciBub2RlQ291bnQgPSBub2Rlcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBub2RlQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvdGVpbiA9IG5vZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBveCA9IHByb3RlaW4ueDtcbiAgICAgICAgICAgICAgICAgICAgb3kgPSBwcm90ZWluLnk7XG4gICAgICAgICAgICAgICAgICAgIG54ID0gb3ggLSBkeDtcbiAgICAgICAgICAgICAgICAgICAgbnkgPSBveSAtIGR5O1xuICAgICAgICAgICAgICAgICAgICBwcm90ZWluLnNldFBvc2l0aW9uKG54LCBueSk7XG4gICAgICAgICAgICAgICAgICAgIHByb3RlaW4uc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub2RlQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBub2Rlc1tpXS5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vaXRzIGEgcHJvdGVpbiAtIGRyYWcgaXQgVE9ETzogRFJBRyBTRUxFQ1RFRFxuICAgICAgICAgICAgICAgIG94ID0gdGhpcy5kcmFnRWxlbWVudC54O1xuICAgICAgICAgICAgICAgIG95ID0gdGhpcy5kcmFnRWxlbWVudC55O1xuICAgICAgICAgICAgICAgIG54ID0gb3ggLSBkeDtcbiAgICAgICAgICAgICAgICBueSA9IG95IC0gZHk7XG4gICAgICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRQb3NpdGlvbihueCwgbnkpO1xuICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmRyYWdTdGFydCA9IGM7XG4gICAgICAgIH1cblxuICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXRlID09PSBNb3VzZUV2ZW50Q29kZXMuUk9UQVRJTkcpIHtcbiAgICAgICAgICAgIC8vIERpc3RhbmNlIGZyb20gbW91c2UgeCBhbmQgY2VudGVyIG9mIHN0aWNrLlxuICAgICAgICAgICAgdmFyIF9keCA9IGMueCAtIHRoaXMuZHJhZ0VsZW1lbnQueFxuICAgICAgICAgICAgLy8gRGlzdGFuY2UgZnJvbSBtb3VzZSB5IGFuZCBjZW50ZXIgb2Ygc3RpY2suXG4gICAgICAgICAgICB2YXIgX2R5ID0gYy55IC0gdGhpcy5kcmFnRWxlbWVudC55O1xuICAgICAgICAgICAgLy9zZWUgaHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9BdGFuMiNNb3RpdmF0aW9uXG4gICAgICAgICAgICB2YXIgY2VudHJlVG9Nb3VzZUFuZ2xlUmFkcyA9IE1hdGguYXRhbjIoX2R5LCBfZHgpO1xuICAgICAgICAgICAgaWYgKHRoaXMud2hpY2hSb3RhdG9yID09PSAwKSB7XG4gICAgICAgICAgICAgICAgY2VudHJlVG9Nb3VzZUFuZ2xlUmFkcy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bilcbiAgICAgICAgICAgIG1pZGRsZWNsaWNrID0gKGV2dC5idXR0b24gPT09IDEpO1xuXG4gICAgICAgIHZhciBwID0gdGhpcy5nZXRFdmVudFBvaW50KGV2dCk7Ly8gc2VlbXMgdG8gYmUgY29ycmVjdCwgc2VlIGJlbG93XG4gICAgICAgIHZhciBjID0gdGhpcy5tb3VzZVRvU1ZHKHAueCwgcC55KTtcblxuICAgICAgICBpZiAodGhpcy5kcmFnRWxlbWVudCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoISh0aGlzLnN0YXRlID09PSBNb3VzZUV2ZW50Q29kZXMuRFJBR0dJTkcgfHwgdGhpcy5zdGF0ZSA9PT0gTW91c2VFdmVudENvZGVzLlJPVEFUSU5HKSkgeyAvL25vdCBkcmFnZ2luZyBvciByb3RhdGluZ1xuICAgICAgICAgICAgICAgIGlmIChyaWdodGNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFJJR0hUIGNsaWNrXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1pZGRsZWNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vY2FuJ3QgYmUgdXNlZD8gcHJvYmxlbSB3aXRoIElFIChzY3JvbGwgdGhpbmd5KVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHsgLy9sZWZ0IGNsaWNrOyBzaG93IG1hdGNoZXMgZm9yIGxpbmssIHRvZ2dsZSBmb3JtIGZvciBwcm90ZWluLCBzd2l0Y2ggc3RpY2sgc2NhbGVcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLmRyYWdFbGVtZW50LnggPT09ICd1bmRlZmluZWQnKSB7IC8vaWYgbm90IHByb3RlaW5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfiB0aGlzLmRyYWdFbGVtZW50LnNob3dEYXRhKCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZ0LnNoaWZ0S2V5KSB7IC8vaWYgc2hpZnQga2V5XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnN3aXRjaFN0aWNrU2NhbGUoYyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXF1ZW5jZUluaXRDb21wbGV0ZSA9PT0gdHJ1ZSl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuZHJhZ0VsZW1lbnQuZm9ybSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldEZvcm0oMSwgYyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRGb3JtKDAsIGMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvL34gdGhpcy5jaGVja0xpbmtzKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXRlID09PSBNb3VzZUV2ZW50Q29kZXMuUk9UQVRJTkcpIHtcbiAgICAgICAgICAgICAgICAvL3JvdW5kIHByb3RlaW4gcm90YXRpb24gdG8gbmVhcmVzdCA1IGRlZ3JlZXMgKGxvb2tzIG5lYXRlcilcbiAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldFJvdGF0aW9uKE1hdGgucm91bmQodGhpcy5kcmFnRWxlbWVudC5yb3RhdGlvbiAvIDUpICogNSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIH0gLy9lbmQg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yIGR5ID0gdGhpcy5kcmFnU3RhcnQueSAtIGMueTtcblxuICAgICAgICAgICAgaWYgKHRoaXMuc3RhdGUgPT09ICBNb3VzZUV2ZW50Q29kZXMuRFJBR0dJTkcpIHtcbiAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgY3VycmVudGx5IGRyYWdnaW5nIHRoaW5ncyBhcm91bmRcbiAgICAgICAgICAgICAgICB2YXIgb3gsIG95LCBueCwgbnk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLmRyYWdFbGVtZW50LnggPT09ICd1bmRlZmluZWQnKSB7IC8vIGlmIG5vdCBhbiBNb2xlY3VsZVxuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZXMgPSB0aGlzLmRyYWdFbGVtZW50LmludGVyYWN0b3JzO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZUNvdW50ID0gbm9kZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG5vZGVDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvdGVpbiA9IG5vZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgb3ggPSBwcm90ZWluLng7XG4gICAgICAgICAgICAgICAgICAgICAgICBveSA9IHByb3RlaW4ueTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG54ID0gb3ggLSBkeDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG55ID0gb3kgLSBkeTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3RlaW4uc2V0UG9zaXRpb24obngsIG55KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3RlaW4uc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5vZGVDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBub2Rlc1tpXS5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vaXRzIGEgcHJvdGVpbiAtIGRyYWcgaXQgVE9ETzogRFJBRyBTRUxFQ1RFRFxuICAgICAgICAgICAgICAgICAgICBveCA9IHRoaXMuZHJhZ0VsZW1lbnQueDtcbiAgICAgICAgICAgICAgICAgICAgb3kgPSB0aGlzLmRyYWdFbGVtZW50Lnk7XG4gICAgICAgICAgICAgICAgICAgIG54ID0gb3ggLSBkeDtcbiAgICAgICAgICAgICAgICAgICAgbnkgPSBveSAtIGR5O1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldFBvc2l0aW9uKG54LCBueSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuZHJhZ1N0YXJ0ID0gYztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5zdGF0ZSA9PT0gTW91c2VFdmVudENvZGVzLlJPVEFUSU5HKSB7XG4gICAgICAgICAgICAgICAgLy8gRGlzdGFuY2UgZnJvbSBtb3VzZSB4IGFuZCBjZW50ZXIgb2Ygc3RpY2suXG4gICAgICAgICAgICAgICAgdmFyIF9keCA9IGMueCAtIHRoaXMuZHJhZ0VsZW1lbnQueFxuICAgICAgICAgICAgICAgIC8vIERpc3RhbmNlIGZyb20gbW91c2UgeSBhbmQgY2VudGVyIG9mIHN0aWNrLlxuICAgICAgICAgICAgICAgIHZhciBfZHkgPSBjLnkgLSB0aGlzLmRyYWdFbGVtZW50Lnk7XG4gICAgICAgICAgICAgICAgLy9zZWUgaHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9B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WVudC54ID09PSAndW5kZWZpbmVkJykgeyAvL2lmIG5vdCBwcm90ZWluXG4gICAgICAgICAgICAgICAgICAgIC8vdGhpcy5kcmFnRWxlbWVudC5zaG93SUQoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5kcmFnRWxlbWVudC5mb3JtID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldEZvcm0oMSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldEZvcm0oMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAvL34gdGhpcy5jaGVja0xpbmtzKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodGhpcy5zdGF0ZSA9PT0gTW91c2VFdmVudENvZGVzLlJPVEFUSU5HKSB7XG4gICAgICAgICAgICAvL3JvdW5kIHByb3RlaW4gcm90YXRpb24gdG8gbmVhcmVzdCA1IGRlZ3JlZXMgKGxvb2tzIG5lYXRlcilcbiAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0Um90YXRpb24oTWF0aC5yb3VuZCh0aGlzLmRyYWdFbGVtZW50LnJvdGF0aW9uIC8gNSkgKiA1KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgfSAvL2VuZCBvZiBwcm90ZWluIGRyYWc7IGRvIG5vdGhpbmdcbiAgICB9XG4gICAgLy9+IGVsc2UgaWYgKC8qdGhpcy5zdGF0ZSAhPT0geGlORVQuQ29udHJvbGxlci5QQU5OSU5HICYmKi8gZXZ0LmN0cmxLZXkgPT09IGZhbHNlKSB7XG4gICAgICAgIC8vfiB0aGlzLmNsZWFyU2VsZWN0aW9uKCk7XG4gICAgLy9+IH1cbi8vflxuICAg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jZXNzaW9uID0geGlORVRfU3RvcmFnZS5hY2Nlc3Npb25Gcm9tSWQoaWQpO1xyXG4gICAgeGlORVRfU3RvcmFnZS5nZXRVbmlQcm90VHh0KGlkLCBmdW5jdGlvbihub05lZWQsIGpzb24pe1xyXG4gICAgICAgICAgICAvL34gdmFyIHNlcXVlbmNlID0gXCJcIjtcclxuICAgICAgICAgICAgLy9+IHZhciBsaW5lcyA9IHR4dC5zcGxpdCgnXFxuJyk7XHJcbiAgICAgICAgICAgIC8vfiB2YXIgbGluZUNvdW50ID0gbGluZXMubGVuZ3RoO1xyXG4gICAgICAgICAgICAvL34gZm9yICh2YXIgbCA9IDA7IGwgPCBsaW5lQ291bnQ7IGwrKyl7XHJcbiAgICAgICAgICAgICAgICAvL34gdmFyIGxpbmUgPSBsaW5lc1tsXTtcclxuICAgICAgICAgICAgICAgIC8vfiBpZiAobGluZS5pbmRleE9mKFwiU1FcIikgPT09IDApe1xyXG4gICAgICAgICAgICAgICAgICAgIC8vfiAvL3NlcXVlbmNlID0gbGluZTtcclxuICAgICAgICAgICAgICAgICAgICAvL34gbCsrO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vfiBmb3IgKGw7IGwgPCBsaW5lQ291bnQ7IGwrKyl7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfiBsaW5lID0gbGluZXNbbF07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfiBzZXF1ZW5jZSArPSBsaW5lO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vfiB9XHJcbiAgICAgICAgICAgICAgICAvL34gfVxyXG4gICAgICAgICAgICAvL34gfVxyXG4gICAgICAgICAgICBjYWxsYmFjayhpZCwganNvbi5zZXF1ZW5jZS5yZXBsYWNlKC9bXkEtWl0vZywgJycpKTtcclxuICAgICAgICB9XHJcbiAgICApO1xyXG59XHJcblxyXG54aU5FVF9TdG9yYWdlLmdldFVuaVByb3RGZWF0dXJlcyA9IGZ1bmN0aW9uIChpZCwgY2FsbG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ICAgICAgICBpZiAocGl4UGVyUmVzID4gOCkge1xuICAgICAgICAgICAgdGhpcy5zdGlja1pvb20gPSAwLjU7Ly90aGlzIGxvb2tzIGxpa2UgYSBoYWNrXG4gICAgICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHN2Z1AueCwgc3ZnUC55KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuc3RpY2tab29tID0gdGhpcy5zdGlja1pvb20gKiAzO1xuICAgICAgICAgICAgLy9tb3ZlIHN0aWNrIHNvIHNhbWUgcmVzaWR1ZSBpcyB1bmRlciBtb3VzZVxuICAgICAgICAgICAgdmFyIGR4ID0gdGhpcy54IC0gKHN2Z1AueCk7XG4gICAgICAgICAgICB2YXIgZHkgPSB0aGlzLnkgLSAoc3ZnUC55KTtcbiAgICAgICAgICAgIGlmICh0aGlzLnJvdGF0aW9uID09PSAwIHx8IHRoaXMucm90YXRpb24gPT09IDE4MCkge1xuICAgICAgICAgICAgICAgIGR5ID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vICAgICAgICAgICAgY29uc29sZS5sb2coZHggKyAnLCcgKyBkeSk7XG4gICAgICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHRoaXMueCArIChkeCAqIDIpLCB0aGlzLnkgKyAoZHkgKiAyKSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgLy8gd2hlbiBzZXR0aW5nIHRoZSBmb3JtIG9mIHByb3QncyxcbiAgICAvLyByZW1lbWJlciBmb2xsb3dpbmcgZG9lc24ndCBoYXBwZW4gd2hlbiB5b3UganVzdCBjYWxsIHRvU3RpY2soKTtcbiAgICB0aGlzLnNjYWxlKCk7XG4gICAgdGhpcy5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbn07XG5cblBvbHltZXIucHJvdG90eXBlLnNjYWxlID0gZnVuY3Rpb24oKSB7XG4gICAgdmFyIHByb3RMZW5ndGggPSAodGhpcy5zaXplKSAqI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IG5ldyBBcnJheSgpO1xuICAgIHZhciBTY2FsZU1halRpY2sgPSAxMDA7XG4gICAgdmFyIFNjYWxlVGlja3NQZXJMYWJlbCA9IDI7IC8vIHZhcmllcyB3aXRoIHNjYWxlP1xuICAgIHZhciBwaXhQZXJSZXMgPSBQb2x5bWVyLlVOSVRTX1BFUl9SRVNJRFVFICogdGhpcy5zdGlja1pvb207IC8vIC8gdGhpcy5jb250cm9sbGVyLno7XG4gICAgdmFyIHRpY2sgPSAtMTtcbiAgICB2YXIgbGFzdFRpY2tYID0gdGhpcy5nZXRSZXNYd2l0aFN0aWNrWm9vbSh0aGlzLnNpemUpO1xuXG4gICAgZm9yICh2YXIgcmVzID0gMTsgcmVzIDw9IHRoaXMuc2l6ZTsgcmVzKyspIHtcbiAgICAgICAgaWYgKHJlcyA9PT0gMSB8fFxuICAgICAgICAgICAgICAgICgocmVzICUgMTAwID09PSAwKSAmJiAoMjAwICogcGl4UGVyUmVzID4gUG9seW1lci5taW5YRGlzdCkpIHx8XG4gICAgICAgICAgICAgICAgKChyZXMgJSAxMCA9PT0gMCkgJiYgKDIwICogcGl4UGVyUmVzID4gUG9seW1lci5taW5YRGlzdCkpXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICB2YXIgdHggPSB0aGlzLmdldFJlc1h3aXRoU3RpY2tab29tKHJlcyk7XG4gICAgICAgICAgICBpZiAocGl4UGVyUmVzID49IDggfHwgcmVzICE9PSAxKSB7XG4gICAgICAgICAgICAgICAgdGlja0F0KHRoaXMsIHR4KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRpY2sgPSAodGljayArIDEpICUgU2NhbGVUaWNrc1BlckxhYmVsO1xuICAgICAgICAgICAgLy8gZG9lcyB0aGlzIG9uZSBnZXQgYSBsYWJlbD9cbiAgICAgICAgICAgIGlmICh0aWNrID09PSAwKSB7Ly8gJiYgdHggPiAyMCkge1xuICAgICAgICAgICAgICAgIGlmICgodHggKyBQb2x5bWVyLm1pblh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5ICE9PSB0cnVlKSB7XG4gICAgICAgIGlmIChmb3JtID09IDEpIHtcbiAgICAgICAgICAgIHRoaXMudG9TdGljaygpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy50b0NpcmNsZShzdmdQKTtcbiAgICAgICAgICAgIHZhciByID0gdGhpcy5nZXRCbG9iUmFkaXVzKCk7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICBkMy5zZWxlY3QodGhpcy5iYWNrZ3JvdW5kKS50cmFuc2l0aW9uKClcbiAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgLXIpLmF0dHIoXCJ5XCIsIC1yKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgciAqIDIpLmF0dHIoXCJoZWlnaHRcIiwgciAqIDIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJyeFwiLCByKS5hdHRyKFwicnlcIiwgcilcbiAgICAgICAgICAgICAgICAuZHVyYXRpb24oUG9seW1lci50cmFuc2l0aW9uVGltZSk7XG4gICAgICAgICAgICBkMy5zZWxlY3QodGhpcy5vdXRsaW5lKS50cmFuc2l0aW9uKClcbiAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgLXIpLmF0dHIoXCJ5XCIsIC1yKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgciAqIDIpLmF0dHIoXCJoZWlnaHRcIiwgciAqIDIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJyeFwiLCByKS5hdHRyKFwicnlcIiwgcilcbiAgICAgICAgICAgICAgICAuZHVyYXRpb24oUG9seW1lci50cmFuc2l0aW9uVGltZSk7XG4gICAgICAgICAgICBkMy5zZWxlY3QodGhpcy5hbm5vdGF0aW9uc1N2Z0dyb3VwKS50cmFuc2l0aW9uKClcbiAgICAgICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBcInNjYWxlKDEsIDEpXCIpXG4gICA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gIGZvciAodmFyIG0gPSAwOyBtIDwgaU1vZENvdW50OyBtKyspIHtcbiAgICAgICAgICAgIHZhciBtb2QgPSBtb2RzW21dO1xuICAgICAgICAgICAgaWYgKG1vZC5zaG93bikge1xuICAgICAgICAgICAgICAgIHZhciBzZWxlY3RMaW5lID0gZDMuc2VsZWN0KG1vZC5saW5lKTtcbiAgICAgICAgICAgICAgICBzZWxlY3RMaW5lLmF0dHIoXCJmaWxsXCIsIFwibm9uZVwiKTtcbiAgICAgICAgICAgICAgICBzZWxlY3RMaW5lLmF0dHIoXCJkXCIsIFwiTSAwLDAgTCAwLDBcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9Ki9cblxuICAgIHZhciBzZWxmID0gdGhpcztcbiAgICBpZiAodGhpcy5hbm5vdGF0aW9ucykge1xuICAgICAgICB2YXIgYW5ub3RzID0gdGhpcy5hbm5vdGF0aW9ucztcbiAgICAgICAgdmFyIGNhID0gYW5ub3RzLmxlbmd0aDtcbiAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPCBjYTsgYSsrKSB7XG4gICAgICAgICAgICB2YXIgYW5ubyA9IGFubm90c1thXTtcbiAgICAgICAgICAgIHZhciBwaWVTbGljZSA9IGFubm8ucGllU2xpY2U7XG4gICAgICAgICAgICBkMy5zZWxlY3QocGllU2xpY2UpLnRyYW5zaXRpb24oKS5hdHRyKFwiZFwiLCB0aGlzLmdldEFubm90YXRpb25QaWVTbGljZUFwcHJveGltYXRlUGF0aChhbm5vKSlcbiAgICAgICAgICAgICAgICAuZHVyYXRpb24oUG9seW1lci50cmFuc2l0aW9uVGltZSkuZWFjaChcImVuZFwiLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBiID0gMDsgYiA8IGNhOyBiKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYW5ub0IgPSBzZWxmLmFubm90YXRpb25zW2JdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzID09PSBhbm5vQi5waWVTbGljZSl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5hdHRyKFwiZFwiLCBzZWxmLmdldEFubm90YXRpb25QaWVTbGljZUFyY1BhdGgoYW5ub0IpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIG9yaWdpbmFsU3RpY2tab29tID0gdGhpcy5zdGlja1pvb207XG4gICAgdmFyIG9yaWdpbmFsUm90YXRpb24gPSB0aGlzLnJvdGF0aW9uO1xuICAgIHZhciBjdWJpY0luT3V0ID0gZDMuZWFzZSgnY3ViaWMtaW4tb3V0Jyk7XG4gICAgZDMudGltZXIoZnVuY3Rpb24oZWxhcHNlZCkge1xuICAgICAgcmV0dXJuIHVwZGF0ZShlbGFwc2VkIC8gUG9seW1lci50cmFuc2l0aW9uVGltZSk7XG4gICAgfSk7XG5cbiAgICBmdW5jdGlvbiB1cGRhdGUoaW50ZXJwKSB7XG4gICAgICAgIHZhciBsYWJlbFRyYW5zZm9ybSA9IGQzLnRyYW5zZm9ybShzZWxmLmxhYmVsU1ZHLmdldEF0dHJpYnV0ZShcInRyYW5zZm9ybVwiKSk7XG4gICAgICAgIHZhciBrID0gc2VsZi5jb250cm9sbGVyLnN2Z0VsZW1lbnQuY3JlYXRlU1ZHTWF0cml4KCkucm90YXRlKGxhYmVsVHJhbnNmb3JtLnJvdGF0ZSkudHJhbnNsYXRlKGxhYmVsVHJhbnNsYXRlSW50ZXJwb2woY3ViaWNJbk91dChpbnRlcnApKSwgTW9sZWN1bGUubGFiZWxZKTsvLy5zY2FsZSh6KS50cmFuc2xhdGUoLWMueCwgLWMueSk7XG4gICAgICAgI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zICE9IG51bGwpIHtcbiAgICAgICAgdmFyIG1vZHMgPSB0aGlzLmxpbmtlck1vZGlmaWNhdGlvbnMucmVzaWR1ZUxpbmtzLnZhbHVlcygpO1xuICAgICAgICB2YXIgaU1vZENvdW50ID0gbW9kcy5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIG0gPSAwOyBtIDwgaU1vZENvdW50OyBtKyspIHtcbiAgICAgICAgICAgIHZhciBtb2QgPSBtb2RzW21dO1xuICAgICAgICAgICAgaWYgKG1vZC5zaG93bikge1xuICAgICAgICAgICAgICAgIHZhciBwYXRoID0gdGhpcy5nZXRSZXNpZHVlTGlua1BhdGgobW9kKTtcbiAgICAgICAgICAgICAgICBkMy5zZWxlY3QobW9kLmxpbmUpLmF0dHIoXCJkXCIsXCJNIDAsMCBMIDAsMCBMIDAsMCBMIDAsMFwiKTtcbiAgICAgICAgICAgICAgICBkMy5zZWxlY3QobW9kLmxpbmUpLnRyYW5zaXRpb24oKS5hdHRyKFwiZFwiLHBhdGgpXG4gICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihQb2x5bWVyLnRyYW5zaXRpb25UaW1lKTtcbiAgICAgICAgICAgICAgICBkMy5zZWxlY3QobW9kLmhpZ2hsaWdodExpbmUpLmF0dHIoXCJkXCIsXCJNIDAsMCBMIDAsMFwiKTtcbiAgICAgICAgICAgICAgICBkMy5zZWxlY3QobW9kLmhpZ2hsaWdodExpbmUpLnRyYW5zaXRpb24oKS5hdHRyKFwiZFwiLHBhdGgpXG4gICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihQb2x5bWVyLnRyYW5zaXRpb25UaW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0qL1xuICAgIGlmICh0aGlzLmFubm90YXRpb25zKSB7XG4gICAgICAgIHZhciBhbm5vdHMgPSB0aGlzLmFubm90YXRpb25zO1xuICAgICAgICB2YXIgY2EgPSBhbm5vdHMubGVuZ3RoO1xuICAgICAgICBmb3IgKHZhci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JvdXAucmVtb3ZlQ2hpbGQodGhpcy5oaWdobGlnaHRHbHlwaCk7XHJcblx0fVxyXG59O1xyXG5cclxuLy8gdXBkYXRlIHRoZSBsaW5rcyhwb2x5Z29ucy9saW5lcykgdG8gZml0IHRvIHRoZSBwcm90ZWluXHJcblNlcXVlbmNlTGluay5wcm90b3R5cGUuc2V0TGlua0Nvb3JkaW5hdGVzID0gZnVuY3Rpb24oaW50ZXJhY3Rvcikge1xyXG5cdCAgICBmdW5jdGlvbiBpc051bWJlcih0aGluZykge1xyXG4gICAgICAgICAgICByZXR1cm4gKCFpc05hTihwYXJzZUZsb2F0KHRoaW5nKSkgJiYgaXNGaW5pdGUodGhpbmcpKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGZ1bmN0aW9uIGdldFBhdGhTZWdtZW50cyhtaWRQb2ludCwgY29udHJvbFBvaW50LCBzdGFydFJlcywgZW5kUmVzLCBpbnRlcmFjdG9yLCB5T2Zmc2V0KSB7XHJcbiAgICAgICAgICAgIHZhciBzdGFydFBvaW50LCBlbmRQb2ludDtcclxuICAgICAgICAgICAgaWYgKGludGVyYWN0b3IuZm9ybSA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgc3RhcnRQb2ludCA9IGludGVyYWN0b3IuZ2V0UG9zaXRpb24oKTtcclxuICAgICAgICAgICAgICAgIGVuZFBvaW50ID0gc3RhcnRQb2ludDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHN0YXJ0UG9pbnQgPSBpbnRlcmFjdG9yLmdldFJlc2lkdWVDb29yZGluYXRlcyhzdGFydFJlcywgeU9mZnNldCk7XHJcbiAgICAgICAgICAgICAgICBlbmRQb2ludCA9IGludGVyYWN0b3IuZ2V0UmVzaWR1ZUNvb3JkaW5hdGVzKGVuZFJlcywgeU9mZnNldCk7XHJcblxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiAnIFEnICsgY29udHJvbFBvaW50WzBdICsgJywnICsgY29udHJvbFBvaW50WzFdICsgJyAnICsgc3RhcnRQb2ludFswXSArICcsJyArIHN0YXJ0UG9pbnRbMV0gK1xyXG4gICAgICAgICAgICAgICAgICAgICcgTCcgKyBlbmRQb2ludFswXSArICcsJyArIGVuZFBvaW50WzFdICtcclxuICAgICAgICAgICAgICAgICAgICAnIFEnICsgY29udHJvbFBvaW50WzBdICsgJywnICsgY29udHJvbFBvaW50WzFdICsgJyAnICsgbWlkUG9pbnRbMF0gKyAnLCcgKyBtaWRQb2ludFsxXTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGZ1bmN0aW9uIHNlcXVlbmNlRGF0YU1pZFBvaW50KHNlcXVlbmNlRGF0YSwgaW50ZXJhY3Rvcikge1xyXG5cdFx0Ly9nZXQgdGhlIHNtYWxsZXN0IHN0YXJ0IGFuZCB0aGUgYmlnZ2VzdCBlbmRcclxuICAgICAgICAgICAgdmFyIGxvd2VzdExpbmtlZFJlcyA9IG51bGwsIGhpZ2hlc3RMaW5rZWRSZXMgPSBudWxsO1xyXG4gICAgICAgICAgICB2YXIgc2RDb3VudCA9IHNlcXVlbmNlRGF0YS5sZW5ndGg7XHJcbiAgICAgICAgICAgIGZvciAodmFyIHMgPSAwOyBzIDwgc2RDb3VudDsgcysrKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgc2VxRGF0dW0gPSBzZXF1ZW5jZURhdGFbc107XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHBhcnNlRmxvYXQoc2VxRGF0dW0uc3RhcnQpKSAmJiBpc0Zpbml0ZShzZXFEYXR1bS5zdGFydCkpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnQgPSBzZXFEYXR1bS5zdGFydCAqIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxvd2VzdExpbmtlZFJlcyA9PT0gbnVsbCB8fCBzdGFydCA8IGxvd2VzdExpbmtlZFJlcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsb3dlc3RMaW5rZWRSZXMgPSBzdGFydDtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHBhcnNlRmxvYXQoc2VxRGF0dW0udW5jZXJ0YWluU3RhcnQpKSAmJiBpc0Zpbml0ZShzZXFEYXR1bS51bmNlcnRhaW5TdGFydCkpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgdW5jZXJ0YWluU3RhcnQgPSBzZXFEYXR1bS51bmNlcnRhaW5TdGFydCAqIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxvd2VzdExpbmtlZFJlcyA9PT0gbnVsbCB8fCB1bmNlcnRhaW5TdGFydCA8IGxvd2VzdExpbmtlZFJlcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsb3dlc3RMaW5rZWRSZXMgPSB1bmNlcnRhaW5TdGFydDtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHBhcnNlRmxvYXQoc2VxRGF0dW0uZW5kKSkgJiYgaXNGaW5pdGUoc2VxRGF0dW0uZW5kKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBlbmQgPSBzZXFEYXR1bS5lbmQgKiAxO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChoaWdoZXN0TGlua2VkUmVzID09PSBudWxsIHx8IGVuZCA+IGhpZ2hlc3RMaW5rZWRSZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGVzdExpbmtlZFJlcyA9IGVuZDtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHBhcnNlRmxvYXQoc2VxRGF0dW0udW5jZXJ0YWluRW5kKSkgJiYgaXNGaW5pdG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IC0gZnJvbU1vbGVjdWxlLnJvdGF0aW9uKTtcclxuICAgICAgICBpZiAob3V0IDwgMCkge1xyXG4gICAgICAgICAgICBvdXQgKz0gMzYwO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgZnlPZmZzZXQgPSAxMDtcclxuICAgICAgICBpZiAob3V0IDwgMTgwKSB7XHJcbiAgICAgICAgICAgIGZ5T2Zmc2V0ID0gLTEwO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgZlJvdFJhZCA9IChmcm9tTW9sZWN1bGUucm90YXRpb24gLyAzNjApICogTWF0aC5QSSAqIDI7XHJcbiAgICAgICAgaWYgKG91dCA+IDE4MCkge1xyXG4gICAgICAgICAgICBmUm90UmFkID0gZlJvdFJhZCAtIE1hdGguUEk7XHJcbiAgICAgICAgfVxyXG5cdFx0Ly9ub3cgZm9yICd0bycgaW50ZXJhY3RvclxyXG4gICAgICAgIG91dCA9IChhYm1wRGVnIC0gdG9Nb2xlY3VsZS5yb3RhdGlvbik7XHJcbiAgICAgICAgaWYgKG91dCA8IDApIHtcclxuICAgICAgICAgICAgb3V0ICs9IDM2MDtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHR5T2Zmc2V0ID0gMTA7XHJcbiAgICAgICAgaWYgKG91dCA+IDE4MCkge1xyXG4gICAgICAgICAgICB0eU9mZnNldCA9IC0xMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHRSb3RSYWQgPSAodG9Nb2xlY3VsZS5yb3RhdGlvbiAvIDM2MCkgKiBNYXRoLlBJICogMjtcclxuICAgICAgICBpZiAob3V0IDwgMTgwKSB7XHJcbiAgICAgICAgICAgIHRSb3RSYWQgPSB0Um90UmFkIC0gTWF0aC5QSTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhciBmdE1pZCA9IFtmTWlkWzBdICsgKDMwICogTWF0aC5zaW4oZlJvdFJhZCkgKiB0aGlzLmNvbnRyb2xsZXIueiksXHJcbiAgICAgICAgIC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ICsgXCIgc2NhbGUoXCIgKyAodGhpcy5jb250cm9sbGVyLnopICsgXCIpXCIpO1xyXG5cdH1cclxuXHR0aGlzLmxpbmUuc2V0QXR0cmlidXRlKFwidHJhbnNmb3JtXCIsIFwidHJhbnNsYXRlKFwiICsgaW50ZXJhY3Rvci54XHJcblx0XHRcdCsgXCIgXCIgKyBpbnRlcmFjdG9yLnkgKyBcIilcIiArIFwiIHNjYWxlKFwiICsgKHRoaXMuY29udHJvbGxlci56KSArIFwiKVwiKTtcclxuXHR0aGlzLmhpZ2hsaWdodExpbmUuc2V0QXR0cmlidXRlKFwidHJhbnNmb3JtXCIsIFwidHJhbnNsYXRlKFwiICsgaW50ZXJhY3Rvci54XHJcblx0XHRcdCsgXCIgXCIgKyBpbnRlcmFjdG9yLnkgKyBcIilcIiArIFwiIHNjYWxlKFwiICsgKHRoaXMuY29udHJvbGxlci56KSArIFwiKVwiKTtcclxufTtcclxuXHJcbm1vZHVsZS5leHBvcnRzID0gVW5hcnlMaW5rO1xyXG4iXX0= diff --git a/src/controller/Controller.js b/src/controller/Controller.js index f9e2837..4b16467 100644 --- a/src/controller/Controller.js +++ b/src/controller/Controller.js @@ -985,7 +985,7 @@ xiNET.Controller.prototype.setAnnotations = function(annotationChoice) { for (m = 0; m < molCount; m++) { var mol = mols[m]; for (var a = 0; a < mol.annotations.length; a++){ - categories.add(mol.annotations[a].name); + categories.add(mol.annotations[a].description); } } var catCount = categories.values().length; @@ -993,7 +993,7 @@ xiNET.Controller.prototype.setAnnotations = function(annotationChoice) { var colourScheme;// = null; if (catCount < 3){catCount = 3;} //~ if (catCount < 21) { - if (catCount < 6) { + if (catCount < 5) { //~ var reversed = colorbrewer.Accent[catCount].slice().reverse(); //~ colourScheme = d3.scale.ordinal().range(reversed); colourScheme = d3.scale.ordinal().range(colorbrewer.Set1[4]);