xiaomianao666

小程序:小小影院α

Jun 28th, 2023
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@小小影院α@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxudmFyIGNocCA9IFtdO1xudHJ5IHtcbiAgICB2YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcbiAgICB2YXIgY29udHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiYuc3R1aS1jb250ZW50X19wbGF5bGlzdCcpO1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGNvbnRzW2ldLCAnYm9keSYmbGknKTtcbiAgICAgICAgY2hwLnB1c2gobGlzdC5sZW5ndGgpO1xuICAgIH0gICAgIFxufSBjYXRjaCAoZSkge31cbnNldFJlc3VsdCgn5pu05paw6IezOicgKyAoTWF0aC5tYXguYXBwbHkobnVsbCwgY2hwKSkpOyIsInRpdGxlIjoi5bCP5bCP5b2x6ZmizrEiLCJhdXRob3IiOiJSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly93d3cuYWpnZ2cuY29tL3Nob3cvMS9wYWdlL2Z5cGFnZS5odG1sIiwidmVyc2lvbiI6MCwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIGQgPSBbXVxuYWRkTGlzdGVuZXIoXCJvbkNsb3NlXCIsICQudG9TdHJpbmcoKCkgPT4ge1xuICAgIGxldCBrZXlzID0gbGl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VwLMKgZm9sZMKgPT09wqAnMSfCoD/CoCcwJ8KgOsKgJzEnKTtcXG4gICAgICAgICAgICBhbGwuZm9yRWFjaCgoaXRlbSk9PntcXG4gICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pXFxuICAgICAgICAgICAgfSlcXHJcXG7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqByZWZyZXNoUGFnZShmYWxzZSk7XFxyXFxuwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgcmV0dXJuwqBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxyXFxuwqDCoMKgwqDCoMKgwqDCoH0swqBmb2xkLOeKtuaAgSAs5YWo5riFKSxcXHJcXG7CoMKgwqDCoMKgwqDCoMKgY29sX3R5cGU6wqAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgbG9uZ0NsaWNrOlt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOifmuIXpmaTnirbmgIEnLFxcbiAgICAgICAgICAgICAgICBqczokLnRvU3RyaW5nKCh4LGFsbCxjbCk9PntcXG4gICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHgpO1xcbiAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hlYWQuY2F0ZScpOyAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgIGFsbC5mb3JFYWNoKChpdGVtKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pXFxuICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICBjbC5mb3JFYWNoKChpdGVtKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pXFxuICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9L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ICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICB0aXRsZTog5qCH6aKYLCAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgY29udGVudDog566A5LuLMSArICdcXFxcbicgKyDnroDku4syLFxcbiAgICAgICAgICAgICAgIGRlc2M6IOaPj+i/sDEgKyAnICcgKyDmj4/ov7AyLFxcbiAgICAgICAgICAgICAgIGltZzog5Zu+54mHLFxcbiAgICAgICAgICAgICAgIHVybDog6ZO+5o6lLFxcbiAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaW1nOiDlm77niYcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS6jOe6p+WklumDqOaQnOe0olwiLFwicGF0aFwiOlwidG9vbFwiLFwicnVsZVwiOlwidmFyIHRpdGxlID0gcGFyc2VEb21Gb3JIdG1sKGh0bWwsIOaQnOe0ouagh+etvik7XFxubG9nKHRpdGxlKVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFwiI0ZGMDAwMFxcXCI+IOiBmuW9seKImjwvZm9udD48L21pZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cDovL2ltYWdlLmNvb2xhcGsuY29tLy9hcGtfbG9nby8yMDIyLzA1MDcvMTQvMF8zODI4XzcyNTRfNjM5QDI2MHgyNjAucG5nLnQucG5nJyxcXG4gICAgdXJsOiAnaGlrZXI6Ly9zZWFyY2g/cz0nICsgdGl0bGUgKyAnJnJ1bGU96IGa5b2x4oiaJyxcXG4gICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzQnLFxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4o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wgbWF4TGVuZ3RoKSB7XFxuICAgICAgICAgICAgbGV0IGxlbiA9IDA7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgaWYgKHN0ci5jaGFyQ29kZUF0KGkpID4gMjU1KSB7XFxuICAgICAgICAgICAgICAgICAgICBsZW4gKz0gMjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxlbisrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChsZW4gPiBtYXhMZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHIuc2xpY2UoMCwgaSkgKyAnLi4uJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHNkZXNjID0gc3Vic3RyKGRlc2MsIG51bSk7XFxuICAgICAgICB2YXIgbGF6eSA9ICQoYCNub0xvYWRpbmcjYCkubGF6eVJ1bGUoKGRjLCBzZGMsIG0pID0+IHtcXG4gICAgICAgICAgICB2YXIgc2hvdyA9IHN0b3JhZ2UwLmdldEl0ZW0obSwgJzAnKTtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBmaW5kSXRlbSgnZGVzYycpLnRpdGxlO1xcbiAgICAgICAgICAgIHZhciByZSA9IC8oPFxcXFwvc21hbGw+PGJyPi4qPz4pLisvZztcXG4gICAgICAgICAgICB2YXIgZXhwID0gJ+WxleW8gDonO1xcbiAgICAgICAgICAgIHZhciByZXQgPSAn5pS26LW3Oic7XFxuICAgICAgICAgICAgaWYgKHNob3cgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZXQsIGV4cClcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIHNkYyArICc8L3NtYWxsPicpXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLyg8XFxcXC9zbWFsbD48YnI+PGZvbnQgY29sb3I9XFxcIikuKj8oXFxcIj4pLywgJyQxIzhBMkJFMiQyICcpLy/ntKvoibLmlLbotbfpopzoibJcXG5cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShtLCAnMCcpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShleHAsIHJldClcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIGRjICsgJzwvc21hbGw+JylcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvKDxcXFxcL3NtYWxsPjxicj48Zm9udCBjb2xvcj1cXFwiKS4qPyhcXFwiPikvLCAnJDEjMDA4MDAwJDInKS8v57u/6Imy5bGV5byA6aKc6ImyXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0obSwgJzEnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIGBoaWtlcjovL2VtcHR5YFxcbiAgICAgICAgfSwgZGVzYywgc2Rlc2MsIG1hcmspXFxuICAgICAgICB2YXIgc2MgPSBzdG9yYWdlMC5nZXRJdGVtKG1hcmssICcwJykgPT0gJzAnID8gJ+WxleW8gDonIDogJ+aUtui1tzonO1xcbiAgICAgICAgdmFyIGRjID0gc3RvcmFnZTAuZ2V0SXRlbShtYXJrLCAnMCcpID09ICcwJyA/IHNkZXNjIDogZGVzYztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgdGl0bGU6ICcnICsgJzxiPjxmb250IGNvbG9yPVxcXCJjeWFuXFxcIj7iiLcg5Ymn5oOF566A5LuLXFx0PC9mb250PjwvYj4nICsgXFxcIjxzbWFsbD48YSBzdHlsZT0ndGV4dC1kZWNvcmF0aW9uOiBub25lOycgaHJlZj0nXFxcIiArIGxhenkgKyBcXFwiJz5cXFwiICsgc2MgKyAnPC9hPjwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIjOEEyQkUyXFxcIj4nICsgYCR7ZGN9YCArICc8L3NtYWxsPicsLy/ntKvoibLpu5jorqTpopzoibJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6ICdkZXNjJyxcXG4gICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDYsXFxuICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNSxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IHRydWUsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG5cXG4vL+a1t+aKpVxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihvYmopIHtcXG4gICAgICAgIHZhciBjb250ZW50cyA9IG9iai5tYWluO1xcbiAgICAgICAgdmFyIHNvcnRPcmRlciA9IG9iai5zb3J0O1xcbiAgICAgICAgdmFyIGltZyA9IG9iai5pbWc7XFxuICAgICAgICB2YXIgdGV4dHMgPSBjb250ZW50cy5tYXAoeCA9PiBwZGZoKHgsICdUZXh0JykpO1xcbiAgICAgICAgdmFyIGFycmF5ID0gdGV4dHMuc29ydCgoYSwgYikgPT4ge1xcbiAgICAgICAgICAgIGNvbnN0IGluZGV4QSA9IHNvcnRPcmRlci5pbmRleE9mKGEuc3Vic3RyKDAsIDIpKTtcXG4gICAgICAgICAgICBjb25zdCBpbmRleEIgPSBzb3J0T3JkZXIuaW5kZXhPZihiLnN1YnN0cigwLCAyKSk7XFxuICAgICAgICAgICAgcmV0dXJuIGluZGV4QSAtIGluZGV4QjtcXG4gICAgICAgIH0pXFxuICAgICAgICB2YXIgcmVnZXggPSBuZXcgUmVnRXhwKCcoJyArIHNvcnRPcmRlci5qb2luKCd8JykgKyAnKScpO1xcbiAgICAgICAgYXJyYXkgPSBhcnJheS5maWx0ZXIoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgIHJldHVybiByZWdleC50ZXN0KGl0ZW0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBhcnJheSA9IGFycmF5Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICBzdHIgPSB4O1xcbiAgICAgICAgICAgIGlmICgvKOWvvOa8lHzkuLvmvJR857G75Z6LKe+8mi8udGVzdChzdHIpKSB7XFxuICAgICAgICAgICAgICAgIHN0ciA9IHN0ci5zcGxpdCgnLycpLm1hcCgodmFsLCBpbmRleCkgPT4gKGluZGV4ID09PSAwID8gJycgOiAnJykgKyB2YWwpLnNsaWNlKDAsIDYpLmpvaW4oJyAnKS5yZXBsYWNlKC8gJC8sICcnKS5yZXBsYWNlKC9cXFxcKC4qP1xcXFwpL2csICcnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHN0clxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICB0aXRsZTogdGhpcy5zbWFsbChhcnJheVswXSArICdcXFxcbicgKyBhcnJheS5zbGljZSgxLCAzKS5qb2luKCdcXFxcbicpLCcjRkY3RjAwJyksLy/mqZjoibJcXG4gICAgICAgICAgIC8vICB0aXRsZTogdGhpcy5zbWFsbCggcGRmaChodG1sLCdwOmNvbnRhaW5zKOW5tOS7vSkmJlRleHQnKS5yZXBsYWNlKC9cXFxcLy9nLCcgJykrICdcX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ICdzaHNvcnQnO1xcbiAgICAgICAgdmFyIHRpdGxlID0gKGdldE15VmFyKHNoc29ydCwgJzAnKSA9PSAnMScpID8gJzxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogI0ZGMDAwMFxcXCI+6YCG5bqPPC9zcGFuPjwvYj4nIDogJzxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogIzFhYWQxOVxcXCI+5q2j5bqPPC9zcGFuPjwvYj4nXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2YXJpICsgJzonICsgdGl0bGUsXFxuICAgICAgICAgICAgZGVzYzogJ+WFsScgKyB0YWJzLmxlbmd0aCArICfmnaHnur/ot68nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2hzb3J0KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25mID0gZ2V0TXlWYXIoc2hzb3J0LCAnMCcpO1xcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCwgJzAnKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCwgJzEnKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmjpLluo/miJDlip8nXFxuICAgICAgICAgICAgfSwgc2hzb3J0KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vY2RuMS5pY29uZmluZGVyLmNvbS9kYXRhL2ljb25zL2FuaW1hbHMtODgvNjQvQ2F0XzEtMTI4LnBuZycsXFxuICAgICAgICB9KVxcbiAgICAgICAgdmFyIOaKmOWPo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nZShmYWxzZSk7J3RvYXN0Oi8v5YiH5o2i5oiQ5Yqf77yBJzsnI25vSGlzdG9yeSNoaWtlcjovL2VtcHR5J1xcXCI7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKHZhcmksICcwJykgPT0gaSA/ICfigJzigJwnICsgdGFic1tpXSArICfigJ3igJ0nIDogdGFic1tpXSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBzZXRMaXN0czogZnVuY3Rpb24obGlzdHMsIGluZGV4LCBzaHNvcnQpIHtcXG4gICAgICAgIHNoc29ydCA9IHNoc29ydCA/IHNoc29ydCA6ICdzaHNvcnQnO1xcbiAgICAgICAgdmFyIGxpc3QgPSBsaXN0c1tpbmRleF07XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoc2hzb3J0KSA9PSAnMScgJiYgbGlzdHMubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gbGlzdHNbaW5kZXhdLnJldmVyc2UoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAodmFyIGogaW4gbGlzdCkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBsaXN0W2pdLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IGxpc3Rbal0udXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogbGlzdC5sZW5ndGggPiA0ID8gJ3RleHRfNScgOiAndGV4dF8yJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBsaXN0W2pdLnVybC5yZXBsYWNlKC9AbGF6eVJ1bGVbXFxcXHNcXFxcU10rL2csICcnKSxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBnZXRUYWJzOiBmdW5jdGlvbihwYXJzZSkge1xcbiAgICAgICAgdmFyIHRhYnMgPSBbXTtcXG4gICAgICAgIHZhciBhcnRzID0gcGRmYShodG1sLCBwYXJzZS7nur/ot68pO1xcbiAgICAgICAgdmFyIOe6v+i3r+WQjSA9IHBhcnNlLue6v+i3r+WQjeensDtcXG4gICAgICAgIHZhciDmm7/mjaLlh73mlbAgPSAnJztcXG4gICAgICAgIGlmIChwYXJzZS7nur/ot6/lkI3np7AuaW5jbHVkZXMoJ0BAJykpIHtcXG4gICAgICAgICAgICDnur/ot6/lkI0gPSBwYXJzZS7nur/ot6/lkI3np7Auc3BsaXQoJ0BAJylbMF07XFxuICAgICAgICAgICAg5pu/5o2i5Ye95pWwID0gcGFyc2Uu57q/6Lev5ZCN56ewLnNwbGl0KCdAQCcpWzFdO1xcbiAgICAgICAgfVxcbiAgICAgICAgZm9yICh2YXIgaSBpbiBhcnRzKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmVuYW1lID0gcGRmaChhcnRzW2ldLCDnur/ot6/lkI0pO1xcbiAgICAgICAgICAgIGlmICjmm7/mjaLlh73mlbAgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgbGluZW5hbWUgPSBldmFsKCdsaW5lbmFtZScgKyDmm7/mjaLlh73mlbApO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0YWJzLnB1c2gobGluZW5hbWUpO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgcmV0dXJuIHRhYnM7XFxuICAgIH0sXFxuICAgIGdldExpc3RzOiBmdW5jdGlvbihwYXJzZSkge1xcbiAgICAgICAgdmFyIGxpc3RzID0gW107XFxuICAgICAgICB2YXIgY29udHMgPSBwZGZhKGh0bWwsIHBhcnNlLumAiembhik7XFxuICAgICAgICB2YXIg6YCJ6ZuG5ZCN56ewID0gcGFyc2Uu6YCJ6ZuG5ZCN56ewID8gcGFyc2Uu6YCJ6ZuG5ZCN56ewIDogJ2EmJlRleHQnO1xcbiAgICAgICAgdmFyIOmAiembhumTvuaOpSA9IHBhcnNlLumAiembhumTvuaOpSA/IHBhcnNlLumAiembhumTvuaOpSA6ICdhJiZocmVmJztcXG4gICAgICAgIHZhciDop6PmnpAgPSBwYXJzZS7op6PmnpAgPyBwYXJzZS7op6PmnpAgOiAnJztcXG4gICAgICAgIHZhciB0ZW1wID0gW107XFxuICAgICAgICBmb3IgKHZhciBpIGluIGNvbnRzKSB7XFxuICAgICAgICAgICAgaWYgKHBhcnNlLumAiembhuWIl+ihqCAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgbGlzdHMucHVzaChwZGZhKGNvbnRzW2ldLCBwYXJzZS7pgInpm4bliJfooagpLm1hcCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoeCwg6YCJ6ZuG5ZCN56ewKS5yZXBsYWNlKC/nrKx86ZuGfOivnXzmnJ8vZywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogcGQoeCwg6YCJ6ZuG6ZO+5o6lKSArIOino+aekCxcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHBkKGNvbnRzW2ldLCDpgInpm4bpk77mjqUpO1xcbiAgICAgICAgICAgICAgICBpZiAoIemAiembhumTvuaOpS5pbmNsdWRlcygnaHJlZicpKSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSBwZGZoKGNvbnRzW2ldLCDpgInpm4bpk77mjqUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRlbXAucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0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dlMC5nZXRNeVZhcignc3BhZ2UnLCAnJyk7XFxuICAgICAgICAgICAgLy9wdXRNeVZhcih1LCBwKTtcXG4gICAgICAgIH0sIOeKtuaAgSkpXFxuICAgIH0sXFxuICAgIGpzb25MaXN0OiBmdW5jdGlvbihhcnIsIGpzb24sIHJ1bGUpIHtcXG4gICAgICAgIGlmIChqc29uLmNvbnN0cnVjdG9yICE9IE9iamVjdCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGpzb24gPSBKU09OLnBhcnNlKGpzb24pXFxuICAgICAgICAgICAgfSBjYXRjaCB7fVxcbiAgICAgICAgfVxcbiAgICAgICAganNvbltydWxlLmxpc3RdLmZvckVhY2goaXRlbT0+e1xcbiAgICAgICAgICAgIHZhciBpbWc9ZXZhbChydWxlLmltZykrcnVsZS5yZWY7XFxuICAgICAgICAgICAgdmFyIGhyZWY9ZXZhbChydWxlLnVybCk7XFxuICAgICAgICAgICAgaHJlZiA9IHJ1bGUuaW10ID8gaHJlZiArICcjaW1tZXJzaXZlVGhlbWUjJyA6IGhyZWY7XFxuICAgICAgICAgICAgdmFyIGxhenk9cnVsZS5sYXp5P3J1bGUubGF6eTonJztcXG4gICAgICAgICAgICB2YXIgZGQ9e1xcbiAgICAgICAgICAgICAgICB0aXRsZTpldmFsKHJ1bGUudGl0bGUpLFxcbiAgICAgICAgICAgICAgICBkZXNjOmV2YWwocnVsZS5kZXNjKSxcXG4gICAgICAgICAgICAgICAgY29udGVudDpldmFsKHJ1bGUuY29udGVudCksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6aW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6J2hpa2VyOi8vZW1wdHkjIycraHJlZiwgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOnJ1bGUuY29sX3R5cGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgICAgIGltZzppbWcsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYobGF6eSE9Jycpe1xcbiAgICAgICAgICAgICAgICBkZFsndXJsJ109aHJlZitsYXp5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIucHVzaChkZCk7XFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBydWxlTGlzdDogZnVuY3Rpb24oYXJyLCBodG1sLCBydWxlKSB7XFxuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgcnVsZS5saXN0KTtcXG4gICAgICAgIGxpc3QuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgICAgICB2YXIgZGVzYyA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmRlc2MpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSB0aGlzLmltZ0hhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5jb250ZW50KTtcXG4gICAgICAgICAgICB2YXIgbGF6eT1ydWxlLmxhenk/cnVsZS5sYXp5OicnO1xcbiAgICAgICAgICAgIHZhciBkZD17XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5IyMnK3VybCxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHJ1bGUuY29sX3R5cGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZihsYXp5IT0nJyl7XFxuICAgICAgICAgICAgICAgIGRkWyd1cmwnXT11cmwrbGF6eTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyLnB1c2goZGQpXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBMaXN0OiBmdW5jdGlvbihhcnIsIGh0bWwsIHJ1bGUsIHBhcmFtKSB7XFxuICAgICAgICBwYXJhbSA9IHBhcmFtID8gcGFyYW0gOiB7fTtcXG4gICAgICAgIHZhciBhdXRvID0gcGFyYW0uYXV0byA/IHBhcmFtLmF1dG8gOiBmYWxzZTtcXG4gICAgICAgIHZhciBzaG93ID0gcGFyYW0uc2hvdyA/IHBhcmFtLnNob3cgOiBmYWxzZTtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAvL3RoaXMuc3BhZ2Uuc2V0KHRydWVfdXJsKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciDnirbmgIEgPSAodHlwZW9mKOeKtuaAgeagh+iusCkgIT0gJ3VuZGVmaW5lZCcgJiYg54q25oCB5qCH6K6wwqAgIT0gJycpID8g54q25oCB5qCH6K6wIDogTVlfUlVMRS51cmw7XFxuICAgICAgICB0aGlzLnJlZnJlc2goKTtcXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBydWxlLmxpc3QpO1xcbiAgICAgICAgdmFyIGFjdGlvbiA9IGZhbHNlO1xcbiAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICBhY3Rpb24gPSBmYWxzZTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdmFyIHNhdmVsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ3lpbGlzdCcsICdbXScpO1xcbiAgICAgICAgICAgIGFjdGlvbiA9ICFleHRNZXRob2QuaXNFcXVhbChzYXZlbGlzdCwgbGlzdCk7XFxuICAgICAgICAgICAgLy9sb2coYWN0aW9uKVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKCh0aGlzLm5leHRQYWdlKCkgJiYgbGlzdC5sZW5ndGggPiAwKSB8fCBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBsaXN0LmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbSgncGFnZW51bScpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKCdwYWdlbGluZScpO1xcbiAgICAgICAgICAgICAgICB2YXIgaWQgPSAnJztcXG4gICAgICAgICAgICAgICAgdmFyIGNscyA9ICcnO1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS50aXRsZSk7XFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxuICAgICAgICAgICAgICAgIHZhciBpbWcgPSB0aGlzLmltZ0hhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMudXJsSGFuZGxlKGl0ZW0sIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gJ2xhc3RpZF8nICsgcGFnZTtcXG4gICAgICAgICAgICAgICAgICAgIGNscyA9ICdsYXN0bWFyayc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6J2hpa2VyOi8vZW1wdHkjIycrdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBjbHNcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxICYmIHNob3cpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogJ3BhZ2VsaW5lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c21hbGw+5Yqg6L295LitLi4uPC9zbWFsbD4nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdwYWdlbnVtJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgncGFnZW51bScsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+PHNtYWxsPuWIsOW6leS6hjwvc21hbGw+PC9mb250PicsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICdsYXN0JyxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9wdXRNeVZhcigneWlsaXN0JywgbGlzdCk7XFxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+PHNtYWxsPuaXoOWGheWuuTwvc21hbGw+PC9mb250PicsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcblxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChhdXRvKSB7XFxuICAgICAgICAgICAgY3JlYXRlTmV4dFBhZ2UoKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbn1cXG5cXG5cXG52YXIgZXh0TWV0aG9kID0ge1xcbiAgICBUb1BhcmFtczogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIganNvbiA9IGFyZ3VtZW50c1swXTtcXG4gICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhqc29uKS5tYXAoa2V5ID0+IGtleSArICc9JyArIGpzb25ba2V5XSkuam9pbignJicpO1xcbiAgICB9LFxcbiAgICB1cmxQYXJzZTogZnVuY3Rpb24odSkge1xcbiAgICAgICAgdmFyIGRpY3QgPSB7fVxcbiAgICAgICAgZGljdC5Tb3VyY2UgPSB1O1xcbiAgICAgICAgbGV0IHBhcmFtcyA9ICh1cmwpID0+IHtcXG4gICAgICAgICAgICBsZXQgcXVlcnlQYXJhbXMgPSB7fTtcXG4gICAgICAgICAgICBsZXQgcmVnID0gLyhbXj89Jl0rKT0oW14/PSZdKykvZztcXG4gICAgICAgICAgICB1cmwucmVwbGFjZShyZWcsIGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICBxdWVyeVBhcmFtc1thcmd1bWVudHNbMV1dID0gYXJndW1lbnRzWzJdO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5UGFyYW1zXFxuICAgICAgICB9XFxuICAgICAgICB2YXIgamF2YVVybCA9IEphdmFJbXBvcnRlcihqYXZhLm5ldC5VUkwpO1xcbiAgICAgICAgd2l0aChqYXZhVXJsKSB7XFxuICAgICAgICAgICAgdmFyIHVybCA9IG5ldyBVUkwodSk7XFxuICAgICAgICAgICAgZGljdC5Qcm90b2NvbCA9IHVybC5nZXRQcm90b2NvbCgpO1xcbiAgICAgIC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HN0cjJbaV0pIHtcXG4gICAgICAgICAgICAgICAgZGlmZkNoYXJzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXFxuICAgICAgICAgICAgICAgICAgICBzMTogc3RyMVtpXSxcXG4gICAgICAgICAgICAgICAgICAgIHMyOiBzdHIyW2ldXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBkaWZmQ2hhcnM7XFxuICAgIH0sXFxuICAgIHJlcGxhY2VDaGFyQXQ6IGZ1bmN0aW9uKHN0ciwgaW5kZXgsIHJlcGxhY2VtZW50KSB7XFxuICAgICAgICBpZiAoaW5kZXggPCAwIHx8IGluZGV4ID49IHN0ci5sZW5ndGgpIHtcXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coaW5kZXgpXFxuICAgICAgICBjb25zdCBhcnIgPSBzdHIuc3BsaXQoXFxcIlxcXCIpO1xcbiAgICAgICAgYXJyW2luZGV4XSA9IHJlcGxhY2VtZW50O1xcbiAgICAgICAgcmV0dXJuIGFyci5qb2luKFxcXCJcXFwiKTtcXG4gICAgfSxcXG4gICAgZ2V0TmV4dFVybDogZnVuY3Rpb24oc291cmNlLCB0YXJnZXQsIHBhcmFtcykge1xcbiAgICAgICAgdmFyIHUxID0gdGhpcy51cmxQYXJzZShzb3VyY2UpO1xcbiAgICAgICAgdmFyIHUyID0gdGhpcy51cmxQYXJzZSh0YXJnZXQpO1xcbiAgICAgICAgdmFyIHBhID0gdW5kZWZpbmVkO1xcbiAgICAgICAgaWYgKHR5cGVvZihwYXJhbXMpID09ICdvYmplY3QnKSB7XFxuICAgICAgICAgICAgcGEgPSBwYXJhbXMuaGFzT3duUHJvcGVydHkoJ+eJueW+gScpID8gcGFyYW1zLueJueW+gSA6IHVuZGVmaW5lZDtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBuZXh0dXJsID0gc291cmNlO1xcbiAgICAgICAgdmFyIGNhID0gT2JqZWN0LmtleXModTIuUGFyYW1zKS5sZW5ndGggPT0gMCA/ICcnIDogJz8nO1xcbiAgICAgICAgaWYgKHBhICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHZhciBycyA9IFN0cmluZyh1Mi5QYXRoKS5yZXBsYWNlKG5ldyBSZWdFeHAocGEpLCAnJDFmeXBhZ2UnKTtcXG4gICAgICAgICAgICBuZXh0dXJsID0gdTIuSG9zdHMgKyBycyArIGNhICsgdGhpcy5Ub1BhcmFtcyh1Mi5QYXJhbXMpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpZiAodGhpcy5pc0VxdWFsKHUxLlBhcmFtcywgdTIuUGFyYW1zKSkge1xcbiAgICAgICAgICAgICAgICAvL2xvZyh1MS5QYXRoKVxcbiAgICAgICAgICAgICAgICAvL2xvZyh1Mi5QYXRoKVxcbiAgICAgICAgICAgICAgICB2YXIgZGYgPSB0aGlzLmZpbmREaWZmZXJlbnRJbmRleChTdHJpbmcodTEuUGF0aCksIFN0cmluZyh1Mi5QYXRoKSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKGRmKVxcbiAgICAgICAgICAgICAgICBpZiAoZGYubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZSA9IGRmWzBdLmluZGV4XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZiA9IGRmLmZpbHRlcih4ID0+IC9cXFxcZCsvLnRlc3QoeC5zMikpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gZlswXS5pbmRleDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgZXEgPSB0aGlzLnJlcGxhY2VDaGFyQXQoU3RyaW5nKHUyLlBhdGgpLCByZSwgJ2Z5cGFnZScpO1xcbiAgICAgICAgICAgICAgICBuZXh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