D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
dkarthik1729
Full window
Github gist
Course_toCourse
Built with
blockbuilder.org
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <script src="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgewogIC8vIElmIHdpbmRvdy5IVE1MV2lkZ2V0cyBpcyBhbHJlYWR5IGRlZmluZWQsIHRoZW4gdXNlIGl0OyBvdGhlcndpc2UgY3JlYXRlIGEKICAvLyBuZXcgb2JqZWN0LiBUaGlzIGFsbG93cyBwcmVjZWRpbmcgY29kZSB0byBzZXQgb3B0aW9ucyB0aGF0IGFmZmVjdCB0aGUKICAvLyBpbml0aWFsaXphdGlvbiBwcm9jZXNzICh0aG91Z2ggbm9uZSBjdXJyZW50bHkgZXhpc3QpLgogIHdpbmRvdy5IVE1MV2lkZ2V0cyA9IHdpbmRvdy5IVE1MV2lkZ2V0cyB8fCB7fTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gYSB2aWV3ZXIgcGFuZS4gSWYgbm90LCB3ZSdyZSBpbiBhIHdlYiBicm93c2VyLgogIHZhciB2aWV3ZXJNb2RlID0gd2luZG93LkhUTUxXaWRnZXRzLnZpZXdlck1vZGUgPQogICAgICAvXGJ2aWV3ZXJfcGFuZT0xXGIvLnRlc3Qod2luZG93LmxvY2F0aW9uKTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gU2hpbnkgbW9kZS4gSWYgbm90LCBpdCdzIGEgc3RhdGljIGRvY3VtZW50LgogIC8vIE5vdGUgdGhhdCBzdGF0aWMgd2lkZ2V0cyBjYW4gYXBwZWFyIGluIGJvdGggU2hpbnkgYW5kIHN0YXRpYyBtb2RlcywgYnV0CiAgLy8gb2J2aW91c2x5LCBTaGlueSB3aWRnZXRzIGNhbiBvbmx5IGFwcGVhciBpbiBTaGlueSBhcHBzL2RvY3VtZW50cy4KICB2YXIgc2hpbnlNb2RlID0gd2luZG93LkhUTUxX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gImZ1bmN0aW9uIikgewogICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJUYXNrIG11c3QgYmUgYSBmdW5jdGlvbiEgU291cmNlOlxuIiArIHRhc2spOwogICAgICAgIH0KICAgICAgICB0YXNrRnVuYy5hcHBseSh0YXJnZXQsIHRoZXNlQXJncyk7CiAgICAgIH0pOwogICAgfQogIH0KCiAgZnVuY3Rpb24gaW5pdFNpemluZyhlbCkgewogICAgdmFyIHNpemluZyA9IHNpemluZ1BvbGljeShlbCk7CiAgICBpZiAoIXNpemluZykKICAgICAgcmV0dXJuOwoKICAgIHZhciBjZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiaHRtbHdpZGdldF9jb250YWluZXIiKTsKICAgIGlmICghY2VsKQogICAgICByZXR1cm47CgogICAgaWYgKHR5cGVvZihzaXppbmcucGFkZGluZykgIT09ICJ1bmRlZmluZWQiKSB7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUubWFyZ2luID0gIjAiOwogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLnBhZGRpbmcgPSBwYWRkaW5nVG9Dc3ModW5wYWNrUGFkZGluZyhzaXppbmcucGFkZGluZykpOwogICAgfQoKICAgIGlmIChzaXppbmcuZmlsbCkgewogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLm92ZXJmbG93ID0gImhpZGRlbiI7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUud2lkdGggPSAiMTAwJSI7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUuaGVpZ2h0ID0gIjEwMCUiOwogICAgICBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc3R5bGUud2lkdGggPSAiMTAwJSI7CiAgICAgIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5zdHlsZS5oZWlnaHQgPSAiMTAwJSI7CiAgICAgIGlmIChjZWwpIHsKICAgICAgICBjZWwuc3R5bGUucG9zaXRpb24gPSAiYWJzb2x1dGUiOwogICAgICAgIH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GgiLCBlbC5vZmZzZXRXaWR0aCkKICAgICAgICAgICAgLmNzcygiaGVpZ2h0IiwgZWwub2Zmc2V0SGVpZ2h0KTsKICAgICAgICAgIGVycm9yRGl2LnRleHQoZXJyLm1lc3NhZ2UpOwogICAgICAgICAgJGVsLmFmdGVyKGVycm9yRGl2KTsKCiAgICAgICAgICAvLyBSZWFsbHkgZHVtYiB3YXkgdG8ga2VlcCB0aGUgc2l6ZS9wb3NpdGlvbiBvZiB0aGUgZXJyb3IgaW4gc3luYyB3aXRoCiAgICAgICAgICAvLyB0aGUgcGFyZW50IGVsZW1lbnQgYXMgdGhlIHdpbmRvdyBpcyByZXNpemVkIG9yIHdoYXRldmVyLgogICAgICAgICAgdmFyIGludElkID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGlmICghZXJyb3JEaXZbMF0ucGFyZW50RWxlbWVudCkgewogICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW50SWQpOwogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvckRpdgogICAgICAgICAgICAgIC5jc3MoInRvcCIsIGVsLm9mZnNldFRvcCkKICAgICAgICAgICAgICAuY3NzKCJsZWZ0IiwgZWwub2Zmc2V0TGVmdCkKICAgICAgICAgICAgICAuY3NzKCJtYXhXaWR0aCIsIGVsLm9mZnNldFdpZHRoKQogICAgICAgICAgICAgIC5jc3MoImhlaWdodCIsIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICB9LCA1MDApOwogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIGNsZWFyRXJyb3I6IGZ1bmN0aW9uKGVsKSB7CiAgICAgIHZhciAkZWwgPSAkKGVsKTsKICAgICAgdmFyIGRpc3BsYXkgPSAkZWwuZGF0YSgicmVzdG9yZS1kaXNwbGF5LW1vZGUiKTsKICAgICAgJGVsLmRhdGEoInJlc3RvcmUtZGlzcGxheS1tb2RlIiwgbnVsbCk7Cgog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mJiBpIDwgZGF0YS5ldmFscy5sZW5ndGg7IGkrKykgewogICAgICAgICAgd2luZG93LkhUTUxXaWRnZXRzLmV2YWx1YXRlU3RyaW5nTWVtYmVyKGRhdGEueCwgZGF0YS5ldmFsc1tpXSk7CiAgICAgICAgfQogICAgICAgIGlmICghYmluZGluZ0RlZi5yZW5kZXJPbk51bGxWYWx1ZSkgewogICAgICAgICAgaWYgKGRhdGEueCA9PT0gbnVsbCkgewogICAgICAgICAgICBlbC5zdHlsZS52aXNpYmlsaXR5ID0gImhpZGRlbiI7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnZpc2liaWxpdHkgPSAiaW5oZXJpdCI7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghZWxlbWVudERhdGEoZWwsICJpbml0aWFsaXplZCIpKSB7CiAgICAgICAgICBpbml0U2l6aW5nKGVsKTsKCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRpYWxpemVkIiwgdHJ1ZSk7CiAgICAgICAgICBpZiAoYmluZGluZ0RlZi5pbml0aWFsaXplKSB7CiAgICAgICAgICAgIHZhciByZXN1bHQgPSBiaW5kaW5nRGVmLmluaXRpYWxpemUoZWwsIGVsLm9mZnNldFdpZHRoLAogICAgICAgICAgICAgIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICAgIGVsZW1lbnREYXRhKGVsLCAiaW5pdF9yZXN1bHQiLCByZXN1bHQpOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBiaW5kaW5nRGVmLnJlbmRlclZhbHVlKGVsLCBkYXRhLngsIGVsZW1lbnREYXRhKGVsLCAiaW5pdF9yZXN1bHQiKSk7CiAgICAgICAgZXZhbEFuZFJ1bihkYXRhLmpzSG9va3MucmVuZGVyLCBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiksIFtlbCwgZGF0YS54XSk7CiAgICAgIH07CgogICAgICAvLy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IH0KCiAgICAgICAgaWYgKGJpbmRpbmcucmVzaXplKSB7CiAgICAgICAgICB2YXIgbGFzdFNpemUgPSB7fTsKICAgICAgICAgIHZhciByZXNpemVIYW5kbGVyID0gZnVuY3Rpb24oZSkgewogICAgICAgICAgICB2YXIgc2l6ZSA9IHsKICAgICAgICAgICAgICB3OiBzaXplT2JqID8gc2l6ZU9iai5nZXRXaWR0aCgpIDogZWwub2Zmc2V0V2lkdGgsCiAgICAgICAgICAgICAgaDogc2l6ZU9iaiA/IHNpemVPYmouZ2V0SGVpZ2h0KCkgOiBlbC5vZmZzZXRIZWlnaHQKICAgICAgICAgICAgfTsKICAgICAgICAgICAgaWYgKHNpemUudyA9PT0gMCAmJiBzaXplLmggPT09IDApCiAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBpZiAoc2l6ZS53ID09PSBsYXN0U2l6ZS53ICYmIHNpemUuaCA9PT0gbGFzdFNpemUuaCkKICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIGxhc3RTaXplID0gc2l6ZTsKICAgICAgICAgICAgYmluZGluZy5yZXNpemUoZWwsIHNpemUudywgc2l6ZS5oLCBpbml0UmVzdWx0KTsKICAgICAgICAgIH07CgogICAgICAgICAgb24od2luZG93LCAicmVzaXplIiwgcmVzaXplSGFuZGxlcik7CgogICAgICAgICAgLy8gVGhpcyBpcyBuZWVkZWQgZm9yIGNhc2VzIHdoZXJlIHdlJ3JlIHJ1bm5pbmcgaW4gYSBTaGlueQogICAgICAgICAgLy8gYXBwLCBidXQgdGhlIHdpZGdldCBpdHNlbGYgaXMgbm90IGEgU2hpbnkgb3V0cHV0LCBidXQKICAgICAgICAgIC8vIHJhdGhlciBhIHNpbXBsZSBzdGF0aWMgd2lkZ2V0LiBPbmUgZXhhbXBsZSBvZiB0aGlzIGlzCiAgICAgICAgICAvLyBhbiBybWFya2Rvd24gZG9jdW1lbnQgdGhhdCBoYXMgcnVudGltZTpzaGlueSBhbmQgd2lkZ2V0CiAg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pZ2h0KTsKICAgICAgfSwKICAgICAgcmVuZGVyVmFsdWU6IGZ1bmN0aW9uKGVsLCB4LCBpbnN0YW5jZSkgewogICAgICAgIHJldHVybiBpbnN0YW5jZS5yZW5kZXJWYWx1ZSh4KTsKICAgICAgfSwKICAgICAgcmVzaXplOiBmdW5jdGlvbihlbCwgd2lkdGgsIGhlaWdodCwgaW5zdGFuY2UpIHsKICAgICAgICByZXR1cm4gaW5zdGFuY2UucmVzaXplKHdpZHRoLCBoZWlnaHQpOwogICAgICB9CiAgICB9OwoKICAgIGlmIChkZWZuLmZpbmQpCiAgICAgIHJlc3VsdC5maW5kID0gZGVmbi5maW5kOwogICAgaWYgKGRlZm4ucmVuZGVyRXJyb3IpCiAgICAgIHJlc3VsdC5yZW5kZXJFcnJvciA9IGRlZm4ucmVuZGVyRXJyb3I7CiAgICBpZiAoZGVmbi5jbGVhckVycm9yKQogICAgICByZXN1bHQuY2xlYXJFcnJvciA9IGRlZm4uY2xlYXJFcnJvcjsKCiAgICByZXR1cm4gcmVzdWx0OwogIH0KfSkoKTsKCg=="></script> <script src="data:application/x-javascript;base64,IWZ1bmN0aW9uKCl7ZnVuY3Rpb24gbihuKXtyZXR1cm4gbiYmKG4ub3duZXJEb2N1bWVudHx8bi5kb2N1bWVudHx8bikuZG9jdW1lbnRFbGVtZW50fWZ1bmN0aW9uIHQobil7cmV0dXJuIG4mJihuLm93bmVyRG9jdW1lbnQmJm4ub3duZXJEb2N1bWVudC5kZWZhdWx0Vmlld3x8bi5kb2N1bWVudCYmbnx8bi5kZWZhdWx0Vmlldyl9ZnVuY3Rpb24gZShuLHQpe3JldHVybiB0Pm4/LTE6bj50PzE6bj49dD8wOk5hTn1mdW5jdGlvbiByKG4pe3JldHVybiBudWxsPT09bj9OYU46K259ZnVuY3Rpb24gdShuKXtyZXR1cm4haXNOYU4obil9ZnVuY3Rpb24gaShuKXtyZXR1cm57bGVmdDpmdW5jdGlvbih0LGUscix1KXtmb3IoYXJndW1lbnRzL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wiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kPyh0aGlzLmQzPW9hLGRlZmluZShvYSkpOiJvYmplY3QiPT10eXBlb2YgbW9kdWxlJiZtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz1vYTp0aGlzLmQzPW9hfSgpOw=="></script> <script src="data:application/x-javascript;base64,Ly8gZDMudGlwCi8vIENvcHlyaWdodCAoYykgMjAxMyBKdXN0aW4gUGFsbWVyCi8vCi8vIFRvb2x0aXBzIGZvciBkMy5qcyBTVkcgdmlzdWFsaXphdGlvbnMKCihmdW5jdGlvbiAocm9vdCwgZmFjdG9yeSkgewogIGlmICh0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQpIHsKICAgIC8vIEFNRC4gUmVnaXN0ZXIgYXMgYW4gYW5vbnltb3VzIG1vZHVsZSB3aXRoIGQzIGFzIGEgZGVwZW5kZW5jeS4KICAgIGRlZmluZShbJ2QzJ10sIGZhY3RvcnkpOwogIH0gZWxzZSBpZiAodHlwZW9mIG1vZHVsZSA9PT0gJ29iamVjdCcgJiYgbW9kdWxlLmV4cG9ydHMpIHsKICAgIC8vIENvbW1vbkpTCiAgICBtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uKGQzKSB7CiAgICAgIGQzLnRpcCA9IGZhY3RvcnkoZDMpOwogICAgICByZXR1cm4gZDMudGlwOwogICAgfTsKICB9IGVsc2UgewogICAgLy8gQnJvd3NlciBnbG9iYWwuCiAgICByb290LmQzLnRpcCA9IGZhY3Rvcnkocm9vdC5kMyk7CiAgfQp9KHRoaXMsIGZ1bmN0aW9uIChkMykgewoKICAvLyBQdWJsaWMgLSBjb250cnVjdHMgYSBuZXcgdG9vbHRpcAogIC8vCiAgLy8gUmV0dXJucyBhIHRpcAogIHJldHVybiBmdW5jdGlvbigpIHsKICAgIHZhciBkaXJlY3Rpb24gPSBkM190aXBfZGlyZWN0aW9uLAogICA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Glvbl9uZSwKICAgICAgc3c6IGRpcmVjdGlvbl9zdywKICAgICAgc2U6IGRpcmVjdGlvbl9zZSwKICAgICAgbXQ6IGRpcmVjdGlvbl9tdCwKICAgICAgbTogIGRpcmVjdGlvbl9tCiAgICB9KSwKCiAgICBkaXJlY3Rpb25zID0gZGlyZWN0aW9uX2NhbGxiYWNrcy5rZXlzKCk7CgogICAgLy8gbXQgLSBtb3VzZXRpcAogICAgZnVuY3Rpb24gZGlyZWN0aW9uX210KCkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHRvcDogZDMuZXZlbnQucGFnZVksCiAgICAgICAgICAgIGxlZnQ6IGQzLmV2ZW50LnBhZ2VYCiAgICAgICAgfTsKICAgIH0KCiAgICBmdW5jdGlvbiBkaXJlY3Rpb25fbigpIHsKICAgICAgdmFyIGJib3ggPSBnZXRTY3JlZW5CQm94KCk7CiAgICAgIHJldHVybiB7CiAgICAgICAgdG9wOiAgYmJveC5uLnkgLSBub2RlLm9mZnNldEhlaWdodCwKICAgICAgICBsZWZ0OiBiYm94Lm4ueCAtIG5vZGUub2Zmc2V0V2lkdGggLyAyCiAgICAgIH07CiAgICB9CgogICAgZnVuY3Rpb24gZGlyZWN0aW9uX3MoKSB7CiAgICAgIHZhciBiYm94ID0gZ2V0U2NyZWVuQkJveCgpOwogICAgICByZXR1cm4gewogICAgICAgIHRvcDogIGJib3gucy55LAogICAgICAgIGxlZnQ6IGJib3gucy54IC0gbm9kZS5vZmZzZXRXaWR0aCAvIDIKICAgICAgfTsKICAgIH0KCiAgICBmdW5jdGlvbiBkaXJlY3Rpb25fZSgpIHsKICAgICAgdmFyIGJib3ggPSBnZXRTY3JlZW5CQm94KCk7CiAgICAgIHJldHVybiB7CiAgICAgICAgdG9wOiAgYmJveC5lLnkgLSBub2RlLm9mZnNldEhlaWdodCAvIDIsCiAgICAgICAgbGVmdDogYmJveC5lLngKICAgICAgfTsKICAgIH0KCiAgICBmdW5jdGlvbiBkaXJlY3Rpb25fdygpIHsKICAgICAgdmFyIGJib3ggPSBnZXRTY3JlZW5CQm94KCk7CiAgICAgIHJldHVybiB7CiAgICAgICAgdG9wOiAgYmJveC53LnkgLSBub2RlLm9mZnNldEhlaWdodCAvIDIsCiAgICAgICAgbGVmdDogYmJveC53LnggLSBub2RlLm9mZnNldFdpZHRoCiAgICAgIH07CiAgICB9CgogICAgZnVuY3Rpb24gZGlyZWN0aW9uX253KCkgewogICAgICB2YXIgYmJveCA9IGdldFNjcmVlbkJCb3goKTsKICAgICAgcmV0dXJuIHsKICAgICAgICB0b3A6ICBiYm94Lm53LnkgLSBub2RlLm9mZnNldEhlaWdodCwKICAgICAgICBsZWZ0OiBiYm94Lm53LnggLSBub2RlLm9mZnNldFdpZHRoCiAgICAgIH07CiAgICB9CgogICAgZnVuY3Rpb24gZGlyZWN0aW9uX25lKCkgewogICAgICB2YXIgYmJveCA9IGdldFNjcmVlbkJCb3goKTsKICAgICAgcmV0dXJuIHsKICAgICAgICB0b3A6ICBiYm94Lm5lLnkgLSBub2RlLm9mZnNldEhlaWdodCwKICAgICAgICBsZWZ0OiBiYm94Lm5lLngKICAgICAgfTsKICAgIH0KCiAgICBmdW5jdGlvbiBkaXJlY3Rpb25fc3coKSB7CiAgICAgIHZhciBiYm94ID0gZ2V0U2NyZWVuQkJveCgpOwogICAgICByZXR1cm4gewogICAgICAgIHRvcDogIGJib3guc3cueSwKICAgICAgICBsZWZ0OiBiYm94LnN3LnggLSBub2RlLm9mZnNldFdpZHRoCiAgICAgIH07CiAgICB9CgogICAgZnVuY3Rpb24gZGlyZWN0aW9uX3NlKCkgewogICAgICB2YXIgYmJveCA9IGdldFNjcmVlbkJCb3goKTsKICAgICAgcmV0dXJuIHsKICAgICAgICB0b3A6ICBiYm94LnNlLnksCiAgICAgICAgbGVmdDogYmJveC5zZS54CiAgICAgIH07CiAgICB9CgogICAgLy8gbWlkZGxlIG9mIHRoZSBiYm94CiAgICBmdW5jdGlvbiBkaXJlY3Rpb25fbSgpIHsKICAgICAgdmFyIGJib3ggPSBnZXRTY3JlZW5CQm94KCk7CiAgICAgIHJldHVybiB7CiAgICAgICAgdG9wOiAgYmJveC5uZS55ICsgKGJib3guc3cueSAtIGJib3gubmUueSkgLyAyLAogICAgICAgIGxlZnQ6IGJib3gubncueCArIChiYm94Lm5lLnggLSBiYm94Lm53LngpIC8gMgogICAgICB9OwogICAgfQoKICAgIGZ1bmN0aW9uIGluaXROb2RlKCkgewogICAgICB2YXIgbm9kZSA9IGQzLnNlbGVjdChkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKSk7CiAgICAgIG5vZGUuc3R5bGUoewogICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLAogICAgICAgIHRvcDogMCwKICAgICAgICBvcGFjaXR5OiAwLAogICAgICAgICdwb2ludGVyLWV2ZW50cyc6ICdub25lJywKICAgICAgICAnYm94LXNpemluZyc6ICdib3JkZXItYm94JwogICAgICB9KTsKCiAgICAgIHJldHVybiBub2RlLm5vZGUoKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRTVkdOb2RlKGVsKSB7CiAgICAgIGVsID0gZWwubm9kZSgpOwogICAgICBpZihlbC50YWdOYW1lLnRvTG93ZXJDYXNlKCkgPT09ICdzdmcnKQogICAgICAgIHJldHVybiBlbDsKCiAgICAgIHJldHVybiBlbC5vd25lclNWR0VsZW1lbnQ7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0Tm9kZUVsKCkgewogICAgICBpZihub2RlID09PSBudWxsKSB7CiAgICAgICAgbm9kZSA9IGluaXROb2RlKCk7CiAgICAgICAgLy8gcmUtYWRkIG5vZGUgdG8gRE9NCiAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChub2RlKTsKICAgICAgfQogICAgICByZXR1cm4gZDMuc2VsZWN0KG5vZGUpOwogICAgfQoKICAgIC8vIFByaXZhdGUgLSBnZXRzIHRoZSBzY3JlZW4gY29vcmRpbmF0ZXMgb2YgYSBzaGFwZQogICAgLy8KICAgIC8vIEdpdmVuIGEgc2hhcGUgb24gdGhlIHNjcmVlbiwgd2lsbCByZXR1cm4gYW4gU1ZHUG9pbnQgZm9yIHRoZSBkaXJlY3Rpb25zCiAgICAvLyBuKG5vcnRoKSwgcyhzb3V0aCksIGUoZWFzdCksIHcod2VzdCksIG5lKG5vcnRoZWFzdCksIHNlKHNvdXRoZWFzdCksIG53KG5vcnRod2VzdCksCiAgICAvLyBzdyhzb3V0aHdlc3QpLgogICAgLy8KICAgIC8vICAgICstKy0rCiAgICAvLyAgICB8ICAgfAogICAgLy8gICAgKyAgICsKICAgIC8vICAgIHwgICB8CiAgICAvLyAgICArLSstKwogICAgLy8KICAgIC8vIFJldHVybnMgYW4gT2JqZWN0IHtuLCBzLCBlLCB3LCBudywgc3csIG5lLCBzZX0KICAgIGZ1bmN0aW9uIGdldFNjcmVlbkJCb3goKSB7CiAgICAgIHZhciB0YXJnZXRlbCAgID0gdGFyZ2V0IHx8IGQzLmV2ZW50LnRhcmdldDsKCiAgICAgIHdoaWxlICgndW5kZWZpbmVkJyA9PT0gdHlwZW9mIHRhcmdldGVsLmdldFNjcmVlbkNUTSAmJiAndW5kZWZpbmVkJyA9PT0gdGFyZ2V0ZWwucGFyZW50Tm9kZSkgewogICAgICAgICAgdGFyZ2V0ZWwgPSB0YXJnZXRlbC5wYXJlbnROb2RlOwogICAgICB9CgogICAgICB2YXIgYmJveCAgICAgICA9IHt9LAogICAgICAgICAgbWF0cml4ICAgICA9IHRhcmdldGVsLmdldFNjcmVlbkNUTSgpLAogICAgICAgICAgdGJib3ggICAgICA9IHRhcmdldGVsLmdldEJCb3goKSwKICAgICAgICAgIHdpZHRoICAgICAgPSB0YmJveC53aWR0aCwKICAgICAgICAgIGhlaWdodCAgICAgPSB0YmJveC5oZWlnaHQsCiAgICAgICAgICB4ICAgICAgICAgID0gdGJib3gueCwKICAgICAgICAgIHkgICAgICAgICAgPSB0YmJveC55OwoKICAgICAgcG9pbnQueCA9IHg7CiAgICAgIHBvaW50LnkgPSB5OwogICAgICBiYm94Lm53ID0gcG9pbnQubWF0cml4VHJhbnNmb3JtKG1hdHJpeCk7CiAgICAgIHBvaW50LnggKz0gd2lkdGg7CiAgICAgIGJib3gubmUgPSBwb2ludC5tYXRyaXhUcmFuc2Zvcm0obWF0cml4KTsKICAgICAgcG9pbnQueSArPSBoZWlnaHQ7CiAgICAgIGJib3guc2UgPSBwb2ludC5tYXRyaXhUcmFuc2Zvcm0obWF0cml4KTsKICAgICAgcG9pbnQueCAtPSB3aWR0aDsKICAgICAgYmJveC5zdyA9IHBvaW50Lm1hdHJpeFRyYW5zZm9ybShtYXRyaXgpOwogICAgICBwb2ludC55IC09IGhlaWdodCAvIDI7CiAgICAgIGJib3gudyAgPSBwb2ludC5tYXRyaXhUcmFuc2Zvcm0obWF0cml4KTsKICAgICAgcG9pbnQueCArPSB3aWR0aDsKICAgICAgYmJveC5lID0gcG9pbnQubWF0cml4VHJhbnNmb3JtKG1hdHJpeCk7CiAgICAgIHBvaW50LnggLT0gd2lkdGggLyAyOwogICAgICBwb2ludC55IC09IGhlaWdodCAvIDI7CiAgICAgIGJib3gubiA9IHBvaW50Lm1hdHJpeFRyYW5zZm9ybShtYXRyaXgpOwogICAgICBwb2ludC55ICs9IGhlaWdodDsKICAgICAgYmJveC5zID0gcG9pbnQubWF0cml4VHJhbnNmb3JtKG1hdHJpeCk7CgogICAgICByZXR1cm4gYmJveDsKICAgIH0KCiAgICByZXR1cm4gdGlwOwogIH07Cgp9KSk7Cg=="></script> <link href="data:text/css;charset=utf-8,%2Ed3%2Dtip%20%7B%0Aline%2Dheight%3A%201%3B%0A%0Apadding%3A%2012px%3B%0Abackground%3A%20rgba%280%2C%200%2C%200%2C%200%2E7%29%3B%0Acolor%3A%20%23fff%3B%0Aborder%2Dradius%3A%202px%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A" rel="stylesheet" /> <script src="data:application/x-javascript;base64,SFRNTFdpZGdldHMud2lkZ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9ucy5mYWRlTGV2ZWwsCiAgICAgICAgc2hvd1Rvb2x0aXBzID0gb3B0aW9ucy5zaG93VG9vbHRpcHMsCiAgICAgICAgc2hvd1plcm9Ub29sdGlwcyA9IG9wdGlvbnMuc2hvd1plcm9Ub29sdGlwcywKICAgICAgICB0b29sdGlwTmFtZXMgPSBvcHRpb25zLnRvb2x0aXBOYW1lcywKICAgICAgICB0b29sdGlwRm9udHNpemUgPSBvcHRpb25zLnRvb2x0aXBGb250c2l6ZSwKICAgICAgICB0b29sdGlwVW5pdCA9IG9wdGlvbnMudG9vbHRpcFVuaXQsCiAgICAgICAgdG9vbHRpcEdyb3VwQ29ubmVjdG9yID0gb3B0aW9ucy50b29sdGlwR3JvdXBDb25uZWN0b3IsCiAgICAgICAgcHJlY2lzaW9uID0gb3B0aW9ucy5wcmVjaXNpb24sCiAgICAgICAgY2xpY2tBY3Rpb24gPSBvcHRpb25zLmNsaWNrQWN0aW9uLAogICAgICAgIGNsaWNrR3JvdXBBY3Rpb24gPSBvcHRpb25zLmNsaWNrR3JvdXBBY3Rpb247CgogICAgZDMuc2VsZWN0KGVsKS5zZWxlY3RBbGwoImRpdi5kMy10aXAiKS5yZW1vdmUoKTsKCiAgICBpZiAoc2hvd1Rvb2x0aXBzKSB7CiAgICAgICAgdmFyIGNob3JkVGlwID0gZDMudGlwKCkKICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdkMy10aXAnKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LXNpemUiLCB0b29sdGlwRm9udHNpemUgKyAicHgiKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgICAgICAgICAgICAgIC5kaXJlY3Rpb24oJ210JykKICAgICAgICAgICAgICAgICAgICAgICAgIC5vZmZzZXQoWzEwLCAxMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAuaHRtbChmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5kZXhlcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpID0gZC5zb3VyY2UuaW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBkLnRhcmdldC5pbmRleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2YWx1ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlqID0gc2lnRmlncyhtYXRyaXhbaV1bal0sIHByZWNpc2lvbiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZqaSA9IHNpZ0ZpZ3MobWF0cml4W2pdW2ldLCBwcmVjaXNpb24pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXIxID0gdG9vbHRpcE5hbWVzW2ldICsgdG9vbHRpcEdyb3VwQ29ubmVjdG9yICsgdG9vbHRpcE5hbWVzW2pdICsgIjogIiArIHZpaiArIHRvb2x0aXBVbml0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIyID0gdG9vbHRpcE5hbWVzW2pdICsgdG9vbHRpcEdyb3VwQ29ubmVjdG9yICsgdG9vbHRpcE5hbWVzW2ldICsgIjogIiArIHZqaSArIHRvb2x0aXBVbml0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09ICJkaXJlY3Rpb25hbCIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRpcjE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2hvd1plcm9Ub29sdGlwcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkaXIxICsgIjwvYnI+IiArIGRpcjI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkaXIxICsgKHZqaSA+IDAgPyAiPC9icj4iICsgZGlyMiA6ICIiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSAiYmlwYXJ0aXRlIikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGlyMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgdmFyIGdyb3VwVGlwID0gZDMudGlwKCkKICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdkMy10aXAnKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LXNpemUiLCB0b29sdGlwRm9udHNpemUgKyAicHgiKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgICAgICAgICAgICAgIC5kaXJlY3Rpb24oJ210JykKICAgICAgICAgICAgICAgICAgICAgICAgIC5vZmZzZXQoWzEwLCAxMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAuaHRtbChmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gc2lnRmlncyhkLnZhbHVlLCBwcmVjaXNpb24pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b29sdGlwTmFtZXNbZC5pbmRleF0gKyAiICh0b3RhbCk6ICIgKyB2YWx1ZSArIHRvb2x0aXBVbml0OwogICAgICAgICAgICAgICAgICAgICAgICAgf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ZW5kKCJnIik7CiAgICBzdmcuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgeFRyYW5zbGF0ZSArICIsIiArIHlUcmFuc2xhdGUgKyAiKSIpOwoKICAgIGlmIChzaG93VG9vbHRpcHMpIHsKICAgICAgIHN2Zy5jYWxsKGNob3JkVGlwKQogICAgICAgICAgLmNhbGwoZ3JvdXBUaXApOwogICAgfQoKICAgIC8vIGNyZWF0ZSBncm91cHMKICAgIHZhciBncm91cHMgPSBzdmcuYXBwZW5kKCJnIikuYXR0cigiY2xhc3MiLCAiZ3JvdXBzIikKICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCJwYXRoIikKICAgICAgICAgICAgICAgICAgICAuZGF0YShjaG9yZC5ncm91cHMpCiAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJwYXRoIikuYXR0cigiaWQiLCBmdW5jdGlvbihkLCBpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiZ3JvdXAtIiArIGdyb3VwTmFtZXNbaV07CiAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgLy8gc3R5bGUgZ3JvdXBzIGFuZCBkZWZpbmUgbW91c2UgZXZlbnRzCiAgICBncm91cHMuc3R5bGUoImZpbGwiLCBmdW5jdGlvbihkKSB7IHJldHVybiBmaWxsU2NhbGUoZC5pbmRleCk7IH0pCiAgICAgICAgICAuc3R5bGUoInN0cm9rZSIsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGZpbGxTY2FsZShkLmluZGV4KTsgfSkKICAgICAgICAgIC5hdHRyKCJkIiwgZDMuc3ZnLmFyYygpLmlubmVyUmFkaXVzKGlubmVyUmFkaXVzKS5vdXRlclJhZGl1cyhvdXRlclJhZGl1cykpCiAgICAgICAgICAub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uKGQpIHsKICAgICAgICAgICAgICBpZiAoc2hvd1Rvb2x0aXBzKSBncm91cFRpcC5zaG93KGQpOwogICAgICAgICAgICAgIHJldHVybiBncm91cEZhZGUoZCwgZmFkZUxldmVsKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgIGlmIChzaG93VG9vbHRpcHMpIGdyb3VwVGlwLmhpZGUoZCk7CiAgICAgICAgICAgICAgcmV0dXJuIGdyb3VwRmFkZShkLCAxKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oImNsaWNrIiwgY2xpY2tHcm91cCk7CgogICAgaWYgKGdyb3VwZWRnZUNvbG9yKSB7CiAgICAgICAgZ3JvdXBzLnN0eWxlKCJzdHJva2UiLCBncm91cGVkZ2VDb2xvcik7CiAgICB9IGVsc2UgewogICAgICAgIGdyb3Vwcy5zdHlsZSgic3Ryb2tlIiwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZmlsbFNjYWxlKGQuaW5kZXgpOyB9KTsKICAgIH0KCiAgICBpZiAoc2hvd1RpY2tzKSB7CiAgICAgICAgLy8gY3JlYXRlIHRpY2tzIGZvciBncm91cHMKICAgICAgICB2YXIgdGlja3MgPSBzdmcuYXBwZW5kKCJnIikuYXR0cigiY2xhc3MiLCAidGlja3MiKQogICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoImciKQogICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKGNob3JkLmdyb3VwcykKICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoImciKSAvLy5hdHRyKCJjbGFzcyIsICJ0aWNrcyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24oZCwgaSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInRpY2tzLSIgKyBncm91cE5hbWVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZ3JvdXBUaWNrcykKICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoImciKS5hdHRyKCJjbGFzcyIsICJ0aWNrIikKICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJvdGF0ZSgiICsgKGQuYW5nbGUgKiAxODAgLyBNYXRoLlBJIC0gOTApICsgIikiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0cmFuc2xhdGUoIiArIG91dGVyUmFkaXVzICsgIiwgMCkiOwogICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAvLyBhZGQgdGljayBtYXJrcwogICAgICAgIHRpY2tzLmFwcGVuZCgibGluZSIpCiAgICAgICAgICAgICAuYXR0cigieDEiLCAxKQogICAgICAgICAgICAgLmF0dHIoInkxIiwgMCkKICAgICAgICAgICAgIC5hdHRyKCJ4MiIsIDUpCiAgICAgICAgICAgICAuYXR0cigieTIiLCAwKQogICAgICAgICAgICAgLnN0eWxlKCJzdHJva2UiLCAiIzAwMCIpOwoKICAgICAgICAvLyBhZGQgdGljayBsYWJlbHMKICAgICAgICB0aWNrcy5hcHBlbmQoInRleHQiKQogICAgICAgICAgICAgLmF0dHIoIngiLCAwKQogICAgICAgICAgICAgLmF0dHIoImR5IiwgIi4zNWVtIikKICAgICAgICAgICAgIC5zdHlsZSgiZm9udC1zaXplIiwgdGlja2xhYmVsRm9udHNpemUgKyAicHgiKQogICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmFuZ2xlID4gTWF0aC5QSSA/ICJyb3RhdGUoMTgwKXRyYW5zbGF0ZSgtOCkiIDogInRyYW5zbGF0ZSg4KSI7IH0pCiAgICAgICAgICAgICAuc3R5bGUoInRleHQtYW5jaG9yIiwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5hbmdsZSA+IE1hdGguUEkgPyAiZW5kIiA6ICJzdGFydCI7IH0pCiAgICAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBkLmxhYmVsOyB9KTsKICAgIH0KCiAgICAvLyBjcmVhdGUgY2hvcmRzCiAgICB2YXIgY2hvcmRzID0gc3ZnLmFwcGVuZCgiZyIpLmF0dHIoImNsYXNzIiwgImNob3JkcyIpCiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgicGF0aCIpCiAgICAgICAgICAgICAgICAgICAgLmRhdGEoY2hvcmQuY2hvcmRzKQogICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgicGF0aCIpLmF0dHIoImlkIiwgZnVuY3Rpb24oZCwgaSkgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gImNob3JkLSIgKyBncm91cE5hbWVzW2Quc291cmNlLmluZGV4XQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLSIgKyBncm91cE5hbWVzW2QudGFyZ2V0LmluZGV4XTsKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgZDMuc3ZnLmNob3JkKCkucmFkaXVzKGlubmVyUmFkaXVzKSk7CgogICAgLy8gc3R5bGUgY2hvcmRzIGFuZCBkZWZpbmUgbW91c2UgZXZlbnRzCiAgICBjaG9yZHMuc3R5bGUoImZpbGwiLCBmdW5jdGlvbihkKSB7IHJldHVybiBmaWxsU2NhbGUoZC50YXJnZXQuaW5kZXgpOyB9KQogICAgICAgICAgLnN0eWxlKCJzdHJva2UiLCBjaG9yZGVkZ2VDb2xvcikKICAgICAgICAgIC5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMC42NykKICAgICAgICAgIC5zdHlsZSgic3Ryb2tlLXdpZHRoIiwgIjAuNXB4IikKICAgICAgICAgIC5zdHlsZSgib3BhY2l0eSIsIDEpCiAgICAgICAgICAub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uKGQpIHsKICAgICAgICAgICAgICBpZiAoc2hvd1Rvb2x0aXBzKSBjaG9yZFRpcC5zaG93KGQpOwogICAgICAgICAgICAgIHJldHVybiBjaG9yZEZhZGUoZCwgZmFkZUxldmVsKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgIGlmIChzaG93VG9vbHRpcHMpIGNob3JkVGlwLmhpZGUoZCk7CiAgICAgICAgICAgICAgcmV0dXJuIGNob3JkRmFkZShkLCAxKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oImNsaWNrIiwgY2xpY2spOwoKICAgIC8vIGNyZWF0ZSBncm91cCBsYWJlbHMKICAgIGlmIChzaG93R3JvdXBuYW1lcykgewogICAgICAgIHZhciBuYW1lcyA9IHN2Zy5hcHBlbmQoImciKS5hdHRyKCJjbGFzcyIsICJuYW1lcyIpCiAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoY2hvcmQuZ3JvdXBzKQogICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgiZyIpLmF0dHIoImNsYXNzIiwgIm5hbWUiKQogICAgICAgICAgICAgICAgICAgICAgIC5vbigibW91c2VvdmVyIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ3JvdXBGYWRlKGQsIGZhZGVMZXZlbCk7CiAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ3JvdXBGYWRlKGQsIDEpOwogICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZ3JvdXBMYWJlbHMpCiAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJnIikuYXR0cigiaWQiLCBmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAibGFiZWwtIiArIGQubGFiZWw7CiAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJvdGF0ZSgiICsgKGQuYW5nbGUgKiAxODAgLyBNYXRoLlBJIC0gOTApICsgIikiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAidHJhbnNsYXRlKCIgKyAob3V0ZXJSYWRpdXMgKyBkLnBhZGRpbmcpICsgIiwgMCkiOwogICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgIG5hbWVzLmFwcGVuZCgidGV4dCIpCiAgICAgICAgICAgIC5hdHRyKCJ4IiwgMCkKICAgICAgICAgICAgLmF0dHIoImR5IiwgIi4zNWVtIikKICAgICAgICAgICAgLnN0eWxlKCJmb250LXNpemUiLCBncm91cG5hbWVGb250c2l6ZSArICJweCIpCiAgICAgICAgICAgIC5zdHlsZSgiZm9udC1mYW1pbHkiLCAic2Fucy1zZXJpZiIpCiAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCBmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZC5oYW5kc2lkZSA9PSAibGVmdCIgPyAicm90YXRlKDE4MCkiIDogbnVsbDsKICAgICAgICAgICAgfSkKICAgICAgICAgICAgLnN0eWxlKCJ0ZXh0LWFuY2hvciIsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQuaGFuZHNpZGUgPT0gImxlZnQiID8gImVuZCIgOiAic3RhcnQiOyB9KQogICAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBkLmxhYmVsOyB9KQogICAgICAgICAgICAuYXR0cigiaWQiLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmxhYmVsOyB9KTsKICAgIH0KCiAgICBpZiAoY2F0ZWdvcnlOYW1lcykgewogICAgICAgIHZhciBjYXRlZ29yaWVzID0gc3ZnLmFwcGVuZCgiZyIpLmF0dHIoImNsYXNzIiwgImNhdGVnb3JpZXMiKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShjYXRlZ29yeU5hbWVzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJnIikuYXR0cigiY2xhc3MiLCAiY2F0ZWdvcnkiKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShjYXRlZ29yeUxhYmVscykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoImZpbGwiLCAiYmxhY2siKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAibGFiZWwtIiArIGQubGFiZWw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKGQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJvdGF0ZSgiICsgKGQuYW5nbGUgKiAxODAgLyBNYXRoLlBJKSArICIpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0cmFuc2xhdGUoIiArIChvdXRlclJhZGl1cyArIGNhdGVnb3J5bmFtZVBhZGRpbmcpICsgIiwgMCkiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgIGNhdGVnb3JpZXMuYXBwZW5kKCJ0ZXh0IikKICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCAwKQogICAgICAgICAgICAgICAgICAuYXR0cigiZHkiLCAiLjM1ZW0iKQogICAgICAgICAgICAgICAgICAuc3R5bGUoImZvbnQtc2l6ZSIsIGNhdGVnb3J5bmFtZUZvbnRzaXplICsgInB4IikKICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LXdlaWdodCIsICJib2xkIikKICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKGQsIGkpIHsgcmV0dXJuIGkgPyAicm90YXRlKDI3MCkiIDogInJvdGF0ZSg5MCkiOyB9KQogICAgICAgICAgICAgICAgICAuc3R5bGUoInRleHQtYW5jaG9yIiwgIm1pZGRsZSIpCiAgICAgICAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubGFiZWw7IH0pCiAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubGFiZWw7IH0pOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhdGVnb3J5TGFiZWxzKGQsIGkpIHsKICAgICAgICByZXR1cm4gW3sKICAgICAgICAgIGFuZ2xlOiBpICogTWF0aC5QSSwKICAgICAgICAgIGxhYmVsOiBkCiAgICAgICAgfV07CiAgICB9CgogICAgLy8gcmV0dXJucyBhbiBhcnJheSBvZiB0aWNrIGFuZ2xlcyBhbmQgbGFiZWxzLCBnaXZlbiBhIGdyb3VwCiAgICBmdW5jdGlvbiBncm91cFRpY2tzKGQpIHsKICAgICAgdmFyIGsgPSAoZC5lbmRBbmdsZSAtIGQuc3RhcnRBbmdsZSkgLyBkLnZhbHVlOwogICAgICByZXR1cm4gZDMucmFuZ2UoMCwgZC52YWx1ZSwgdGlja0ludGVydmFsKS5tYXAoZnVuY3Rpb24odiwgaSkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICBhbmdsZTogdiAqIGsgKyBkLnN0YXJ0QW5nbGUsCiAgICAgICAgICBsYWJlbDogaSAlIDUgPyBudWxsIDogdgogICAgICAgIH07CiAgICAgIH0pOwogICAgfQoKICAgIGZ1bmN0aW9uIGdyb3VwTGFiZWxzKGQpIHsKICAgICAgdmFyIGEgPSAoZC5zdGFydEFuZ2xlICsgZC5lbmRBbmdsZSkgLyAyOwogICAgICByZXR1cm4gW3sKICAgICAgICAgIGFuZ2xlOiBhLAogICAgICAgICAgaGFuZHNpZGU6IChhIDwgTWF0aC5QSSkgPyAicmlnaHQiIDogImxlZnQiLAogICAgICAgICAgbGFiZWw6IGdyb3VwTmFtZXNbZC5pbmRleF0sCiAgICAgICAgICBwYWRkaW5nOiBncm91cG5hbWVQYWRkaW5nW2QuaW5kZXhdCiAgICAgICAgfV07CiAgICB9CgogICAgLy8gcmV0dXJucyBhbiBldmVudCBoYW5kbGVyIGZvciBmYWRpbmcgYWxsIGNob3JkcyBub3QgYmVsb25naW5nIHRvIGEKICAgIC8vIHNwZWNpZmljIGdyb3VwCiAgICBmdW5jdGlvbiBncm91cEZhZGUoZywgb3BhY2l0eSkgewogICAgICAgIHN2Zy5zZWxlY3RBbGwoIi5jaG9yZHMgcGF0aCIpCiAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5zb3VyY2UuaW5kZXggIT0gZy5pbmRleAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGQudGFyZ2V0LmluZGV4ICE9IGcuaW5kZXg7IH0pCiAgICAgICAgICAgIC50cmFuc2l0aW9uKCkKICAgICAgICAgICAgLnN0eWxlKCJvcGFjaXR5Iiwgb3BhY2l0eSk7CiAgICB9CgogICAgLy8gcmV0dXJucyBhbiBldmVudCBoYW5kbGVyIGZvciBmYWRpbmcgYWxsIGNob3JkcyBleGNlcHQgZm9yIHRoZSBvbmUKICAgIC8vIGdpdmVuCiAgICBmdW5jdGlvbiBjaG9yZEZhZGUoZywgb3BhY2l0eSkgewogICAgICAgIHN2Zy5zZWxlY3RBbGwoIi5jaG9yZHMgcGF0aCIpCiAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5zb3VyY2UuaW5kZXggIT0gZy5zb3VyY2UuaW5kZXgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBkLnRhcmdldC5pbmRleCAhPSBnLnRhcmdldC5pbmRleDsKICAgICAgICAgICAgfSkKICAgICAgICAgICAgLnRyYW5zaXRpb24oKQogICAgICAgICAgICAuc3R5bGUoIm9wYWNpdHkiLCBvcGFjaXR5KTsKICAgIH0KCiAgICAvLyByb3VuZCB0byBzaWduaWZpY2FudCBmaWd1cmVzIC8gZGlnaXRzCiAgICBmdW5jdGlvbiBzaWdGaWdzKG4sIHNpZykgewogICAgICAgIGlmIChuID09IDApIHsgcmV0dXJuIG59CiAgICAgICAgaWYgKHNpZyA9PSAibnVsbCIpIHsgc2lnID0gNzsgfQogICAgICAgIHZhciBtdWx0ID0gTWF0aC5wb3coMTAsIHNpZyAtIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLkxOMTApIC0gMSk7CiAgICAgICAgcmV0dXJuIE1hdGgucm91bmQobiAqIG11bHQpIC8gbXVsdDsKICAgIH0KCiAgICBmdW5jdGlvbiBjbGljayhkKSB7CiAgICAgIHJldHVybiBldmFsKGNsaWNrQWN0aW9uKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjbGlja0dyb3VwKGQpIHsKICAgICAgICByZXR1cm4gZXZhbChjbGlja0dyb3VwQWN0aW9uKQogICAgfQoKICB9ICAvLyBlbmQgcmVuZGVyVmFsdWUgZnVuY3Rpb24KCn0pOwoK"></script> <script src="data:application/x-javascript;base64,SFRNTFdpZGdldHMud2lkZ2V0KHsKCiAgbmFtZTogJ2Nob3JkZGlhZycsCiAgdHlwZTogJ291dHB1dCcsCgogIGluaXRpYWxpemU6IGZ1bmN0aW9uKGVsLCB3aWR0aCwgaGVpZ2h0KSB7CgogICAgZDMuc2VsZWN0KGVsKS5hcHBlbmQoInN2ZyIpCiAgICAgICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgd2lkdGgpCiAgICAgICAgICAgICAgICAgLmF0dHIoImhlaWdodCIsIGhlaWdodCk7CgogICAgcmV0dXJuIGQzLmxheW91dC5jaG9yZCgpOwoKICB9LAoKICByZXNpemU6IGZ1bmN0aW9uKGVsLCB3aWR0aCwgaGVpZ2h0LCBjaG9yZCkgewoKICAgIGQzLnNlbGVjdChlbCkuc2VsZWN0KCJzdmciKQogICAgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIHdpZHRoKQogICAgICAgICAgICAgICAgIC5hdHRyKCJoZWlnaHQiLCBoZWlnaHQpOwoKICAgIHRoaXMucmVuZGVyVmFsdWUoZWwsIGNob3JkLnBhcmFtcywgY2hvcmQpOwoKICB9LAoKICByZW5kZXJWYWx1ZTogZnVuY3Rpb24oZWwsIHBhcmFtcywgY2hvcmQpIHsKCiAgICAvLyBzYXZlIHBhcmFtcyBmb3IgcmVmZXJlbmNlIGZyb20gcmVzaXplIG1ldGhvZAogICAgY2hvcmQucGFyYW1zID0gcGFyYW1zOwoKICAgIHZhciBtYXRyaXggPSBwYXJhbXMubWF0cml4LAogICAgICAgIG9wdGlvbnMgPSBwYXJhbXMub3B0aW9uczsKCiAgICAvLyBnZXQgd2lkdGggYW5kIGhlaWdodCwgY2FsY3VsYXRlIG1pbiBmb3IgdXNlIGluIGRpYWdyYW0gc2l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NrSW50ZXJ2YWwgPSBvcHRpb25zLnRpY2tJbnRlcnZhbCwKICAgICAgICB0aWNrbGFiZWxGb250c2l6ZSA9IG9wdGlvbnMudGlja2xhYmVsRm9udHNpemUsCiAgICAgICAgZmFkZUxldmVsID0gb3B0aW9ucy5mYWRlTGV2ZWwsCiAgICAgICAgc2hvd1Rvb2x0aXBzID0gb3B0aW9ucy5zaG93VG9vbHRpcHMsCiAgICAgICAgc2hvd1plcm9Ub29sdGlwcyA9IG9wdGlvbnMuc2hvd1plcm9Ub29sdGlwcywKICAgICAgICB0b29sdGlwTmFtZXMgPSBvcHRpb25zLnRvb2x0aXBOYW1lcywKICAgICAgICB0b29sdGlwRm9udHNpemUgPSBvcHRpb25zLnRvb2x0aXBGb250c2l6ZSwKICAgICAgICB0b29sdGlwVW5pdCA9IG9wdGlvbnMudG9vbHRpcFVuaXQsCiAgICAgICAgdG9vbHRpcEdyb3VwQ29ubmVjdG9yID0gb3B0aW9ucy50b29sdGlwR3JvdXBDb25uZWN0b3IsCiAgICAgICAgcHJlY2lzaW9uID0gb3B0aW9ucy5wcmVjaXNpb24sCiAgICAgICAgY2xpY2tBY3Rpb24gPSBvcHRpb25zLmNsaWNrQWN0aW9uLAogICAgICAgIGNsaWNrR3JvdXBBY3Rpb24gPSBvcHRpb25zLmNsaWNrR3JvdXBBY3Rpb247CgogICAgZDMuc2VsZWN0KGVsKS5zZWxlY3RBbGwoImRpdi5kMy10aXAiKS5yZW1vdmUoKTsKCiAgICBpZiAoc2hvd1Rvb2x0aXBzKSB7CiAgICAgICAgdmFyIGNob3JkVGlwID0gZDMudGlwKCkKICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdkMy10aXAnKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LXNpemUiLCB0b29sdGlwRm9udHNpemUgKyAicHgiKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgICAgICAgICAgICAgIC5kaXJlY3Rpb24oJ210JykKICAgICAgICAgICAgICAgICAgICAgICAgIC5vZmZzZXQoWzEwLCAxMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAuaHRtbChmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5kZXhlcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpID0gZC5zb3VyY2UuaW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBkLnRhcmdldC5pbmRleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2YWx1ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlqID0gc2lnRmlncyhtYXRyaXhbaV1bal0sIHByZWNpc2lvbiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZqaSA9IHNpZ0ZpZ3MobWF0cml4W2pdW2ldLCBwcmVjaXNpb24pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXIxID0gdG9vbHRpcE5hbWVzW2ldICsgdG9vbHRpcEdyb3VwQ29ubmVjdG9yICsgdG9vbHRpcE5hbWVzW2pdICsgIjogIiArIHZpaiArIHRvb2x0aXBVbml0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIyID0gdG9vbHRpcE5hbWVzW2pdICsgdG9vbHRpcEdyb3VwQ29ubmVjdG9yICsgdG9vbHRpcE5hbWVzW2ldICsgIjogIiArIHZqaSArIHRvb2x0aXBVbml0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09ICJkaXJlY3Rpb25hbCIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRpcjE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2hvd1plcm9Ub29sdGlwcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkaXIxICsgIjwvYnI+IiArIGRpcjI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkaXIxICsgKHZqaSA+IDAgPyAiPC9icj4iICsgZGlyMiA6ICIiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSAiYmlwYXJ0aXRlIikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGlyMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgdmFyIGdyb3VwVGlwID0gZDMudGlwKCkKICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdkMy10aXAnKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LXNpemUiLCB0b29sdGlwRm9udHNpemUgKyAicHgiKQogICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgICAgICAgICAgICAgIC5kaXJlY3Rpb24oJ210JykKICAgICAgICAgICAgICAgICAgICAgICAgIC5vZmZzZXQoWzEwLCAxMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAuaHRtbChmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gc2lnRmlncyhkLnZhbHVlLCBwcmVjaXNpb24p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5vdXRlclJhZGl1cyhvdXRlclJhZGl1cykpCiAgICAgICAgICAub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uKGQpIHsKICAgICAgICAgICAgICBpZiAoc2hvd1Rvb2x0aXBzKSBncm91cFRpcC5zaG93KGQpOwogICAgICAgICAgICAgIHJldHVybiBncm91cEZhZGUoZCwgZmFkZUxldmVsKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgIGlmIChzaG93VG9vbHRpcHMpIGdyb3VwVGlwLmhpZGUoZCk7CiAgICAgICAgICAgICAgcmV0dXJuIGdyb3VwRmFkZShkLCAxKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oImNsaWNrIiwgY2xpY2tHcm91cCk7CgogICAgaWYgKGdyb3VwZWRnZUNvbG9yKSB7CiAgICAgICAgZ3JvdXBzLnN0eWxlKCJzdHJva2UiLCBncm91cGVkZ2VDb2xvcik7CiAgICB9IGVsc2UgewogICAgICAgIGdyb3Vwcy5zdHlsZSgic3Ryb2tlIiwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZmlsbFNjYWxlKGQuaW5kZXgpOyB9KTsKICAgIH0KCiAgICBpZiAoc2hvd1RpY2tzKSB7CiAgICAgICAgLy8gY3JlYXRlIHRpY2tzIGZvciBncm91cHMKICAgICAgICB2YXIgdGlja3MgPSBzdmcuYXBwZW5kKCJnIikuYXR0cigiY2xhc3MiLCAidGlja3MiKQogICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoImciKQogICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKGNob3JkLmdyb3VwcykKICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoImciKSAvLy5hdHRyKCJjbGFzcyIsICJ0aWNrcyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24oZCwgaSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInRpY2tzLSIgKyBncm91cE5hbWVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZ3JvdXBUaWNrcykKICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoImciKS5hdHRyKCJjbGFzcyIsICJ0aWNrIikKICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJvdGF0ZSgiICsgKGQuYW5nbGUgKiAxODAgLyBNYXRoLlBJIC0gOTApICsgIikiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0cmFuc2xhdGUoIiArIG91dGVyUmFkaXVzICsgIiwgMCkiOwogICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAvLyBhZGQgdGljayBtYXJrcwogICAgICAgIHRpY2tzLmFwcGVuZCgibGluZSIpCiAgICAgICAgICAgICAuYXR0cigieDEiLCAxKQogICAgICAgICAgICAgLmF0dHIoInkxIiwgMCkKICAgICAgICAgICAgIC5hdHRyKCJ4MiIsIDUpCiAgICAgICAgICAgICAuYXR0cigieTIiLCAwKQogICAgICAgICAgICAgLnN0eWxlKCJzdHJva2UiLCAiIzAwMCIpOwoKICAgICAgICAvLyBhZGQgdGljayBsYWJlbHMKICAgICAgICB0aWNrcy5hcHBlbmQoInRleHQiKQogICAgICAgICAgICAgLmF0dHIoIngiLCAwKQogICAgICAgICAgICAgLmF0dHIoImR5IiwgIi4zNWVtIikKICAgICAgICAgICAgIC5zdHlsZSgiZm9udC1zaXplIiwgdGlja2xhYmVsRm9udHNpemUgKyAicHgiKQogICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmFuZ2xlID4gTWF0aC5QSSA/ICJyb3RhdGUoMTgwKXRyYW5zbGF0ZSgtOCkiIDogInRyYW5zbGF0ZSg4KSI7IH0pCiAgICAgICAgICAgICAuc3R5bGUoInRleHQtYW5jaG9yIiwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5hbmdsZSA+IE1hdGguUEkgPyAiZW5kIiA6ICJzdGFydCI7IH0pCiAgICAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBkLmxhYmVsOyB9KTsKICAgIH0KCiAgICAvLyBjcmVhdGUgY2hvcmRzCiAgICB2YXIgY2hvcmRzID0gc3ZnLmFwcGVuZCgiZyIpLmF0dHIoImNsYXNzIiwgImNob3JkcyIpCiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgicGF0aCIpCiAgICAgICAgICAgICAgICAgICAgLmRhdGEoY2hvcmQuY2hvcmRzKQogICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgicGF0aCIpLmF0dHIoImlkIiwgZnVuY3Rpb24oZCwgaSkgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gImNob3JkLSIgKyBncm91cE5hbWVzW2Quc291cmNlLmluZGV4XQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLSIgKyBncm91cE5hbWVzW2QudGFyZ2V0LmluZGV4XTsKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgZDMuc3ZnLmNob3JkKCkucmFkaXVzKGlubmVyUmFkaXVzKSk7CgogICAgLy8gc3R5bGUgY2hvcmRzIGFuZCBkZWZpbmUgbW91c2UgZXZlbnRzCiAgICBjaG9yZHMuc3R5bGUoImZpbGwiLCBmdW5jdGlvbihkKSB7IHJldHVybiBmaWxsU2NhbGUoZC50YXJnZXQuaW5kZXgpOyB9KQogICAgICAgICAgLnN0eWxlKCJzdHJva2UiLCBjaG9yZGVkZ2VDb2xvcikKICAgICAgICAgIC5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMC42NykKICAgICAgICAgIC5zdHlsZSgic3Ryb2tlLXdpZHRoIiwgIjAuNXB4IikKICAgICAgICAgIC5zdHlsZSgib3BhY2l0eSIsIDEpCiAgICAgICAgICAub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uKGQpIHsKICAgICAgICAgICAgICBpZiAoc2hvd1Rvb2x0aXBzKSBjaG9yZFRpcC5zaG93KGQpOwogICAgICAgICAgICAgIHJldHVybiBjaG9yZEZhZGUoZCwgZmFkZUxldmVsKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgIGlmIChzaG93VG9vbHRpcHMpIGNob3JkVGlwLmhpZGUoZCk7CiAgICAgICAgICAgICAgcmV0dXJuIGNob3JkRmFkZShkLCAxKTsKICAgICAgICAgIH0pCiAgICAgICAgICAub24oImNsaWNrIiwgY2xpY2spOwoKICAgIC8vIGNyZWF0ZSBncm91cCBsYWJlbHMKICAgIGlmIChzaG93R3JvdXBuYW1lcykgewogICAgICAgIHZhciBuYW1lcyA9IHN2Zy5hcHBlbmQoImciKS5hdHRyKCJjbGFzcyIsICJuYW1lcyIpCiAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoY2hvcmQuZ3JvdXBzKQogICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgiZyIpLmF0dHIoImNsYXNzIiwgIm5hbWUiKQogICAgICAgICAgICAgICAgICAgICAgIC5vbigibW91c2VvdmVyIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ3JvdXBGYWRlKGQsIGZhZGVMZXZlbCk7CiAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ3JvdXBGYWRlKGQsIDEpOwogICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZ3JvdXBMYWJlbHMpCiAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJnIikuYXR0cigiaWQiLCBmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAibGFiZWwtIiArIGQubGFiZWw7CiAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJvdGF0ZSgiICsgKGQuYW5nbGUgKiAxODAgLyBNYXRoLlBJIC0gOTApICsgIikiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAidHJhbnNsYXRlKCIgKyAob3V0ZXJSYWRpdXMgKyBkLnBhZGRpbmcpICsgIiwgMCkiOwogICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgIG5hbWVzLmFwcGVuZCgidGV4dCIpCiAgICAgICAgICAgIC5hdHRyKCJ4IiwgMCkKICAgICAgICAgICAgLmF0dHIoImR5IiwgIi4zNWVtIikKICAgICAgICAgICAgLnN0eWxlKCJmb250LXNpemUiLCBncm91cG5hbWVGb250c2l6ZSArICJweCIpCiAgICAgICAgICAgIC5zdHlsZSgiZm9udC1mYW1pbHkiLCAic2Fucy1zZXJpZiIpCiAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCBmdW5jdGlvbihkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZC5oYW5kc2lkZSA9PSAibGVmdCIgPyAicm90YXRlKDE4MCkiIDogbnVsbDsKICAgICAgICAgICAgfSkKICAgICAgICAgICAgLnN0eWxlKCJ0ZXh0LWFuY2hvciIsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQuaGFuZHNpZGUgPT0gImxlZnQiID8gImVuZCIgOiAic3RhcnQiOyB9KQogICAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBkLmxhYmVsOyB9KQogICAgICAgICAgICAuYXR0cigiaWQiLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmxhYmVsOyB9KTsKICAgIH0KCiAgICBpZiAoY2F0ZWdvcnlOYW1lcykgewogICAgICAgIHZhciBjYXRlZ29yaWVzID0gc3ZnLmFwcGVuZCgiZyIpLmF0dHIoImNsYXNzIiwgImNhdGVnb3JpZXMiKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShjYXRlZ29yeU5hbWVzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJnIikuYXR0cigiY2xhc3MiLCAiY2F0ZWdvcnkiKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShjYXRlZ29yeUxhYmVscykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgiZyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoImZpbGwiLCAiYmxhY2siKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24oZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAibGFiZWwtIiArIGQubGFiZWw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKGQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJvdGF0ZSgiICsgKGQuYW5nbGUgKiAxODAgLyBNYXRoLlBJKSArICIpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0cmFuc2xhdGUoIiArIChvdXRlclJhZGl1cyArIGNhdGVnb3J5bmFtZVBhZGRpbmcpICsgIiwgMCkiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgIGNhdGVnb3JpZXMuYXBwZW5kKCJ0ZXh0IikKICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCAwKQogICAgICAgICAgICAgICAgICAuYXR0cigiZHkiLCAiLjM1ZW0iKQogICAgICAgICAgICAgICAgICAuc3R5bGUoImZvbnQtc2l6ZSIsIGNhdGVnb3J5bmFtZUZvbnRzaXplICsgInB4IikKICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LWZhbWlseSIsICJzYW5zLXNlcmlmIikKICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmb250LXdlaWdodCIsICJib2xkIikKICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKGQsIGkpIHsgcmV0dXJuIGkgPyAicm90YXRlKDI3MCkiIDogInJvdGF0ZSg5MCkiOyB9KQogICAgICAgICAgICAgICAgICAuc3R5bGUoInRleHQtYW5jaG9yIiwgIm1pZGRsZSIpCiAgICAgICAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubGFiZWw7IH0pCiAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubGFiZWw7IH0pOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhdGVnb3J5TGFiZWxzKGQsIGkpIHsKICAgICAgICByZXR1cm4gW3sKICAgICAgICAgIGFuZ2xlO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XIoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5zb3VyY2UuaW5kZXggIT0gZy5pbmRleAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGQudGFyZ2V0LmluZGV4ICE9IGcuaW5kZXg7IH0pCiAgICAgICAgICAgIC50cmFuc2l0aW9uKCkKICAgICAgICAgICAgLnN0eWxlKCJvcGFjaXR5Iiwgb3BhY2l0eSk7CiAgICB9CgogICAgLy8gcmV0dXJucyBhbiBldmVudCBoYW5kbGVyIGZvciBmYWRpbmcgYWxsIGNob3JkcyBleGNlcHQgZm9yIHRoZSBvbmUKICAgIC8vIGdpdmVuCiAgICBmdW5jdGlvbiBjaG9yZEZhZGUoZywgb3BhY2l0eSkgewogICAgICAgIHN2Zy5zZWxlY3RBbGwoIi5jaG9yZHMgcGF0aCIpCiAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5zb3VyY2UuaW5kZXggIT0gZy5zb3VyY2UuaW5kZXgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBkLnRhcmdldC5pbmRleCAhPSBnLnRhcmdldC5pbmRleDsKICAgICAgICAgICAgfSkKICAgICAgICAgICAgLnRyYW5zaXRpb24oKQogICAgICAgICAgICAuc3R5bGUoIm9wYWNpdHkiLCBvcGFjaXR5KTsKICAgIH0KCiAgICAvLyByb3VuZCB0byBzaWduaWZpY2FudCBmaWd1cmVzIC8gZGlnaXRzCiAgICBmdW5jdGlvbiBzaWdGaWdzKG4sIHNpZykgewogICAgICAgIGlmIChuID09IDApIHsgcmV0dXJuIG59CiAgICAgICAgaWYgKHNpZyA9PSAibnVsbCIpIHsgc2lnID0gNzsgfQogICAgICAgIHZhciBtdWx0ID0gTWF0aC5wb3coMTAsIHNpZyAtIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLkxOMTApIC0gMSk7CiAgICAgICAgcmV0dXJuIE1hdGgucm91bmQobiAqIG11bHQpIC8gbXVsdDsKICAgIH0KCiAgICBmdW5jdGlvbiBjbGljayhkKSB7CiAgICAgIHJldHVybiBldmFsKGNsaWNrQWN0aW9uKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjbGlja0dyb3VwKGQpIHsKICAgICAgICByZXR1cm4gZXZhbChjbGlja0dyb3VwQWN0aW9uKQogICAgfQoKICB9ICAvLyBlbmQgcmVuZGVyVmFsdWUgZnVuY3Rpb24KCn0pOwoK"></script> </head> <body style="background-color:white;"> <div id="htmlwidget_container"> <div id="htmlwidget-31af74cb19493e66e3a9" style="width:960px;height:500px;" class="chorddiag html-widget"></div> </div> <script type="application/json" data-for="htmlwidget-31af74cb19493e66e3a9">{"x":{"matrix":[[23,15,3,8,17,4,5,15,3,12,10],[15,31,8,12,23,4,7,21,3,16,15],[3,8,11,4,8,2,1,9,4,1,4],[8,12,4,17,13,4,0,10,4,6,7],[17,23,8,13,34,8,6,23,4,17,17],[4,4,2,4,8,11,4,3,2,6,7],[5,7,1,0,6,4,9,3,0,8,2],[15,21,9,10,23,3,3,29,6,13,13],[3,3,4,4,4,2,0,6,8,1,5],[12,16,1,6,17,6,8,13,1,23,12],[10,15,4,7,17,7,2,13,5,12,28]],"options":{"type":"directional","width":null,"height":null,"margin":90,"showGroupnames":true,"groupNames":["DAM","DFES","HRAnalytics","ITBI","InnSR","IE","MnA","PBM","SIPM","Valuation","nochoice"],"groupColors":["#1B9E77","#D95F02","#7570B3","#E7298A","#66A61E","#E6AB02","#A6761D","#666666"],"groupThickness":0.1,"groupPadding":0.0349065850398866,"groupnamePadding":[10,10,10,10,10,10,10,10,10,10,10],"groupnameFontsize":14,"groupedgeColor":null,"chordedgeColor":"#808080","categoryNames":null,"categorynamePadding":100,"categorynameFontsize":28,"showTicks":false,"tickInterval":1,"ticklabelFontsize":10,"fadeLevel":0.1,"showTooltips":true,"showZeroTooltips":true,"tooltipNames":["DAM","DFES","HRAnalytics","ITBI","InnSR","IE","MnA","PBM","SIPM","Valuation","nochoice"],"tooltipFontsize":12,"tooltipUnit":"","tooltipGroupConnector":" ▶ ","precision":"null","clickAction":null,"clickGroupAction":null}},"evals":[],"jsHooks":[]}</script> <script type="application/htmlwidget-sizing" data-for="htmlwidget-31af74cb19493e66e3a9">{"viewer":{"width":450,"height":350,"padding":0,"fill":true},"browser":{"width":960,"height":500,"padding":0,"fill":true}}</script> </body> </html>