Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥模板.Q小白教程@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbXSxcInNhdmVkXCI6ZmFsc2UsXCJ0aXRsZVwiOlwi6KeG55WM6K665Z2bUlwiLFwidmVyc2lvblwiOjAsXCJ1cmxcIjpcImh0dHBzOi8vaGFpa3Vvc2hpamllLmNuL3RvcGljLzg0NDAjZnlwYWdlI25vSGlzdG9yeSM7Z2V0O1VURi04O3tVc2VyLUFnZW50QEFuZHJvaWQmJkNvb2tpZUB1c2VyVG9rZW49MmQ3ZWY2NjlkZmM5NGRhNGI0NzAxMjhjMjc4NGFmNDF9XCIsXCJjb2xfdHlwZVwiOlwidGV4dF8xXCIsXCJmaW5kX3J1bGVcIjpcImpzOlxcbnZhciByZXMgPSB7fTtcXG52YXIgZCA9IFtdO1xcbnZhciB1cmxTcGxpdHMgPSBNWV9VUkwuc3BsaXQoXFxcIiNcXFwiKTtcXG52YXIgbVVybCA9IHVybFNwbGl0c1swXTtcXG52YXIgcGFnZSA9IHVybFNwbGl0c1sxXTtcXG52YXIgY29sVHlwZSA9ICdyaWNoX3RleHQnO1xcblxcbi8vIOaYr+WQpuaYvuekuuW4luWtkOWIhuexu++8jOaYvuekui8xIOS4jeaYvuekui8wXFxudmFyIHNob3dNZXRhID0gMTtcXG4vLyDluJbl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xcbiAgICAgICAgICAgIG5vTW9yZSA9IG5vTW9yZSA9PT0gJycgPyAnMCcgOiBub01vcmU7XFxuICAgICAgICAgICAgdXJsVGVtcGxhdGUgPSB1cmxUZW1wbGF0ZS5yZXBsYWNlKFxcXCJ7ZW50aXR5SWR9XFxcIiwgZW50aXR5SWQpO1xcbiAgICAgICAgICAgIHVybCA9IHVybFRlbXBsYXRlLnJlcGxhY2UoXFxcIntjdXJzb3J9XFxcIiwgY3Vyc29yKTtcXG4gICAgICAgICAgICAvLyB1cmwgPSBcXFwiaHR0cDovL2hhaWt1b3NoaWppZS5jbi9hcGkvY29tbWVudC9saXN0P2VudGl0eVR5cGU9dG9waWMmZW50aXR5SWQ9Mzk4JmN1cnNvcj05MTgzXFxcIjtcXG4gICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGpzb24gPSBKU09OLnBhcnNlKGZldGNoKHVybCwge30pKTtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBqc29uLmRhdGE7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHRzID0gZGF0YS5yZXN1bHRzO1xcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0cyAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbm93VGltZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHtrZXk6ICdjdXJzb3InLCB2YWx1ZTogZGF0YS5jdXJzb3J9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRpbWVEaWZmKG5vd1RpbWUsIGNyZWF0ZVRpbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBEYXRlLnByb3RvdHlwZS5mb3JtYXQgPSBmdW5jdGlvbiAoZm10KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIk0rXFxcIjogdGhpcy5nZXRNb250aCgpICsgMSwgICAgICAgICAgICAgICAgIC8v5pyI5Lu9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZCtcXFwiOiB0aGlzLmdldERhdGUoKSwgICAgICAgICAgICAgICAgICAgIC8v5pelXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaCtcXFwiOiB0aGlzLmdldEhvdXJzKCksICAgICAgICAgICAgICAgICAgIC8v5bCP5pe2XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibStcXFwiOiB0aGlzLmdldE1pbnV0ZXMoKSwgICAgICAgICAgICAgICAgIC8v5YiGXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicytcXFwiOiB0aGlzLmdldFNlY29uZHMoKSwgICAgICAgICAgICAgICAgIC8v56eSXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicStcXFwiOiBNYXRoLmZsb29yKCh0aGlzLmdldE1vbnRoKCkgKyAzKSAvIDMpLCAvL+Wto+W6plxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlNcXFwiOiB0aGlzLmdldE1pbGxpc2Vjb25kcygpICAgICAgICAgICAgIC8v5q+r56eSXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvKHkrKS8udGVzdChmbXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbXQgPSBmbXQucmVwbGFjZShSZWdFeHAuJDEsICh0aGlzLmdldEZ1bGxZZWFyKCkgKyBcXFwiXFxcIikuc3Vic3RyKDQgLSBSZWdFeHAuJDEubGVuZ3RoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgayBpbiBvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3IFJlZ0V4cChcXFwiKFxcXCIgKyBrICsgXFxcIilcXFwiKS50ZXN0KGZtdCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbXQgPSBmbXQucmVwbGFjZShSZWdFeHAuJDEsIChSZWdFeHAuJDEubGVuZ3RoID09PSAxKSA/IChvW2tdKSA6ICgoXFxcIjAwXFxcIiArIG9ba10pLnN1YnN0cigoXFxcIlxcXCIgKyBvW2tdKS5sZW5ndGgpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZtdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aW1lID0gbmV3IERhdGUoY3JlYXRlVGltZSkuZm9ybWF0KFxcXCJ5eXl5LU1NLWRkIGhoOm1tOnNzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVEaWZmID0gbm93VGltZSAtIGNyZWF0ZVRpbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRheXMgPSBNYXRoLmZsb29yKHRpbWVEaWZmIC8gKDI0ICogMzYwMCAqIDEwMDApKTsgLy8g6K6h566X5Ye65aSp5pWwXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRheUxlYXZlID0gdGltZURpZmYgJSAoMjQgKiAzNjAwICogMTAwMCk7IC8vIOiuoeeul+WkqeaVsOWQjuWJqeS9meeahOaXtumXtFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3VycyA9IE1hdGguZmxvb3IoZGF5TGVhdmUgLyAoMzYwMCAqIDEwMDApKTsgLy8g6K6h566X5aSp5pWw5ZCO5Ymp5L2Z55qE5bCP5pe25pWwXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvdXJMZWF2ZSA9IHRpbWVEaWZmICUgKDM2MDAgKiAxMDAwKTsgLy8g6K6h566X5Ymp5L2Z5bCP5pe25ZCO5Ymp5L2Z55qE5q+r56eS5pWwXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1pbnV0ZXMgPSBNYXRoLmZsb29yKGhvdXJMZWF2ZSAvICg2MCAqIDEwMDApKTsgLy8g6K6h566X5Ymp5L2Z55qE5YiG6ZKf5pWwXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPCBkYXlzICYmIGRheXMgPCAzMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lID0gZGF5cyArIFxcXCLlpKnliY1cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkYXlzIDwgMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaG91cnMgPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lID0gaG91cnMgKyBcXFwi5bCP5pe25YmNXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWUgPSBtaW51dGVzICsgXFxcIuWIhumSn+WJjVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpbWU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3VsdHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVzdWx0c1tpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcXVvdGVDb250ZW50ID0gJyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5xdW90ZSAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHJlc3VsdC5xdW90ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSBwYXJzZURvbUZvckh0bWwocXVvdGUuY29udGVudCwgJ2JvZHkmJkh0bWwnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5pY2tuYW1lID0gcXVvdGUudXNlci5uaWNrbmFtZTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0dyb290QmFieS9hcnRpY2xlL2RldGFpbHMvOTk5ODAzOTVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNyZWF0ZVRpbWUgPSBxdW90ZS51c2VyLmNyZWF0ZVRpbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aW1lID0gdGltZURpZmYobm93VGltZSwgY3JlYXRlVGltZSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gY29udGVudFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC88YVtcXFxcc1xcXFxTXS4qPzxcXFxcL2E+L2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb21tZW50UmVwbHlUZXh0QXJyYXkgPSBjb250ZW50Lm1hdGNoKC88cFtcXFxcc1xcXFxTXS4qPzxcXFxcL3A+L2cpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCA9IGFiYnJldmlhdGVSZXBseVRleHQoY29udGVudCwgY29tbWVudFJlcGx5VGV4dEFycmF5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1b3RlQ29udGVudCA9ICc8YmxvY2txdW90ZSBjbGFzcz1cXFwiY29tbWVudC1xdW90ZVxcXCI+PGRpdiBjbGFzcz1cXFwiY29tbWVudC1xdW90ZS11c2VyXFxcIj48YSBjbGFzcz1cXFwicXVvdGUtbmlja25hbWVcXFwiPjxmb250IGNvbG9yPVxcXCInICsgcXVvdGVVc2VyQ29sb3IgKyAnXFxcIj4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG5pY2tuYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICc8L2ZvbnQ+PC9hPjxzcGFuIGNsYXNzPVxcXCJxdW90ZS10aW1lXFxcIj48Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnXFxcXHRcXFxcdCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdGltZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnPC9mb250Pjwvc3Bhbj48L2Rpdj48ZGl2IGl0ZW1wcm9wPVxcXCJ0ZXh0XFxcIj4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGNvbnRlbnRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgJzwvZGl2PjwvYmxvY2txdW90ZT4nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9ICc8cD4nICsgcmVzdWx0LmNvbnRlbnQgKyAnPC9wPic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1ldGEgPSAnPGJyPjxzbWFsbD48Zm9udCBjb2xvcj1cXFwiJyArIHVzZXJDb2xvciArICdcXFwiPidcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyByZXN1bHQudXNlci5uaWNrbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArICc8L2ZvbnQ+XFxcXHRcXFxcdDxmb250IGNvbG9yPVxcXCJncmV5XFxcIj4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdGltZURpZmYobm93VGltZSwgcmVzdWx0LmNyZWF0ZVRpbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgJ1xcXFx0XFxcXHTlm57lpI0nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgJzwvZm9udD48L3NtYWxsPic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRDb250ZW50ID0gcXVvdGVDb250ZW50ICsgY29udGVudCArIG1ldGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gY29tbWVudENvbnRlbnRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxpbWcgY2xhc3M9XFxcImF2YXRhcihbXFxcXHNcXFxcU10qPyk+L2csICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvKDwocCkoW1xcXFxzXFxcXFNdKj8pPil8PHA+fDxcXFxcL3A+L2csICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZVdpdGhDYWxsYmFjaygvPGltZyAoc3JjfGRhdGEtc3JjKT1cXFwiKC4qPylcXFwiKFtcXFxcc1xcXFxTXSo/KT4vZywgXFxcIjxpbWcgZGF0YS12PlxcXCIsIGltZ1RhZ1JlcGxhY2VtZW50MilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxpbWcoW1xcXFxzXFxcXFNdKj8pPi9nLCBpbWdFcnJvcilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxzaG93aW1nL2csICc8aW1nJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBNWV9VUkwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5vTW9yZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPHA+PC9wPlxcXCIgKyAnPGNlbnRlcj48Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+5bey5peg5pu05aSa6K+E6K66PC9mb250PjwvY2VudGVyPicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHtrZXk6ICdub01vcmUnICsgZW50aXR5SWQsIHZhbHVlOiAxfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxufSBlbHNlIHtcXG4gICAgdmFyIGh0bWwgPSBnZXRS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xcXCJncmV5XFxcIj4nICsgcGFyc2VEb21Gb3JIdG1sKG1ldGFJdGVtc1swXSwgJ1RleHQnKVxcbiAgICAgICAgICAgICAgICArICcgICdcXG4gICAgICAgICAgICAgICAgKyBwYXJzZURvbUZvckh0bWwobWV0YUl0ZW1zWzFdLCAnVGV4dCcpXFxuICAgICAgICAgICAgICAgICsgJyAgJ1xcbiAgICAgICAgICAgICAgICArICc8L2ZvbnQ+PGZvbnQgY29sb3I9XFxcIicgKyBub2RlQ29sb3IgKyAnXFxcIj4nICsgbWV0YU5vZGUgKyAnPC9mb250Pjxmb250IGNvbG9yPVxcXCJncmV5XFxcIj4nO1xcbiAgICAgICAgICAgIGxldCBtZXRhVGFncyA9IHBhcnNlRG9tRm9yQXJyYXkoJzxkaXY+JyArIG1ldGFJdGVtc1szXSArICc8L2Rpdj4nLCAnZGl2JiYudGFnJyk7XFxuICAgICAgICAgICAgLy8gc2V0RXJyb3IoSlNPTi5zdHJpbmdpZnkobWV0YVRhZ3MpKTtcXG4gICAgICAgICAgICBsZXQgbWV0YVRhZyA9ICcnO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWV0YVRhZ3MubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbWV0YVRhZyA9IChtZXRhVGFnID09PSAnJyA/IG1ldGFUYWcgOiAobWV0YVRhZyArICcgICcpKVxcbiAgICAgICAgICAgICAgICAgICAgKyBwYXJzZURvbUZvckh0bWwobWV0YVRhZ3NbaV0sICdUZXh0JylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gbWV0YVRhZyA9IG1ldGFUYWcucmVwbGFjZSgn572u6aG2JywgJ+KAnOKAnOe9rumhtuKAneKAnScpO1xcbiAgICAgICAgICAgIG1ldGFTaXplID0gbWV0YVNpemUgPT09ICcnID8gJ3NtYWxsJyA6IG1ldGFTaXplO1xcbiAgICAgICAgICAgIG1ldGEgPSAnPCcgKyBtZXRhU2l6ZSArICc+JyArIG1ldGEgKyAnICAnICsgbWV0YVRhZyArICc8L2ZvbnQ+PC8nICsgbWV0YVNpemUgKyAnPicgKyAnPGJyPic7XFxuICAgICAgICAgICAgLy8gc2V0RXJyb3IobWV0YSk7XFxuICAgICAgICB9XFxuXFxuICAgICAgICAvLyDwn5GN8J+Pu+KdpO+4j/Cfp6HimaHimaXwn5Ks8J+Rge+4j+Kev/CTgbpcXG4gICAgICAgIGlmICh1c2VFbW9qaSlcXG4gICAgICAgICAgICBjb3VudCA9IGNvdW50LnJlcGxhY2UoXFxcIuiOt+i1nu+8mlxcXCIsIFxcXCLinaTvuI8gXFxcIilcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoXFxcIuivhOiuuu+8mlxcXCIsIFxcXCLwn5KsIFxcXCIpXFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKFxcXCLmn6XnnIvvvJpcXFwiLCBcXFwi8J+Rge+4jyBcXFwiKTtcXG5cXG4gICAgICAgIGxldCBoZWFkZXIgPSBcXFwiXFxcIiArIHRpdGxlICsgJ1xcXFx0PHNtYWxsPjxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48YSBocmVmPVxcXCInICsgTVlfVVJMICsgJ1xcXCI+W+afpeeci+WOn+aWh108L2E+PC9mb250Pjwvc21hbGw+JyArIFxcXCI8YnI+XFxcIiArIG1ldGEgKyBjb3VudCArICcnO1xcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaGVhZGVyLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjsgaSsrKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgIGlmIChzaG93Q29udGVudCkge1xcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCAnLmNvbnRlbnQmJkh0bWwnKVxcbiAgICAgICAgICAgICAgICAucmVwbGFjZVdpdGhDYWxsYmFjaygvPGltZyAoc3JjfGRhdGEtc3JjKT1cXFwiKC4qPylcXFwiKFtcXFxcc1xcXFxTXSo/KT4vZywgXFxcIjxpbWcgZGF0YS12PlxcXCIsIGltZ1RhZ1JlcGxhY2VtZW50MilcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxpbWcoW1xcXFxzXFxcXFNdKj8pPi9nLCBpbWdFcnJvcilcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxzaG93aW1nL2csICc8aW1nJylcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLyg8KGRpdikoW1xcXFxzXFxcXFNdKj8pPil8PGRpdj58PFxcXFwvZGl2Pi9nLCAnJyk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCI8cD48L3A+XFxcIiArIHRpdGxlXFxuICAgICAgICAgICAgICAgICxcXG4gICAgICAgICAgICAgICAgZGVzYzogJycsXFxuICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgcmVnRXhwID0gLyguKj8p77+lKC4qPynvv6UoLiopLztcXG4gICAgICAgIGlmIChqcy5pbmRleE9mKCc+5rW36ZiUJykgIT09IC0xKSB7XFxuXFxuICAgICAgICAgICAgLyppZiAoc2hvd0NvbnRlbnQpIHtcXG4gICAgICAgICAgICBmb3IodmFyIGkgPSAwOyBpIDwgMjsgaSsrKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0qL1xcblxcbiAgICAgICAgICAgIGxldCBjb2wgPSBcXFwidGV4dF8xXFxcIjtcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IGpzLm1hdGNoKC8+5rW36ZiUW1xcXFxzXFxcXFNdKj88XFxcXC8vZyk7XFxuICAgICAgICAgICAgaWYgKGxpc3QgIT0gbnVsbCAmJiBsaXN0Lmxlbmd0aCAhPT0gMCkgaGFzUnVsZSA9IDE7XFxuICAgICAgICAgICAgaWYgKGxpc3QgIT0gbnVsbCAmJiBsaXN0Lmxlbmd0aCA+IDEpIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPHA+PC9wPlxcXCIgKyBcXFwiPGJpZz48Yj7mnKzmlofmiYDmnInop4TliJnkuIDplK7lr7zlhaU8L2I+PC9iaWc+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gbGlzdFtqXS5zcGxpdCgnPicpWzFdLnNwbGl0KCc8LycpWzBdO1xcbiAgICAgICAgICAgICAgICBsZXQgbVRpdGxlID0gdGl0bGU7XFxuXFxuICAgICAgICAgICAgICAgIGlmIChyZWdFeHAudGVzdCh0aXRsZSkgPT09IHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbCA9IFxcXCJ0ZXh0XzNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09PSAxKSBtVGl0bGUgPSBcXFwi5LiA6ZSu5a+85YWlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0Lmxlbmd0aCA+IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB2YXIgcmVnRXhwMSA9IC8odGl0bGVcXFwiOlxcXCIoLio/KVxcXCIpfChiYXNlNjQ6XFxcXC9cXFxcL0AoLio/KUApfCgoLio/KUApLztcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXRFcnJvciAoUmVnRXhwLiQyKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1UaXRsZSA9IFJlZ0V4cC4kMztcXG4gICAgICAgICAgICAgICAgICAgICAgICBtVGl0bGUgPSAobVRpdGxlICE9IG51bGwgJiYgbVRpdGxlICE9PSAnJykgPyBtVGl0bGUgOiB0aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKFJlZ0V4cC4kMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJob21lX3J1bGVcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL3RpdGxlXFxcIjpcXFwiKC4qPylcXFwiLy50ZXN0KG1UaXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGl0bGUgPSBSZWdFeHAuJDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwiaG9tZV9ydWxlX3YyXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC9iYXNlNjQ6XFxcXC9cXFxcL0AoLio/KUAvLnRlc3QobVRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UaXRsZSA9IFJlZ0V4cC4kMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJqc191cmxcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyguKj8pQC8udGVzdChtVGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRpdGxlID0gUmVnRXhwLiQxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcImhvbWVfcnVsZV91cmxcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRpdGxlID0gXFxcIummlumhteWQiOmbhlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwiYm9va21hcmtfdXJsXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UaXRsZSA9IFxcXCLkuabnrb7lkIjpm4ZcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gKG1UaXRsZSAhPSBudWxsICYmIG1UaXRsZSAhPT0gJycpID8gbVRpdGxlIDogdGl0bGU7XFxuICAgICAgICAgICAgICAgIGlmICh0aXRsZS5sZW5ndGggPiAxNCkgY29sID0gXFxcInRleHRfMlxcXCI7XFxuXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiAn8J+UlOKAmOKAmOKAmeKAmTxiPiDngrnlh7vlr7zlhaUgPC9iPvCflJQnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoZGVjb2RlVVJJQ29tcG9uZW50KGxpc3Rbal0uc3BsaXQoJz4nKVsxXS5zcGxpdCgnPC8nKVswXS5yZXBsYWNlKC9hbXA7L2csICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8mbHQ7L2csICc8JylcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvJmd0Oy9nLCAnPicpKSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZVxcbiAgICAgICAgaWYgKGpzLmluZGV4T2YoJzxjb2RlPuaWueWchicpICE9PSAtMSkge1xcblxcbiAgICAgICAgICAgIC8qaWYgKHNob3dDb250ZW50KSB7XFxuICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IDI7IGkrKylcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICBsZXQgbGlzdCA9IGpzLm1hdGNoKC88Y29kZT7mlrnlnIZbXFxcXHNcXFxcU10qPzxcXFxcL2NvZGUvZyk7XFxuXFxuICAgICAgICAgICAgaWYgKGxpc3QgIT0gbnVsbCAmJiBsaXN0Lmxlbmd0aCAhPT0gMCkgaGFzUnVsZSA9IDE7XFxuICAgICAgICAgICAgaWYgKGxpc3QgIT0gbnVsbCAmJiBsaXN0Lmxlbmd0aCA+IDEpIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPHA+PC9wPlxcXCIgKyBcXFwiPGJpZz48Yj7mnKzmlofmiYDmnInop4TliJnkuIDplK7lr7zlhaU8L2I+PC9iaWc+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdjb2RlJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgIGxldCBtVGl0bGUgPSB0aXRsZTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKHJlZ0V4cC50ZXN0KHRpdGxlKSA9PT0gdHJ1ZSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29sID0gXFxcInRleHRfM1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPT09IDEpIG1UaXRsZSA9IFxcXCLkuIDplK7lr7zlhaVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoID4gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG1UaXRsZSA9IFJlZ0V4cC4kMztcXG4gICAgICAgICAgICAgICAgICAgICAgICBtVGl0bGUgPSAobVRpdGxlICE9IG51bGwgJiYgbVRpdGxlICE9PSAnJykgPyBtVGl0bGUgOiB0aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKFJlZ0V4cC4kMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJzb3VyY2VcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL3RpdGxlXFxcIjpcXFwiKC4qPylcXFwiLy50ZXN0KG1UaXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGl0bGUgPSBSZWdFeHAuJDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdGl0bGUgPSAobVRpdGxlICE9IG51bGwgJiYgbVRpdGxlICE9PSAnJykgPyBtVGl0bGUgOiB0aXRsZTtcXG5cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6ICfngrnlh7vlr7zlhaUnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoZGVjb2RlVVJJQ29tcG9uZW50KGxpc3Rbal0uc3BsaXQoJz4nKVsxXS5zcGxpdCgnPC8nKVswXS5yZXBsYWNlKC9hbXA7L2csICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8mbHQ7L2csICc8JylcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvJmd0Oy9nLCAnPicpKSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuXFxuICAgICAgICB9XFxuXFxuICAgICAgICBpZiAodG9rZW4gIT09ICcnKSB7XFxuICAgICAgICAgICAgbGV0IHN0YXJJY29uID0gc3Rhckljb25zWzBdO1xcbiAgICAgICAgICAgIGxldCBsaWtlSWNvbiA9IGxpa2VJY29uc1swXTtcXG4gICAgICAgICAgICBsZXQgY29tbWVudEljb24gPSBjb21tZW50SWNvbnNbMF07XFxuICAgICAgICAgICAgLy8gbGV0IGFydGljbGVJY29uID0gYXJ0aWNsZUljb25zWzBdO1xcbiAgICAgICAgICAgIGxldCBzdGFySWNvbk1heCA9IHN0YXJJY29ucy5sZW5ndGgtMTtcXG4gICAgICAgICAgICBsZXQgbGlrZUljb25NYXggPSBsaWtlSWNvbnMubGVuZ3RoLTE7XFxuICAgICAgICAgICAgbGV0IGNvbW1lbnRJY29uTWF4ID0gY29tbWVudEljb25zLmxlbmd0aC0xO1xcbiAgICAgICAgICAgIC8vIGxldCBhcnRpY2xlSWNvbk1heCA9IGFydGljbGVJY29ucy5sZW5ndGgtMTtcXG4gICAgICAgICAgICBpZiAoaWNvbkluZGV4ID09PSAtMSkge1xcbiAgICAgICAgICAgICAgICBsZXQgbWF4TGVuID0gTWF0aC5tYXgoc3Rhckljb25NYXgsIGxpa2VJY29uTWF4LCBjb21tZW50SWNvbk1heC8qLCBhcnRpY2xlSWNvbk1heCovKTtcXG4gICAgICAgICAgICAgICAgaWNvbkluZGV4ID0gTWF0aC5mbG9vcigoTWF0aC5yYW5kb20oKSAqIChtYXhMZW4gKyAxKSkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzdGFySWNvbiA9IHN0YXJJY29uc1tpY29uSW5kZXggPiBzdGFySWNvbk1heCA/IHN0YXJJY29uTWF4IDogaWNvbkluZGV4XTtcXG4gICAgICAgICAgICBsaWtlSWNvbiA9IGxpa2VJY29uc1tpY29uSW5kZXggPiBsaWtlSWNvbk1heCA/IGxpa2VJY29uTWF4IDogaWNvbkluZGV4XTtcXG4gICAgICAgICAgICBjb21tZW50SWNvbiA9IGNvbW1lbnRJY29uc1tpY29uSW5kZXggPiBjb21tZW50SWNvbk1heCA/IGNvbW1lbnRJY29uTWF4IDogaWNvbkluZGV4XTtcXG4gICAgICAgICAgICAvLyBhcnRpY2xlSWNvbiA9IGFydGljbGVJY29uc1tpY29uSW5kZXggPiBhcnRpY2xlSWNvbk1heCA/IGFydGljbGVJY29uTWF4IDogaWNvbkluZGV4XTtcXG4gICAgICAgICAgICBsZXQgaXNTdGFycmVkID0gMDtcXG4gICAgICAgICAgICBsZXQgc3RhclN0YXR1cyA9ICcnO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHN0YXJTdGF0dXMgPSBwYXJzZURvbUZvckh0bWwoaHRtbCwgXFxcIi5mYXZvcml0ZS5hY3RpdmUmJkh0bWxcXFwiKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAg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cnNlKGxpa2VSZXN1bHQpO21lc3NhZ2U9bGlrZVJlc3VsdC5tZXNzYWdlO2lmKGxpa2VSZXN1bHQubWVzc2FnZT09PScnKXtpZihsaWtlUmVzdWx0LnN1Y2Nlc3M9PT10cnVlKW1lc3NhZ2U9J+eCuei1nuaIkOWKnyc7cmVmcmVzaFBhZ2UoZmFsc2UpO30gZWxzZSBpZiAobGlrZVJlc3VsdC5tZXNzYWdlID09PSAn6K+35YWI55m75b2VJykge2xldCB0b2tlbkZpbGUgPSAnaGlrZXI6XFxcXC9cXFxcL2ZpbGVzXFxcXC9ydWxlc1xcXFwvanNcXFxcL2hpa2VyYmJzX3Rva2VuLmpzJzt3cml0ZUZpbGUodG9rZW5GaWxlLCAnJyk7bWVzc2FnZSA9ICfor7fph43mlrDorr/pl67kuIDmrKHorrrlnZvnvZHpobXojrflj5bnmbvlvZXkv6Hmga8nO30gbWVzc2FnZT0ndG9hc3Q6XFxcXC9cXFxcLycrbWVzc2FnZTt9fX1tZXNzYWdlYFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5Zue5aSNJyxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogY29tbWVudEljb24sXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJyxcXG4gICAgICAgICAgICAgICAgdXJsOiBtVXJsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgLypkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WOn+aWhycsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGFydGljbGVJY29uLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgICAgIHVybDogbVVybFxcbiAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3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XFxuICAgICAgICAgICAgICAgICAgICBwbHVnaW4gPSBmZXRjaChwbHVnaW5VcmwsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbHVnaW4gPT0gbnVsbCkgcGx1Z2luID0gJyc7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHBsdWdpbiA9Jyc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHBsdWdpblVwZGF0ZSA9IDA7XFxuICAgICAgICAgICAgICAgIGlmIChwbHVnaW4gIT09ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocGx1Z2luTGF0ZXN0LnNwbGl0KCdiYXNlNjQ6XFxcXC9cXFxcLycpWzFdICE9PSBiYXNlNjRFbmNvZGUocGx1Z2luKS5yZXBsYWNlKC9cXFxcbi9nLCAnJykpIHBsdWdpblVwZGF0ZSA9IDE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPHA+PC9wPlxcXCIgKyAnPHNtYWxsPjxmb250IGNvbG9yPVxcXCJncmV5XFxcIj4nICsgICflpoLpnIDmlLbol4/miJbngrnotZ7lip/og73vvIzpnIDnmbvlvZXorrrlnZvlkI7miafooYzku6XkuIvmraXpqqTojrflj5YgVG9rZW7vvJo8YnI+W+acrOaPkOekuuWPr+e8lui+keinhOWImeWFs+mXrV08YnI+MS4gJyArICgocGx1Z2luID09PSAnJyB8fCBwbHVnaW5VcGRhdGUgPT09IDEpID8gJ+eCueWHu+S4i+aWueWPo+S7pOS7o+eggScgKyAocGx1Z2luVXBkYXRlID09PSAxID8gJzxiPuabtOaWsOaPkuS7tjwvYj4nIDogJ+WvvOWFpeS4k+eUqOaPkuS7ticpICsgJ++8jOeEtuWQjicgOiAn5L2g5bey5a+85YWl5pyA5paw5LiT55So5o+S5Lu277yM5Y+q6ZyAJykgKyAnPGEgaHJlZj1cXFwiJyArIE1ZX1VSTCArICdcXFwiPlvmn6XnnIvljp/mloddPC9hPuS4gOasoeWGjei/lOWbnuWIt+aWsCcgKyAoKHBsdWdpbiA9PT0gJycgfHwgcGx1Z2luVXBkYXRlID09PSAxKSA/ICc8YnI+PHByZT48Y29kZT4nICsgcGx1Z2luTGF0ZXN0ICsgJzwvY29kZT48L3ByZT4nIDogJycpICsgXFxcIjwvZm9udD48L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICBpZiAoc2hvd0NvbW1lbnQpIHtcXG4gICAgICAgICAgICAvKmlmIChoYXNSdWxlKSB7XFxuICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IDI7IGkrKylcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICAvY3Vyc29yOlxcXCIoLio/KVxcXCIvLnRlc3QoaHRtbCk7XFxuICAgICAgICAgICAgbGV0IGN1cnNvclRlbXAgPSBSZWdFeHAuJDE7XFxuICAgICAgICAgICAgbGV0IGN1cnNvciA9IChjdXJzb3JUZW1wICE9IG51bGwgJiYgY3Vyc29yVGVtcCAhPT0gJycpID8gY3Vyc29yVGVtcCA6ICcwJztcXG4gICAgICAgICAgICBwdXRWYXIoe2tleTogJ2N1cnNvcicsIHZhbHVlOiBjdXJzb3J9KTtcXG4gICAgICAgICAgICBwdXRWYXIoe2tleTogJ2ZpcnN0X3BhZ2VfY3Vyc29yJywgdmFsdWU6IGN1cnNvcn0pO1xcblxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPHA+PC9wPlxcXCIgKyBcXFwiPGJpZz48Yj5cXFwiICsgcGFyc2VEb21Gb3JIdG1sKGh0bWwsICcuY29tbWVudC10aXRsZSYmSHRtbCcpICsgXFxcIjwvYj48L2JpZz5cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHZhciBwbCA9IHBhcnNlRG9tKGh0bWwsICcuY29tbWVudHMmJkh0bWwnKVxcbiAgICAgICAgICAgICAgICAubWF0Y2goLzxsaVtcXFxcc1xcXFxTXSo/PFxcXFwvbGkvZyk7XFxuICAgICAgICAgICAgaWYgKHBsID09IG51bGwgfHwgcGwubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIjxwPjwvcD5cXFwiICsgJzxmb250IGNvbG9yPVxcXCJncmV5XFxcIj7mmoLml6Dor4Torro8L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgcGwubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vIC8oPChkaXZ8cCkoW1xcXFxzXFxcXFNdKj8pPil8PGRpdj58PHA+fDxcXFxcL2Rpdj58PFxcXFwvcD4vZ1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRDb250ZW50ID0gcGFyc2VEb21Gb3JIdG1sKHBsW2pdLCAnLmNvbW1lbnQtY29udGVudCYmSHRtbCcpXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxpbWcgY2xhc3M9XFxcImF2YXRhcihbXFxcXHNcXFxcU10qPyk+L2csICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oPChwKShbXFxcXHNcXFxcU10qPyk+KXw8cD58PFxcXFwvcD4vZywgJycpXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzxpbWcgKHNyY3xkYXRhLXNyYyk9XFxcIiguKj8pXFxcIihbXFxcXHNcXFxcU10qPyk+L2csIFxcXCI8aW1nIGRhdGEtdj5cXFwiLCBpbWdUYWdSZXBsYWNlbWVudDIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxpbWcoW1xcXFxzXFxcXFNdKj8pPi9nLCBpbWdFcnJvcilcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvPHNob3dpbWcvZywgJzxpbWcnKTtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRSZXBseVRleHQgPSBwYXJzZURvbUZvckh0bWwocGxbal0sICcuY29tbWVudC1xdW90ZSYmSHRtbCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb21tZW50UXVvdGVVc2VybmFtZSA9IHBhcnNlRG9tRm9ySHRtbChjb21tZW50UmVwbHlUZXh0LCBcXFwiLnF1b3RlLW5pY2tuYW1lJiZIdG1sXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRRdW90ZVRpbWUgPSBwYXJzZURvbUZvckh0bWwoY29tbWVudFJlcGx5VGV4dCwgXFxcIi5xdW90ZS10aW1lJiZIdG1sXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29tbWVudFJlcGx5VGV4dCA9IGNvbW1lbnRSZXBseVRleHRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLzxhW1xcXFxzXFxcXFNdLio/PFxcXFwvYT4vZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb21tZW50UmVwbHlUZXh0QXJyYXkgPSBjb21tZW50UmVwbHlUZXh0Lm1hdGNoKC88cFtcXFxcc1xcXFxTXS4qPzxcXFxcL3A+L2cpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1lbnRDb250ZW50ID0gYWJicmV2aWF0ZVJlcGx5VGV4dChjb21tZW50Q29udGVudCwgY29tbWVudFJlcGx5VGV4dEFycmF5KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShjb21tZW50UXVvdGVVc2VybmFtZSwgJzxmb250IGNvbG9yPVxcXCInICsgcXVvdGVVc2VyQ29sb3IgKyAnXFxcIj4nICsgY29tbWVudFF1b3RlVXNlcm5hbWUgKyAnPC9mb250PicpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKGNvbW1lbnRRdW90ZVRpbWUsICc8Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+JyArIGNvbW1lbnRRdW90ZVRpbWUgKyAnPC9mb250PicpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsgLy8gcCwtMlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPHA+PC9wPlxcXCIgKyBjb21tZW50Q29udGVudCArICc8YnI+PHNtYWxsPicgKyBwYXJzZURvbUZvckh0bWwocGxbal0sICcuY29tbWVudC1uaWNrbmFtZSYmSHRtbCcpLnJlcGxhY2UoLzxhW1xcXFxzXFxcXFNdLio/Pi9nLCAnPGZvbnQgY29sb3I9XFxcIicgKyB1c2VyQ29sb3IgKyAnXFxcIj4nKS5yZXBsYWNlKC88XFxcXC9hPi9nLCBcXFwiPC9mb250PlxcXCIpICsgJ1xcXFx0XFxcXHQ8Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+JyArIHBhcnNlRG9tRm9ySHRt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