xiaomianao666

小程序:知识听书

Jan 24th, 2022
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@知识听书@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi55+l6K+G5ZCs5LmmIiwiYXV0aG9yIjoi6L275ZCI6ZuG55Sf5oiQ5ZmoIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjk1LCJjb2xfdHlwZSI6Imljb25fcm91bmRfc21hbGxfNCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG4vLyDlvZPmsqHmnInni6znq4vlsI/nqIvluo/pppbpobXml7bmuIXpmaTpobXpnaLnvJPlrZhcbmFkZExpc3RlbmVyKFwib25DbG9zZVwiLCAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICBpZihwYXJzZUludChnZXRNeVZhcignb3BlbmVkSW5kZXgnLCAnMCcpKSA9PT0gMCl7XG4gICAgICAgIEpTT04ucGFyc2UocmVhZEZpbGUoXCJfcnVsZUhhc2hDYWNoZVwiKSB8fCBcIltdXCIpLmZvckVhY2goKHYpID0+IGRlbGV0ZUZpbGUodikpXG4gICAgICAgIGRlbGV0ZUZpbGUoJ19ydWxlSGFzaENhY2hlJylcbiAgICB9XG59KSk7XG4vL+WFs+mXreiHquWumuS5ieWIhuexu++8n1xuY29uc3QgZGVmYXVsdERpc1RhYk1vZGlmeSA9IHRydWU7XG5jb25zdCBRSU5HX1RJVExFID0gZ2V0TXlWYXIoJ215Q29sbGVjdGlvbicpLFxubmV3V2luZG93ID0gcmVhZEZpbGUoJ25ld1dpbmRvdycp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iJyxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBydWxlczogJC50b1N0cmluZygoUUlOR19USVRMRSwgdHlwZVNob3csZGlzVGFiTW9kaWZ5KSA9PiB7XG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRSkoKTtcbiAgICAgICAgICAgICAgICBpZiAoZGlzVGFiTW9kaWZ5JiZ0eXBlU2hvdykge1xuICAgICAgICAgICAgICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi50eXBlID09PSB0eXBlU2hvdyk7XG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoIWRpc1RhYk1vZGlmeSl7XG4gICAgICAgICAgICAgICAgICAgIHR5cGVOb3cgPSB0eXBlU2hvdyB8fCAn5YWo6YOoJztcbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZU5vdz09PSflhbbku5YnKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKCh2KSA9PiAhdi5zb3J0X3VybCk7XG4gICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKHR5cGVOb3chPT0n5YWo6YOoJyl7XG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi5zb3J0X3VybD09PXR5cGVOb3cpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcyk7XG4gICAgICAgICAgICB9LCBRSU5HX1RJVExFLCB0eXBlU2hvdyxkaXNUYWJNb2RpZnkpLFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcignc2VhcmNoS2V5JywgJycpLFxuICAgICAgICAgICAgb25DaGFuZ2U6IFwicHV0TXlWYXIoJ3NlYXJjaEtleScsaW5wdXQpXCJcbiAgICAgICAgfVxuICAgIH1dLFxuICAgIHJ1bGVzID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRSkoKTtcbmlmKGRpc1RhYk1vZGlmeSkge1xuICAgIHR5cGVzID0ge1xuICAgICAgICAnJzogJ+WFqOmDqCcsXG4gICAgICAgICdhbGwnOiAn6IGa5ZCIJyxcbiAgICAgICAgJ3ZpZGVvJzogJ+inhumikScsXG4gICAgICAgICdtdXNpYyc6ICfpn7PpopEnLFxuICAgICAgICAnbGl2ZSc6ICfnm7Tmkq0nLFxuICAgICAgICAnY2FydG9vbic6ICfmvKvnlLsnLFxuICAgICAgICAncmVhZCc6ICfpmIXor7snLFxuICAgICAgICAncGljdHVyZSc6ICflm77pm4YnLFxuICAgICAgICAnbmV3cyc6ICfotYTorq8nLFxuICAgICAgICAndG9vbCc6ICflt6XlhbcnLFxuICAgICAgICAnb3RoZXInOiAn5YW25a6DJ1xuICAgIH07XG4gICAgZm9yIChsZXQgayBpbiB0eXBlcykge1xuICAgICAgICBpZiAoIWsgfHwgcnVsZXMuZmluZCgodikgPT4gdi50eXBlID09PSBrKSkge1xuICAgICAgICAgICAgbGV0IHRpdGxlID0gJ+KAnOKAnOKAneKAnScgKyAoayA9PT0gdHlwZVNob3cgPyB0eXBlc1trXS5ib2xkKCkuZm9udGNvbG9yKCcjMTJiNjY4JykgOiB0eXBlc1trXSk7XG4gICAgICAgICAgICBsZXQgY250ID0gcnVsZXMuZmlsdGVyKGl0ID0+ICFrIHx8IGl0LnR5cGUgPT09IGspLmxlbmd0aDtcbiAgICAgICAgICAgIGVsLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICcgJyArIGNvbG9yKGNudCwgJyNmZjcwMDAnKSxcbiAgICAgICAgICAgICAgICB1cmw6IGsgPT09IHR5cGVTaG93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaykgPT4ge1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndHlwZVNob3cnLCBrKVxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgICAgICAgICAgICAgIH0sIGspLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKHR5cGVTaG93KSB7XG4gICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKCh2KSA9PiB2LnR5cGUgPT09IHR5cGVTaG93KTtcbiAgICB9XG59ZWxzZSB7XG4gICAgdHlwZXMgPSBydWxlcy5tYXAoaXQgPT4gaXQuc29ydF91cmwgfHwgXCLlhbbku5ZcIik7XG4gICAgdHlwZXMudW5zaGlmdCgn5YWo6YOoJyk7XG4gICAgdHlwZXMgPSB1bmlxdWUyKHR5cGVzKTtcbiAgICB0eXBlTm93ID0gdHlwZVNob3cgfHwgJ+WFqOmDqCc7XG4gICAgZm9yIChsZXQgayBpbiB0eXBlcykge1xuICAgICAgICBsZXQgaXRzID0gdHlwZXNba107XG4gICAgICAgIGxldCB0aXRsZSA9ICfigJzigJzigJ3igJ0nICsgKGl0cyA9PT0gdHlwZU5vdyA/IGl0cy5ib2xkKCkuZm9udGNvbG9yKCcjMTJiNjY4JykgOiBpdHMpO1xuICAgICAgICBsZXQgY250O1xuICAgICAgICBpZiAoaXRzID09PSAn5YWo6YOoJykge1xuICAgICAgICAgICAgY250ID0gcnVsZXMubGVuZ3RoXG4gICAgICAgIH0gZWxzZSBpZiAoaXRzID09PSAn5YW25LuWJykge1xuICAgICAgICAgICAgY250ID0gcnVsZXMuZmlsdGVyKGl0ID0+ICFpdC5zb3J0X3VybCkubGVuZ3RoO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY250ID0gcnVsZXMuZmlsdGVyKGl0ID0+IGl0LnNvcnRfdXJsID09PSBpdHMpLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgICBlbC5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICcgJyArIGNvbG9yKGNudCwgJyNmZjcwMDAnKSxcbiAgICAgICAgICAgIHVybDogaXRzID09PSB0eXBlTm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaXRzKSA9PiB7XG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3R5cGVTaG93JywgaXRzKTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICB9LCBpdHMpLFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xuICAgICAgICB9KVxuICAgIH1cbiAgICBpZih0eXBlTm93PT09J+WFtuS7licpe1xuICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gIXYuc29ydF91cmwpO1xuICAgIH1lbHNlIGlmKHR5cGVOb3chPT0n5YWo6YOoJyl7XG4gICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKCh2KSA9PiB2LnNvcnRfdXJsPT09dHlwZU5vdyk7XG4gICAgfVxufVxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdXJsUGFyc2U/cnVsZT0nICsgUUlOR19USVRMRSkpLnJ1bGUpO1xucnVsZXMuZm9yRWFjaCgodikgPT4ge1xuICAgIGxldCB1cmxQYXJhbSA9IHYudXJsLnNwbGl0KCc7JyksXG4gICAgICAgIHJ1bGVUbXAgPSB7XG4gICAgICAgICAgICB0aXRsZTogdi50aXRsZSwgdXJsOiB1cmxQYXJhbS5zaGlmdCgpLFxuICAgICAgICAgICAgY2xhc3NfbmFtZTogdi5jbGFzc19uYW1lLCBjbGFzc191cmw6IHYuY2xhc3NfdXJsLFxuICAgICAgICAgICAgYXJlYV9uYW1lOiB2LmFyZWFfbmFtZSwgYXJlYV91cmw6IHYuYXJlYV91cmwsXG4gICAgICAgICAgICB5ZWFyX25hbWU6IHYueWVhcl9uYW1lLCB5ZWFyX3VybDogdi55ZWFyX3VybCxcbiAgICAgICAgICAgIHNvcnRfbmFtZTogdi5zb3J0X25hbWUsIHNvcnRfdXJsOiB2LnNvcnRfdXJsXG4gICAgICAgIH0sXG4gICAgICAgIGZ5cGFnZSA9IHJ1bGVUbXAudXJsLmluY2x1ZGVzKCdmeXBhZ2UnKSA/ICdmeXBhZ2UnIDogJzEnLFxuICAgICAgICBkb21haW4gPSAoLyhodHRwcz86XFwvXFwvLis/KSg/OlxcL3wkKS9pLmV4ZWMocnVsZVRtcC51cmwpIHx8IFssICdoaWtlcjovL2VtcHR5J10pWzFdLFxuICAgICAgICBkID0ge1xuICAgICAgICAgICAgdGl0bGU6IHYudGl0bGUsXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkJyxcbiAgICAgICAgICAgIGltZzogdi5pY29uIHx8ICdoaWtlcjovL2ltYWdlcy9pY29uMScsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIHVybDogZG9tYWluICsgJy8jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjIyMjJyArIEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHJ1bGVUbXApKSxcbiAgICAgICAgICAgICAgICAgICAgcGFnZU51bTogZnlwYWdlLFxuICAgICAgICAgICAgICAgICAgICBRSU5HX1RJVExFOiBnZXRNeVZhcignbXlDb2xsZWN0a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WUuZm9yRWFjaCgobmFtZSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gY2xhc3NfdXJsW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgbm93ID0gSlNPTi5zdHJpbmdpZnkoeyBuYW1lOiBuYW1lLCB1cmw6IHVybCB9KVxcbiAgICAgICAgICAgICAgICBlbC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBzZWxlY3RlZCA9PSBub3cgPyAn4oCc4oCc4oCd4oCdJyArIG5hbWUuZm9udGNvbG9yKHRoaXMuY29sb3IpLmJvbGQoKSA6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHNlbGVjdGVkID09IG5vdyA/ICdoaWtlcjovL2VtcHR5JyA6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNpZ24sIGlkLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiArIGlkLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdGhpcy5zaWduLCBpZCwgbm93KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGVsLnB1c2goeyBjb2xfdHlwZTogdGhpcy5ib3VuZGFyeSB9KVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG4gICAgaW5pdChjbGFzc09iamVjdCkge1xcbiAgICAgICAgaWYgKHR5cGVvZiBjbGFzc09iamVjdC5jbGFzc19uYW1lID09ICdzdHJpbmcnKVxcbiAgICAgICAgICAgIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPSBjbGFzc09iam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gICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+WvvOWFpea1t+mYlCc6XFxuICAgICAgICAgICAgZC51cmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZGF0YVtpXSkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgfVxcbiAgICBlbC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gICAgICAgIHBhcmFtMSA9IENBTExCQUNLX0tFWVxcbiAgICAgICAgcGFyYW0yID0gTVlfUlVMRVxcbiAgICAgICAgcGFyYW0zID0gTVlfVFlQRVxcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZWwuZGF0YSkpIGVsID0gZWwuZGF0YTtcXG4gICAgICAgIEFycmF5LnByb3RvdHlwZS5wdXNoLmFwcGx5KG15Q29sbGVjdGlvbl9lbCwgZWwubWFwKCh2KSA9PiB7XFxuICAgICAgICAgICAgbGV0IE1ZX19SVUxFID0ge307XFxuICAgICAgICAgICAgdi5jb2xfdHlwZSA9IHYuY29sX3R5cGUgfHwgTVlfUlVMRS5jb2xfdHlwZVxcblxcbiAgICAgICAgICAgIGlmICghdi51cmwgfHwgWydydWxlJywgJ3BpY3MnLCAndG9hc3QnLCAnaW5wdXQnLCAnY29weScsICdlZGl0RmlsZScsICd4NScsICd4NVdlYlZpZXcnLCAneDVQbGF5JywgJ3dlYicsICdzZWxlY3QnLCAneDVSdWxlJywgJ3dlYlJ1bGUnLCAnZG93bmxvYWQnXS5maW5kKCh2dikgPT4gdi51cmwuc3RhcnRzV2l0aCh2diArICc6Ly8nKSkgfHwgWyd4NV93ZWJ2aWV3X3NpbmdsZScsICdpbnB1dCddLmZpbmQoKHZ2KSA9PiB2LmNvbF90eXBlID09IHZ2KSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuaW5jbHVkZXMoJ0BydWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCBbXywgdXJsLCBydWxlXSA9IHYudXJsLm1hdGNoKC9eKFtcXFxcc1xcXFxTXSo/KUBydWxlPShbXFxcXHNcXFxcU10qKSQvKVxcbiAgICAgICAgICAgICAgICB2LnVybCA9IHVybFxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gcnVsZVxcbiAgICAgICAgICAgICAgICBNW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ICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gdi51cmwuaW5kZXhPZignLmpzOicpXFxuICAgICAgICAgICAgICAgIGlmIChyZUluZGV4ID49IDApIHYudXJsID0gdi51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOlxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsIEpTT04ucGFyc2UocmVhZEZpbGUoXFxcIicgKyBydWxlSGFzaCArICdcXFwiKSkpOycgKyB2LnVybC5zbGljZShyZUluZGV4ICsgNClcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzSW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFNWV9SVUxFLmRldGFpbF9maW5kX3J1bGUgfHwgL2hpa2VyOlxcXFwvXFxcXC8oPyFlbXB0eS4rJCkvLnRlc3Qodi51cmwpKSByZXR1cm4gdlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHYuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgIHVybDogKGZ1bmN0aW9uKHVybCkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsLnNwbGl0KCc7JylcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwuc2hpZnQoKSArICc7JyArIHBhcmFtSGFuZGxlKHVybCwgTVlfUlVMRS51YSwgTVlfUlVMRS51cmwpXFxuICAgICAgICAgICAgICAgIH0pKHYudXJsKSxcXG4gICAgICAgICAgICAgICAgUlVMRTogTVlfX1JVTEUsXFxuICAgICAgICAgICAgICAgIEhBU0g6IHJ1bGVIYXNoLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGlzSW5kZXggJiYgd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vckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSByZXMudXJsLmluZGV4T2YoJy5qczonKVxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwgSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiJyArIHJ1bGVIYXNoICsgJ1xcXCIpKSk7JyArIHJlcy51cmwuc2xpY2UocmVJbmRleCArIDQpXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChkZXRhaWxGaW5kUnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IChmdW5jdGlvbih1cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwuc3BsaXQoJzsnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwuc2hpZnQoKSArICc7JyArIHBhcmFtSGFuZGxlKHVybCwgTVlfUlVMRS51YSwgTVlfUlVMRS51cmwuc3BsaXQoJzsnKVsyXSlcXG4gICAgICAgICAgICAgICAgICAgIH0pKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiB7IGRldGFpbF9maW5kX3J1bGU6IGRldGFpbEZpbmRSdWxlIH0sXFxuICAgICAgICAgICAgICAgICAgICBIQVNIOiBydWxlSGFzaCxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXNJbmRleCAmJiB0aXRsZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChNWV9SVUxFLmRldGFpbF9maW5kX3J1bGUpIHtcXG4gICAgICAgICAgICAgICAgcmVzLmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAoZnVuY3Rpb24odXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsLnNwbGl0KCc7JylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsLnNoaWZ0KCkgKyAnOycgKyBwYXJhbUhhbmRsZSh1cmwsIE1ZX1JVTEUudWEsIE1ZX1JVTEUudXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSkodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgIFJVTEU6IHt9LFxcbiAgICAgICAgICAgICAgICAgICAgSEFTSDogcnVsZUhhc2gsXFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGlzSW5kZXggJiYgdGl0bGVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXMudXJsID0gJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG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