xiaomianao666

小程序:聚漫🔮

Oct 12th, 2022
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@聚漫🔮@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6IGa5ryr8J+UriIsImF1dGhvciI6IuWwj+ajieiihPCfjJ4m5rC46L+c44Gu5piO5pelJuWbouWtkCZIaSbmoqbmtbcm6I+c6bihJmR5MjAyMCIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjoyMjEwMDkxMDYsImNvbF90eXBlIjoiaWNvbl9zbWFsbF80IiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJhbGwiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmNvbnN0IFFJTkdfVElUTEUgPSBnZXRNeVZhcignbXlDb2xsZWN0aW9uJyksXG4gICAgbmV3V2luZG93ID0gcmVhZEZpbGUoJ25ld1dpbmRvdycpLFxuICAgIHR5cGVTaG93ID0gZ2V0TXlWYXIoJ3R5cGVTaG93JywgJ0AnKSxcbiAgICB0eXBlcyA9IHtcbiAgICAgICAgJ2FsbCc6ICfkvJjotKgnLFxuICAgICAgICAndmlkZW8nOiAn6KeG6aKRJyxcbiAgICAgICAgJ211c2ljJzogJ+mfs+mikScsXG4gICAgICAgICdsaXZlJzogJ+ebtOaSrScsXG4gICAgICAgICdjYXJ0b29uJzogJ+a8q+eUuycsXG4gICAgICAgICdyZWFkJzogJ+mYheivuycsXG4gICAgICAgICdwaWN0dXJlJzogJ+WPpuexuycsXG4gICAgICAgICduZXdzJzogJ+aXoOaQnOe0oicsXG4gICAgICAgICd0b29sJzogJ+WPr+S4i+i9vScsXG4gICAgICAgICdvdGhlcic6ICfmir3po44nXG4gICAgfVxubGV0IGVsID0gW3tcbiAgICAgICAgdGl0bGU6ICcgJyArIFFJTkdfVElUTEUuYm9sZCgpICsgJyAmbmJzcCAmbmJzcCAnICsgJ+KamSDovbvlkIjpm4borr7nva4g4pqZJy5zbWFsbCgpLFxuICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvQ29uZmlnP3J1bGU9JyArIFFJTkdfVElUTEUgKyAnJiNub1JlY29yZEhpc3RvcnkjJyxcbiAgICAgICAgaW1nOiBNWV9SVUxFLmljb24gfHwgJ2hpa2VyOi8vaW1hZ2VzL2ljb24xJyxcbiAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXG4gICAgfSwge1xuICAgICAgICBkZXNjOiAnMCcsXG4gICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9NYWluLnZpZXc/cnVsZT3mnKzlnLDotYTmupDnrqHnkIYnLFxuICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9ob21lX3BpYzQnLFxuICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzEnXG4gICAgfSwge1xuICAgICAgICB1cmw6ICdcImhpa2VyOi8vc2VhcmNoP3M9XCIraW5wdXQnLFxuICAgICAgICBkZXNjOiAn6L+Z5piv6IGa5ryr55qE5pCc57Si5ZOmfn4nLFxuICAgICAgICB0aXRsZTogJ+aQnOe0oicsXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxuICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKFFJTkdfVElUTEUsIHR5cGVTaG93KSA9PiB7XG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRSlcbiAgICAgICAgICAgICAgICBpZiAodHlwZVNob3dbMF0gPT0gJ0AnKSB7XG4gICAgICAgICAgICAgICAgICAgIGx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/ICdmeXBhZ2UnIDogJzEnLFxuICAgICAgICBkb21haW4gPSAoL15odHRwcz86XFwvXFwvW14vPyNdKy9pLmV4ZWMocnVsZVRtcC51cmwpIHx8IFsnaGlrZXI6Ly9lbXB0eSddKVswXSxcbiAgICAgICAgZCA9IHtcbiAgICAgICAgICAgIHRpdGxlOiB2LnRpdGxlLFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZCcsXG4gICAgICAgICAgICBpbWc6IHYuaWNvbiB8fCAnaGlrZXI6Ly9pbWFnZXMvaWNvbjEnLFxuICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICB1cmw6IGRvbWFpbiArICcvI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyMjIycgKyBmeXBhZ2UgK1xuICAgICAgICAgICAgICAgICAgICAnLmpzOmxldCB7IHJ1bkNvZGUsIGluZGV4VXJsIH0gPSAkLnJlcXVpcmUoXCJoaWtlcjovL3BhZ2UvZnVuY1Rvb2xz77yf77yfcnVsZT0nICsgUUlOR19USVRMRSArICdcIiwgJ1xuICAgICAgICAgICAgICAgICAgICAgKyBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBNWV9SVUxFOiBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZVRtcCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgUUlOR19USVRMRTogUUlOR19USVRMRVxuICAgICAgICAgICAgICAgICAgICB9KSArICcp77yb77ybaW5kZXhVcmwoaW5wdXQpOycgKyBwYXJhbUhhbmRsZSh1cmxQYXJhbSwgdi51YSksXG4gICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHsgdGl0bGU6IHYudGl0bGUgfSkpLFxuICAgICAgICAgICAgICAgIGlzSW5kZXg6IHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIGlmI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S5mb3JFYWNoKChuYW1lLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBjbGFzc191cmxbaV0sXFxuICAgICAgICAgICAgICAgICAgICBub3cgPSBKU09OLnN0cmluZ2lmeSh7IG5hbWU6IG5hbWUsIHVybDogdXJsIH0pXFxuICAgICAgICAgICAgICAgIGVsLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ0nICsgbmFtZS5mb250Y29sb3IodGhpcy5jb2xvcikuYm9sZCgpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc2VsZWN0ZWQgPT0gbm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGlkLCBub3cpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZWwucHVzaCh7IGNvbF90eXBlOiB0aGlzLmJvdW5kYXJ5IH0pXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBpbml0KGNsYXNzT2JqZWN0KSB7XFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPT0gJ3N0cmluZycpXFxuICAgICAgICAgICAgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9IGNsYXNzT2JqZWN0LmNsY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0gZ2V0TXlWYXIoJ3JlbW90ZVVybCcpXFxuICAgICAgICBpZiAoIXVybC5zdGFydHNXaXRoKCdoaWtlcjovLycpICYmICF1cmwuc3RhcnRzV2l0aCgnZmlsZTovLycpKVxcbiAgICAgICAgICAgIHVybCA9ICdoaWtlcjovL2ZpbGVzL2xpYnMvJyArIG1kNSh1cmwpICsgJy5qcydcXG4gICAgICAgIGVsc2UgaWYgKHVybC5zdGFydHNXaXRoKCdoaWtlcjovL3BhZ2UvJykpIHVybCA9ICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgaWYgKGlucHV0ID09ICflpIfku70nKSByZXR1cm4gJCgnaGlrZXI6Ly9maWxlcy90bXAvJyArIFFJTkdfVElUTEUgKyAnX2JhY2t1cC5qc29uJywgJ+i+k+WFpeWkh+S7vei3r+W+hCcpXFxuICAgICAgICAgICAgLmlucHV0KCh1cmwsIHVwZGF0ZUludGVydmFsLCBuZXdXaW5kb3csIHRhYkZvbGQsIGRpc2FibGVDdXN0b20pID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gcmVxdWVzdCh1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgY3VzdG9tRGF0YSA9IHJlYWRGaWxlKCdjdXN0b21EYXRhJylcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGlucHV0LCBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJbnRlcnZhbDogdXBkYXRlSW50ZXJ2YWwsXFxuICAgICAgICAgICAgICAgICAgICBuZXdXaW5kb3c6IG5ld1dpbmRvdyxcXG4gICAgICAgICAgICAgICAgICAgIHRhYkZvbGQ6IHRhYkZvbGQsXFxuICAgICAgICAgICAgICAgICAgICBkaXNhYmxlQ3VzdG9tOiBkaXNhYmxlQ3VzdG9tLFxcbiAgICAgICAgICAgICAgICAgICAgY3VzdG9tRGF0YTogY3VzdG9tRGF0YSxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bG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i5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIHJ1bGVzW2ldLnZpc2libGUgPSAhcnVsZXNbaV0udmlzaWJsZVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4g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4gICAgZmluZFJ1bGUgPSBmaW5kUnVsZS5zcGxpdCgnOycpXFxuICAgIHBhcnNlRG9tRm9yQXJyYXkoZ2V0UmVzQ29kZSgpLCBmaW5kUnVsZS5zaGlmdCgpKS5mb3JFYWNoKChkYXRhKSA9PiB7XFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSByZXMudXJsLmluZGV4T2YoJy5qczonKVxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6JyArIGhpamFja0xhenlSdWxlICsgJzsnICsgcmVzLnVybC5zbGljZShyZUluZGV4ICsgNClcXG4gICAgICAgICAgICB9IGVsc2UgIGlmIChkZXRhaWxGaW5kUnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGdlbkV4VXJsKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihnZW5NeVJ1bGUoKSwgeyBkZXRhaWxfZmluZF9ydWxlOiBkZXRhaWxGaW5kUnVsZSB9KSkpLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGxlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkP3J1bGU9JyArIFFJTkdfVElUTEVcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKE1ZX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGdlbkV4VXJsKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZ2VuTXlSdWxlKCkpKSxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXNJbmRleCAmJiB0aXRsZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgIC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A9PiB2LnRpdGxlID09IHZ2LnRpdGxlKVxcbiAgICAgICAgaWYgKGluZGV4ID49IDApIHtcXG4gICAgICAgICAgICBzZWxmLnB1c2godilcXG4gICAgICAgICAgICBsZXQgcnVsZSA9IGRhdGEuc3BsaWNlKGluZGV4LCAxKVswXVxcbiAgICAgICAgICAgIGlmIChzaG93QWxsIHx8IHYudmlzaWJsZSlcXG4gICAgICAgICAgICAgICAgcmV3cml0ZURhdGEucHVzaChPYmplY3QuYXNzaWduKHJ1bGUsIHYpKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHNlbGZcXG4gICAgfSwgW10pXFxuICAgIGRhdGEuZm9yRWFjaCgodikgPT4gY3VzdG9tRGF0YS5wdXNoKHsgdGl0bGU6IHYudGl0bGUsIHZpc2libGU6IHRydWUgfSkpXFxuICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkoY3VzdG9tRGF0YSkpXFxuICAgICQuZXhwb3J0cyA9IHJld3JpdGVEYXRhLmNvbmNhdChkYXRhKVxcbn1cXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIumTvuaOpeWkhOeQhipcIixcInBhdGhcIjpcInVybFBhcnNlXCIsXCJydWxlXCI6XCIvLyDpppbpobXpk77mjqXmm7/mjaLliIbnsbtcXG5mdW5jdGlvbiBpbmRleFVybChwYXJhbSkge1xcbiAgICBmdW5jdGlvbiBydW5Db2RlKHJ1bGUpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IFtpbnB1dCwgY29kZV0gPSBydWxlLnNwbGl0KCcuanM6JylcXG4gICAgICAgICAgICByZXR1cm4gY29kZSA/IGV2YWwoY29kZSkgOiBydWxlXFxuICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiBydWxlIH1cXG4gICAgfVxcbiAgICBsZXQgeyBSVUxFLCBwYWdlTnVtLCBRSU5HX1RJVExFIH0gPSBKU09OL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cXCIpID09IFxcXCLmlLbotbdcXFwiP3B1dFZhcihcXFwiampzXFxcIixcXFwi5bGV5byAXFxcIik6cHV0VmFyKFxcXCJqanNcXFwiLFxcXCLmlLbotbdcXFwiKTtcXFwiaGlrZXI6Ly9lbXB0eVxcXCInO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+eugOS7iyA8c21hbGw+PHNtYWxsPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjojMTlCODlEXFxcIj7lsZXlvIA+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nLFxcbiAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzE5Ny5wbmdcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoamppZCwgZGVjaWQsIGRlc19kZXNjKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRWYXIoXFxcImpqc1xcXCIsIFxcXCLmlLbotbdcXFwiKSA9PSBcXFwi5pS26LW3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJqanNcXFwiLCBcXFwi5bGV5byAXFxcIik7XFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnroDku4sgPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFwiY29sb3I6IzE5Qjg5RFxcXCI+5pS26LW3Pjwvc3Bhbj48L3NtYWxsPjwvc21hbGw+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG5cXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBkZWNpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjICsgJy4uLjwvc3Bhbj4nXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJqanNcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnroDku4sgPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFwiY29sb3I6IzE5Qjg5RFxcXCI+5bGV5byAPjwvc3Bhbj48L3NtYWxsPjwvc21hbGw+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG5cXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBkZWNpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAzMCkgKyAnLi4uPC9zcGFuPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB9LCBNWV9SVUxFICsgXFxcIl9qamlkXFxcIiwgTVlfUlVMRSArIFxcXCJfZGVjaWRcXFwiLCBkZXNfZGVzYyksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFICsgXFxcIl9qamlkXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojODA4MDgwXFxcIj4nICsgZGVzX2Rlc2Muc3Vic3RyKDAsIDMwKSArICcuLi48L3NwYW4+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICBsaW5lU3BhY2luZzogMyxcXG4gICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUgKyBcXFwiX2RlY2lkXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICA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dvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXG4gICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jSk7XFxuICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXCI+JyArIHRpdGxlICsgJzwvc3Bhbj48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW11cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcgKyDliIbnsbvpopzoibIgKyAnXFxcIj4nICsgdGl0bGUgKyAnPC9zcGFuPjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGQoaXRlbSwg5YiG57G76ZO+5o6lKSArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH0pXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Yqo5oCBW+S4gF0qXCIsXCJwYXRoXCI6XCJjYXRlZ29yaWVzLWhlYWRlclwiLFwicnVsZVwiOlwiY29uc3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2J1dHRvblxcXCIgfTtcXG4gICAgICogICAgICAgIOWPguaVsOmHh+eUqOWPr+mAieimhuebluaooeW8j++8jOS4jeWGmeeahOWPguaVsOWImeS9v+eUqOm7mOiupDtcXG4gICAgICogICAgICAgIOavlOWmguS8oOWFpSB7IGNvbF90eXBlOlxcXCJ0ZXh0XzFcXFwiIH3vvIzpgqPmnIDnu4jnu5PmnpzlsLHmmK8geyB0aXRsZTpcXFwi5qCH6aKYMVxcXCIsIHVybDpcXFwieHh4XFxcIiwgY29sX3R5cGU6XFxcInRleHRfMVxcXCIgfVxcbiAgICAgKiBAcmV0dXJucyB7Q2F0ZWdvcmllc0hlYWRlcn1cXG4gICAgICovXFxuICAgIGZvbGRMYXlvdXQobGF5b3V0KSB7XFxuICAgICAgICBpZiAodHlwZW9mIGxheW91dCA9PT0gJ29iamVjdCcpIHtcXG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzKGxheW91dClcXG4gICAgICAgICAgICBsZXQgaW5qZWN0SW5kZXggPSBsYXlvdXQuaW5qZWN0SW5kZXggfHwgbGF5b3V0Wyfmipjlj6DmjInpkq7mj5LlhaXooYwnXVxcbiAgICAgICAgICAgIGlmIChsYXlvdXQudGl0bGUgfHwgbGF5b3V0LnVybCB8fCBsYXlvdXQuY29sX3R5cGUgfHwgaW5qZWN0SW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBrZXlzW2ldXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF1ba2V5XSA9IGxheW91dFtrZXldO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7fkvKDlhaXmraPnoa7nmoTmipjlj6DnlYzpnaLlhYPntKDvvIFcXFwiKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvLyBpbmplY3RJbmRleCDmipjlj6DmjInpkq7mj5LlhaXnrKwgaW5qZWN0SW5kZXgg6KGMXFxuICAgICAgICAgICAgaWYgKGluamVjdEluZGV4KSB7XFxuICAgICAgICAgICAgICAgIGlmICghKHR5cGVvZiAoaW5qZWN0SW5kZXgpID09PSAnbnVtYmVyJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGM6K+35Lyg5YWl5pWw5a2X77yBXFxcIilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeWkp+S6jiAwIOeahOaVtOaVsO+8gVxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluamVjdEluZGV4ID4gdGhpc1tzeW1ib2xNYXAubUZvbGRJbmRleF0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGM5LiN5b6X5aSn5LqO5pi+56S65oqY5Y+g6KGM5pWw77yB6K+36LCD55SoIC5mb2xkSW5kZXgoaW5kZXgpIOaIliAu56ys5Yeg6KGM5byA5aeL5oqY5Y+gKGluZGV4KSDkvKDlhaXmraPnoa7nmoTmmL7npLrmipjlj6DooYzmlbBcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS5pbmplY3RJbmRleCA9IGluamVjdEluZGV4IHx8IDE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICA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ICAgICAgICAgdGl0bGUgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB0aXRsZVJ1bGUpXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRpdGxlID0gcGFyc2VEb21Gb3JIdG1sKHNyYywgdGl0bGVSdWxlKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRpdGxlIHx8IFxcXCJcXFwiO1xcbiAgICB9LFxcbiAgICBnZXRVcmwoc3JjLCBjYXRlZ29yeSkge1xcbiAgICAgICAgbGV0IHVybCA9ICcnXFxuICAgICAgICBsZXQgdXJsUnVsZSA9IGNhdGVnb3J5LnVybFJ1bGUgfHwgJ2EmJmhyZWYnXFxuICAgICAgICBpZiAodHlwZW9mIHVybFJ1bGUgPT09ICdvYmplY3QnKSB7XFxuICAgICAgICAgICAgbGV0IG1VcmxSdWxlID0gdXJsUnVsZS5ydWxlIHx8IHVybFJ1bGVbJ+ino+aekOinhOWImSddIHx8ICdhJiZocmVmJztcXG4gICAgICAgICAgICBpZiAobVVybFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIG1VcmxSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgaWYgKHVybFJ1bGUucGFyc2VPcHRpb24pIHtcXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodXJsUnVsZS5wYXJzZU9wdGlvbikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tRm9ySHRtbFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRmaFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbXFxcIuino+aekOaWueazlVxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGVbXFxcIuino+aekOaWueazlVxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGFyc2VEb21cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGFyc2VEb21Gb3JIdG1sXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZGZoXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2Uoc3JjLCBtVXJsUnVsZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh1cmxSdWxlLmRlYWxVcmwpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZS5kZWFsVXJsKHVybClcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbJ+S6jOasoeWkhOeQhiddKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGVbJ+S6jOasoeWkhOeQhiddKHVybClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmICh1cmxSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cmwgPSBwYXJzZURvbShzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB1cmwgfHwgXFxcIlxcXCI7XFxuICAgIH0sXFxuICAgIGJ1aWxkKCkge1xcbiAgICAgICAgLy8g5qOA5rWL5piv5ZCm5Lyg5YWl6ZyA6KaB55qE5Y+C5pWwXFxuICAgICAgICB0aGlzLmNoZWNrUGFyYW1zKClcXG4gICAgICAgIC8vIOavj+S4gOS4quWIhuexu+eahOWUr+S4gOagh+ivhlxcbiAgICAgICAgbGV0IG1UYWcgPSB0aGlzW3N5bWJvbE1hcC5tVGFnXSB8fCBcXFwiXFxcIlxcbiAgICAgICAgLy/nv7vpobUg6ZyA6KaB5qC55o2u5a6e6ZmF5pu/5o2iXFxuICAgICAgICBjb25zdCBodG1sID0gdGhpc1tzeW1ib2xNYXAuc3JjXSB8fCByZ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WxlT2JqW1xcXCLliIbnsbvmoIfpophcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIHVybFJ1bGU6IHJ1bGVPYmoudXJsUnVsZSB8fCBydWxlT2JqW1xcXCLliIbnsbvpk77mjqVcXFwiXSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICAvLyBsb2coJC5zdHJpbmdpZnkoY2F0ZWdvcmllcykpXFxuXFxuICAgICAgICBsZXQgaW5pdF9jYXRlID0gW11cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjA7IGkrKykge1xcbiAgICAgICAgICAgIGluaXRfY2F0ZS5wdXNoKFxcXCIwXFxcIilcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGNvbnN0IGNhdGVfdGVtcF9qc29uID0gZ2V0TXlWYXIobVRhZyArIHRoaXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShpbml0X2NhdGUpKVxcbiAgICAgICAgY29uc3QgY2F0ZV90ZW1wID0gSlNPTi5wYXJzZShjYXRlX3RlbXBfanNvbilcXG5cXG4gICAgICAgIGlmICh0aGlzW3N5bWJvbE1hcC5tUGFnZV0gPT09IDEpIHtcXG5cXG4gICAgICAgICAgICBjYXRlZ29yaWVzLmZvckVhY2goKGNhdGVnb3J5LCBpbmRleCkgPT4ge1xcblxcbiAgICAgICAgICAgICAgICAvLyDmipjlj6AgVUlcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5uZXJFbmFibGVdICYmIHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS5pbmplY3RJbmRleCA9PT0gKGluZGV4KzEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZm9sZExheW91dCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdLnRpdGxlIHx8ICh0aGlzW3N5bWJvbE1hcC5tRm9sZF0gPT09ICcxJyA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICNGRjAwMDBcXFwiPuKIqDwvc3Bhbj48L2I+JyA6ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICMxYWFkMTlcXFwiPuKIpzwvc3Bhbj48L2I+JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0udXJsIHx8ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5I1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLm1UYWcgKyBwYXJhbXMuVkFSTUFQLkZPTEQsIGdldE15VmFyKHBhcmFtcy5tVGFnICsgcGFyYW1zLlZBUk1BUC5GT0xELCBwYXJhbXMuaXNGb2xkKSA9PT0gJzEnID8gJzAnIDogJzEnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYWc6IG1UYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRm9sZDogdGhpc1tzeW1ib2xNYXAubUZvbGRdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS5jb2xfdHlwZSB8fCBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKGZvbGRMYXlvdXQpXFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy/lhbfkvZPliJfooajkuIvnmoTliIbnsbtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgICAgIGlmIChjYXRlZ29yeS5zdWJMaXN0UnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gdGhpcy5ldmFsSlNSdWxlKGNhdGVnb3J5Lmxpc3QsIGNhdGVnb3J5LnN1Ykxpc3RSdWxlKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwYXJzZURvbUZvckFycmF5KGNhdGVnb3J5Lmxpc3QsIGNhdGVnb3J5LnN1Ykxpc3RSdWxlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoaW5kZXggPCAodGhpc1tzeW1ib2xNYXAubUZvbGRJbmRleF0gfHwgMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuaW5kZXggPT09IDAgPyBuZXdfY2F0ZSA6IHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzW3N5bWJvbE1hcC5tRm9sZF0gPT09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgY2F0ZWdvcnkpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj0nICsgdGhpc1tzeW1ib2xNYXAubUNvbG9yXSArICc+JyArIHRpdGxlICsgJyA8L2ZvbnQ+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5VUkwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiB0aGlzW3N5bWJvbE1hcC5tUGFnZV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuICAgIOeVjOmdoihsYXlvdXQpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dChsYXlvdXQpXFxuICAgIH0sXFxuICAgIOWIhuexu+mTvuaOpSh0cnVlVXJsKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy50cnVlVXJsKHRydWVVcmwpO1xcbiAgICB9LFxcbiAgICDpobXnoIEocGFnZSkge1xcbiAgICAgICAgcmV0dXJuIHRoaX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RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgcmVnT2JqID0gdGhpcy5yZWdleE1hcFtpXTtcXG4gICAgICAgICAgICBsZXQgdXJsRXhwID0gcmVnT2JqLnJlZztcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHVybEV4cCA9PT0gJ3N0cmluZycpIHtcXG4gICAgICAgICAgICAgICAgdXJsRXhwID0gbmV3IFJlZ0V4cCh1cmxFeHApXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh1cmxFeHAudGVzdCh0aGlzLnBhcmFtcy51cmwpKSB7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhcmFtcy5kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHVybEV4cC50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRydWVfdXJsID0gcmVnT2JqLmV4ZWMoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRydWVfdXJsKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRydWVfdXJsO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJhbXMudXJsXFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIOiOt+WPluWkhOeQhue7k+aenCgpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmV4ZWMoKVxcbiAgICB9LFxcbiAgICDpk77mjqUodXJsKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5iYXNlVXJsKHVybClcXG4gICAgfSxcXG4gICAg6aG156CBKHBhZ2UpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnBhZ2UocGFnZSlcXG4gICAgfSxcXG4gICAg5o+S5YWl5paw5aSE55CG6KeE5YiZKHJlZ0V4cCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuYWRkRXh0cmEocmVnRXh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TtcXG4gICAgICAgaWYgKG9iai7liJfooajlpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcbiAgICAgICAgfVxcbiAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXG4gICAgICAgIGlmIChvYmou6ZO+5o6l5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICB1cmwgPSBvYmou6ZO+5o6l5aSE55CGKHVybClcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwaWMgPSBwZChpdCwgb2JqLuWbvueJhylcXG4gICAgICAgIGlmIChvYmou5Zu+54mH5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICBwaWMgPSBvYmou5Zu+54mH5aSE55CGKHBpYylcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXQsIG9iai7moIfpopgpLFxcbiAgICAgICAgICAgIHVybDogdXJsKycjYXV0b0NhY2hlIycsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IG9iai7mj4/ov7AgPyBwZGZoKGl0LCBvYmou5o+P6L+wKSA6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpY1xcbiAgICAgICAgfSk7XFxuXFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpO1xcbn1cXG52YXIgdG9vbCA9IHtcXG4gICAg5LiA57qnOiDkuIDnuqdcXG59XFxuJC5leHBvcnRzID0gdG9vbFwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5LiA57qnW+S6jF0qXCIsXCJwYXRoXCI6XCJ5aWppXCIsXCJydWxlXCI6XCJmdW5jdGlvbiDkuIDnuqcoKSB7fTtcXHJcXG5PYmplY3QuYXN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S4uuepulxcbiAgICAvL+acgOe7iOi/lOWbniBbe3RpdGxlOiAn6Lev57q/5ZCNJyxsaXN0OiBbe3RpdGxlOifpgInpm4blkI0nLHVybDon6YCJ6ZuGdXJsJywuLi59XSxzanNzOifkuIvovb3otYTmlpknfSwuLi4uXVxcbiAgICAvL+mAiembhuWIl+ihqCDnrKzkuIDpobnmmK9jc3PpgInmi6nlmajvvIzkuYvlkI7lj6/ku6XnlKgk5YiG5Ymy5re75Yqg6KaB5Yig6Zmk56ug6IqC5ZCNXFxuXFxuXFxuICAgIHZhciDnq6DoioJqc29uID0gW107XFxuICAgIHZhciDljZXot6/nur/nq6DoioIgPSAn56ug6IqC5YiX6KGoJ1xcblxcbiAgICB2YXIg5YiX6KGo5ZCNID0gW107XFxuICAgIGlmICgh5aSa6Lev57q/5ZCmKSB7XFxuXFxuICAgICAgICDliJfooajlkI0ucHVzaCjljZXot6/nur/nq6DoioIpXFxuXFxuICAgIH0gZWxzZSB7XFxuXFxuICAgICAgICBwZGZhKOa6kOaVsOaNriwg6Lev57q/5YiX6KGoKS5mb3JFYWNoKGZ1bmN0aW9uKGRhdGEpIHtcXG4gICAgICAgICAgICDliJfooajlkI0ucHVzaChwZGZoKGRhdGEsIOi3r+e6v+WQjSkpXFxuICAgICAgICB9KTtcXG5cXG4gICAgfVxcblxcbiAgICB2YXIg6ZuG5pWw57uEID0gW107XFxuXFxuXFxudmFyIOaOkumZpOeroOiKgiA9IFtdO1xcbmlmKOmAiembhuWIl+ihqC5pbmNsdWRlcygnJCcpKXtcXG7mjpLpmaTnq6DoioIgPSDpgInpm4bliJfooaguc3BsaXQoJyQnKVxcbumAiembhuWIl+ihqCA9IOaOkumZpOeroOiKgi5zaGlmdCgpXFxufVxcblxcbiAgICBpZiAoIeWkmui3r+e6v+WQpikge1xcbiAgICAgICAg6ZuG5pWw57uELnB1c2gocGRmYSjmupDmlbDmja4sIOmAiembhuWIl+ihqCkpXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICB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i5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTog5YiX6KGo5ZCNW2ldLFxcbiAgICAgICAgICAgIGxpc3Q6IGRvTGlzdCxcXG4gICAgICAgICAgICBzanNzOiB7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJMaXN0OiBkb0xpc3QsXFxuICAgICAgICAgICAgICAgIGluZm86IHtcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tOYW1lOiBib29rTmFtZSwgLy/mvKvnlLvlkI3np7AsXFxuICAgICAgICAgICAgICAgICAgICBydWxlTmFtZTogTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tUb3BQaWM6IOWbvueJhyxcXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlQ29kZTog5ryr55S76Kej5p6QLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmlldzogXFxcIjFcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICByZXR1cm4g56ug6IqCanNvblxcbn1cXG5cXG5cXG5mdW5jdGlvbiDmt7vliqDlpLTpg6jliJfooagoZCwg5qCH6aKYLCDlm77niYcsIOaPj+i/sCwg5L2c6ICFLCDml7bpl7QsIOWIhuexuyzpobVVUkwpIHtcXG5cXG4gICAg5qCH6aKYID0gIeagh+mimCA/ICcnIDog5qCH6aKYICsgJ1xcXFxuJ1xcbiAgICDlm77niYcgPSAh5Zu+54mHID8gJycgOiDlm77niYdcXG4gICAg5o+P6L+wID0gIeaPj+i/sCA/ICcnIDog5o+P6L+wLnJlcGxhY2UoXFxcIuabtOaWsOiHs++8mlxcXCIsICcnKVxcblxcbiAgICDkvZzogIUgPSAh5L2c6ICFID8gJycgOiAnXFxcXG4nICsg5L2c6ICFXFxuICAgIOaXtumXtCA9ICHml7bpl7QgPyAnJyA6ICdcXFxcbicgKyDml7bpl7RcXG4gICAg5YiG57G7ID0gIeWIhuexuyA/ICcnID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bdcXFwiKTtcXG4gICAgdmFyIGpqdXJsID0gJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgo566A5LuL5YaF5a65LCDnroDku4vlhoXlrrnmlLYsIOaUtiwg5pS25YaF5a65LCDlvZPliY1VUkwpID0+IHtcXG4gICAgICAgIHZhciBqc2JsID0g5b2T5YmNVVJMICsgXFxcIueugOS7i+aUtlxcXCI7XFxuICAgICAgICB2YXIgamogPSBnZXRWYXIo5b2T5YmNVVJMICsgXFxcIueugOS7i+aUtlxcXCIsIFxcXCLlt7LmlLbotbdcXFwiKTtcXG4gICAgICAgIGpqID0gamogPT0gXFxcIuW3suaUtui1t1xcXCIgPyBcXFwi5bGV5byAXFxcIiA6IFxcXCLlt7LmlLbotbdcXFwiO1xcbiAgICAgICAgcHV0VmFyKGpzYmwsIGpqKVxcbiAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IOW9k+WJjVVSTCArIFxcXCJfYnRcXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB0aXRsZTog5pS2LnJlcGxhY2UoXFxcIueugOS7i+aUtlxcXCIsIGpqKVxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiDlvZPliY1VUkwgKyBcXFwiX216XFxcIlxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgdGl0bGU6IGpqID09IFxcXCLlt7LmlLbotbdcXFwiID8g5pS25YaF5a65LnJlcGxhY2UoXFxcIueugOS7i1xcXCIsIOeugOS7i+WGheWuueaUtikgOiDmlLblhoXlrrkucmVwbGFjZShcXFwi566A5LuLXFxcIiwg566A5LuL5YaF5a65KVxcbiAgICAgICAgfSlcXG4gICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgfSwg566A5LuL5YaF5a65LCDnroDku4vlhoXlrrnmlLYsIGJ0dGl0bGUsIG16dGV4dCwg6aG1VVJMKVxcblxcblxcbiAgICAvL+agh+mimFxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGJ0dGl0bGUucmVwbGFjZShcXFwi566A5LuL5pS2XFxcIiwgamopLFxcbiAgICAgICAgdXJsOiBqanVybCxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgIHBpY191cmw6IOWbvueJhyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJfYnRcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICAvL+eugOS7i1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGpqID09IFxcXCLlt7LmlLbotbdcXFwiID8gbXp0ZXh0LnJlcGxhY2UoXFxcIueugOS7i1xcXCIsIOeugOS7i+WGheWuueaUtikgOiBtenRleHQucmVwbGFjZShcXFwi566A5LuLXFxcIiwg566A5LuL5YaF5a65KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJfbXpcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbn1cXG5cXG5mdW5jdGlvbiDmt7vliqDliJfooajnq6DoioIoZCwg5qCH6aKY5pWw5o2uLCDliJfooajmlbDmja4sIOino+aekOS7o+eggSwg6aG1VVJMLCDlm77niYcpIHtcXG5cXG5cXG4gICAgLy9k5LiO5aSW55WMZO+8jOS4uuWQjOWGheWtmOWcsOWdgO+8jOS4jeeUqOi/lOWbnlxcbiAgICAvL+agh+mimOaVsOaNriAg5Y2z5qCH6aKY5ZCN5a2XXFxuICAgIC8v5YiX6KGo5pWw5o2u5b+F6aG75pivSlNPTiAg5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Xh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJf5o6S5bqPXFxcIlxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgdGl0bGU6IOagh+mimOWQjS5yZXBsYWNlKCfot6/nur8nLCDmoIfpopjmlbDmja4pLnJlcGxhY2UoJ+aOkuW6jycsIOaPkOekuilcXG4gICAgICAgIH0pXFxuXFxuXFxuICAgICAgICBpZiAo5o+Q56S6ID09ICflgJLluo8nKSB7XFxuICAgICAgICAgICAg5YiX6KGo5pWw5o2uLnJldmVyc2UoKVxcbiAgICAgICAgfVxcbiAgICAgICAg5YiX6KGo5pWw5o2uLmZvckVhY2goZnVuY3Rpb24oZGF0YSwgc3NpZCkge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZGF0YS50aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBkYXRhLnVybCArIOino+aekOS7o+eggSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFwiX+mAiembhlxcXCIgKyBzc2lkXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcblxcblxcbiAgICAgICAgcHV0VmFyKOmhtVVSTCArIFxcXCLnq6DoioLmjpLluo9cXFwiLCDmj5DnpLopXFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0sIOagh+mimOWQjSwg5qCH6aKY5pWw5o2uLCDliJfooajmlbDmja4sIOino+aekOS7o+eggSwg6aG1VVJMKVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IOagh+mimOWQjS5yZXBsYWNlKCfot6/nur8nLCDmoIfpopjmlbDmja4pLnJlcGxhY2UoJ+aOkuW6jycsIOaOkuW6jyksXFxuICAgICAgICBwaWNfdXJs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e6v+WQjSzpgInpm4bmgLvliJfooags6YCJ6ZuG5YiX6KGoLOmbhuWQjSzpm4Z1cmws5YmN57yALOW9k+WJjemhteWQjSzlm77niYcpXFxuXFxuICAgIC8v566A5LuLXFxuICAgIOa3u+WKoOeugOS7iyhkLCBwZGZoKGNvZGUsIOeugOS7iyksIOW9k+WJjVVSTCwgJycpXFxuXFxuICAgLy/lvZPmsqHmnInnq6DoioLlhoXlrrnvvIzlsLHkuI3mmL7npLpcXG4gICAgaWYgKOeroOiKgmpzb24ubGVuZ3RoID4gMCkge1xcblxcbiAgICAgICAgLy/ot6/nur/pgInmi6lcXG4gICAgICAgIHZhciDpgInmi6nliJfooaggPSDmt7vliqDpgInmi6not6/nur8oZCwg56ug6IqCanNvbiwg5b2T5YmNVVJMLCDlpJrot6/nur/lkKYpXFxuXFxuICAgICAgICAvL+mAieaLqeS4i+i9vVxcbiAgICAgICAg5re75Yqg6YCJ5oup5LiL6L29KGQsIOeroOiKgmpzb24s5aSa6Lev57q/5ZCmKVxcblxcbiAgICAgICAgLy/mjpLluo/kuI7pgInpm4ZcXG4gICAgICAgIHZhciBsYXp5ID0gYEBsYXp5UnVsZT0uanM6YCArIOa8q+eUu+ino+aekDtcXG4gICAgICAgIOa3u+WKoOWIl+ihqOeroOiKgihkLCDnq6DoioJqc29uW+mAieaLqeWIl+ihqF0udGl0bGUsIOeroOiKgmpzb25b6YCJ5oup5YiX6KGoXS5saXN0LCBsYXp5LCDlvZPliY1VUkwsICcnKVxcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxvbmdfdGV4dFxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS6jOe6p+WIl+ihqCpcIixcInBhdGhcIjpcImVqbGJcIixcInJ1bGVcIjpcInZhciB0YWJzID0gW11cXG52YX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bGF6eSkgPT4ge1xcbiAgICAgICAgdmFyIGxpc3RzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImxpc3RzXFxcIik7XFxuICAgICAgICB2YXIg56ug6IqCID0gbGlzdHNbZ2V0TXlWYXIoTVlfVVJMLCAnMCcpXTtcXG4gICAgICAgIHZhciDmjpLluo8gPSBnZXRNeVZhcihNWV9VUkwgKyBcXFwi56ug6IqC5o6S5bqPXFxcIiwgJyMxYWFkMTlcXFwiPuato+W6jycpO1xcbiAgICAgICAgdmFyIOaPkOekuiA9IOaOkuW6jyA9PSAnI0ZGMDAwMFxcXCI+5YCS5bqPJyA/ICcjMWFhZDE5XFxcIj7mraPluo8nIDogJyNGRjAwMDBcXFwiPuWAkuW6jyc7XFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogTVlfVVJMICsgXFxcIl/mjpLluo9cXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB0aXRsZTog5o6S5bqP5ZCNLnJlcGxhY2UoJ+aOkuW6jycsIOaPkOekuilcXG4gICAgICAgIH0pXFxuICAgICAgICBpZiAo5o6S5bqPID09ICcjMWFhZDE5XFxcIj7mraPluo8nKSB7XFxuICAgICAgICAgICAg56ug6IqCLnJldmVyc2UoKVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGNwID0g56ug6IqCLm1hcCgoZGF0YSwgc3NpZCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGRhdGEsICdhJiZUZXh0JyksXFxuICAgICAgICAgICAgICAgIHVybDogcGQoZGF0YSwgJ2EmJmhyZWYnKSArIGxhenksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiDnq6DoioIubGVuZ3RoID4gMyA/ICd0ZXh0XzQnIDogJ3RleHRfMicsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICA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PuWAkuW6jycgPyAnIzFhYWQxOVxcXCI+5q2j5bqPJyA6ICcjRkYwMDAwXFxcIj7lgJLluo8nO1xcblxcbiAgICAgICAgICAgIOe6v+i3ry5mb3JFYWNoKChkYXRhLCB4bGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGlkID09IHhsaWQgPyAn4oCc4oCcJyArIGRhdGEgKyAn4oCd4oCdJyA6IGRhdGEsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9VUkwgKyBcXFwiX+e6v+i3r1xcXCIgKyB4bGlkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcHV0TXlWYXIoTVlfVVJMLCBpZClcXG4gICAgICAgICAgICB2YXIg56ug6IqCID0gbGlzdHNbZ2V0TXlWYXIoTVlfVVJMLCAnMCcpXTtcXG4gICAgICAgICAgICBpZiAo5o6S5bqPID09ICcjRkYwMDAwXFxcIj7lgJLluo8nKSB7XFxuICAgICAgICAgICAgICAgIOeroOiKgi5yZXZlcnNlKClcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGNwID0g56ug6IqCLm1hcCgoZGF0YSwgc3NpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoZGF0YSwgJ2EmJlRleHQnKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogcGQoZGF0YSwgJ2EmJmhyZWYnKSArIGxhenksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTog56ug6IqCLmxlbmd0aCA+IDMgPyAndGV4dF80JyA6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgIC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