diff --git a/a.sh b/a.sh deleted file mode 100755 index caa9b50..0000000 --- a/a.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -EXT=js -DIST=ts -for name in `ls *.${EXT}`; do - mv $name ${name%.${EXT}}.${DIST} -done -: Function; -global. -: any - as any - -BlockNumDB -BlockNumDBMin -UseTruncateBlockDB -ContextSendLoadToBegin - - diff --git a/src/HTML/CSS/blockviewer.css b/src/HTML/CSS/blockviewer.css index fe0032b..8dd89b8 100644 --- a/src/HTML/CSS/blockviewer.css +++ b/src/HTML/CSS/blockviewer.css @@ -1,440 +1,440 @@ -@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic'); - -:root { - --blue-grey: #445368; - --light-blue: #718CAF; -} - -body { - margin: 0 auto; - box-sizing: border-box; - font-family: "Roboto", "Arial", sans-serif; - - color: #445368; - background: #f2f2f2; -} -main { - max-width: 1200px; - margin: 0 auto; -} - -*, -*::before, -*::after { - box-sizing: inherit; -} - -*::placeholder { - color: rgba(0, 0, 0, 0.5); - font-family: "Roboto"; - font-size: 16px; -} - -a { - text-decoration: none; - color: #445368; -} - -a:hover, -a:focus { - color: #718CAF; -} - -.hidden { - display: none; -} - -.btn { - color: #fff; - background: #445368; - - display: block; - padding: 15px 25px; - border: none; - box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3); - border-radius: 4px; - - text-decoration: none; - text-transform: uppercase; - font-family: inherit; - font-weight: 500; - font-size: 18px; - line-height: 21px; - cursor: pointer; - text-align: center; -} - -.btn:hover, -.btn:focus { - background: #718CAF; - color: #fff; -} - -.btn[disabled], -.btn.disabled { - opacity: .3; - cursor: not-allowed; -} - - -.reconnect { - background-image: url("./../PIC/reload.svg"); - background-repeat: no-repeat; - background-size: 18px 18px; - background-position: center center; - padding: 5px; - width: 27px; - margin-left: 5px; -} -.reconnect span { - display: none; -} -.grey-btn { - border: none; - background: #F2F2F2; - border-radius: 3px; - font-family: inherit; - font-size: 14px; - line-height: 16px; - color: #000; - height: 27px; - white-space: nowrap; -} - -.header { - background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); - color: #fff; - box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15); -} -.header__wrapper { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; - height: 100%; -} - -.header__logo { - margin-right: 2px; - padding: 0 15px; -} -.header__logo-link:hover { - opacity: .5; - cursor: pointer; -} -.header__right { - display: flex; - align-items: center; - position: relative; -} -.header__right select { - /* background: var(--blue-grey); */ - background: transparent; - border: none; - color: #fff; - padding: 5px; - width: 55px; - font-family: inherit; - font-size: 12px; - line-height: 14px; -} -.white-select { - display: none; -} -.header__nav { - width: 100%; -} -.page-pagination { - display: flex; - justify-content: center; - padding-bottom: 15px; - padding-right: 15px; -} -.page-pagination__num { - width: 33%; - margin: 0 5px; -} -.page-pagination .btn { - padding: 0; - white-space: nowrap; - width: 45px; - height: 40px; - margin: 0 5px; -} -.page-pagination .btn:first-of-type { - margin-left: 0; -} -.page-pagination .btn:last-of-type { - margin-right: 0; -} -.back-link { - cursor: pointer; - position: relative; - width: 30px; -} -.back-link span { - display: none; -} -.back-link::before { - content: ''; - display: block; - color: var(--blue-grey); - background: url("./../PIC/right-arrow.svg") no-repeat; - background-size: 18px 18px; - transform: translateY(-50%) rotate(180deg); - height: 18px; - width: 18px; - position: absolute; - left: 15px; - top: 50%; -} -.back-link:hover::before, -.back-link:focus::before { - opacity: .5; -} - - - - - -.back-link--history { - position: absolute; - top: 15px; - font-size: 16px; - line-height: 19px; - font-weight: 400; - text-decoration: none; -} - -.back-link--history::before { - left: 0; -} - -.back-link--history span { - display: block; - padding-left: 23px; -} - -.header__logo--history { - padding: 10px 15px; -} - -.history-page { - position: relative; - padding-bottom: 110px; -} -.history__text-block { - padding: 65px 15px 10px; -} -.history-page__id { - margin-bottom: 7px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - color: #445368; -} -.history-page__id-count { - max-width: 140px; - margin-left: 2px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - text-align-last: left; - color: #445368; - border: none; - background: #f2f2f2; -} -.history-page__description { - margin: 0; - margin-bottom: 17px; - font-size: 12px; - line-height: 14px; - color: rgba(0, 0, 0, 0.5); -} -.history-page__balance { - display: flex; - align-items: center; - - font-size: 14px; - line-height: 16px; - font-weight: 700; -} -.history-page__tera-icon { - margin-left: 5px; -} -.history-page__table { - padding: 15px 0 15px 15px; - background-color: #ffffff; -} -.history-page__table .grid { - width: 100%; - border-collapse: collapse; -} -.history-page__table-wrap { - overflow-x: auto; -} -.history-page__table th { - background: var(--blue-grey); - color: #fff; - border-right: 1px solid rgba(0, 0, 0, 0.1); - height: 30px; - padding: 0 20px 0 10px; - font-size: 16px; - line-height: 19px; - font-weight: 400; - white-space: nowrap; - text-align-last: left; -} -.history-page__table th:first-child { - border-top-left-radius: 5px; -} -.history-page__table th:last-child { - border-top-right-radius: 5px; -} -.history-page__table .grid tr td { - padding: 8px 10px 6px; - font-size: 14px; - line-height: 16px; - white-space: nowrap; - color: #000000; - background-color: #ffffff; - border: 1px solid #C4C4C4; -} -.history-page__table .grid tr td:first-of-type { - text-align: center; -} -.history-page__table .grid tr td.code -{ - white-space: normal; - width: 340px; - min-width:200px; - font-family: "courier new", "times new roman", monospace; - font-size: small; - word-break: break-all; -} - -.history-page__table .grid tr td.hash -{ - white-space: normal; - width: 160px; - font-family: "courier new", "times new roman", monospace; - font-size: small; - word-break: break-all; -} - - - -@media (min-width: 576px) { - .history__text-block { - padding: 65px 33px 10px; - } - .history-page__table { - padding: 15px 33px; - } - .back-link::before { - left: 0; - } -} - -@media (min-width: 768px) { - .header { - height: 60px; - } - .fixed-status .grey-btn { - height: 40px; - padding: 10px; - } - .reconnect { - width: 40px; - margin-left: 15px; - background-position: 11px 11px; - } - .main-logo { - width: 125px; - height: 30px; - } - .back-link { - display: block; - padding-left: 34px; - } - .back-link span { - display: inline; - text-decoration: underline; - } - .back-link::before { - left: 0; - } - .back-link--history span { - padding-left: 0; - } -} - -@media (min-width: 960px) { - .header__logo { - padding-left: 20px; - } - .reconnect.grey-btn { - width: 130px; - margin-left: 15px; - padding-top: 12px; - padding-left: 39px; - background-position: 11px 11px; - } - .reconnect span { - display: inline; - } - .history-page { - padding-right: 40px; - padding-left: 40px; - } - .history__text-block { - padding: 65px 0 10px; - } - .history-page__table { - padding: 15px 0 10px; - } -} - -@media (min-width: 1200px) { - .header__wrapper { - max-width: 1150px; - margin: 0 auto; - } - .history__text-block { - padding-top: 60px; - padding-bottom: 0; - } - .history-page__id { - font-size: 28px; - line-height: 33px; - text-align: center; - } - .history-page__id-count { - font-size: 28px; - line-height: 33px; - text-align: center; - } - .history-page__description { - margin-bottom: 30px; - font-size: 16px; - line-height: 19px; - text-align: center; - } - .history-page__balance { - justify-content: center; - margin-bottom: 30px; - font-size: 16px; - line-height: 19px; - } - .history-page__table { - padding: 30px 15px; - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); - background-color: #ffffff; - } - .page-pagination { - padding-bottom: 20px; - } -} +@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic'); + +:root { + --blue-grey: #445368; + --light-blue: #718CAF; +} + +body { + margin: 0 auto; + box-sizing: border-box; + font-family: "Roboto", "Arial", sans-serif; + + color: #445368; + background: #f2f2f2; +} +main { + max-width: 1200px; + margin: 0 auto; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +*::placeholder { + color: rgba(0, 0, 0, 0.5); + font-family: "Roboto"; + font-size: 16px; +} + +a { + text-decoration: none; + color: #445368; +} + +a:hover, +a:focus { + color: #718CAF; +} + +.hidden { + display: none; +} + +.btn { + color: #fff; + background: #445368; + + display: block; + padding: 15px 25px; + border: none; + box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3); + border-radius: 4px; + + text-decoration: none; + text-transform: uppercase; + font-family: inherit; + font-weight: 500; + font-size: 18px; + line-height: 21px; + cursor: pointer; + text-align: center; +} + +.btn:hover, +.btn:focus { + background: #718CAF; + color: #fff; +} + +.btn[disabled], +.btn.disabled { + opacity: .3; + cursor: not-allowed; +} + + +.reconnect { + background-image: url("./../PIC/reload.svg"); + background-repeat: no-repeat; + background-size: 18px 18px; + background-position: center center; + padding: 5px; + width: 27px; + margin-left: 5px; +} +.reconnect span { + display: none; +} +.grey-btn { + border: none; + background: #F2F2F2; + border-radius: 3px; + font-family: inherit; + font-size: 14px; + line-height: 16px; + color: #000; + height: 27px; + white-space: nowrap; +} + +.header { + background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); + color: #fff; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15); +} +.header__wrapper { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + height: 100%; +} + +.header__logo { + margin-right: 2px; + padding: 0 15px; +} +.header__logo-link:hover { + opacity: .5; + cursor: pointer; +} +.header__right { + display: flex; + align-items: center; + position: relative; +} +.header__right select { + /* background: var(--blue-grey); */ + background: transparent; + border: none; + color: #fff; + padding: 5px; + width: 55px; + font-family: inherit; + font-size: 12px; + line-height: 14px; +} +.white-select { + display: none; +} +.header__nav { + width: 100%; +} +.page-pagination { + display: flex; + justify-content: center; + padding-bottom: 15px; + padding-right: 15px; +} +.page-pagination__num { + width: 33%; + margin: 0 5px; +} +.page-pagination .btn { + padding: 0; + white-space: nowrap; + width: 45px; + height: 40px; + margin: 0 5px; +} +.page-pagination .btn:first-of-type { + margin-left: 0; +} +.page-pagination .btn:last-of-type { + margin-right: 0; +} +.back-link { + cursor: pointer; + position: relative; + width: 30px; +} +.back-link span { + display: none; +} +.back-link::before { + content: ''; + display: block; + color: var(--blue-grey); + background: url("./../PIC/right-arrow.svg") no-repeat; + background-size: 18px 18px; + transform: translateY(-50%) rotate(180deg); + height: 18px; + width: 18px; + position: absolute; + left: 15px; + top: 50%; +} +.back-link:hover::before, +.back-link:focus::before { + opacity: .5; +} + + + + + +.back-link--history { + position: absolute; + top: 15px; + font-size: 16px; + line-height: 19px; + font-weight: 400; + text-decoration: none; +} + +.back-link--history::before { + left: 0; +} + +.back-link--history span { + display: block; + padding-left: 23px; +} + +.header__logo--history { + padding: 10px 15px; +} + +.history-page { + position: relative; + padding-bottom: 110px; +} +.history__text-block { + padding: 65px 15px 10px; +} +.history-page__id { + margin-bottom: 7px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + color: #445368; +} +.history-page__id-count { + max-width: 140px; + margin-left: 2px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + text-align-last: left; + color: #445368; + border: none; + background: #f2f2f2; +} +.history-page__description { + margin: 0; + margin-bottom: 17px; + font-size: 12px; + line-height: 14px; + color: rgba(0, 0, 0, 0.5); +} +.history-page__balance { + display: flex; + align-items: center; + + font-size: 14px; + line-height: 16px; + font-weight: 700; +} +.history-page__tera-icon { + margin-left: 5px; +} +.history-page__table { + padding: 15px 0 15px 15px; + background-color: #ffffff; +} +.history-page__table .grid { + width: 100%; + border-collapse: collapse; +} +.history-page__table-wrap { + overflow-x: auto; +} +.history-page__table th { + background: var(--blue-grey); + color: #fff; + border-right: 1px solid rgba(0, 0, 0, 0.1); + height: 30px; + padding: 0 20px 0 10px; + font-size: 16px; + line-height: 19px; + font-weight: 400; + white-space: nowrap; + text-align-last: left; +} +.history-page__table th:first-child { + border-top-left-radius: 5px; +} +.history-page__table th:last-child { + border-top-right-radius: 5px; +} +.history-page__table .grid tr td { + padding: 8px 10px 6px; + font-size: 14px; + line-height: 16px; + white-space: nowrap; + color: #000000; + background-color: #ffffff; + border: 1px solid #C4C4C4; +} +.history-page__table .grid tr td:first-of-type { + text-align: center; +} +.history-page__table .grid tr td.code +{ + white-space: normal; + width: 340px; + min-width:200px; + font-family: "courier new", "times new roman", monospace; + font-size: small; + word-break: break-all; +} + +.history-page__table .grid tr td.hash +{ + white-space: normal; + width: 160px; + font-family: "courier new", "times new roman", monospace; + font-size: small; + word-break: break-all; +} + + + +@media (min-width: 576px) { + .history__text-block { + padding: 65px 33px 10px; + } + .history-page__table { + padding: 15px 33px; + } + .back-link::before { + left: 0; + } +} + +@media (min-width: 768px) { + .header { + height: 60px; + } + .fixed-status .grey-btn { + height: 40px; + padding: 10px; + } + .reconnect { + width: 40px; + margin-left: 15px; + background-position: 11px 11px; + } + .main-logo { + width: 125px; + height: 30px; + } + .back-link { + display: block; + padding-left: 34px; + } + .back-link span { + display: inline; + text-decoration: underline; + } + .back-link::before { + left: 0; + } + .back-link--history span { + padding-left: 0; + } +} + +@media (min-width: 960px) { + .header__logo { + padding-left: 20px; + } + .reconnect.grey-btn { + width: 130px; + margin-left: 15px; + padding-top: 12px; + padding-left: 39px; + background-position: 11px 11px; + } + .reconnect span { + display: inline; + } + .history-page { + padding-right: 40px; + padding-left: 40px; + } + .history__text-block { + padding: 65px 0 10px; + } + .history-page__table { + padding: 15px 0 10px; + } +} + +@media (min-width: 1200px) { + .header__wrapper { + max-width: 1150px; + margin: 0 auto; + } + .history__text-block { + padding-top: 60px; + padding-bottom: 0; + } + .history-page__id { + font-size: 28px; + line-height: 33px; + text-align: center; + } + .history-page__id-count { + font-size: 28px; + line-height: 33px; + text-align: center; + } + .history-page__description { + margin-bottom: 30px; + font-size: 16px; + line-height: 19px; + text-align: center; + } + .history-page__balance { + justify-content: center; + margin-bottom: 30px; + font-size: 16px; + line-height: 19px; + } + .history-page__table { + padding: 30px 15px; + border: 1px solid rgba(0, 0, 0, 0.1); + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); + background-color: #ffffff; + } + .page-pagination { + padding-bottom: 20px; + } +} diff --git a/src/HTML/CSS/buttons.css b/src/HTML/CSS/buttons.css index 3652ff2..5ddad06 100644 --- a/src/HTML/CSS/buttons.css +++ b/src/HTML/CSS/buttons.css @@ -1,201 +1,201 @@ -/*Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons*/ - -/*TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader*/ -#TabHeader th -{ - /*border: 1px solid black;*/ - width:205px; - - color: white; - background-color: #22547f; - margin: 0; - padding: 0; - height: 34px; -} -.bttab -{ - background-color: black; - vertical-align: middle; - cursor: pointer; - color: white; - width: 100%; - margin: 0; - padding-top: 7px; - height: 100%; -} - - - - - -/*User action*/ -.btdoit -{ - width: 130px; - height: 32px; - line-height: 20px; - margin: 10px; - cursor: pointer; - font-family: monospace; -} - - -.btdoitm -{ - width: 40px; - height: 32px; - line-height: 20px; - margin: 10px; - cursor: pointer; - font-family: monospace; -} - - -/*All buttons*/ -.bt -{ - border: 1px solid black; - background: transparent; - font-weight: 400; - cursor: pointer; -} -.bt:hover,button:hover -{ - filter: brightness(120%); - cursor: pointer; -} - - -.bt:active -{ - cursor: progress; -} - - - - -.btlong -{ - width: 160px; -} - -.btopen -{ - width: 136px; -} - -.btsmall -{ - width: 10px; -} - -#idSendList -{ - width: 800px; - border: 0 solid black; - font-weight: 700; -} - -#PaiListInfo -{ - width: 800px; - height:20px; - text-align: center; -} - -.btinvoice -{ - width: 133px; - min-width: 133px; - max-width: 133px; - height:40px; - white-space: pre-line; - background-image: url('/HTML/PIC/invoice.png'); - background-repeat: no-repeat; - background-size: 16px; -} -.btinvoice_use -{ - width: 110px; - min-width: 110px; - max-width: 110px; - height:62px; -} - - - -#idCounters -{ - background-image: url('/HTML/PIC/counters.png'); - background-repeat: no-repeat; - background-size: 16px; -} - -#idChains -{ - background-image: url('/HTML/PIC/chains.png'); - background-repeat: no-repeat; - background-size: 16px; -} - - - - -#idMonitor -{ - background-image: url('/HTML/PIC/monitor.png'); - background-repeat: no-repeat; - background-size: 16px; -} - -#idConsole -{ - background-image: url('/HTML/PIC/console.png'); - background-repeat: no-repeat; - background-size:16px; -} -#idOpenSmart -{ - background-image: url('/HTML/PIC/smart.png'); - background-repeat: no-repeat; - background-size:16px; -} - -#idNetwork -{ - background-image: url('/HTML/PIC/network.png'); - background-repeat: no-repeat; - background-size:16px; -} - -#idDown -{ - background-image: url('/HTML/PIC/down.png'); - background-repeat: no-repeat; - background-size: 16px; - background-position: right; -} - -#idUp -{ - background-image: url('/HTML/PIC/up.png'); - background-repeat: no-repeat; - background-size: 16px; - background-position: right; - - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 1); -} - - - - -.btexlporer -{ - width: 136px; -} - - -input[type="checkbox"] -{ - vertical-align: middle; -} +/*Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons*/ + +/*TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader*/ +#TabHeader th +{ + /*border: 1px solid black;*/ + width:205px; + + color: white; + background-color: #22547f; + margin: 0; + padding: 0; + height: 34px; +} +.bttab +{ + background-color: black; + vertical-align: middle; + cursor: pointer; + color: white; + width: 100%; + margin: 0; + padding-top: 7px; + height: 100%; +} + + + + + +/*User action*/ +.btdoit +{ + width: 130px; + height: 32px; + line-height: 20px; + margin: 10px; + cursor: pointer; + font-family: monospace; +} + + +.btdoitm +{ + width: 40px; + height: 32px; + line-height: 20px; + margin: 10px; + cursor: pointer; + font-family: monospace; +} + + +/*All buttons*/ +.bt +{ + border: 1px solid black; + background: transparent; + font-weight: 400; + cursor: pointer; +} +.bt:hover,button:hover +{ + filter: brightness(120%); + cursor: pointer; +} + + +.bt:active +{ + cursor: progress; +} + + + + +.btlong +{ + width: 160px; +} + +.btopen +{ + width: 136px; +} + +.btsmall +{ + width: 10px; +} + +#idSendList +{ + width: 800px; + border: 0 solid black; + font-weight: 700; +} + +#PaiListInfo +{ + width: 800px; + height:20px; + text-align: center; +} + +.btinvoice +{ + width: 133px; + min-width: 133px; + max-width: 133px; + height:40px; + white-space: pre-line; + background-image: url('/HTML/PIC/invoice.png'); + background-repeat: no-repeat; + background-size: 16px; +} +.btinvoice_use +{ + width: 110px; + min-width: 110px; + max-width: 110px; + height:62px; +} + + + +#idCounters +{ + background-image: url('/HTML/PIC/counters.png'); + background-repeat: no-repeat; + background-size: 16px; +} + +#idChains +{ + background-image: url('/HTML/PIC/chains.png'); + background-repeat: no-repeat; + background-size: 16px; +} + + + + +#idMonitor +{ + background-image: url('/HTML/PIC/monitor.png'); + background-repeat: no-repeat; + background-size: 16px; +} + +#idConsole +{ + background-image: url('/HTML/PIC/console.png'); + background-repeat: no-repeat; + background-size:16px; +} +#idOpenSmart +{ + background-image: url('/HTML/PIC/smart.png'); + background-repeat: no-repeat; + background-size:16px; +} + +#idNetwork +{ + background-image: url('/HTML/PIC/network.png'); + background-repeat: no-repeat; + background-size:16px; +} + +#idDown +{ + background-image: url('/HTML/PIC/down.png'); + background-repeat: no-repeat; + background-size: 16px; + background-position: right; +} + +#idUp +{ + background-image: url('/HTML/PIC/up.png'); + background-repeat: no-repeat; + background-size: 16px; + background-position: right; + + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 1); +} + + + + +.btexlporer +{ + width: 136px; +} + + +input[type="checkbox"] +{ + vertical-align: middle; +} diff --git a/src/HTML/CSS/codes.css b/src/HTML/CSS/codes.css index 61dbdf1..7766620 100644 --- a/src/HTML/CSS/codes.css +++ b/src/HTML/CSS/codes.css @@ -1,90 +1,90 @@ -/* - -Google Code style (c) Aahan Krish -Some correct by vtools - -*/ - -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #eff5eb; - color: black; -} - -.hljs-comment, -.hljs-quote { - color: #800; -} - -.hljs-keyword, -.hljs-selector-tag, -.hljs-section, -.hljs-title, -.hljs-name { - color: #008; -} - -.hljs-variable, -.hljs-template-variable { - color: #660; -} - -.hljs-string, -.hljs-selector-attr, -.hljs-selector-pseudo, -.hljs-regexp { - color: #080; -} - -.hljs-literal, -.hljs-symbol, -.hljs-bullet, -.hljs-meta, -.hljs-number, -.hljs-link { - color: #066; -} - -.hljs-title, -.hljs-doctag, -.hljs-type, -.hljs-attr, -.hljs-built_in, -.hljs-builtin-name, -.hljs-params { - color: #606; -} - -.hljs-attribute, -.hljs-subst { - color: #000; -} - -.hljs-formula { - background-color: #eee; - font-style: italic; -} - -.hljs-selector-id, -.hljs-selector-class { - color: #9B703F -} - -.hljs-addition { - background-color: #baeeba; -} - -.hljs-deletion { - background-color: #ffc8bd; -} - -.hljs-doctag, -.hljs-strong { - font-weight: bold; -} - -.hljs-emphasis { - font-style: italic; -} +/* + +Google Code style (c) Aahan Krish +Some correct by vtools + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #eff5eb; + color: black; +} + +.hljs-comment, +.hljs-quote { + color: #800; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-section, +.hljs-title, +.hljs-name { + color: #008; +} + +.hljs-variable, +.hljs-template-variable { + color: #660; +} + +.hljs-string, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-regexp { + color: #080; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-meta, +.hljs-number, +.hljs-link { + color: #066; +} + +.hljs-title, +.hljs-doctag, +.hljs-type, +.hljs-attr, +.hljs-built_in, +.hljs-builtin-name, +.hljs-params { + color: #606; +} + +.hljs-attribute, +.hljs-subst { + color: #000; +} + +.hljs-formula { + background-color: #eee; + font-style: italic; +} + +.hljs-selector-id, +.hljs-selector-class { + color: #9B703F +} + +.hljs-addition { + background-color: #baeeba; +} + +.hljs-deletion { + background-color: #ffc8bd; +} + +.hljs-doctag, +.hljs-strong { + font-weight: bold; +} + +.hljs-emphasis { + font-style: italic; +} diff --git a/src/HTML/CSS/history.css b/src/HTML/CSS/history.css index 261f923..eb2382e 100644 --- a/src/HTML/CSS/history.css +++ b/src/HTML/CSS/history.css @@ -1,440 +1,440 @@ -@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic'); - -:root { - --blue-grey: #445368; - --light-blue: #718CAF; -} - -body { - margin: 0 auto; - box-sizing: border-box; - font-family: "Roboto", "Arial", sans-serif; - - color: #445368; - background: #f2f2f2; -} -main { - max-width: 1200px; - margin: 0 auto; -} - -*, -*::before, -*::after { - box-sizing: inherit; -} - -*::placeholder { - color: rgba(0, 0, 0, 0.5); - font-family: "Roboto"; - font-size: 16px; -} - -a { - text-decoration: none; - color: #445368; -} - -a:hover, -a:focus { - color: #718CAF; -} - -.hidden { - display: none; -} - -.btn { - color: #fff; - background: #445368; - - display: block; - padding: 15px 25px; - border: none; - box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3); - border-radius: 4px; - - text-decoration: none; - text-transform: uppercase; - font-family: inherit; - font-weight: 500; - font-size: 18px; - line-height: 21px; - cursor: pointer; - text-align: center; -} - -.btn:hover, -.btn:focus { - background: #718CAF; - color: #fff; -} - -.btn[disabled], -.btn.disabled { - opacity: .3; - cursor: not-allowed; -} - - -.reconnect { - background-image: url("./../PIC/reload.svg"); - background-repeat: no-repeat; - background-size: 18px 18px; - background-position: center center; - padding: 5px; - width: 27px; - margin-left: 5px; -} -.reconnect span { - display: none; -} -.grey-btn { - border: none; - background: #F2F2F2; - border-radius: 3px; - font-family: inherit; - font-size: 14px; - line-height: 16px; - color: #000; - height: 27px; - white-space: nowrap; -} - -.header { - background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); - color: #fff; - box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15); -} -.header__wrapper { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; - height: 100%; -} - -.header__logo { - margin-right: 2px; - padding: 0 15px; -} -.header__logo-link:hover { - opacity: .5; - cursor: pointer; -} -.header__right { - display: flex; - align-items: center; - position: relative; -} -.header__right select { - /* background: var(--blue-grey); */ - background: transparent; - border: none; - color: #fff; - padding: 5px; - width: 55px; - font-family: inherit; - font-size: 12px; - line-height: 14px; -} -.white-select { - display: none; -} -.header__nav { - width: 100%; -} -.header__wallet-set { - margin-left: 5px; -} -.header__wallet-link { - color: rgba(255, 255, 255, 0.6); - display: block; - padding: 13px 15px 9px 15px; -} -.header__wallet-link:hover, -.header__wallet-link:focus { - background: #55657C; -} -.header__wallet-link span { - display: none; -} -.header__wallet-link:active, -.header__wallet-link.active { - box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25); -} -.dapps-page__pagination, -.page-pagination { - display: flex; - justify-content: center; - padding-bottom: 15px; - padding-right: 15px; -} -.page-pagination__num { - width: 33%; - margin: 0 5px; -} -.page-pagination .btn { - padding: 0; - white-space: nowrap; - width: 45px; - height: 40px; - margin: 0 5px; -} -.page-pagination .btn:first-of-type { - margin-left: 0; -} -.page-pagination .btn:last-of-type { - margin-right: 0; -} - -.back-link { - position: relative; - width: 30px; - cursor: pointer; -} -.back-link span { - display: none; -} -.back-link::before { - content: ''; - display: block; - color: var(--blue-grey); - background: url("./../PIC/right-arrow.svg") no-repeat; - background-size: 18px 18px; - transform: translateY(-50%) rotate(180deg); - height: 18px; - width: 18px; - position: absolute; - left: 15px; - top: 50%; -} -.back-link:hover::before, -.back-link:focus::before { - opacity: .5; -} - - - -.header__logo--history { - padding: 10px 15px; -} - -.back-link--history { - position: absolute; - top: 15px; - font-size: 16px; - line-height: 19px; - line-height: 19px; - font-weight: 400; - text-decoration: none; -} - -.back-link--history::before { - left: 0; -} - -.back-link--history span { - display: block; - padding-left: 23px; -} - -.history-page { - padding-bottom: 110px; -} -.history__text-block { - position: relative; - padding: 10px 15px 10px; -} -.history-page__id { - margin-bottom: 7px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - color: #445368; -} -.history-page__id-count { - max-width: 140px; - margin-left: 2px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - text-align-last: left; - color: #445368; - border: none; - background: #f2f2f2; -} -.history-page__description { - margin: 0; - margin-bottom: 17px; - font-size: 12px; - line-height: 14px; - color: rgba(0, 0, 0, 0.5); -} -.history-page__balance { - display: flex; - align-items: center; - - font-size: 14px; - line-height: 16px; - font-weight: 700; -} -.history-page__tera-icon { - margin-left: 5px; -} -.history-page__table { - padding: 15px 0 15px 15px; -} -.history-page__table .grid { - width: 100%; - border-collapse: collapse; -} -.history-page__table-wrap { - overflow-x: auto; -} -.history-page__table th { - background: var(--blue-grey); - color: #fff; - border-right: 1px solid rgba(0, 0, 0, 0.1); - height: 30px; - padding: 0 20px 0 10px; - font-size: 16px; - line-height: 19px; - font-weight: 400; - white-space: nowrap; - text-align-last: left; -} -.history-page__table th:first-child { - border-top-left-radius: 5px; -} -.history-page__table th:last-child { - border-top-right-radius: 5px; -} -.history-page__table .grid tr td { - padding: 2px 10px 0px; - font-size: 14px; - line-height: 16px; - color: #000000; - background-color: #ffffff; - border: 1px solid #C4C4C4; -} - -.history-page__table .grid tr th.direct { - max-width:30px; -} - -.history-page__table .grid tr td.date -{ - white-space: nowrap; -} - - -.history-page__table .grid tr td:first-of-type { - text-align: center; -} - -.history-page__table .grid tr td:first-of-type b { - font-size: 16px!important; - font-weight: 700!important; -} -.history-page__table .grid tr td.desc { - max-width: 170px; - word-break: break-all; -} - -@media (min-width: 576px) { - .history__text-block { - padding: 10px 33px 10px; - } - .history-page__table { - padding: 15px 33px; - } - .back-link::before { - left: 0; - } -} - -@media (min-width: 768px) { - .header { - height: 60px; - } - .main-logo { - width: 125px; - height: 30px; - } - .back-link { - display: block; - padding-left: 34px; - } - .back-link span { - display: inline; - text-decoration: underline; - } - .back-link::before { - left: 0; - } - .back-link--history span { - padding-left: 0; - } -} - -@media (min-width: 960px) { - .header__logo { - padding-left: 20px; - } - .history-page { - padding-right: 40px; - padding-left: 40px; - } - .history__text-block { - padding: 10px 0 10px; - } - .history-page__table { - padding: 15px 0 10px; - } -} - -@media (min-width: 1200px) { - .header__wrapper { - max-width: 1150px; - margin: 0 auto; - } - .history__text-block { - padding-top: 10px; - padding-bottom: 0; - } - .history-page__id { - font-size: 28px; - line-height: 33px; - text-align: center; - } - .history-page__id-count { - font-size: 28px; - line-height: 33px; - text-align: center; - } - .history-page__description { - margin-bottom: 20px; - font-size: 16px; - line-height: 19px; - min-height: 20px; - text-align: center; - } - .history-page__balance { - justify-content: center; - margin-bottom: 30px; - font-size: 16px; - line-height: 19px; - } - .history-page__table { - padding: 30px 15px; - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); - background-color: #ffffff; - } - .page-pagination { - padding-bottom: 20px; - } +@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic'); + +:root { + --blue-grey: #445368; + --light-blue: #718CAF; +} + +body { + margin: 0 auto; + box-sizing: border-box; + font-family: "Roboto", "Arial", sans-serif; + + color: #445368; + background: #f2f2f2; +} +main { + max-width: 1200px; + margin: 0 auto; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +*::placeholder { + color: rgba(0, 0, 0, 0.5); + font-family: "Roboto"; + font-size: 16px; +} + +a { + text-decoration: none; + color: #445368; +} + +a:hover, +a:focus { + color: #718CAF; +} + +.hidden { + display: none; +} + +.btn { + color: #fff; + background: #445368; + + display: block; + padding: 15px 25px; + border: none; + box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3); + border-radius: 4px; + + text-decoration: none; + text-transform: uppercase; + font-family: inherit; + font-weight: 500; + font-size: 18px; + line-height: 21px; + cursor: pointer; + text-align: center; +} + +.btn:hover, +.btn:focus { + background: #718CAF; + color: #fff; +} + +.btn[disabled], +.btn.disabled { + opacity: .3; + cursor: not-allowed; +} + + +.reconnect { + background-image: url("./../PIC/reload.svg"); + background-repeat: no-repeat; + background-size: 18px 18px; + background-position: center center; + padding: 5px; + width: 27px; + margin-left: 5px; +} +.reconnect span { + display: none; +} +.grey-btn { + border: none; + background: #F2F2F2; + border-radius: 3px; + font-family: inherit; + font-size: 14px; + line-height: 16px; + color: #000; + height: 27px; + white-space: nowrap; +} + +.header { + background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); + color: #fff; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15); +} +.header__wrapper { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + height: 100%; +} + +.header__logo { + margin-right: 2px; + padding: 0 15px; +} +.header__logo-link:hover { + opacity: .5; + cursor: pointer; +} +.header__right { + display: flex; + align-items: center; + position: relative; +} +.header__right select { + /* background: var(--blue-grey); */ + background: transparent; + border: none; + color: #fff; + padding: 5px; + width: 55px; + font-family: inherit; + font-size: 12px; + line-height: 14px; +} +.white-select { + display: none; +} +.header__nav { + width: 100%; +} +.header__wallet-set { + margin-left: 5px; +} +.header__wallet-link { + color: rgba(255, 255, 255, 0.6); + display: block; + padding: 13px 15px 9px 15px; +} +.header__wallet-link:hover, +.header__wallet-link:focus { + background: #55657C; +} +.header__wallet-link span { + display: none; +} +.header__wallet-link:active, +.header__wallet-link.active { + box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25); +} +.dapps-page__pagination, +.page-pagination { + display: flex; + justify-content: center; + padding-bottom: 15px; + padding-right: 15px; +} +.page-pagination__num { + width: 33%; + margin: 0 5px; +} +.page-pagination .btn { + padding: 0; + white-space: nowrap; + width: 45px; + height: 40px; + margin: 0 5px; +} +.page-pagination .btn:first-of-type { + margin-left: 0; +} +.page-pagination .btn:last-of-type { + margin-right: 0; +} + +.back-link { + position: relative; + width: 30px; + cursor: pointer; +} +.back-link span { + display: none; +} +.back-link::before { + content: ''; + display: block; + color: var(--blue-grey); + background: url("./../PIC/right-arrow.svg") no-repeat; + background-size: 18px 18px; + transform: translateY(-50%) rotate(180deg); + height: 18px; + width: 18px; + position: absolute; + left: 15px; + top: 50%; +} +.back-link:hover::before, +.back-link:focus::before { + opacity: .5; +} + + + +.header__logo--history { + padding: 10px 15px; +} + +.back-link--history { + position: absolute; + top: 15px; + font-size: 16px; + line-height: 19px; + line-height: 19px; + font-weight: 400; + text-decoration: none; +} + +.back-link--history::before { + left: 0; +} + +.back-link--history span { + display: block; + padding-left: 23px; +} + +.history-page { + padding-bottom: 110px; +} +.history__text-block { + position: relative; + padding: 10px 15px 10px; +} +.history-page__id { + margin-bottom: 7px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + color: #445368; +} +.history-page__id-count { + max-width: 140px; + margin-left: 2px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + text-align-last: left; + color: #445368; + border: none; + background: #f2f2f2; +} +.history-page__description { + margin: 0; + margin-bottom: 17px; + font-size: 12px; + line-height: 14px; + color: rgba(0, 0, 0, 0.5); +} +.history-page__balance { + display: flex; + align-items: center; + + font-size: 14px; + line-height: 16px; + font-weight: 700; +} +.history-page__tera-icon { + margin-left: 5px; +} +.history-page__table { + padding: 15px 0 15px 15px; +} +.history-page__table .grid { + width: 100%; + border-collapse: collapse; +} +.history-page__table-wrap { + overflow-x: auto; +} +.history-page__table th { + background: var(--blue-grey); + color: #fff; + border-right: 1px solid rgba(0, 0, 0, 0.1); + height: 30px; + padding: 0 20px 0 10px; + font-size: 16px; + line-height: 19px; + font-weight: 400; + white-space: nowrap; + text-align-last: left; +} +.history-page__table th:first-child { + border-top-left-radius: 5px; +} +.history-page__table th:last-child { + border-top-right-radius: 5px; +} +.history-page__table .grid tr td { + padding: 2px 10px 0px; + font-size: 14px; + line-height: 16px; + color: #000000; + background-color: #ffffff; + border: 1px solid #C4C4C4; +} + +.history-page__table .grid tr th.direct { + max-width:30px; +} + +.history-page__table .grid tr td.date +{ + white-space: nowrap; +} + + +.history-page__table .grid tr td:first-of-type { + text-align: center; +} + +.history-page__table .grid tr td:first-of-type b { + font-size: 16px!important; + font-weight: 700!important; +} +.history-page__table .grid tr td.desc { + max-width: 170px; + word-break: break-all; +} + +@media (min-width: 576px) { + .history__text-block { + padding: 10px 33px 10px; + } + .history-page__table { + padding: 15px 33px; + } + .back-link::before { + left: 0; + } +} + +@media (min-width: 768px) { + .header { + height: 60px; + } + .main-logo { + width: 125px; + height: 30px; + } + .back-link { + display: block; + padding-left: 34px; + } + .back-link span { + display: inline; + text-decoration: underline; + } + .back-link::before { + left: 0; + } + .back-link--history span { + padding-left: 0; + } +} + +@media (min-width: 960px) { + .header__logo { + padding-left: 20px; + } + .history-page { + padding-right: 40px; + padding-left: 40px; + } + .history__text-block { + padding: 10px 0 10px; + } + .history-page__table { + padding: 15px 0 10px; + } +} + +@media (min-width: 1200px) { + .header__wrapper { + max-width: 1150px; + margin: 0 auto; + } + .history__text-block { + padding-top: 10px; + padding-bottom: 0; + } + .history-page__id { + font-size: 28px; + line-height: 33px; + text-align: center; + } + .history-page__id-count { + font-size: 28px; + line-height: 33px; + text-align: center; + } + .history-page__description { + margin-bottom: 20px; + font-size: 16px; + line-height: 19px; + min-height: 20px; + text-align: center; + } + .history-page__balance { + justify-content: center; + margin-bottom: 30px; + font-size: 16px; + line-height: 19px; + } + .history-page__table { + padding: 30px 15px; + border: 1px solid rgba(0, 0, 0, 0.1); + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); + background-color: #ffffff; + } + .page-pagination { + padding-bottom: 20px; + } } \ No newline at end of file diff --git a/src/HTML/CSS/mobile-wallet.css b/src/HTML/CSS/mobile-wallet.css index e7e85a5..a0a22ec 100644 --- a/src/HTML/CSS/mobile-wallet.css +++ b/src/HTML/CSS/mobile-wallet.css @@ -1,2744 +1,2755 @@ -@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic'); - -:root { - --blue-grey: #445368; - --light-blue: #718CAF; - --fill--password:#000; -} - - - - -body { - margin: 0 auto; - box-sizing: border-box; - font-family: "Roboto", "Arial", sans-serif; - - color: #445368; - background: #f2f2f2; -} -main { - max-width: 1200px; - margin: 0 auto; -} - -*, -*::before, -*::after { - box-sizing: inherit; -} - -*::placeholder { - color: rgba(0, 0, 0, 0.5); - font-family: "Roboto"; - font-size: 16px; -} - -a { - text-decoration: none; - color: #445368; -} - -a:hover, -a:focus { - color: #718CAF; -} - -.hidden { - display: none; -} -.small-text { - font-size: 10px; - line-height: 12px; -} -.text-center { - text-align: center; -} -#overlay { - background: rgba(68, 83, 104, 0.65); - position: fixed; - width: 100%; - height: 100vh; - top: 0; - display: none; -} - -label[for=load-key] { - font-weight: 500; -} -textarea { - resize: none; -} -.currentBlockNum { - font-size: 14px; - padding: 15px; - padding-bottom: 0; - margin-bottom: 15px; -} -.currentBlockNum span { - display: inline-block; - min-width: 220px; -} -.currentBlockNum p { - display: flex; - justify-content: space-between; - margin-top: 8px; - margin-bottom: 8px; -} -.currentBlockNum p:first-child { - margin-top: 0; -} -.currentBlockNum p:last-child { - margin-bottom: 0; -} -.btn { - color: #fff; - background: #445368; - - display: block; - padding: 15px 25px; - border: none; - box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3); - border-radius: 4px; - - text-decoration: none; - text-transform: uppercase; - font-family: inherit; - font-weight: 500; - font-size: 18px; - line-height: 21px; - cursor: pointer; - text-align: center; -} - -.btn:hover, -.btn:focus { - background: #718CAF; - color: #fff; -} - -.btn[disabled], -.btn.disabled { - opacity: .3; - cursor: not-allowed; -} - -.btn span { - opacity: .4; -} - -.btn--white { - background: #fff; - color: #445368; -} - -.btn--white:hover, -.btn--white:focus { - background: #F5F5F5; - color: #445368; -} - -.btn--full-width { - width: 100%; - border-radius: 0px; -} -.btn--270 { - max-width: 270px; - border-radius: 4px; -} - -.btn--450 { - max-width: 450px; - margin: 0 auto; -} - -.btn--center { - margin: 0 auto; -} - -.grey-btn { - border: none; - background: #F2F2F2; - border-radius: 3px; - font-family: inherit; - font-size: 14px; - line-height: 16px; - color: #000; - height: 27px; - - white-space: nowrap; -} - -.btn-no-bg { - color: var(--blue-grey); - background: none; - border: none; - text-transform: uppercase; - font-weight: 500; - font-size: 16px; - line-height: 19px; -} - -.prod-card__drop-btn:hover, -.prod-card__drop-btn:focus { - background: rgba(0, 0, 0, 0.1); -} - -.title { - font-weight: 700; - font-size: 20px; - line-height: 23px; -} - -.welcome, -.wallet-settings, -.wallet-settings--info, -.accounts-info, -.accounts-info__add, -.accounts-info__empty, -.send-page, -.dapps-page, -.explorer-page { - padding-bottom: 50px; -} - -.explorer-page { - padding-bottom: 100px; -} - -.header { - background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); - color: #fff; - box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15); -} -.header__wrapper { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; -} - -.header__logo { - margin-right: 2px; - padding: 0 15px; -} -.header__logo-link:hover { - opacity: .5; - cursor: pointer; -} -.header__right { - display: flex; - align-items: center; - position: relative; -} -.header__right select { - /* background: var(--blue-grey); */ - background: transparent; - border: none; - color: #fff; - padding: 5px; - width: 55px; - font-family: inherit; - font-size: 12px; - line-height: 14px; -} -.white-select { - display: none; -} -.header__nav { - width: 100%; -} -.header__wallet-set { - margin-left: 5px; -} -.header__wallet-link { - color: rgba(255, 255, 255, 0.6); - display: block; - padding: 13px 15px 9px 15px; -} -.header__wallet-link:hover, -.header__wallet-link:focus { - background: #55657C; -} -.header__wallet-link span { - display: none; -} -.header__wallet-link:active, -.header__wallet-link.active { - box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25); - } - - -.nav-tabs__list { - list-style: none; - padding: 0; - margin: 0; - - display: flex; - justify-content: space-between; - - font-size: 13px; -} - -.nav-tabs__tab { - background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); - width: 100%; - text-align: center; -} - -.nav-tabs__link { - color: rgba(255, 255, 255, 0.6); - text-decoration: none; - padding: 17px 14px 18px 14px; - display: block; -} - -.tab-link:hover { - background: linear-gradient(180deg, #3D4C61 0%, #445368 100%); - opacity: .6; - cursor: pointer; -} - -.tab-link.active, -.tab-link:focus { - color: #fff; - background: #55657C; - box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25); - cursor: pointer; -} - -.welcome { - text-align: center; - padding: 50px 15px 35px; -} - -.welcome__link { - max-width: 270px; - margin: 0 auto; -} - -.social-list { - display: flex; - flex-wrap: wrap; - justify-content: center; - margin: 0 auto; - max-width: 300px; - list-style-type: none; - padding: 50px 0 80px; - font-weight: 500; -} - -.social-list__item { - text-align: center; - padding: 10px 0; - -} - -.social-list__item a { - padding: 0 15px; - border-right: 1px solid rgba(68, 83, 104, .2); -} - -.social-list__item:nth-child(3n) a { - border-right: none; -} - -.fixed-status { - background: var(--blue-grey); - color: rgba(255, 255, 255, 1); - font-size: 12px; - padding: 12px 10px 11px 10px; - padding-left: 17px; - - position: fixed; - bottom: 0; - left: 0; - - width: 100%; - font-family: "Roboto", sans-serif; -} -.fixed-status__wrap { - display: flex; - align-items: center; - max-width: 1170px; - margin: 0 auto; -} - -.fixed-status__status { - max-width: 330px; - margin-right: auto; - padding-right: 10px; -} -.fixed-status .grey-btn { - padding-left: 3px; - font-size: 12px; - line-height: 14px; -} - -.reconnect { - background-image: url("./../PIC/reload.svg"); - background-repeat: no-repeat; - background-size: 18px 18px; - background-position: center center; - padding: 5px; - width: 27px; - margin-left: 5px; -} -.reconnect span { - display: none; -} - - -.key-field { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; - font-size: 16px; - line-height: 18px; - padding-bottom: 16px; - color: #445368; -} - -.key-field:first-of-type { - padding-top: 15px; -} - -.key-field__title { - font-weight: 500; - margin: 0 auto 0 0; - padding-left: 15px; -} - -.key-field__title span { - opacity: .6; -} -@media (max-width: 445px) -{ - .key-field__title--pay { - margin-bottom: 5px; - } -} - -.key-field__input { - width: 100%; - padding: 15px 15px 13px 14px; - margin: 10px 0 0; - border: 1px solid rgba(0, 0, 0, 0.1); - font-family: inherit; - font-size: 16px; - line-height: 18px; - color: #445368; -} -.key-field__input--select { - padding: 11px 15px 11px 10px; - font-size: 18px; - line-height: 21px; -} -.key-field__input--enter { - padding-top: 20px; - padding-bottom: 18px; -} - -.key-field__btn { - margin-right: 15px; -} - -.key-field__btn--with-icon { - display: flex; - align-items: center; -} -.key-field__btn--with-icon svg { - margin-left: 10px; -} - -.key-field__textarea { - width: 100%; - background: #FFFFFF; - border: 1px solid rgba(0, 0, 0, 0.1); - min-height: 50px; - padding: 21px 15px 14px 15px; - margin-top: 8px; - font-family: "Roboto", "Arial", sans-serif; - font-size: 16px; - line-height: 18px; - color: #445368; -} -.key-field__textarea--mobile { - max-height: 50px; - padding-top: 15px; -} - -.key-field__select::placeholder, -.key-field__input::placeholder, -.key-field__textarea::placeholder { - color: rgba(68, 83, 104, .5); - font-size: 16px; - font-family: "Roboto", "Arial", sans-serif; - color: #445368; - opacity: 0.5; -} - -.key-field__select { - width: 100%; - border: 1px solid rgba(0, 0, 0, 0.1); - padding: 12px 15px; - margin-top: 5px; - background: #fff; - font-family: inherit; - font-size: 16px; - line-height: 18px; - color: #445368; -} -.key-field__key-place { - word-wrap: break-word; - padding: 10px 15px; - width: 100%; - margin-bottom: 0; -} -.back-link { - position: relative; - width: 30px; -} -.back-link span { - display: none; -} -.back-link::before { - content: ''; - display: block; - color: var(--blue-grey); - background: url("./../PIC/right-arrow.svg") no-repeat; - background-size: 18px 18px; - transform: translateY(-50%) rotate(180deg); - height: 18px; - width: 18px; - position: absolute; - left: 15px; - top: 50%; -} -.back-link:hover::before, -.back-link:focus::before { - opacity: .5; -} -.wallet-settings__title-wrap { - position: relative; - display: flex; - align-items: center; - margin-bottom: 15px; -} -.wallet-settings__title, -.accounts-info__title { - display: block; - padding: 15px 20px; - text-align: center; - margin: 0 auto; -} -.accounts-info__title { - margin-left: calc(50% - 133px); -} -.wallet-settings__btns-wrapper { - display: flex; - /*flex-wrap: wrap;*/ - align-items: center; - justify-content: center; - padding: 0 20px 20px; -} -.wallet-settings__ok-btns { - padding-top: 30px; - flex-wrap: wrap; -} -.wallet-settings__ok-btns .btn { - width: 100%; -} - -.wallet-settings__btns-wrapper .btn { - margin: 10px 10px; - white-space: nowrap; - min-width: 125px; - text-align: center; -} - -.wallet-settings__go-btn { - margin: 0 auto; - min-width: 270px; - text-align: center; - - margin-bottom: 60px; - margin-top: auto; -} - -.wallet-settings__hidden-field { - border-top: 1px dotted var(--blue-grey); - width: 100%; - margin: 20px 15px 5px; -} - -.wallet-settings__btn-270.btn { - max-width: 270px; - margin: 0 auto; - border-radius: 4px; -} - -.accounts-info__counter { - text-transform: uppercase; - padding: 15px; - margin: 0; -} - -.accounts-info__btn { - margin: 30px auto 50px; -} - -.accounts-info__add-btn { - margin-top: 44px; - max-width: 330px; -} - -.accounts-info__to-send-link { - padding: 15px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - display: block; - position: relative; - width: 100%; - margin-bottom: 15px; - font-family: inherit; - font-size: 16px; - line-height: 18px; -} - -.accounts-info__to-send-link::after { - content: ''; - color: var(--blue-grey); - background: url("./../PIC/right-arrow.svg") no-repeat; - position: absolute; - background-size: 17px 17px; - transform: translateY(-50%); - height: 17px; - width: 17px; - right: 15px; - top: 50%; -} - -.accounts-info__to-send-link:hover::after, -.accounts-info__to-send-link:focus::after { - opacity: .5; -} - -.accounts-info__counter-wrapper { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - -ms-align-items: center; - align-items: center; - padding: 0 15px 15px; -} - -.accounts-info__counter-wrapper .title { - margin: 0; - margin-right: -30px; -} - -.accounts-info__empty img { - width: 100%; - display: none; -} -.accounts-info__empty-img img:first-child { - display: block; -} - -.prod-list { - list-style-type: none; - padding: 0; - margin: 0; -} -.prod-card { - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); - background: #FFFFFF; - margin-bottom: 5px; -} -.prod-card__dapp-icon { - margin-right: 2px; -} - -.prod-card__first-line, -.prod-card__second-line, -.prod-card__footer { - display: -webkit-flex; - display: -moz-flex; - display: -ms-flex; - display: -o-flex; - display: flex; - justify-content: space-between; - white-space: nowrap; -} - -.prod-card__first-line { - padding: 15px; -} - -.prod-card__second-line { - padding: 0 15px 15px; -} - -.prod-card__footer { - padding: 15px; -} - -.prod-card__id { - color: #445368; - opacity: 0.5; - margin-right: 15px; - min-width: 56px; -} -.prod-card__id:first-of-type { - min-width: 45px; -} -.prod-card__id--desktop { - display: none; -} -.prod-card__id--mobile { - display: none; -} -.prod-card__id--mobile-active { - display: none; -} -@media (max-width: 960px) { - .prod-card__id--mobile { - display: block; - } -} -@media (min-width: 960px) { - .prod-card__id--desktop { - display: block; - } -} -.prod-card__descr { - width: 100%; - text-overflow: ellipsis; - overflow: hidden; -} - -.prod-card__heading { - font-size: 21px; - line-height: 25px; - font-weight: bold; - color: var(--blue-grey); - - display: flex; - -ms-align-items: center; - align-items: center; - justify-content: flex-end; - width: 100%; - /*padding-bottom: 15px;*/ -} -.prod-card__currency { - margin-left: 5px; - position: relative; -} -.prod-card__currency--with-dot:after { - content: ''; - position: absolute; - top: 0; - right: 0; - background: var(--blue-grey); - width: 5px; - height: 5px; - border-radius: 50%; -} -.prod-card__footer-empty { - position: relative; - padding-left: 40px; - color: rgba(0, 0, 0, 0.2);; -} -.prod-card__footer-empty:before { - content: ''; - position: absolute; - background-image: url("./../PIC/add-icon.svg"); - background-size: 30px 30px; - top: 50%; - transform: translateY(-50%); - left: 0; - width: 30px; - height: 30px; - border-radius: 50%; -} -.prod-card__heading sup { - font-size: 13px; - line-height: 15px; - vertical-align: unset; -} - -.prod-card__dropdown { - cursor: pointer; - position: absolute; - right: 38px; - top: 10px; - box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.15); - background: #fff; - border-radius: 4px; - width: 197px; - z-index: 20; -} -.prod-card__dropdown a { - display: block; - padding: 10px 15px; -} -.prod-card__drop-btn -{ - cursor: pointer; - padding: 6px 12px; - border-radius: 4px; -} -.accounts-info__accounts { - padding: 0 15px; - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); - background: #FFFFFF; -} -.accounts-info__accounts .prod-card { - /*padding: 0 15px;*/ - box-shadow: none; - background: transparent; - font-size: 12px; - line-height: 14px; -} -.accounts-info__accounts .prod-card__heading { - width: 50%; -} -.prod-card__coins-count { - font-weight: normal; - font-size: 14px; - line-height: 16px; - padding: 0 15px; - display: inline; - text-align: right; -} -.accounts-info__accounts .prod-card__id { - opacity: 1; - text-decoration: underline; - margin-right: auto; -} -.accounts-info__accounts .prod-card__first-line { - flex-wrap: wrap; -} -.accounts-info__accounts .prod-card__second-line { - padding: 15px; -} -.prod-card__footer { - border-top: 1px solid rgba(68, 83, 104, 0.1); - position: relative; -} - -.prod-card__link -{ - cursor: pointer; - display: flex; - -ms-align-items: center; - align-items: center; - width: 100%; -} - -.prod-card__link:hover:after { - opacity: .5; -} - -.prod-card__link--empty { - color: rgba(68, 83, 104, 0.5); -} - -.prod-card__link--empty:before { - background: url("./../PIC/chain-off.svg") no-repeat; - opacity: .2; -} -.prod-card__link--info::after { - display: none; -} -.prod-card__link--info::before { - content: ""; - position: absolute; - top: 0; - left: -28px; - background: url("./../PIC/info.svg") no-repeat; - width: 18px; - height: 18px; -} -.prod-card__link--info { - position: relative; - width: auto; - margin-left: auto; -} -.accounts-info__total { - padding: 20px 15px 30px; -} - -.prod-card--line { - display: -webkit-flex; - display: -moz-flex; - display: -ms-flex; - display: -o-flex; - display: flex; - justify-content: space-between; - padding: 10px 0; - margin-bottom: 0; -} -.prod-card--line:not(:last-child) { - border-bottom: 1px solid rgba(0, 0, 0, 0.1); -} -.prod-card--line .prod-card__first-line { - width: 100%; - padding: 0 15px 0 0; -} -.prod-card--line .prod-card__footer { - border: 0; - border-left: 1px solid rgba(0, 0, 0, 0.1); - padding: 0 0 0 15px; - display: flex; - align-items: center; - -} -.prod-card--line .prod-card__footer-wrap { - width: 100%; - display: -webkit-flex; - display: -moz-flex; - display: -ms-flex; - display: -o-flex; - display: flex; - -ms-align-items: center; - align-items: center; - justify-content: flex-start; -} - -.prod-card__dapp-name { - margin-left: 10px; - margin-right: auto; -} - -.prod-card__dapp-text { - font-size: 14px; - line-height: 16px; - color: rgba(0, 0, 0, 0.2); -} - -.total-info__item { - display: -webkit-flex; - display: -moz-flex; - display: -ms-flex; - display: -o-flex; - display: flex; - justify-content: space-between; - width: 100%; - font-size: 14px; - line-height: 16px; - padding: 5px 0; -} - -.total-info__item dd { - font-weight: bold; -} -.send-page__send-btn { - border-radius: 4px; -} - -.send-page__send-btn-wrp { - padding: 0 15px 80px; -} -.send-page__setting .title, -.dapps-page .title { - display: none; -} - -.light-grey-text { - color: rgba(0, 0, 0, 0.5); -} -.lighter-grey-text { - color: rgba(0, 0, 0, 0.2); -} -.grey-blue-text { - color: var(--blue-grey); -} -.confirm-info { - font-size: 16px; - max-width: 950px; -} -.confirm-info__line { - display: flex; - align-items: flex-start; - padding: 15px; -} -.confirm-info__line .btn-no-bg { - margin-left: auto; -} -.confirm-info__line p { - margin: 0; -} -.confirm-info__title { - min-width: 90px; - text-align: right; - font-weight: 500; -} -.confirm-info__descr { - text-align: left; - margin-left: 3%; - font-weight: 500; -} -.confirm-info__descr p { - padding-top: 10px; -} -.send-page__btns-wrap { - display: flex; - justify-content: space-between; - padding: 20px 15px 80px; -} -.send-page__btns-wrap .btn { - width: 48%; - margin: 0; -} - -.dapps-page__field.key-field { - padding-top: 0; - margin-top: 5px; -} -.dapps-page__field select { - padding: 15px; - background: #fff; -} -.dapps-page__pagination, -.page-pagination { - display: flex; - justify-content: center; - padding-bottom: 15px; - padding-right: 15px; -} -.page-pagination__num { - width: 33%; - margin: 0 5px; -} -.dapps-page__pagination input, -.page-pagination input { - margin: 0 5px; - border: 1px solid rgba(0, 0, 0, 0.1); -} -.dapps-page__page-btns, -.page-pagination .btn { - padding: 0; - white-space: nowrap; - width: 45px; - height: 40px; - margin: 0 5px; -} -.page-pagination .btn:first-of-type { - margin-left: 0; -} -.page-pagination .btn:last-of-type { - margin-right: 0; -} - - -.prod-card__second-line-left ol { - margin-top: 10px; - border-radius: 3px; - padding: 0; - list-style-position: inside; - display: flex; - flex-wrap: wrap; -} -.prod-card__second-line-left li { - border: 1px solid rgba(68, 83, 104, 0.1); - padding: 5px 10px; - margin: 0 10px 10px 0; - border-radius: 4px; -} -.prod-card__second-line-left p { - white-space: normal; - display: none; - padding-top: 5px; - margin-top: 0; -} -.dapp-modal__ok-token:before { - content: ""; - background: url("./../PIC/check.svg") no-repeat; - background-size: 20px 15px; - width: 20px; - height: 15px; - display: inline-block; - margin-right: 10px; -} -@media (max-width: 440px) { - .dapp-modal .modal__close { - left: -15px; - top: -15px; - } -} -@media (max-width: 960px) { - .modal__title-wrap { - margin-right: auto; - } -} - -.dapp-modal { - padding-bottom: 100px; -} - -.modal { - padding: 30px; - background: #fff; - border-radius: 3px; - color: #000; - position: fixed; - box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.15); - margin: 0 auto; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - max-width: 570px; - width: 87%; - z-index: 10; -} -.dapp-modal { - top: calc(50% - 210px); - left: 20px; - right: 20px; - transform: none; -} -.modal h3 { - font-size: 20px; - line-height: 23px; - letter-spacing: 0.02em; - margin: 15px 0 10px; - color: var(--blue-grey); -} -.modal__header { - display: flex; -} -.password-modal { - display: none; - padding: 15px 15px 45px 15px; - padding-top: 15px; - padding-bottom: 45px; - border-radius: 5px; -} -.password-modal__title { - width: 100%; - margin-top: 0; - margin-bottom: 10px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - text-align: center; - text-transform: uppercase; - color: #445368; -} -.password-modal__subtitle { - width: 100%; - margin-top: 0; - margin-bottom: 30px; - - font-size: 16px; - line-height: 18px; - text-align: center; - color: rgba(0, 0, 0, 0.5); -} -.password-modal--change .password-modal__input--margin { - margin-bottom: 30px; -} -.password-modal--set .btn, -.password-modal--change .btn { - max-width: 48%; - width: 48%; -} -.password-modal__buttons--one .btn { - width: 100%; -} -.password-modal__subtitle--red { - color: #eb5757; -} -.password-modal__input { - width: 100%; - margin-bottom: 10px; - padding: 11px 15px; - font-size: 18px; - line-height: 21px; - color: rgba(0, 0, 0, 0.2); - border: 1px solid rgba(0, 0, 0, 0.1); - border-radius: 4px; -} -.password-modal__input:last-of-type { - margin-bottom: 30px; -} -.password-modal__buttons { - display: flex; - justify-content: space-between; - flex-wrap: wrap; -} -.password-modal__buttons--one { - justify-content: center; -} -.password-modal__buttons .btn { - font-size: 16px; - line-height: 19px; -} -.password-modal__link { - display: block; - width: 100%; - margin-top: 30px; - font-size: 16px; - line-height: 19px; - font-weight: 500; - text-align: center; - text-transform: uppercase; - text-decoration: underline; - color: rgba(0, 0, 0, 0.5); -} -@media (max-width: 359px) { - .password-modal__buttons .btn { - padding: 15px 20px; - } - .accounts-info__add-btn { - max-width: 320px; - } -} -@media (min-width: 500px) { - .password-modal__buttons .btn { - width: 100%; - } -} -.modal__ol { - list-style-position: inside; - display: flex; - flex-wrap: wrap; - padding: 0; -} -.modal__category { - padding: 5px 10px; - border: 1px solid rgba(68, 83, 104, 0.1); - margin: 0 10px 10px 0; -} -.dapp-modal__token-status { - margin: 15px 0 0; -} -.dapp-modal__token-status .light-grey-text { - color: rgba(0, 0, 0, 0.2); -} -.modal__img-wrap { - padding: 10px 15px; - text-align: center; -} -.modal__img-wrap img { - display: block; - margin-bottom: 5px; -} - -.modal__btns-wrap { - display: flex; - justify-content: center; - padding: 30px 0 0; -} -.modal__close { - position: absolute; - width: 50px; - height: 50px; - box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.15); - top: -25px; - left: -25px; - border: 0; - border-radius: 50%; -} -.modal__close::before, -.modal__close::after { - content: ""; - position: absolute; - left: 24px; - height: 35px; - width: 2px; - top: 7px; - background-color: var(--blue-grey); -} - -.modal__close:before { - transform: rotate(45deg); -} - -.modal__close:after { - transform: rotate(-45deg); -} -.modal__btns-wrap .btn { - margin: 0 15px; - padding: 14px 10px; - min-width: 125px; -} -.modal-lock { - position: absolute; - top: 17px; - right: 26px; - display: block; - width: 14px; - height: 18px; -} -.modal-lock2 { - position: absolute; - top: 18px; - right: 10px; - display: block; - width: 10px; - height: 20px; -} - - -.def-list__item { - display: flex; - align-items: center; -} -.def-list__item dt { - min-width: 90px; - margin-right: 30px; -} - -.def-list__item a { - text-decoration: underline; -} -.def-list__item dd { - margin: 5px 0; -} - -.explorer-page__explore { - margin-top: 10px; - text-align: left; - position: relative; - font-weight: bold; - font-size: 20px; - line-height: 23px; - text-transform: none; - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); - padding: 18px 12px 17px 15px; -} - -.explorer-page__explore:last-of-type { - margin-bottom: 20px; -} - -.explorer-page__explore::after { - content: ""; - display: block; - background: url("./../PIC/down-arrow.svg") no-repeat; - background-size: 20px 15px; - width: 20px; - height: 15px; - position: absolute; - top: 50%; - right: 13px; - transform: translateY(-50%); -} -.explorer-page__explore.btpress { - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: none; -} -.explorer-page__explore.btpress::after { - transform: translateY(-50%) rotate(180deg); -} - -.dapps__table { - width: 100%; -} -.dapps__table tr { - margin-bottom: 5px; -} -.dapps__table .prod-card__link--info { - font-size: 14px; - line-height: 16px; -} -.dapps__table .prod-card__id { - font-size: 16px; - line-height: 19px; - opacity: 1; -} -.dapps__table .prod-card__heading { - font-size: 20px; - line-height: 23px; -} -.dapps__table tr:first-of-type .dapp_card { - padding-bottom: 15px; -} - -.explorer-page__table { - background: #fff; - padding: 15px 0 15px 15px; - display: none; -} -.explorer-page__table-wrap { - overflow-x: scroll; -} -.dapps-page .explorer-page__table-wrap { - overflow-x: hidden; -} -.explorer-page__explore.btpress + .explorer-page__table { - display: block; -} -.explorer-page__table .grid { - border-collapse: collapse; - border-spacing: 1px; -} -.explorer-page__table th { - background: var(--blue-grey); - color: #fff; - border-right: 1px solid rgba(0, 0, 0, 0.1); - height: 30px; - padding: 0 40px; - font-size: 16px; - line-height: 19px; - font-weight: 400; - white-space: nowrap; -} -.explorer-page__table th:first-child { - border-top-left-radius: 5px; -} -.explorer-page__table th:last-child { - border-top-right-radius: 5px; -} - -.explorer-page__table td { - padding: 5px; - border: 1px solid #C4C4C4; - text-align: center; - font-size: 14px; - line-height: 16px; - letter-spacing: 0.02em; -} - -.explorer-page__table td:nth-child(2) { - text-align: right; -} -.explorer-page__table td:nth-child(4) { - text-align: left; -} -td.hash { - font-size: 10px; - line-height: 12px; - letter-spacing: 0.02em; - width: 220px; - min-width: 120px; - word-break: break-all; -} -.history-page__table .grid tr td.code -{ - white-space: normal; - width: 340px; - min-width:200px; - font-family: "courier new", "times new roman", monospace; - font-size: small; - word-break: break-all; -} -.explorer-page__table td.pubkey { - width: 215px; - min-width: 215px; -} - -.explorer-page__table td a { - text-decoration: underline; -} - -.explorer-page__table .num button { - background: none; - border: none; - color: var(--blue-grey); - text-decoration: underline; -} - -.explorer-page__diagramms canvas { - width: 100%; -} -.explorer-page__diagramms b { - padding-left: 15px; -} -.explorer-page__diagramms .delete { - margin-left: 10px; - margin-bottom: 10px; - background: #fff; - border: none; - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); -} -.addresses-modal { - padding-bottom: 0; -} -.addresses-modal .title { - text-transform: uppercase; - text-align: center; - color: #445368; - margin: 0; - padding-bottom: 15px; - font-size: 20px; -} -.addresses-modal__input { - padding: 14px 15px; - width: 100%; - border: 1px solid rgba(0, 0, 0, 0.1); - - background: url("./../PIC/glass.svg") no-repeat; - -webkit-background-size: 18px 18px; - background-size: 18px 18px; - background-position: 98% 13px; -} -.addresses-modal__list { - padding: 0 15px; - margin: 0; - list-style-type: none; - max-height: 350px; - overflow-y: auto; -} -.addresses-modal__item { - padding: 10px 0; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - display: flex; - position: relative; -} -.addresses-modal__text-wrap { - display: flex; - justify-content: space-between; - -ms-align-items: center; - align-items: center; - width: 100%; - padding-right: 30px; -} -.addresses-modal__btns-wrapper { - display: flex; - justify-content: flex-end; - padding-right: 5px; - position: absolute; - top: 4px; - width: 100%; - background: rgba(255,255,255,.6); -} -.addresses-modal__delete-item { - position: absolute; - right: 0; - top: 21px; - height: 15px; - width: 15px; - background: none; - border: none; -} -.addresses-modal__delete-item::before, -.addresses-modal__delete-item::after { - content: ""; - position: absolute; - left: 9px; - height: 15px; - width: 2px; - top: 0; - background-color: var(--blue-grey); -} - -.addresses-modal__delete-item:before { - transform: rotate(45deg); -} - -.addresses-modal__delete-item:after { - transform: rotate(-45deg); -} -.addresses-modal__btns-wrapper .btn { - width: 125px; - margin: 5px 10px; - padding: 10px 25px; -} -.addresses-modal__choosing { - display: flex; - justify-content: space-between; - padding-top: 30px; - padding-bottom: 30px; -} -.addresses-modal__choosing .btn { - width: 48%; - padding: 15px 0; -} -.wallet-settings__generate { - margin-bottom: 20px; -} - -.welcome__img .tablet { - display: none; - margin: 0 auto; -} - -.prod-card--line .mob-hidden { - display: none; -} - -@media (max-width: 1000px) -{ - .nomobile - { - display: none; - } -} - -@media (min-width: 576px) { - .welcome, - .wallet-settings--info, - .wallet-settings, - .accounts-info, - .send-page, - .dapps-page { - padding-left: 33px; - padding-right: 33px; - } - .welcome { - padding: 20px 0 0 0; - } - .wallet-settings__title { - padding: 15px 0; - } - .wallet-settings__title:before { - left: 5px; - } - .key-field__title { - padding-left: 0; - } - .wallet-settings__generate { - border-radius: 4px; - } - .social-list { - max-width: 100%; - padding: 102px 0 20px; - } - .accounts-info__counter-wrapper, - .accounts-info__total { - padding-left: 0; - padding-right: 0; - } - - .accounts-info__total h3 { - margin-top: 5px; - margin-bottom: 5px; - } - - .accounts-info__total .total-info { - margin-top: 10px; - } - .key-field__input { - padding-top: 20px; - padding-bottom: 18px; - } - .key-field { - padding-bottom: 30px; - } - .key-field:first-of-type { - padding-bottom: 16px; - } - .send-page__send-btn-wrp { - max-width: 330px; - width: 330px; - margin: 0 auto; - margin-top: 30px; - padding-left: 0; - padding-right: 0; - padding-bottom: 30px; - } - .dapps-page__field select { - padding-left: 10px; - } - /* .dapps-page__field select::placeholder { - color: rgba(0, 0, 0, 0.2); - } */ - .dapps-page__pagination, - .page-pagination { - max-width: 576px; - margin: 0 auto; - justify-content: space-between; - } - .explorer-page__explore.btpress + .explorer-page__table { - padding-left: 34px; - padding-right: 34px; - } - .dapps-page__page-btns, - .page-pagination .btn { - width: 60px; - height: 40px; - } - .dapps-page__page-btns:first-of-type { - margin-left: 0; - } - .page-pagination .btn:first-of-type { - margin-left: 0; - } - .dapps-page__page-btns:last-of-type { - margin-right: 0; - } - .page-pagination .btn:last-of-type { - margin-right: 0; - } - .dapps-page__pagination input, - .page-pagination input { - width: 150px; - height: 40px; - } - .dapps-page .key-field:first-of-type { - padding-bottom: 30px; - } - .dapps-page { - padding-bottom: 75px; - } - .explorer-page__explore { - padding-right: 33px; - padding-left: 33px; - } - .currentBlockNum { - padding-left: 33px; - padding-right: 33px; - } - .currentBlockNum p { - justify-content: flex-start; - } - .currentBlockNum p span:first-of-type { - min-width: 180px; - } - .explorer-page__explore::after { - right: 30px; - } - .explorer-page__table th.cur { - text-transform: uppercase; - } - .wallet-settings__field { - padding-bottom: 0; - } - .wallet-settings__generate { - margin: 0 auto; - margin-bottom: 5px; - max-width: 285px; - } - .back-link::before { - left: 0; - } - .accounts-info__add .key-field { - padding-bottom: 15px; - } - - .accounts-info__add .key-field__input { - max-height: 48px; - height: 48px; - padding-top: 15px; - padding-bottom: 14px; - } - .accounts-info__add .key-field__input--select { - padding-top: 10px; - padding-bottom: 10px; - } - .accounts-info__add-btn { - margin-top: 15px; - } - .dapp_card { - padding: 0; - } - .dapps-page__field.key-field { - margin-top: 10px; - } - .accounts-info__to-send-link { - padding-left: 0; - } -} - - -@media (min-width: 768px) { - .main-logo { - width: 125px; - height: 30px; - } - .no-mr { - margin-right: 0; - } - .accounts-info__counter-wrapper .title { - font-size: 28px!important; - line-height: 33px; - } - .header__logo { - margin-top: 3px; - } - .header__logo-link img { - height: 30px; - width: 125px; - } - .prod-card { - border-radius: 4px; - } - .welcome__img .mobile { - display: none; - } - .welcome__img .tablet { - display: block; - width: 410px; - height: 410px; - } - .wallet-settings__generate { - margin-bottom: 0; - } - .title { - font-size: 28px; - line-height: 33px; - } - .welcome, - .wallet-settings--info, - .wallet-settings, - .accounts-info, - .send-page, - .dapps-page { - padding-top: 45px; - padding-left: 39px; - padding-right: 39px; - } - .send-page { - padding-top: 25px; - } - .welcome { - padding-top: 53px; - } - .welcome__title.title { - margin-top: -8px; - margin-bottom: 30px; - } - .header { - height: 60px; - } - .header__wrapper { - flex-wrap: nowrap; - } - .header__right { - order: 2; - } - .header__right select { - text-decoration: underline; - width: 60px; - } - .header__wallet-link { - display: flex; - align-items: center; - padding: 18px 17px; - } - .header__wallet-link span { - white-space: nowrap; - margin-left: 10px; - display: block; - text-transform: uppercase; - } - .header__nav { - max-width: 350px; - } - .nav-tabs__list { - font-size: 16px; - line-height: 18px; - } - .nav-tabs__tab { - background: none; - } - .nav-tabs__link { - padding: 21px 15px; - - } - .welcome__link { - margin: 60px auto; - } - .social-list { - flex-wrap: wrap; - max-width: 550px; - padding-top: 0; - margin-top: 180px; - } - .header__right select { - position: absolute; - font-size: 14px; - line-height: 16px; - bottom: -38px; - right: 7px; - width: 60px; - border-radius: 3px; - background: transparent; - color: var(--blue-grey); - } - .white-select { - display: block; - border: 0; - padding: 10px; - margin: 10px 15px 10px auto; - } - .back-link { - display: block; - padding-left: 34px; - } - .back-link span { - display: inline; - text-decoration: underline; - } - .back-link::before { - left: 0; - } - .wallet-settings__title { - text-align: left; - padding: 30px 0; - } - .wallet-settings__ok-btns { - display: flex; - flex-wrap: nowrap; - } - .wallet-settings__btns-wrapper, - .wallet-settings__ok-btns { - padding: 30px 0; - justify-content: space-between; - } - .wallet-settings__btns-wrapper .btn, - .wallet-settings__ok-btns .btn { - margin: 0; - width: calc(50% - 15px); - max-width: none; - } - .wallet-settings__go-btn { - margin: 100px auto 150px; - width: 100%; - } - .accounts-info__empty-img { - display: flex; - justify-content: space-between; - padding-bottom: 100px; - } - .accounts-info__empty-img img { - width: 48%; - } - .accounts-info__empty-img img:nth-child(2) { - display: block; - } - .accounts-info__counter { - text-align: center; - font-size: 28px; - line-height: 33px; - } - .accounts-info__counter-wrapper { - padding: 15px 0 60px; - } - .accounts-info__to-send-link { - order: 2; - border-bottom: 0; - width: auto; - margin-bottom: 0; - padding-right: 35px; - } - .accounts-info__accounts .prod-card { - font-size: 16px; - line-height: 19px; - padding: 18px 0; - } - .accounts-info__to-send-link::after { - right: 0; - } - .accounts-info__counter-wrapper p { - order: 1; - - } - .accounts-info__counter-wrapper .btn { - order: 0; - } - .accounts-info__total { - padding-left: 0; - } - .total-info { - max-width: 330px; - } - .send-page .title, - .dapps-page .title { - display: block; - margin: 0 auto; - text-align: center; - padding-bottom: 0; - padding-top: 30px; - } - .send-page .title { - margin-bottom: 25px; - } - .send-page__send-btn-wrp { - padding-top: 75px; - } - .confirm-info__title { - min-width: 180px; - } - .confirm-info__descr { - margin-left: 30px; - } - .confirm-info__line .btn-no-bg { - margin-left: 0; - } - .send-page__btns-wrap { - padding-left: 0; - padding-right: 0; - justify-content: space-between; - padding-top: 75px; - } - .page-pagination { - justify-content: space-between; - max-width: 690px; - margin: 0 auto; - } - .page-pagination .btn { - width: 90px; - margin-left: 30px; - margin-right: 0; - } - .page-pagination .btn:first-child { - margin-left: 0; - } - .page-pagination input { - min-width: 210px; - margin-left: 30px; - } - .prod-card__second-line-left p { - white-space: normal; - display: block; - max-width: 550px; - } - .dapps-page__card .prod-card__heading { - justify-content: flex-start; - } - .prod-card__heading span { - display: inline; - } - .modal__btns-wrap .btn { - margin: 0 15px; - padding: 15px 10px; - min-width: 210px; - } - .accounts-info__accounts .prod-card__descr { - margin-top: 10px; - max-width: none; - } - .addresses-modal__item { - padding: 15px 0; - } - .addresses-modal__item-name { - display: flex; - width: 100%; - } - .addresses-modal__item-name .grey-blue-text { - width: 50%; - } - .addresses-modal__btns-wrapper .btn { - padding: 6px 30px; - } - .key-field__key-place { - margin: 0; - padding: 10px 0; - } - .fixed-status .grey-btn { - height: 40px; - padding: 10px; - } - .fixed-status .grey-btn--select { - padding-right: 0; - } - .reconnect { - width: 40px; - margin-left: 15px; - background-position: 11px 11px; - } - .fixed-status__status { - font-size: 14px; - max-width: none; - } - .currentBlockNum { - padding: 60px 30px 20px; - } - .key-field__title { - margin-bottom: 5px; - } - -.prod-card--line .prod-card__first-line { - flex-wrap: nowrap; - justify-content: flex-start; - -ms-align-items: center; - align-items: center; - } - .accounts-info__accounts .prod-card__id { - width: auto; - margin-right: 20px; - } - .prod-card--line .prod-card__descr { - order: 1; - margin: 0; - } - .prod-card--line .prod-card__heading { - order: 2; - margin-left: auto; - } - .send-page__field .key-field__input, - .key-field__select { - max-height: 58px; - height: 58px; - } - .key-field:first-of-type { - padding-bottom: 30px; - } - .send-page__send-btn-wrp { - max-width: 450px; - width: 450px; - padding-top: 25px; - } - .send-page__confirm .title { - margin-bottom: 40px; - } - .dapps-page .title { - margin-bottom: 10px; - padding-top: 20px; - } - .dapps-page .key-field:first-of-type { - padding-bottom: 15px; - } - .wallet-settings__title { - padding: 10px; - margin-bottom: 30px; - } - .wallet-settings__generate { - max-width: 100%; - width: 100%; - } - .wallet-wrapper { - margin-top: 90px; - } - .accounts-info__add .key-field { - padding-bottom: 25px; - } - .accounts-info__add-btn { - margin-top: 65px; - } - -} - - - -@media (max-width: 960px) { - /* .prod-card--line:hover { - transform: scale(1.05, 1.2); - box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); - padding:5px 15px; - background: #fff; - display: block; - transition: all ease .5s; - } - .prod-card--line:hover .mob-hidden { - display: inline-block; - } - .prod-card--line:hover .prod-card__footer { - padding: 5px; - padding-left: 0; - border: 0; - } - .prod-card--line:hover .prod-card__footer-empty { - padding: 10px 0 10px 40px; - } - .prod-card--line:hover .prod-card__coins-count { - padding-top: 5px; - } - .prod-card--line:hover .prod-card__coins-count, - .prod-card--line:hover .prod-card__id { - font-weight: 500; - } - .prod-card--line:hover .small-text { - font-weight: normal; - } - .prod-card--line:hover .id-sign { - display: inline-block; - font-weight: 500; - } - .prod-card--line:hover .prod-card__first-line { - padding-right: 0; - } */ - - .prod-card--active { - /* transform: scale(1.05, 1.2); - box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); - padding:5px 15px; */ - background: #fff; - display: block; - transition: all ease .5s; - } - .prod-card--active .mob-hidden { - display: inline-block; - } - .prod-card--active .prod-card__footer { - padding: 5px; - padding-left: 0; - border: 0; - } - .prod-card--active .prod-card__footer-empty { - padding: 10px 0 10px 40px; - } - .prod-card--active .prod-card__coins-count { - padding-top: 5px; - } - .accounts-info__accounts .prod-card__id { - text-decoration: none; - } - .prod-card--active .prod-card__coins-count, - .prod-card--active .prod-card__id { - font-weight: 500; - } - .prod-card--active .prod-card__id { - text-decoration: underline; - } - .prod-card--active .prod-card__id--mobile { - display: none; - } - .prod-card--active .prod-card__id--mobile-active { - display: block; - } - .prod-card--active .small-text { - font-weight: normal; - } - .prod-card--active .id-sign { - display: inline-block; - font-weight: 500; - } - .prod-card--active .prod-card__first-line { - padding-right: 0; - } -} - -@media (min-width: 960px) { - .welcome { - padding-top: 22px; - } - .social-list { - margin-top: 160px; - } - .header__logo { - padding-left: 42px; - } - .header__wallet-set { - margin-right: 39px; - margin-left: 0; - } - .header__right select { - right: 37px; - } - .send-page__send-btn-wrp { - max-width: 100%; - width: 100%; - padding-top: 0; - padding-bottom: 70px; - } - .accounts-info__counter-wrapper .btn { - width: 210px; - } - .accounts-info__counter-wrapper { - padding-bottom: 20px; - } - .prod-card__dapp-icon { - margin-right: 10px; - } - .prod-card--line .mob-hidden { - display: inline-block; - } - .accounts-info__accounts .prod-card { - padding: 10px 0 9px 0; - } - .addresses-modal { - padding: 15px 15px 0; - } - .accounts-info__btn { - max-width: 350px; - } - .prod-card--line .prod-card__footer { - min-width: 300px; - } - .welcome__img .tablet { - width: 225px; - height: 225px; - } - .addresses-modal__list { - max-height: 480px; - } - .accounts-info__empty-img { - padding-bottom: 60px; - } - .accounts-info__empty-img img { - display: block; - width: 32%; - } - .send-page__send-btn-wrp .btn { - margin-right: 0; - max-width: 210px; - border-radius: 4px; - } - .wallet-settings__btns-wrapper { - padding: 0; - justify-content: flex-end; - } - .wallet-settings__ok-btns { - padding-top: 100px; - justify-content: flex-end; - } - .send-page__btns-wrap { - padding-left: 0; - padding-right: 0; - padding-top: 15px; - justify-content: flex-end; - } - .dapps-page .title { - margin-bottom: 30px; - } - .accounts-info__add .key-field { - max-width: 770px; - margin: 0 auto; - } - .accounts-info__add-btn { - max-width: 210px; - width: 210px; - margin-left: auto; - margin-right: 0; - } - .wallet-settings__go-btn { - max-width: 290px; - } - .send-page__btns-wrap .btn, - .wallet-settings__ok-btns .btn { - margin-left: 30px; - max-width: 210px; - } - .wallet-settings__btns-wrapper .btn { - margin-left: 30px; - max-width: 130px; - } - .send-page__field, - .key-field__select, - .confirm-info__line, - .dapps-page__card { - max-width: 770px; - margin: 0 auto; - } - .dapps-page__card { - margin-bottom: 10px; - } - .page-pagination { - justify-content: space-between; - max-width: 770px; - margin: 0 auto; - } - .page-pagination .btn { - width: 50px; - } - .page-pagination input { - min-width: 450px; - } - .prod-card__second-line-left p { - max-width: 595px; - } - .modal { - max-width: 770px; - } - .modal__title-wrap { - width: 100%; - } - .modal__def-list { - display: flex; - } - .def-list__item { - margin-right: 30px; - } - .def-list__item dt { - min-width: auto; - margin-right: 15px; - } - .addresses-modal__choosing { - justify-content: flex-end; - } - - .addresses-modal__choosing .btn { - max-width: 210px; - margin-left: 30px; - } - .wallet-settings__generate { - float: left; - width: auto; - } - .wallet-settings__field { - position: relative; - justify-content: flex-start; - max-width: 770px; - margin: 0 auto; - } - .key-field__title { - margin-right: 30px; - } - .send-page__field .key-field__title { - margin-right: auto; - } - .wallet-settings__field .key-field__btn:not(.wallet-settings__hiding) { - position: absolute; - right: 0; - bottom: 42px; - } - .wallet-wrapper { - max-width: 770px; - margin: 0 auto; - padding-top: 15px; - } - .wallet-settings__generate { - width: 210px; - } - .reconnect span { - display: inline; - } - .reconnect.grey-btn { - width: 130px; - margin-left: 15px; - padding-top: 12px; - padding-left: 39px; - background-position: 11px 11px; - } - .explorer-page { - padding-right: 40px; - padding-left: 40px; - } - .currentBlockNum { - font-size: 16px; - padding-left: 0; - } - .currentBlockNum p { - margin-top: 10px; - margin-bottom: 0; - } - .key-field__textarea { - max-height: 58px; - padding-top: 21px; - padding-bottom: 16px; - } - .wallet-settings__hiding { - margin-bottom: 8px; - } - .password-modal { - padding-top: 45px; - } - .explorer-page__explore::after { - right: 10px; - } - .explorer-page__explore { - padding-right: 15px; - padding-left: 15px; - } - .explorer-page__explore.btpress + .explorer-page__table { - padding-right: 15px; - padding-left: 15px; - } -} - -@media (max-height: 700px) { - .social-list { - margin-top: 100px; - } -} - -@media (min-width: 1200px) { - .header__logo { - padding-left: 20px; - } - .header__wallet-set { - margin-right: 18px; - } - .header__right select { - right: 10px; - } - .accounts-info__add .key-field { - min-width: 920px; - width: 920px; - } - .wallet-settings__title-wrap { - margin-bottom: 50px; - } - .welcome__img svg { - width: 180px; - height: 150px; - } - .header__wrapper { - max-width: 1150px; - margin: 0 auto; - } - .total-info { - max-width: 360px; - } - .send-page__send-btn-wrp .btn, - .send-page__btns-wrap .btn, - .wallet-settings__ok-btns .btn { - max-width: 250px; - } - - .wallet-settings__btns-wrapper .btn { - max-width: 160px; - } - .send-page__field, - .key-field__select, - .dapps-page__card { - max-width: 920px; - } - .key-field__select { - min-height: 58px; - } - .key-field { - margin-bottom: 0; - } - .currentBlockNum p span:first-of-type { - min-width: 250px; - } - .page-pagination { - justify-content: space-between; - max-width: 920px; - margin: 0 auto; - } - .page-pagination .btn { - width: 65px; - } - .page-pagination input { - min-width: 540px; - } - .prod-card__second-line-left p { - max-width: 715px; - } - .wallet-settings .wallet-settings__field, - .wallet-settings .btn--full-width, - .wallet-wrapper { - max-width: 920px; - margin-left: auto; - margin-right: auto; - } - .wallet-settings__go-btn { - max-width: 350px; - margin-left: auto; - margin-right: auto; - } - - .wallet-settings__ok-btns { - padding-top: 150px; - } - .wallet-settings__generate { - width: 250px; - } - .wallet-settings__info { - margin-bottom: 35px; - } - -} - -.delete -{ - position: absolute; - display: none; -} - -.myhidden -{ - display: none; -} - - -.pointer -{ - cursor: pointer; -} - -.nodapp .editdapp -{ - display: none; -} - -.dapp_card -{ - width: 100%; -} - - - - - -/* правила стилей для history и explorer */ -.header__logo--history { - padding: 10px 15px; -} - -.history-page { - padding-bottom: 110px; -} -.history__text-block { - padding: 10px 15px 10px; -} -.history-page__id { - margin-bottom: 7px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - color: #445368; -} -.history-page__id-count { - max-width: 140px; - margin-left: 2px; - - font-size: 20px; - line-height: 23px; - font-weight: 700; - text-align-last: left; - color: #445368; - border: none; - background: #f2f2f2; -} -.history-page__description { - margin: 0; - margin-bottom: 17px; - font-size: 12px; - line-height: 14px; - color: rgba(0, 0, 0, 0.5); -} -.history-page__balance { - display: flex; - align-items: center; - - font-size: 14px; - line-height: 16px; - font-weight: 700; -} -.history-page__tera-icon { - margin-left: 5px; -} -.history-page__table { - padding: 15px 0 15px 15px; -} -.history-page__table .grid { - width: 100%; - border-collapse: collapse; -} -.history-page__table-wrap { - overflow-x: scroll; -} -.history-page__table th { - background: var(--blue-grey); - color: #fff; - border-right: 1px solid rgba(0, 0, 0, 0.1); - height: 30px; - padding: 0 20px 0 10px; - font-size: 16px; - line-height: 19px; - font-weight: 400; - white-space: nowrap; - text-align-last: left; -} -.history-page__table th:first-child { - border-top-left-radius: 5px; -} -.history-page__table th:last-child { - border-top-right-radius: 5px; -} -.history-page__table .grid tr td { - padding: 2px 10px 0px; - font-size: 14px; - line-height: 16px; - color: #000000; - background-color: #ffffff; - border: 1px solid #C4C4C4; -} -.history-page__table .grid tr td:first-of-type { - text-align: center; -} -.history-page__table .grid tr td.desc { - max-width: 170px; - word-break: break-all; -} - -@media (min-width: 576px) { - .history__text-block { - padding: 10px 33px 10px; - } - .history-page__table { - padding: 15px 33px; - } -} - -@media (min-width: 960px) { - .history-page { - padding-right: 40px; - padding-left: 40px; - } - .history__text-block { - padding: 10px 0 10px; - } - .history-page__table { - padding: 15px 0 10px; - } -} - -@media (min-width: 1200px) { - .history__text-block { - padding-top: 10px; - padding-bottom: 0; - } - .history-page__id { - font-size: 28px; - line-height: 33px; - text-align: center; - } - .history-page__id-count { - font-size: 28px; - line-height: 33px; - text-align: center; - } - .history-page__description { - margin-bottom: 30px; - font-size: 16px; - line-height: 19px; - text-align: center; - } - .history-page__balance { - justify-content: center; - margin-bottom: 30px; - font-size: 16px; - line-height: 19px; - } - .history-page__table { - padding: 30px 15px; - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); - background-color: #ffffff; - } -} - -/* vtools added*/ - -th.minwidth -{ - padding: 5px; -} -.minwidth -{ - width: 100px; -} -.accname -{ - width: 200px; - max-width: 200px; - word-break: break-all; -} - -.openblock -{ - cursor:pointer; -} - -.header__logo-name { - margin: 0; - margin-top: 3px; - font-size: 14px; - line-height: 18px; - font-weight: 300; - letter-spacing: 0.17em; - text-transform: uppercase; - color: #ffffff; -} - -.header__wrapper { - height: 100%; -} - -.header__logo-link { - display: flex; - flex-direction: column; -} +@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic'); + +:root { + --blue-grey: #445368; + --light-blue: #718CAF; + --fill--password:#000; +} + + + + +body { + margin: 0 auto; + box-sizing: border-box; + font-family: "Roboto", "Arial", sans-serif; + + color: #445368; + background: #f2f2f2; +} +main { + max-width: 1200px; + margin: 0 auto; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +*::placeholder { + color: rgba(0, 0, 0, 0.5); + font-family: "Roboto"; + font-size: 16px; +} + +a { + text-decoration: none; + color: #445368; +} + +a:hover, +a:focus { + color: #718CAF; +} + +.hidden { + display: none; +} +.small-text { + font-size: 10px; + line-height: 12px; +} +.text-center { + text-align: center; +} +#overlay { + background: rgba(68, 83, 104, 0.65); + position: fixed; + width: 100%; + height: 100vh; + top: 0; + display: none; +} + +label[for=load-key] { + font-weight: 500; +} +textarea { + resize: none; +} +.currentBlockNum { + font-size: 14px; + padding: 15px; + padding-bottom: 0; + margin-bottom: 15px; +} +.currentBlockNum span { + display: inline-block; + min-width: 220px; +} +.currentBlockNum p { + display: flex; + justify-content: space-between; + margin-top: 8px; + margin-bottom: 8px; +} +.currentBlockNum p:first-child { + margin-top: 0; +} +.currentBlockNum p:last-child { + margin-bottom: 0; +} +.btn { + color: #fff; + background: #445368; + + display: block; + padding: 15px 25px; + border: none; + box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3); + border-radius: 4px; + + text-decoration: none; + text-transform: uppercase; + font-family: inherit; + font-weight: 500; + font-size: 18px; + line-height: 21px; + cursor: pointer; + text-align: center; +} + +.btn:hover, +.btn:focus { + background: #718CAF; + color: #fff; +} + +.btn[disabled], +.btn.disabled { + opacity: .3; + cursor: not-allowed; +} + +.btn span { + opacity: .4; +} + +.btn--white { + background: #fff; + color: #445368; +} + +.btn--white:hover, +.btn--white:focus { + background: #F5F5F5; + color: #445368; +} + +.btn--full-width { + width: 100%; + border-radius: 0px; +} +.btn--270 { + max-width: 270px; + border-radius: 4px; +} + +.btn--450 { + max-width: 450px; + margin: 0 auto; +} + +.btn--center { + margin: 0 auto; +} + +.grey-btn { + border: none; + background: #F2F2F2; + border-radius: 3px; + font-family: inherit; + font-size: 14px; + line-height: 16px; + color: #000; + height: 27px; + + white-space: nowrap; +} + +.btn-no-bg { + color: var(--blue-grey); + background: none; + border: none; + text-transform: uppercase; + font-weight: 500; + font-size: 16px; + line-height: 19px; +} + +.prod-card__drop-btn:hover, +.prod-card__drop-btn:focus { + background: rgba(0, 0, 0, 0.1); +} + +.title { + font-weight: 700; + font-size: 20px; + line-height: 23px; +} + +.welcome, +.wallet-settings, +.wallet-settings--info, +.accounts-info, +.accounts-info__add, +.accounts-info__empty, +.send-page, +.dapps-page, +.explorer-page { + padding-bottom: 50px; +} + +.explorer-page { + padding-bottom: 100px; +} + +.header { + background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); + color: #fff; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15); +} +.header__wrapper { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; +} + +.header__logo { + margin-right: 2px; + padding: 0 15px; +} +.header__logo-link:hover { + opacity: .5; + cursor: pointer; +} +.header__right { + display: flex; + align-items: center; + position: relative; +} +.header__right select { + /* background: var(--blue-grey); */ + background: transparent; + border: none; + color: #fff; + padding: 5px; + width: 55px; + font-family: inherit; + font-size: 12px; + line-height: 14px; +} +.white-select { + display: none; +} +.header__nav { + width: 100%; +} +.header__wallet-set { + margin-left: 5px; +} +.header__wallet-link { + color: rgba(255, 255, 255, 0.6); + display: block; + padding: 13px 15px 9px 15px; +} +.header__wallet-link:hover, +.header__wallet-link:focus { + background: #55657C; +} +.header__wallet-link span { + display: none; +} +.header__wallet-link:active, +.header__wallet-link.active { + box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25); + } + + +.nav-tabs__list { + list-style: none; + padding: 0; + margin: 0; + + display: flex; + justify-content: space-between; + + font-size: 13px; +} + +.nav-tabs__tab { + background: linear-gradient(270deg, #3D4C61 0%, #445368 100%); + width: 100%; + text-align: center; +} + +.nav-tabs__link { + color: rgba(255, 255, 255, 0.6); + text-decoration: none; + padding: 17px 14px 18px 14px; + display: block; +} + +.tab-link:hover { + background: linear-gradient(180deg, #3D4C61 0%, #445368 100%); + opacity: .6; + cursor: pointer; +} + +.tab-link.active, +.tab-link:focus { + color: #fff; + background: #55657C; + box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25); + cursor: pointer; +} + +.welcome { + text-align: center; + padding: 50px 15px 35px; +} + +.welcome__link { + max-width: 270px; + margin: 0 auto; +} + +.social-list { + display: flex; + flex-wrap: wrap; + justify-content: center; + margin: 0 auto; + max-width: 300px; + list-style-type: none; + padding: 50px 0 80px; + font-weight: 500; +} + +.social-list__item { + text-align: center; + padding: 10px 0; + +} + +.social-list__item a { + padding: 0 15px; + border-right: 1px solid rgba(68, 83, 104, .2); +} + +.social-list__item:nth-child(3n) a { + border-right: none; +} + +.fixed-status { + background: var(--blue-grey); + color: rgba(255, 255, 255, 1); + font-size: 12px; + padding: 12px 10px 11px 10px; + padding-left: 17px; + + position: fixed; + bottom: 0; + left: 0; + + width: 100%; + font-family: "Roboto", sans-serif; +} +.fixed-status__wrap { + display: flex; + align-items: center; + max-width: 1170px; + margin: 0 auto; +} + +.fixed-status__status { + max-width: 330px; + margin-right: auto; + padding-right: 10px; +} +.fixed-status .grey-btn { + padding-left: 3px; + font-size: 12px; + line-height: 14px; +} + +.reconnect { + background-image: url("./../PIC/reload.svg"); + background-repeat: no-repeat; + background-size: 18px 18px; + background-position: center center; + padding: 5px; + width: 27px; + margin-left: 5px; +} +.reconnect span { + display: none; +} + + +.key-field { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + font-size: 16px; + line-height: 18px; + padding-bottom: 16px; + color: #445368; +} + +.key-field:first-of-type { + padding-top: 15px; +} + +.key-field__title { + font-weight: 500; + margin: 0 auto 0 0; + padding-left: 15px; +} + +.key-field__title span { + opacity: .6; +} +@media (max-width: 445px) +{ + .key-field__title--pay { + margin-bottom: 5px; + } +} + +.key-field__input { + width: 100%; + padding: 15px 15px 13px 14px; + margin: 10px 0 0; + border: 1px solid rgba(0, 0, 0, 0.1); + font-family: inherit; + font-size: 16px; + line-height: 18px; + color: #445368; +} +.key-field__input--select { + padding: 11px 15px 11px 10px; + font-size: 18px; + line-height: 21px; +} +.key-field__input--enter { + padding-top: 20px; + padding-bottom: 18px; +} + +.key-field__btn { + margin-right: 15px; +} + +.key-field__btn--with-icon { + display: flex; + align-items: center; +} +.key-field__btn--with-icon svg { + margin-left: 10px; +} + +.key-field__textarea { + width: 100%; + background: #FFFFFF; + border: 1px solid rgba(0, 0, 0, 0.1); + min-height: 50px; + padding: 21px 15px 14px 15px; + margin-top: 8px; + font-family: "Roboto", "Arial", sans-serif; + font-size: 16px; + line-height: 18px; + color: #445368; +} +.key-field__textarea--mobile { + max-height: 50px; + padding-top: 15px; +} + +.key-field__select::placeholder, +.key-field__input::placeholder, +.key-field__textarea::placeholder { + color: rgba(68, 83, 104, .5); + font-size: 16px; + font-family: "Roboto", "Arial", sans-serif; + color: #445368; + opacity: 0.5; +} + +.key-field__select { + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 12px 15px; + margin-top: 5px; + background: #fff; + font-family: inherit; + font-size: 16px; + line-height: 18px; + color: #445368; +} +.key-field__key-place { + word-wrap: break-word; + padding: 10px 15px; + width: 100%; + margin-bottom: 0; +} +.back-link { + position: relative; + width: 30px; +} +.back-link span { + display: none; +} +.back-link::before { + content: ''; + display: block; + color: var(--blue-grey); + background: url("./../PIC/right-arrow.svg") no-repeat; + background-size: 18px 18px; + transform: translateY(-50%) rotate(180deg); + height: 18px; + width: 18px; + position: absolute; + left: 15px; + top: 50%; +} +.back-link:hover::before, +.back-link:focus::before { + opacity: .5; +} +.wallet-settings__title-wrap { + position: relative; + display: flex; + align-items: center; + margin-bottom: 15px; +} +.wallet-settings__title, +.accounts-info__title { + display: block; + padding: 15px 20px; + text-align: center; + margin: 0 auto; +} +.accounts-info__title { + margin-left: calc(50% - 133px); +} +.wallet-settings__btns-wrapper { + display: flex; + /*flex-wrap: wrap;*/ + align-items: center; + justify-content: center; + padding: 0 20px 20px; +} +.wallet-settings__ok-btns { + padding-top: 30px; + flex-wrap: wrap; +} +.wallet-settings__ok-btns .btn { + width: 100%; +} + +.wallet-settings__btns-wrapper .btn { + margin: 10px 10px; + white-space: nowrap; + min-width: 125px; + text-align: center; +} + +.wallet-settings__go-btn { + margin: 0 auto; + min-width: 270px; + text-align: center; + + margin-bottom: 60px; + margin-top: auto; +} + +.wallet-settings__hidden-field { + border-top: 1px dotted var(--blue-grey); + width: 100%; + margin: 20px 15px 5px; +} + +.wallet-settings__btn-270.btn { + max-width: 270px; + margin: 0 auto; + border-radius: 4px; +} + +.accounts-info__counter { + text-transform: uppercase; + padding: 15px; + margin: 0; +} + +.accounts-info__btn { + margin: 30px auto 50px; +} + +.accounts-info__add-btn { + margin-top: 44px; + max-width: 330px; +} + +.accounts-info__to-send-link { + padding: 15px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + display: block; + position: relative; + width: 100%; + margin-bottom: 15px; + font-family: inherit; + font-size: 16px; + line-height: 18px; +} + +.accounts-info__to-send-link::after { + content: ''; + color: var(--blue-grey); + background: url("./../PIC/right-arrow.svg") no-repeat; + position: absolute; + background-size: 17px 17px; + transform: translateY(-50%); + height: 17px; + width: 17px; + right: 15px; + top: 50%; +} + +.accounts-info__to-send-link:hover::after, +.accounts-info__to-send-link:focus::after { + opacity: .5; +} + +.accounts-info__counter-wrapper { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + -ms-align-items: center; + align-items: center; + padding: 0 15px 15px; +} + +.accounts-info__counter-wrapper .title { + margin: 0; + margin-right: -30px; +} + +.accounts-info__empty img { + width: 100%; + display: none; +} +.accounts-info__empty-img img:first-child { + display: block; +} + +.prod-list { + list-style-type: none; + padding: 0; + margin: 0; +} +.prod-card { + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); + background: #FFFFFF; + margin-bottom: 5px; +} +.prod-card__dapp-icon { + margin-right: 2px; +} + +.prod-card__first-line, +.prod-card__second-line, +.prod-card__footer { + display: -webkit-flex; + display: -moz-flex; + display: -ms-flex; + display: -o-flex; + display: flex; + justify-content: space-between; + white-space: nowrap; +} + +.prod-card__first-line { + padding: 15px; +} + +.prod-card__second-line { + padding: 0 15px 15px; +} + +.prod-card__footer { + padding: 15px; +} + +.prod-card__id { + color: #445368; + opacity: 0.5; + margin-right: 15px; + min-width: 56px; +} +.prod-card__id:first-of-type { + min-width: 45px; +} +.prod-card__id--desktop { + display: none; +} +.prod-card__id--mobile { + display: none; +} +.prod-card__id--mobile-active { + display: none; +} +@media (max-width: 960px) { + .prod-card__id--mobile { + display: block; + } +} +@media (min-width: 960px) { + .prod-card__id--desktop { + display: block; + } +} +.prod-card__descr { + width: 100%; + text-overflow: ellipsis; + overflow: hidden; +} + +.prod-card__heading { + font-size: 21px; + line-height: 25px; + font-weight: bold; + color: var(--blue-grey); + + display: flex; + -ms-align-items: center; + align-items: center; + justify-content: flex-end; + width: 100%; + /*padding-bottom: 15px;*/ +} +.prod-card__currency { + margin-left: 5px; + position: relative; +} +.prod-card__currency--with-dot:after { + content: ''; + position: absolute; + top: 0; + right: 0; + background: var(--blue-grey); + width: 5px; + height: 5px; + border-radius: 50%; +} +.prod-card__footer-empty { + position: relative; + padding-left: 40px; + color: rgba(0, 0, 0, 0.2);; +} +.prod-card__footer-empty:before { + content: ''; + position: absolute; + background-image: url("./../PIC/add-icon.svg"); + background-size: 30px 30px; + top: 50%; + transform: translateY(-50%); + left: 0; + width: 30px; + height: 30px; + border-radius: 50%; +} +.prod-card__heading sup { + font-size: 13px; + line-height: 15px; + vertical-align: unset; +} + +.prod-card__dropdown { + cursor: pointer; + position: absolute; + right: 38px; + top: 10px; + box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.15); + background: #fff; + border-radius: 4px; + width: 197px; + z-index: 20; +} +.prod-card__dropdown a { + display: block; + padding: 10px 15px; +} +.prod-card__drop-btn +{ + cursor: pointer; + padding: 6px 12px; + border-radius: 4px; +} +.accounts-info__accounts { + padding: 0 15px; + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); + background: #FFFFFF; +} +.accounts-info__accounts .prod-card { + /*padding: 0 15px;*/ + box-shadow: none; + background: transparent; + font-size: 12px; + line-height: 14px; +} +.accounts-info__accounts .prod-card__heading { + width: 50%; +} +.prod-card__coins-count { + font-weight: normal; + font-size: 14px; + line-height: 16px; + padding: 0 15px; + display: inline; + text-align: right; +} +.accounts-info__accounts .prod-card__id { + opacity: 1; + text-decoration: underline; + margin-right: auto; +} +.accounts-info__accounts .prod-card__first-line { + flex-wrap: wrap; +} +.accounts-info__accounts .prod-card__second-line { + padding: 15px; +} +.prod-card__footer { + border-top: 1px solid rgba(68, 83, 104, 0.1); + position: relative; +} + +.prod-card__link +{ + cursor: pointer; + display: flex; + -ms-align-items: center; + align-items: center; + width: 100%; +} + +.prod-card__link:hover:after { + opacity: .5; +} + +.prod-card__link--empty { + color: rgba(68, 83, 104, 0.5); +} + +.prod-card__link--empty:before { + background: url("./../PIC/chain-off.svg") no-repeat; + opacity: .2; +} +.prod-card__link--info::after { + display: none; +} +.prod-card__link--info::before { + content: ""; + position: absolute; + top: 0; + left: -28px; + background: url("./../PIC/info.svg") no-repeat; + width: 18px; + height: 18px; +} +.prod-card__link--info { + position: relative; + width: auto; + margin-left: auto; +} +.accounts-info__total { + padding: 20px 15px 30px; +} + +.prod-card--line { + display: -webkit-flex; + display: -moz-flex; + display: -ms-flex; + display: -o-flex; + display: flex; + justify-content: space-between; + padding: 10px 0; + margin-bottom: 0; +} +.prod-card--line:not(:last-child) { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); +} +.prod-card--line .prod-card__first-line { + width: 100%; + padding: 0 15px 0 0; +} +.prod-card--line .prod-card__footer { + border: 0; + border-left: 1px solid rgba(0, 0, 0, 0.1); + padding: 0 0 0 15px; + display: flex; + align-items: center; + +} +.prod-card--line .prod-card__footer-wrap { + width: 100%; + display: -webkit-flex; + display: -moz-flex; + display: -ms-flex; + display: -o-flex; + display: flex; + -ms-align-items: center; + align-items: center; + justify-content: flex-start; +} + +.prod-card__dapp-name { + margin-left: 10px; + margin-right: auto; +} + +.prod-card__dapp-text { + font-size: 14px; + line-height: 16px; + color: rgba(0, 0, 0, 0.2); +} + +.total-info__item { + display: -webkit-flex; + display: -moz-flex; + display: -ms-flex; + display: -o-flex; + display: flex; + justify-content: space-between; + width: 100%; + font-size: 14px; + line-height: 16px; + padding: 5px 0; +} + +.total-info__item dd { + font-weight: bold; +} +.send-page__send-btn { + border-radius: 4px; +} + +.send-page__send-btn-wrp { + padding: 0 15px 80px; +} +.send-page__setting .title, +.dapps-page .title { + display: none; +} + +.light-grey-text { + color: rgba(0, 0, 0, 0.5); +} +.lighter-grey-text { + color: rgba(0, 0, 0, 0.2); +} +.grey-blue-text { + color: var(--blue-grey); +} +.confirm-info { + font-size: 16px; + max-width: 950px; +} +.confirm-info__line { + display: flex; + align-items: flex-start; + padding: 15px; +} +.confirm-info__line .btn-no-bg { + margin-left: auto; +} +.confirm-info__line p { + margin: 0; +} +.confirm-info__title { + min-width: 90px; + text-align: right; + font-weight: 500; +} +.confirm-info__descr { + text-align: left; + margin-left: 3%; + font-weight: 500; +} +.confirm-info__descr p { + padding-top: 10px; +} +.send-page__btns-wrap { + display: flex; + justify-content: space-between; + padding: 20px 15px 80px; +} +.send-page__btns-wrap .btn { + width: 48%; + margin: 0; +} + +.dapps-page__field.key-field { + padding-top: 0; + margin-top: 5px; +} +.dapps-page__field select { + padding: 15px; + background: #fff; +} +.dapps-page__pagination, +.page-pagination { + display: flex; + justify-content: center; + padding-bottom: 15px; + padding-right: 15px; +} +.page-pagination__num { + width: 33%; + margin: 0 5px; +} +.dapps-page__pagination input, +.page-pagination input { + margin: 0 5px; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.dapps-page__page-btns, +.page-pagination .btn { + padding: 0; + white-space: nowrap; + width: 45px; + height: 40px; + margin: 0 5px; +} +.page-pagination .btn:first-of-type { + margin-left: 0; +} +.page-pagination .btn:last-of-type { + margin-right: 0; +} + + +.prod-card__second-line-left ol { + margin-top: 10px; + border-radius: 3px; + padding: 0; + list-style-position: inside; + display: flex; + flex-wrap: wrap; +} +.prod-card__second-line-left li { + border: 1px solid rgba(68, 83, 104, 0.1); + padding: 5px 10px; + margin: 0 10px 10px 0; + border-radius: 4px; +} +.prod-card__second-line-left p { + white-space: normal; + display: none; + padding-top: 5px; + margin-top: 0; +} +.dapp-modal__ok-token:before { + content: ""; + background: url("./../PIC/check.svg") no-repeat; + background-size: 20px 15px; + width: 20px; + height: 15px; + display: inline-block; + margin-right: 10px; +} +@media (max-width: 440px) { + .dapp-modal .modal__close { + left: -15px; + top: -15px; + } +} +@media (max-width: 960px) { + .modal__title-wrap { + margin-right: auto; + } +} + +.dapp-modal { + padding-bottom: 100px; +} + +.modal { + padding: 30px; + background: #fff; + border-radius: 3px; + color: #000; + position: fixed; + box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.15); + margin: 0 auto; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + max-width: 570px; + width: 87%; + z-index: 10; +} +.dapp-modal { + top: calc(50% - 210px); + left: 20px; + right: 20px; + transform: none; +} +.modal h3 { + font-size: 20px; + line-height: 23px; + letter-spacing: 0.02em; + margin: 15px 0 10px; + color: var(--blue-grey); +} +.modal__header { + display: flex; +} +.password-modal { + display: none; + padding: 15px 15px 45px 15px; + padding-top: 15px; + padding-bottom: 45px; + border-radius: 5px; +} +.password-modal__title { + width: 100%; + margin-top: 0; + margin-bottom: 10px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + text-align: center; + text-transform: uppercase; + color: #445368; +} +.password-modal__subtitle { + width: 100%; + margin-top: 0; + margin-bottom: 30px; + + font-size: 16px; + line-height: 18px; + text-align: center; + color: rgba(0, 0, 0, 0.5); +} +.password-modal--change .password-modal__input--margin { + margin-bottom: 30px; +} +.password-modal--set .btn, +.password-modal--change .btn { + max-width: 48%; + width: 48%; +} +.password-modal__buttons--one .btn { + width: 100%; +} +.password-modal__subtitle--red { + color: #eb5757; +} +.password-modal__input { + width: 100%; + margin-bottom: 10px; + padding: 11px 15px; + font-size: 18px; + line-height: 21px; + color: rgba(0, 0, 0, 0.2); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 4px; +} +.password-modal__input:last-of-type { + margin-bottom: 30px; +} +.password-modal__buttons { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} +.password-modal__buttons--one { + justify-content: center; +} +.password-modal__buttons .btn { + font-size: 16px; + line-height: 19px; +} +.password-modal__link { + display: block; + width: 100%; + margin-top: 30px; + font-size: 16px; + line-height: 19px; + font-weight: 500; + text-align: center; + text-transform: uppercase; + text-decoration: underline; + color: rgba(0, 0, 0, 0.5); +} +@media (max-width: 359px) { + .password-modal__buttons .btn { + padding: 15px 20px; + } + .accounts-info__add-btn { + max-width: 320px; + } +} +@media (min-width: 500px) { + .password-modal__buttons .btn { + width: 100%; + } +} +.modal__ol { + list-style-position: inside; + display: flex; + flex-wrap: wrap; + padding: 0; +} +.modal__category { + padding: 5px 10px; + border: 1px solid rgba(68, 83, 104, 0.1); + margin: 0 10px 10px 0; +} +.dapp-modal__token-status { + margin: 15px 0 0; +} +.dapp-modal__token-status .light-grey-text { + color: rgba(0, 0, 0, 0.2); +} +.modal__img-wrap { + padding: 10px 15px; + text-align: center; +} +.modal__img-wrap img { + display: block; + margin-bottom: 5px; +} + +.modal__btns-wrap { + display: flex; + justify-content: center; + padding: 30px 0 0; +} +.modal__close { + position: absolute; + width: 50px; + height: 50px; + box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.15); + top: -25px; + left: -25px; + border: 0; + border-radius: 50%; +} +.modal__close::before, +.modal__close::after { + content: ""; + position: absolute; + left: 24px; + height: 35px; + width: 2px; + top: 7px; + background-color: var(--blue-grey); +} + +.modal__close:before { + transform: rotate(45deg); +} + +.modal__close:after { + transform: rotate(-45deg); +} +.modal__btns-wrap .btn { + margin: 0 15px; + padding: 14px 10px; + min-width: 125px; +} +.modal-lock { + position: absolute; + top: 17px; + right: 26px; + display: block; + width: 14px; + height: 18px; +} +.modal-lock2 { + position: absolute; + top: 18px; + right: 10px; + display: block; + width: 10px; + height: 20px; +} + + +.def-list__item { + display: flex; + align-items: center; +} +.def-list__item dt { + min-width: 90px; + margin-right: 30px; +} + +.def-list__item a { + text-decoration: underline; +} +.def-list__item dd { + margin: 5px 0; +} + +.explorer-page__explore { + margin-top: 10px; + text-align: left; + position: relative; + font-weight: bold; + font-size: 20px; + line-height: 23px; + text-transform: none; + border: 1px solid rgba(0, 0, 0, 0.1); + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); + padding: 18px 12px 17px 15px; +} + +.explorer-page__explore:last-of-type { + margin-bottom: 20px; +} + +.explorer-page__explore::after { + content: ""; + display: block; + background: url("./../PIC/down-arrow.svg") no-repeat; + background-size: 20px 15px; + width: 20px; + height: 15px; + position: absolute; + top: 50%; + right: 13px; + transform: translateY(-50%); +} +.explorer-page__explore.btpress { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + box-shadow: none; +} +.explorer-page__explore.btpress::after { + transform: translateY(-50%) rotate(180deg); +} + +.dapps__table { + width: 100%; +} +.dapps__table tr { + margin-bottom: 5px; +} +.dapps__table .prod-card__link--info { + font-size: 14px; + line-height: 16px; +} +.dapps__table .prod-card__id { + font-size: 16px; + line-height: 19px; + opacity: 1; +} +.dapps__table .prod-card__heading { + font-size: 20px; + line-height: 23px; +} +.dapps__table tr:first-of-type .dapp_card { + padding-bottom: 15px; +} + +.explorer-page__table { + background: #fff; + padding: 15px 0 15px 15px; + display: none; +} +.explorer-page__table-wrap { + overflow-x: scroll; +} +.dapps-page .explorer-page__table-wrap { + overflow-x: hidden; +} +.explorer-page__explore.btpress + .explorer-page__table { + display: block; +} +.explorer-page__table .grid { + border-collapse: collapse; + border-spacing: 1px; +} +.explorer-page__table th { + background: var(--blue-grey); + color: #fff; + border-right: 1px solid rgba(0, 0, 0, 0.1); + height: 30px; + padding: 0 40px; + font-size: 16px; + line-height: 19px; + font-weight: 400; + white-space: nowrap; +} +.explorer-page__table th:first-child { + border-top-left-radius: 5px; +} +.explorer-page__table th:last-child { + border-top-right-radius: 5px; +} + +.explorer-page__table td { + padding: 5px; + border: 1px solid #C4C4C4; + text-align: center; + font-size: 14px; + line-height: 16px; + letter-spacing: 0.02em; +} + +.explorer-page__table td:nth-child(2) { + text-align: right; +} +.explorer-page__table td:nth-child(4) { + text-align: left; +} +td.hash { + font-size: 10px; + line-height: 12px; + letter-spacing: 0.02em; + width: 220px; + min-width: 120px; + word-break: break-all; +} +.history-page__table .grid tr td.code +{ + white-space: normal; + width: 340px; + min-width:200px; + font-family: "courier new", "times new roman", monospace; + font-size: small; + word-break: break-all; +} +.explorer-page__table td.pubkey { + width: 215px; + min-width: 215px; +} + +.explorer-page__table td a { + text-decoration: underline; +} + +.explorer-page__table .num button { + background: none; + border: none; + color: var(--blue-grey); + text-decoration: underline; +} + +.explorer-page__diagramms canvas { + width: 100%; +} +.explorer-page__diagramms b { + padding-left: 15px; +} +.explorer-page__diagramms .delete { + margin-left: 10px; + margin-bottom: 10px; + background: #fff; + border: none; + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); +} +.addresses-modal { + padding-bottom: 0; +} +.addresses-modal .title { + text-transform: uppercase; + text-align: center; + color: #445368; + margin: 0; + padding-bottom: 15px; + font-size: 20px; +} +.addresses-modal__input { + padding: 14px 15px; + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.1); + + background: url("./../PIC/glass.svg") no-repeat; + -webkit-background-size: 18px 18px; + background-size: 18px 18px; + background-position: 98% 13px; +} +.addresses-modal__list { + padding: 0 15px; + margin: 0; + list-style-type: none; + max-height: 350px; + overflow-y: auto; +} +.addresses-modal__item { + padding: 10px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + display: flex; + position: relative; +} +.addresses-modal__text-wrap { + display: flex; + justify-content: space-between; + -ms-align-items: center; + align-items: center; + width: 100%; + padding-right: 30px; +} +.addresses-modal__btns-wrapper { + display: flex; + justify-content: flex-end; + padding-right: 5px; + position: absolute; + top: 4px; + width: 100%; + background: rgba(255,255,255,.6); +} +.addresses-modal__delete-item { + position: absolute; + right: 0; + top: 21px; + height: 15px; + width: 15px; + background: none; + border: none; +} +.addresses-modal__delete-item::before, +.addresses-modal__delete-item::after { + content: ""; + position: absolute; + left: 9px; + height: 15px; + width: 2px; + top: 0; + background-color: var(--blue-grey); +} + +.addresses-modal__delete-item:before { + transform: rotate(45deg); +} + +.addresses-modal__delete-item:after { + transform: rotate(-45deg); +} +.addresses-modal__btns-wrapper .btn { + width: 125px; + margin: 5px 10px; + padding: 10px 25px; +} +.addresses-modal__choosing { + display: flex; + justify-content: space-between; + padding-top: 30px; + padding-bottom: 30px; +} +.addresses-modal__choosing .btn { + width: 48%; + padding: 15px 0; +} +.wallet-settings__generate { + margin-bottom: 20px; +} + +.welcome__img .tablet { + display: none; + margin: 0 auto; +} + +.prod-card--line .mob-hidden { + display: none; +} + +@media (max-width: 1000px) +{ + .nomobile + { + display: none; + } +} + +@media (min-width: 576px) { + .welcome, + .wallet-settings--info, + .wallet-settings, + .accounts-info, + .send-page, + .dapps-page { + padding-left: 33px; + padding-right: 33px; + } + .welcome { + padding: 20px 0 0 0; + } + .wallet-settings__title { + padding: 15px 0; + } + .wallet-settings__title:before { + left: 5px; + } + .key-field__title { + padding-left: 0; + } + .wallet-settings__generate { + border-radius: 4px; + } + .social-list { + max-width: 100%; + padding: 102px 0 20px; + } + .accounts-info__counter-wrapper, + .accounts-info__total { + padding-left: 0; + padding-right: 0; + } + + .accounts-info__total h3 { + margin-top: 5px; + margin-bottom: 5px; + } + + .accounts-info__total .total-info { + margin-top: 10px; + } + .key-field__input { + padding-top: 20px; + padding-bottom: 18px; + } + .key-field { + padding-bottom: 30px; + } + .key-field:first-of-type { + padding-bottom: 16px; + } + .send-page__send-btn-wrp { + max-width: 330px; + width: 330px; + margin: 0 auto; + margin-top: 30px; + padding-left: 0; + padding-right: 0; + padding-bottom: 30px; + } + .dapps-page__field select { + padding-left: 10px; + } + /* .dapps-page__field select::placeholder { + color: rgba(0, 0, 0, 0.2); + } */ + .dapps-page__pagination, + .page-pagination { + max-width: 576px; + margin: 0 auto; + justify-content: space-between; + } + .explorer-page__explore.btpress + .explorer-page__table { + padding-left: 34px; + padding-right: 34px; + } + .dapps-page__page-btns, + .page-pagination .btn { + width: 60px; + height: 40px; + } + .dapps-page__page-btns:first-of-type { + margin-left: 0; + } + .page-pagination .btn:first-of-type { + margin-left: 0; + } + .dapps-page__page-btns:last-of-type { + margin-right: 0; + } + .page-pagination .btn:last-of-type { + margin-right: 0; + } + .dapps-page__pagination input, + .page-pagination input { + width: 150px; + height: 40px; + } + .dapps-page .key-field:first-of-type { + padding-bottom: 30px; + } + .dapps-page { + padding-bottom: 75px; + } + .explorer-page__explore { + padding-right: 33px; + padding-left: 33px; + } + .currentBlockNum { + padding-left: 33px; + padding-right: 33px; + } + .currentBlockNum p { + justify-content: flex-start; + } + .currentBlockNum p span:first-of-type { + min-width: 180px; + } + .explorer-page__explore::after { + right: 30px; + } + .explorer-page__table th.cur { + text-transform: uppercase; + } + .wallet-settings__field { + padding-bottom: 0; + } + .wallet-settings__generate { + margin: 0 auto; + margin-bottom: 5px; + max-width: 285px; + } + .back-link::before { + left: 0; + } + .accounts-info__add .key-field { + padding-bottom: 15px; + } + + .accounts-info__add .key-field__input { + max-height: 48px; + height: 48px; + padding-top: 15px; + padding-bottom: 14px; + } + .accounts-info__add .key-field__input--select { + padding-top: 10px; + padding-bottom: 10px; + } + .accounts-info__add-btn { + margin-top: 15px; + } + .dapp_card { + padding: 0; + } + .dapps-page__field.key-field { + margin-top: 10px; + } + .accounts-info__to-send-link { + padding-left: 0; + } +} + + +@media (min-width: 768px) { + .main-logo { + width: 125px; + height: 30px; + } + .no-mr { + margin-right: 0; + } + .accounts-info__counter-wrapper .title { + font-size: 28px!important; + line-height: 33px; + } + .header__logo { + margin-top: 3px; + } + .header__logo-link img { + height: 30px; + width: 125px; + } + .prod-card { + border-radius: 4px; + } + .welcome__img .mobile { + display: none; + } + .welcome__img .tablet { + display: block; + width: 410px; + height: 410px; + } + .wallet-settings__generate { + margin-bottom: 0; + } + .title { + font-size: 28px; + line-height: 33px; + } + .welcome, + .wallet-settings--info, + .wallet-settings, + .accounts-info, + .send-page, + .dapps-page { + padding-top: 45px; + padding-left: 39px; + padding-right: 39px; + } + .send-page { + padding-top: 25px; + } + .welcome { + padding-top: 53px; + } + .welcome__title.title { + margin-top: -8px; + margin-bottom: 30px; + } + .header { + height: 60px; + } + .header__wrapper { + flex-wrap: nowrap; + } + .header__right { + order: 2; + } + .header__right select { + text-decoration: underline; + width: 60px; + } + .header__wallet-link { + display: flex; + align-items: center; + padding: 18px 17px; + } + .header__wallet-link span { + white-space: nowrap; + margin-left: 10px; + display: block; + text-transform: uppercase; + } + .header__nav { + max-width: 350px; + } + .nav-tabs__list { + font-size: 16px; + line-height: 18px; + } + .nav-tabs__tab { + background: none; + } + .nav-tabs__link { + padding: 21px 15px; + + } + .welcome__link { + margin: 60px auto; + } + .social-list { + flex-wrap: wrap; + max-width: 550px; + padding-top: 0; + margin-top: 180px; + } + .header__right select { + position: absolute; + font-size: 14px; + line-height: 16px; + bottom: -38px; + right: 7px; + width: 60px; + border-radius: 3px; + background: transparent; + color: var(--blue-grey); + } + .white-select { + display: block; + border: 0; + padding: 10px; + margin: 10px 15px 10px auto; + } + .back-link { + display: block; + padding-left: 34px; + } + .back-link span { + display: inline; + text-decoration: underline; + } + .back-link::before { + left: 0; + } + .wallet-settings__title { + text-align: left; + padding: 30px 0; + } + .wallet-settings__ok-btns { + display: flex; + flex-wrap: nowrap; + } + .wallet-settings__btns-wrapper, + .wallet-settings__ok-btns { + padding: 30px 0; + justify-content: space-between; + } + .wallet-settings__btns-wrapper .btn, + .wallet-settings__ok-btns .btn { + margin: 0; + width: calc(50% - 15px); + max-width: none; + } + .wallet-settings__go-btn { + margin: 100px auto 150px; + width: 100%; + } + .accounts-info__empty-img { + display: flex; + justify-content: space-between; + padding-bottom: 100px; + } + .accounts-info__empty-img img { + width: 48%; + } + .accounts-info__empty-img img:nth-child(2) { + display: block; + } + .accounts-info__counter { + text-align: center; + font-size: 28px; + line-height: 33px; + } + .accounts-info__counter-wrapper { + padding: 15px 0 60px; + } + .accounts-info__to-send-link { + order: 2; + border-bottom: 0; + width: auto; + margin-bottom: 0; + padding-right: 35px; + } + .accounts-info__accounts .prod-card { + font-size: 16px; + line-height: 19px; + padding: 18px 0; + } + .accounts-info__to-send-link::after { + right: 0; + } + .accounts-info__counter-wrapper p { + order: 1; + + } + .accounts-info__counter-wrapper .btn { + order: 0; + } + .accounts-info__total { + padding-left: 0; + } + .total-info { + max-width: 330px; + } + .send-page .title, + .dapps-page .title { + display: block; + margin: 0 auto; + text-align: center; + padding-bottom: 0; + padding-top: 30px; + } + .send-page .title { + margin-bottom: 25px; + } + .send-page__send-btn-wrp { + padding-top: 75px; + } + .confirm-info__title { + min-width: 180px; + } + .confirm-info__descr { + margin-left: 30px; + } + .confirm-info__line .btn-no-bg { + margin-left: 0; + } + .send-page__btns-wrap { + padding-left: 0; + padding-right: 0; + justify-content: space-between; + padding-top: 75px; + } + .page-pagination { + justify-content: space-between; + max-width: 690px; + margin: 0 auto; + } + .page-pagination .btn { + width: 90px; + margin-left: 30px; + margin-right: 0; + } + .page-pagination .btn:first-child { + margin-left: 0; + } + .page-pagination input { + min-width: 210px; + margin-left: 30px; + } + .prod-card__second-line-left p { + white-space: normal; + display: block; + max-width: 550px; + } + .dapps-page__card .prod-card__heading { + justify-content: flex-start; + } + .prod-card__heading span { + display: inline; + } + .modal__btns-wrap .btn { + margin: 0 15px; + padding: 15px 10px; + min-width: 210px; + } + .accounts-info__accounts .prod-card__descr { + margin-top: 10px; + max-width: none; + } + .addresses-modal__item { + padding: 15px 0; + } + .addresses-modal__item-name { + display: flex; + width: 100%; + } + .addresses-modal__item-name .grey-blue-text { + width: 50%; + } + .addresses-modal__btns-wrapper .btn { + padding: 6px 30px; + } + .key-field__key-place { + margin: 0; + padding: 10px 0; + } + .fixed-status .grey-btn { + height: 40px; + padding: 10px; + } + .fixed-status .grey-btn--select { + padding-right: 0; + } + .reconnect { + width: 40px; + margin-left: 15px; + background-position: 11px 11px; + } + .fixed-status__status { + font-size: 14px; + max-width: none; + } + .currentBlockNum { + padding: 60px 30px 20px; + } + .key-field__title { + margin-bottom: 5px; + } + +.prod-card--line .prod-card__first-line { + flex-wrap: nowrap; + justify-content: flex-start; + -ms-align-items: center; + align-items: center; + } + .accounts-info__accounts .prod-card__id { + width: auto; + margin-right: 20px; + } + .prod-card--line .prod-card__descr { + order: 1; + margin: 0; + } + .prod-card--line .prod-card__heading { + order: 2; + margin-left: auto; + } + .send-page__field .key-field__input, + .key-field__select { + max-height: 58px; + height: 58px; + } + .key-field:first-of-type { + padding-bottom: 30px; + } + .send-page__send-btn-wrp { + max-width: 450px; + width: 450px; + padding-top: 25px; + } + .send-page__confirm .title { + margin-bottom: 40px; + } + .dapps-page .title { + margin-bottom: 10px; + padding-top: 20px; + } + .dapps-page .key-field:first-of-type { + padding-bottom: 15px; + } + .wallet-settings__title { + padding: 10px; + margin-bottom: 30px; + } + .wallet-settings__generate { + max-width: 100%; + width: 100%; + } + .wallet-wrapper { + margin-top: 90px; + } + .accounts-info__add .key-field { + padding-bottom: 25px; + } + .accounts-info__add-btn { + margin-top: 65px; + } + +} + + + +@media (max-width: 960px) { + /* .prod-card--line:hover { + transform: scale(1.05, 1.2); + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); + padding:5px 15px; + background: #fff; + display: block; + transition: all ease .5s; + } + .prod-card--line:hover .mob-hidden { + display: inline-block; + } + .prod-card--line:hover .prod-card__footer { + padding: 5px; + padding-left: 0; + border: 0; + } + .prod-card--line:hover .prod-card__footer-empty { + padding: 10px 0 10px 40px; + } + .prod-card--line:hover .prod-card__coins-count { + padding-top: 5px; + } + .prod-card--line:hover .prod-card__coins-count, + .prod-card--line:hover .prod-card__id { + font-weight: 500; + } + .prod-card--line:hover .small-text { + font-weight: normal; + } + .prod-card--line:hover .id-sign { + display: inline-block; + font-weight: 500; + } + .prod-card--line:hover .prod-card__first-line { + padding-right: 0; + } */ + + .prod-card--active { + /* transform: scale(1.05, 1.2); + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); + padding:5px 15px; */ + background: #fff; + display: block; + transition: all ease .5s; + } + .prod-card--active .mob-hidden { + display: inline-block; + } + .prod-card--active .prod-card__footer { + padding: 5px; + padding-left: 0; + border: 0; + } + .prod-card--active .prod-card__footer-empty { + padding: 10px 0 10px 40px; + } + .prod-card--active .prod-card__coins-count { + padding-top: 5px; + } + .accounts-info__accounts .prod-card__id { + text-decoration: none; + } + .prod-card--active .prod-card__coins-count, + .prod-card--active .prod-card__id { + font-weight: 500; + } + .prod-card--active .prod-card__id { + text-decoration: underline; + } + .prod-card--active .prod-card__id--mobile { + display: none; + } + .prod-card--active .prod-card__id--mobile-active { + display: block; + } + .prod-card--active .small-text { + font-weight: normal; + } + .prod-card--active .id-sign { + display: inline-block; + font-weight: 500; + } + .prod-card--active .prod-card__first-line { + padding-right: 0; + } +} + +@media (min-width: 960px) { + .welcome { + padding-top: 22px; + } + .social-list { + margin-top: 160px; + } + .header__logo { + padding-left: 42px; + } + .header__wallet-set { + margin-right: 39px; + margin-left: 0; + } + .header__right select { + right: 37px; + } + .send-page__send-btn-wrp { + max-width: 100%; + width: 100%; + padding-top: 0; + padding-bottom: 70px; + } + .accounts-info__counter-wrapper .btn { + width: 210px; + } + .accounts-info__counter-wrapper { + padding-bottom: 20px; + } + .prod-card__dapp-icon { + margin-right: 10px; + } + .prod-card--line .mob-hidden { + display: inline-block; + } + .accounts-info__accounts .prod-card { + padding: 10px 0 9px 0; + } + .addresses-modal { + padding: 15px 15px 0; + } + .accounts-info__btn { + max-width: 350px; + } + .prod-card--line .prod-card__footer { + min-width: 300px; + } + .welcome__img .tablet { + width: 225px; + height: 225px; + } + .addresses-modal__list { + max-height: 480px; + } + .accounts-info__empty-img { + padding-bottom: 60px; + } + .accounts-info__empty-img img { + display: block; + width: 32%; + } + .send-page__send-btn-wrp .btn { + margin-right: 0; + max-width: 210px; + border-radius: 4px; + } + .wallet-settings__btns-wrapper { + padding: 0; + justify-content: flex-end; + } + .wallet-settings__ok-btns { + padding-top: 100px; + justify-content: flex-end; + } + .send-page__btns-wrap { + padding-left: 0; + padding-right: 0; + padding-top: 15px; + justify-content: flex-end; + } + .dapps-page .title { + margin-bottom: 30px; + } + .accounts-info__add .key-field { + max-width: 770px; + margin: 0 auto; + } + .accounts-info__add-btn { + max-width: 210px; + width: 210px; + margin-left: auto; + margin-right: 0; + } + .wallet-settings__go-btn { + max-width: 290px; + } + .send-page__btns-wrap .btn, + .wallet-settings__ok-btns .btn { + margin-left: 30px; + max-width: 210px; + } + .wallet-settings__btns-wrapper .btn { + margin-left: 30px; + max-width: 130px; + } + .send-page__field, + .key-field__select, + .confirm-info__line, + .dapps-page__card { + max-width: 770px; + margin: 0 auto; + } + .dapps-page__card { + margin-bottom: 10px; + } + .page-pagination { + justify-content: space-between; + max-width: 770px; + margin: 0 auto; + } + .page-pagination .btn { + width: 50px; + } + .page-pagination input { + min-width: 450px; + } + .prod-card__second-line-left p { + max-width: 595px; + } + .modal { + max-width: 770px; + } + .modal__title-wrap { + width: 100%; + } + .modal__def-list { + display: flex; + } + .def-list__item { + margin-right: 30px; + } + .def-list__item dt { + min-width: auto; + margin-right: 15px; + } + .addresses-modal__choosing { + justify-content: flex-end; + } + + .addresses-modal__choosing .btn { + max-width: 210px; + margin-left: 30px; + } + .wallet-settings__generate { + float: left; + width: auto; + } + .wallet-settings__field { + position: relative; + justify-content: flex-start; + max-width: 770px; + margin: 0 auto; + } + .key-field__title { + margin-right: 30px; + } + .send-page__field .key-field__title { + margin-right: auto; + } + .wallet-settings__field .key-field__btn:not(.wallet-settings__hiding) { + position: absolute; + right: 0; + bottom: 42px; + } + .wallet-wrapper { + max-width: 770px; + margin: 0 auto; + padding-top: 15px; + } + .wallet-settings__generate { + width: 210px; + } + .reconnect span { + display: inline; + } + .reconnect.grey-btn { + width: 130px; + margin-left: 15px; + padding-top: 12px; + padding-left: 39px; + background-position: 11px 11px; + } + .explorer-page { + padding-right: 40px; + padding-left: 40px; + } + .currentBlockNum { + font-size: 16px; + padding-left: 0; + } + .currentBlockNum p { + margin-top: 10px; + margin-bottom: 0; + } + .key-field__textarea { + max-height: 58px; + padding-top: 21px; + padding-bottom: 16px; + } + .wallet-settings__hiding { + margin-bottom: 8px; + } + .password-modal { + padding-top: 45px; + } + .explorer-page__explore::after { + right: 10px; + } + .explorer-page__explore { + padding-right: 15px; + padding-left: 15px; + } + .explorer-page__explore.btpress + .explorer-page__table { + padding-right: 15px; + padding-left: 15px; + } +} + +@media (max-height: 700px) { + .social-list { + margin-top: 100px; + } +} + +@media (min-width: 1200px) { + .header__logo { + padding-left: 20px; + } + .header__wallet-set { + margin-right: 18px; + } + .header__right select { + right: 10px; + } + .accounts-info__add .key-field { + min-width: 920px; + width: 920px; + } + .wallet-settings__title-wrap { + margin-bottom: 50px; + } + .welcome__img svg { + width: 180px; + height: 150px; + } + .header__wrapper { + max-width: 1150px; + margin: 0 auto; + } + .total-info { + max-width: 360px; + } + .send-page__send-btn-wrp .btn, + .send-page__btns-wrap .btn, + .wallet-settings__ok-btns .btn { + max-width: 250px; + } + + .wallet-settings__btns-wrapper .btn { + max-width: 160px; + } + .send-page__field, + .key-field__select, + .dapps-page__card { + max-width: 920px; + } + .key-field__select { + min-height: 58px; + } + .key-field { + margin-bottom: 0; + } + .currentBlockNum p span:first-of-type { + min-width: 250px; + } + .page-pagination { + justify-content: space-between; + max-width: 920px; + margin: 0 auto; + } + .page-pagination .btn { + width: 65px; + } + .page-pagination input { + min-width: 540px; + } + .prod-card__second-line-left p { + max-width: 715px; + } + .wallet-settings .wallet-settings__field, + .wallet-settings .btn--full-width, + .wallet-wrapper { + max-width: 920px; + margin-left: auto; + margin-right: auto; + } + .wallet-settings__go-btn { + max-width: 350px; + margin-left: auto; + margin-right: auto; + } + + .wallet-settings__ok-btns { + padding-top: 150px; + } + .wallet-settings__generate { + width: 250px; + } + .wallet-settings__info { + margin-bottom: 35px; + } + +} + +.delete +{ + position: absolute; + display: none; +} + +.myhidden +{ + display: none; +} + + + +.nodapp .editdapp +{ + display: none; +} + +.dapp_card +{ + width: 100%; +} + + + + + +/* правила стилей для history и explorer */ +.header__logo--history { + padding: 10px 15px; +} + +.history-page { + padding-bottom: 110px; +} +.history__text-block { + padding: 10px 15px 10px; +} +.history-page__id { + margin-bottom: 7px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + color: #445368; +} +.history-page__id-count { + max-width: 140px; + margin-left: 2px; + + font-size: 20px; + line-height: 23px; + font-weight: 700; + text-align-last: left; + color: #445368; + border: none; + background: #f2f2f2; +} +.history-page__description { + margin: 0; + margin-bottom: 17px; + font-size: 12px; + line-height: 14px; + color: rgba(0, 0, 0, 0.5); +} +.history-page__balance { + display: flex; + align-items: center; + + font-size: 14px; + line-height: 16px; + font-weight: 700; +} +.history-page__tera-icon { + margin-left: 5px; +} +.history-page__table { + padding: 15px 0 15px 15px; +} +.history-page__table .grid { + width: 100%; + border-collapse: collapse; +} +.history-page__table-wrap { + overflow-x: scroll; +} +.history-page__table th { + background: var(--blue-grey); + color: #fff; + border-right: 1px solid rgba(0, 0, 0, 0.1); + height: 30px; + padding: 0 20px 0 10px; + font-size: 16px; + line-height: 19px; + font-weight: 400; + white-space: nowrap; + text-align-last: left; +} +.history-page__table th:first-child { + border-top-left-radius: 5px; +} +.history-page__table th:last-child { + border-top-right-radius: 5px; +} +.history-page__table .grid tr td { + padding: 2px 10px 0px; + font-size: 14px; + line-height: 16px; + color: #000000; + background-color: #ffffff; + border: 1px solid #C4C4C4; +} +.history-page__table .grid tr td:first-of-type { + text-align: center; +} +.history-page__table .grid tr td.desc { + max-width: 170px; + word-break: break-all; +} + +@media (min-width: 576px) { + .history__text-block { + padding: 10px 33px 10px; + } + .history-page__table { + padding: 15px 33px; + } +} + +@media (min-width: 960px) { + .history-page { + padding-right: 40px; + padding-left: 40px; + } + .history__text-block { + padding: 10px 0 10px; + } + .history-page__table { + padding: 15px 0 10px; + } +} + +@media (min-width: 1200px) { + .history__text-block { + padding-top: 10px; + padding-bottom: 0; + } + .history-page__id { + font-size: 28px; + line-height: 33px; + text-align: center; + } + .history-page__id-count { + font-size: 28px; + line-height: 33px; + text-align: center; + } + .history-page__description { + margin-bottom: 30px; + font-size: 16px; + line-height: 19px; + text-align: center; + } + .history-page__balance { + justify-content: center; + margin-bottom: 30px; + font-size: 16px; + line-height: 19px; + } + .history-page__table { + padding: 30px 15px; + border: 1px solid rgba(0, 0, 0, 0.1); + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); + background-color: #ffffff; + } +} + +/* vtools added*/ + +th.minwidth +{ + padding: 5px; +} +.minwidth +{ + width: 100px; +} +.accname +{ + width: 200px; + max-width: 200px; + word-break: break-all; +} + +.openblock +{ + cursor:pointer; +} + +.header__logo-name { + margin: 0; + margin-top: 3px; + font-size: 14px; + line-height: 18px; + font-weight: 300; + letter-spacing: 0.17em; + text-transform: uppercase; + color: #ffffff; +} + +.header__wrapper { + height: 100%; +} + +.header__logo-link { + display: flex; + flex-direction: column; +} + +iframe +{ + left:0; + top: 0px; + width: 100%; + height: 97vh; + border: 0; +} + +.pointer,.olink +{ + cursor: pointer; +} + diff --git a/src/HTML/CSS/style.css b/src/HTML/CSS/style.css index 090f86e..649e8ae 100644 --- a/src/HTML/CSS/style.css +++ b/src/HTML/CSS/style.css @@ -1,180 +1,180 @@ -/*STYLE STYLE STYLE*/ -/*STYLE STYLE STYLE*/ -/*STYLE STYLE STYLE*/ -/*STYLE STYLE STYLE*/ - - -root -{ - --colorText:#000; -} - - -body -{ - - font-family: Arial, sans-serif; - font-size: 15px; - font-weight: 300; -} - -body.styleBrown -{ - --color0:#503F13; - --color1:#86754A; - --color2:#F5E5BB; - --color3:#F5F0E3; -} - - -body.styleGreen -{ - --color0:#204410; - --color1:#4F7340; - --color2:#CBF4BA; - --color3:#E7F4E1; -} - -body.styleBlue -{ - --color0:#0D1B35; - --color1:#354259; - --color2:#BED0F2; - --color3:#E1E7F2; -} - -body.styleGray -{ - --color0:#424a5D; - --color1:#5b6775; - --color2:#FFFFFF; - --color3:#f3f3f4; -} - -body.styleContrast1 -{ - --color0:#101010; - --color1:#303030; - --color2: #b3cee8; - --color3:#FFFFFF; -} - -body.styleContrast2 -{ - --color0:#101010; - --color1:#303030; - --color2: #cee8df; - --color3:#FFFFFF; -} - -body.styleContrast3 -{ - --color0:#101010; - --color1:#303030; - --color2: #e8e0d4; - --color3:#FFFFFF; -} - - -body.univers .bt -{ - background: var(--color1); - color: var(--color2); -} -body.univers -{ - background: var(--color2); -} - -body.univers table.grid -{ - background:var(--color3); -} - -body.univers .bttab -{ - background: var(--color1); - color:white; -} - -body.univers .current -{ - background: var(--color0); - color:white; -} - -body.univers input,textarea,select -{ - background:white; - color: black; -} - - - - -/*dark*/ -body.styleDark -{ - background: #282828; - --colorText:white; - color: white; -} - -body.styleDark .bt -{ - background: #4c4c4c; - color: white; - border: 1px solid #5a5a5a; -} - -body.styleDark .header_tr -{ - color:white; -} - - -body.styleDark table.grid -{ - background: #565656; -} - -body.styleDark .bttab -{ - background: #202225; - color:white; -} - -body.styleDark .current -{ - background: #565b61; - color:white; -} - -body.styleDark input,textarea,select -{ - background:white; - color: black; -} - -/*bt*/ -body.styleDark button -{ - background: #939393; - border: 1px solid #282828; - color: white; -} - -body.styleDark .bold -{ - font-weight: 300; -} - -body.styleDark #idStatus -{ - color: #fffabd; -} - -body.styleDark #idOpenWallet -{ - border: 1px solid darkgrey; -} +/*STYLE STYLE STYLE*/ +/*STYLE STYLE STYLE*/ +/*STYLE STYLE STYLE*/ +/*STYLE STYLE STYLE*/ + + +root +{ + --colorText:#000; +} + + +body +{ + + font-family: Arial, sans-serif; + font-size: 15px; + font-weight: 300; +} + +body.styleBrown +{ + --color0:#503F13; + --color1:#86754A; + --color2:#F5E5BB; + --color3:#F5F0E3; +} + + +body.styleGreen +{ + --color0:#204410; + --color1:#4F7340; + --color2:#CBF4BA; + --color3:#E7F4E1; +} + +body.styleBlue +{ + --color0:#0D1B35; + --color1:#354259; + --color2:#BED0F2; + --color3:#E1E7F2; +} + +body.styleGray +{ + --color0:#424a5D; + --color1:#5b6775; + --color2:#FFFFFF; + --color3:#f3f3f4; +} + +body.styleContrast1 +{ + --color0:#101010; + --color1:#303030; + --color2: #b3cee8; + --color3:#FFFFFF; +} + +body.styleContrast2 +{ + --color0:#101010; + --color1:#303030; + --color2: #cee8df; + --color3:#FFFFFF; +} + +body.styleContrast3 +{ + --color0:#101010; + --color1:#303030; + --color2: #e8e0d4; + --color3:#FFFFFF; +} + + +body.univers .bt +{ + background: var(--color1); + color: var(--color2); +} +body.univers +{ + background: var(--color2); +} + +body.univers table.grid +{ + background:var(--color3); +} + +body.univers .bttab +{ + background: var(--color1); + color:white; +} + +body.univers .current +{ + background: var(--color0); + color:white; +} + +body.univers input,textarea,select +{ + background:white; + color: black; +} + + + + +/*dark*/ +body.styleDark +{ + background: #282828; + --colorText:white; + color: white; +} + +body.styleDark .bt +{ + background: #4c4c4c; + color: white; + border: 1px solid #5a5a5a; +} + +body.styleDark .header_tr +{ + color:white; +} + + +body.styleDark table.grid +{ + background: #565656; +} + +body.styleDark .bttab +{ + background: #202225; + color:white; +} + +body.styleDark .current +{ + background: #565b61; + color:white; +} + +body.styleDark input,textarea,select +{ + background:white; + color: black; +} + +/*bt*/ +body.styleDark button +{ + background: #939393; + border: 1px solid #282828; + color: white; +} + +body.styleDark .bold +{ + font-weight: 300; +} + +body.styleDark #idStatus +{ + color: #fffabd; +} + +body.styleDark #idOpenWallet +{ + border: 1px solid darkgrey; +} diff --git a/src/HTML/CSS/wallet.css b/src/HTML/CSS/wallet.css index 488a97d..9247324 100644 --- a/src/HTML/CSS/wallet.css +++ b/src/HTML/CSS/wallet.css @@ -1,535 +1,535 @@ - -/*Списки*/ -table -{ - border-collapse: collapse; - width:100%; - max-width: 800px -} -.grid th, .grid td -{ - border: 1px solid #264378; - padding: 4px; -} -.grid td -{ - width: 60px; - vertical-align:top; -} - -.bold -{ - font-weight: 700; -} - -.smallbold -{ - font-weight: 600; -} - - - -td.sum -{ - text-align: right; - width: 120px; -} - - - -td.num -{ - text-align: right; - width: 50px; -} - -td.cur -{ - text-align: left; - width: 50px; - font-size:smaller; -} -td.snum -{ - text-align: center; - width: 20px; -} - -td.direct -{ - text-align: center; - vertical-align: middle; - width: 10px; - font-weight: 700; - font-size:x-large; -} -td.smart -{ - text-align: right; - width: 150px; - max-width: 200px; -} - - -td.txt -{ - text-align: left; - width: 100px; -} -td.desc -{ - text-align: left; - width: 200px; - max-width: 200px; - word-break: break-all; -} -td.name -{ - text-align: left; - width: 100px; -} - -td.date -{ - text-align: left; - width: 90px; - min-width: 70px; - font-size: small; -} - - - - - - -/*SEND SEND SEND SEND SEND SEND SEND SEND SEND SEND */ - -table.form_input -{ - border-collapse: collapse; - width: 600px; -} -.form_input td -{ - width: 20%; -} -.form_input td:nth-child(2) -{ - width: 80%; -} - -.form_input input, .form_input select -{ - width: 98%; - text-align: right; -} - -.form_input textarea -{ - width: 98%; - text-align: left; -} -.form_input .bsend -{ - width: 33%; - height: 30px; - text-align: center; - float: left; -} -.short_input input -{ - width: 120px; -} - - - - -td.code -{ - width: 240px; - font-family: "courier new", "times new roman", monospace; - font-size: small; - align-content: left; - text-align: left; - word-break: break-all; -} -td.code2 -{ - width: 340px; - font-family: "courier new", "times new roman", monospace; - font-size: small; - align-content: left; - text-align: left; - word-break: break-all; -} -.hash -{ - width: 250px; - min-width: 100px; - font-family: "courier new", "times new roman", monospace; - font-size: 60%; - align-content: left; - text-align: left; - word-break: break-all; -} -.pubkey -{ - width: 180px; - font-family: "courier new", "times new roman", monospace; - font-size: 75%; - align-content: left; - text-align: left; - word-break: break-all; -} - -.accname -{ - width: 180px; - font-family: Cambria,sans-serif; - align-content: left; - text-align: left; - word-break: break-all; -} - - -.verify -{ - -} - - - -/*CHECKBOX*/ - -.checkbox -{ - position: absolute; - z-index: -1; - opacity: 0; - margin: 10px 0 0 20px; -} -.checkbox + label -{ - position: relative; - padding: 0 20px 0 55px; - cursor: pointer; -} -.checkbox + label:before -{ - content: ''; - position: absolute; - top: -4px; - left: 0; - width: 50px; - height: 26px; - border-radius: 13px; - background: #CDD1DA; - box-shadow: inset 0 2px 3px rgba(0,0,0,.2); - transition: .2s; - -} -.checkbox + label:after -{ - content: ''; - position: absolute; - top: -2px; - left: 2px; - width: 22px; - height: 22px; - border-radius: 10px; - background: #FFF; - box-shadow: 0 2px 5px rgba(0,0,0,.3); - transition: .2s; -} -.checkbox:checked + label:before -{ - background: #46b319; -} -.checkbox_red:checked + label:before -{ - background: darkred; -} - -.checkbox_alert + label:before -{ - background: #f0b323; -} - -.checkbox:checked + label:after -{ - left: 26px; -} -.checkbox:focus + label:before -{ - box-shadow: inset 0 2px 3px rgba(0,0,0,.2), 0 0 0 3px rgba(217, 217, 217, 0.7); -} - - - - - - - - -#idPercentMining -{ - width: 40px; - text-align: center; - display:inline-block; -} - - - -#idNodeWhiteList -{ - width: 780px; -} - - -#idTotalSum -{ - text-align: left; -} - -/*CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG*/ -/*Просмотр ключей*/ -table.keys -{ - border-collapse: collapse; - width: 800px; -} -/*Редактирование приватного ключа*/ -#grid_edit_key .bt -{ - width: 80px; - height: 30px; - line-height: 20px; - margin: 10px; - text-align: center; -} -#idTypeKey,#idShortNameText -{ - width: 250px; - height: 20px; - text-align: left; -} - -/*Редактирование new acc Name*/ -#grid_edit_newacc .bt, #grid_mining_set .bt, #idTablePassword1 .bt, #idTablePassword2 .bt -{ - width: 80px; - height: 30px; - line-height: 20px; - margin: 10px; - text-align: center; -} -#idAutoSetMining -{ - width: 16px; - height: 16px; - text-align: left; - top: 3px; - position:relative; -} - -#grid_accounts_all, #grid_history -{ - font-size: smaller; -} -#grid_history .red td -{ - color: darkred; -} -#grid_history .blue td -{ - color: darkblue; -} -#grid_history .green td -{ - color: darkgreen; -} - - - -/*idStatus Log operations*/ -#idStatus -{ - z-index:1000; - position:relative; - top:40px; - left:10px; - text-align: left; - width:800px; /* ширина блока */ - color:blue; -} - -#idServerLog -{ - width:100%; - max-width: 800px; - text-align: left; - - border: 1px solid black; - height: 220px; - padding: 1px; - margin: 0px; - - - font-family: "courier new", "times new roman", monospace; - font-size: 80%; - align-content: left; - word-break: break-all; - -} - -#idTransaction -{ - width:100%; - min-width: 795px; - max-width: 795px; - text-align: left; - color:#204410; -} - -#idDescription -{ - width: 95%; - min-width: 560px; - max-width: 560px; -} - - -#idAccount -{ - width: 100%; - text-align: left; - align-content: left; -} -#idTo -{ - width: 99%; - text-align: left; - align-content: left; -} - -#idSumSend -{ - background-color: #f0ffb9; - font-weight: 700; - width: 75%; -} - -#view_header -{ - width: 800px; - font-weight: 600; - color: black; - text-align: center; -} -.header_tr -{ - width: 600px; - font-weight: 600; - text-align: center; - color:black; -} - - -#idPaginationHistory, #idPaginationBlock, #idPaginationAccount, #idPaginationAct, #idPaginationHash, #idUtilView, #idPaginationDapps -{ - width: 800px; - align-content: center; - text-align: center; -} - - -#MAIN -{ - align-content: left; -} - -#idStableScroll -{ - z-index:0; - position:absolute; - top:800px; - height: 10px; - color: darkred; - width: 97%; - margin: auto; -} - - - - -#idBlockOnSend -{ - z-index:100; - position:absolute; - height:170px; - width:380px; - top:20%; - left:0; - transform: translateX(50vw) translateX(-190px); - - font-size: larger; - padding: 10px; - background: #2b372d; - color: white; - text-align: left; - border: 1px solid gray; - box-shadow: 0 0 0 2px darkgrey; - border-radius: 8px; -} - - -#idCheckOnSend -{ - font-size: smaller; - position:absolute; - bottom: 10px; -} - -.radius -{ - border-radius: 4px; - max-height: 34px; - height: 34px; -} -button.radius -{ - color:white; - background-color: #337ab7; - border-color: #2e6da4; - width: 100px; - margin: 20px; -} - - - -.bt_open_dapp -{ - min-width: 160px; - max-width: 160px; - height: 40px; - min-height: 40px; - vertical-align:middle; - margin: 0; -} - -.setsmart -{ - color:saddlebrown; - margin: 0; -} - -.olink -{ - text-decoration: none; - color: var(--colorText); -} -.olink:hover -{ - font-weight: bold; -} - + +/*Списки*/ +table +{ + border-collapse: collapse; + width:100%; + max-width: 800px +} +.grid th, .grid td +{ + border: 1px solid #264378; + padding: 4px; +} +.grid td +{ + width: 60px; + vertical-align:top; +} + +.bold +{ + font-weight: 700; +} + +.smallbold +{ + font-weight: 600; +} + + + +td.sum +{ + text-align: right; + width: 120px; +} + + + +td.num +{ + text-align: right; + width: 50px; +} + +td.cur +{ + text-align: left; + width: 50px; + font-size:smaller; +} +td.snum +{ + text-align: center; + width: 20px; +} + +td.direct +{ + text-align: center; + vertical-align: middle; + width: 10px; + font-weight: 700; + font-size:x-large; +} +td.smart +{ + text-align: right; + width: 150px; + max-width: 200px; +} + + +td.txt +{ + text-align: left; + width: 100px; +} +td.desc +{ + text-align: left; + width: 200px; + max-width: 200px; + word-break: break-all; +} +td.name +{ + text-align: left; + width: 100px; +} + +td.date +{ + text-align: left; + width: 90px; + min-width: 70px; + font-size: small; +} + + + + + + +/*SEND SEND SEND SEND SEND SEND SEND SEND SEND SEND */ + +table.form_input +{ + border-collapse: collapse; + width: 600px; +} +.form_input td +{ + width: 20%; +} +.form_input td:nth-child(2) +{ + width: 80%; +} + +.form_input input, .form_input select +{ + width: 98%; + text-align: right; +} + +.form_input textarea +{ + width: 98%; + text-align: left; +} +.form_input .bsend +{ + width: 33%; + height: 30px; + text-align: center; + float: left; +} +.short_input input +{ + width: 120px; +} + + + + +td.code +{ + width: 240px; + font-family: "courier new", "times new roman", monospace; + font-size: small; + align-content: left; + text-align: left; + word-break: break-all; +} +td.code2 +{ + width: 340px; + font-family: "courier new", "times new roman", monospace; + font-size: small; + align-content: left; + text-align: left; + word-break: break-all; +} +.hash +{ + width: 250px; + min-width: 100px; + font-family: "courier new", "times new roman", monospace; + font-size: 60%; + align-content: left; + text-align: left; + word-break: break-all; +} +.pubkey +{ + width: 180px; + font-family: "courier new", "times new roman", monospace; + font-size: 75%; + align-content: left; + text-align: left; + word-break: break-all; +} + +.accname +{ + width: 180px; + font-family: Cambria,sans-serif; + align-content: left; + text-align: left; + word-break: break-all; +} + + +.verify +{ + +} + + + +/*CHECKBOX*/ + +.checkbox +{ + position: absolute; + z-index: -1; + opacity: 0; + margin: 10px 0 0 20px; +} +.checkbox + label +{ + position: relative; + padding: 0 20px 0 55px; + cursor: pointer; +} +.checkbox + label:before +{ + content: ''; + position: absolute; + top: -4px; + left: 0; + width: 50px; + height: 26px; + border-radius: 13px; + background: #CDD1DA; + box-shadow: inset 0 2px 3px rgba(0,0,0,.2); + transition: .2s; + +} +.checkbox + label:after +{ + content: ''; + position: absolute; + top: -2px; + left: 2px; + width: 22px; + height: 22px; + border-radius: 10px; + background: #FFF; + box-shadow: 0 2px 5px rgba(0,0,0,.3); + transition: .2s; +} +.checkbox:checked + label:before +{ + background: #46b319; +} +.checkbox_red:checked + label:before +{ + background: darkred; +} + +.checkbox_alert + label:before +{ + background: #f0b323; +} + +.checkbox:checked + label:after +{ + left: 26px; +} +.checkbox:focus + label:before +{ + box-shadow: inset 0 2px 3px rgba(0,0,0,.2), 0 0 0 3px rgba(217, 217, 217, 0.7); +} + + + + + + + + +#idPercentMining +{ + width: 40px; + text-align: center; + display:inline-block; +} + + + +#idNodeWhiteList +{ + width: 780px; +} + + +#idTotalSum +{ + text-align: left; +} + +/*CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG CONFIG*/ +/*Просмотр ключей*/ +table.keys +{ + border-collapse: collapse; + width: 800px; +} +/*Редактирование приватного ключа*/ +#grid_edit_key .bt +{ + width: 80px; + height: 30px; + line-height: 20px; + margin: 10px; + text-align: center; +} +#idTypeKey,#idShortNameText +{ + width: 250px; + height: 20px; + text-align: left; +} + +/*Редактирование new acc Name*/ +#grid_edit_newacc .bt, #grid_mining_set .bt, #idTablePassword1 .bt, #idTablePassword2 .bt +{ + width: 80px; + height: 30px; + line-height: 20px; + margin: 10px; + text-align: center; +} +#idAutoSetMining +{ + width: 16px; + height: 16px; + text-align: left; + top: 3px; + position:relative; +} + +#grid_accounts_all, #grid_history +{ + font-size: smaller; +} +#grid_history .red td +{ + color: darkred; +} +#grid_history .blue td +{ + color: darkblue; +} +#grid_history .green td +{ + color: darkgreen; +} + + + +/*idStatus Log operations*/ +#idStatus +{ + z-index:1000; + position:relative; + top:40px; + left:10px; + text-align: left; + width:800px; /* ширина блока */ + color:blue; +} + +#idServerLog +{ + width:100%; + max-width: 800px; + text-align: left; + + border: 1px solid black; + height: 220px; + padding: 1px; + margin: 0px; + + + font-family: "courier new", "times new roman", monospace; + font-size: 80%; + align-content: left; + word-break: break-all; + +} + +#idTransaction +{ + width:100%; + min-width: 795px; + max-width: 795px; + text-align: left; + color:#204410; +} + +#idDescription +{ + width: 95%; + min-width: 560px; + max-width: 560px; +} + + +#idAccount +{ + width: 100%; + text-align: left; + align-content: left; +} +#idTo +{ + width: 99%; + text-align: left; + align-content: left; +} + +#idSumSend +{ + background-color: #f0ffb9; + font-weight: 700; + width: 75%; +} + +#view_header +{ + width: 800px; + font-weight: 600; + color: black; + text-align: center; +} +.header_tr +{ + width: 600px; + font-weight: 600; + text-align: center; + color:black; +} + + +#idPaginationHistory, #idPaginationBlock, #idPaginationAccount, #idPaginationAct, #idPaginationHash, #idUtilView, #idPaginationDapps +{ + width: 800px; + align-content: center; + text-align: center; +} + + +#MAIN +{ + align-content: left; +} + +#idStableScroll +{ + z-index:0; + position:absolute; + top:800px; + height: 10px; + color: darkred; + width: 97%; + margin: auto; +} + + + + +#idBlockOnSend +{ + z-index:100; + position:absolute; + height:170px; + width:380px; + top:20%; + left:0; + transform: translateX(50vw) translateX(-190px); + + font-size: larger; + padding: 10px; + background: #2b372d; + color: white; + text-align: left; + border: 1px solid gray; + box-shadow: 0 0 0 2px darkgrey; + border-radius: 8px; +} + + +#idCheckOnSend +{ + font-size: smaller; + position:absolute; + bottom: 10px; +} + +.radius +{ + border-radius: 4px; + max-height: 34px; + height: 34px; +} +button.radius +{ + color:white; + background-color: #337ab7; + border-color: #2e6da4; + width: 100px; + margin: 20px; +} + + + +.bt_open_dapp +{ + min-width: 160px; + max-width: 160px; + height: 40px; + min-height: 40px; + vertical-align:middle; + margin: 0; +} + +.setsmart +{ + color:saddlebrown; + margin: 0; +} + +.olink +{ + text-decoration: none; + color: var(--colorText); +} +.olink:hover +{ + font-weight: bold; +} + diff --git a/src/HTML/JS/client-electron.js b/src/HTML/JS/client-electron.js index 5377447..42ae61f 100644 --- a/src/HTML/JS/client-electron.js +++ b/src/HTML/JS/client-electron.js @@ -10,19 +10,23 @@ const ipcRenderer = require('electron').ipcRenderer; -function GetDataElectron(Method, ObjPost, Func) { - if (Func === undefined) { +function GetDataElectron(Method,ObjPost,Func) +{ + if(Func === undefined) + { Func = ObjPost; ObjPost = null; } var reply; - try { - reply = ipcRenderer.sendSync('GetData', { path: Method, obj: ObjPost }); + try + { + reply = ipcRenderer.sendSync('GetData', {path:Method, obj:ObjPost}); } - catch (e) { + catch(e) + { reply = undefined; } - if (Func) + if(Func) Func(reply); }; window.GetData = GetDataElectron; diff --git a/src/HTML/JS/client.js b/src/HTML/JS/client.js index 3e04b24..1b4c0b3 100644 --- a/src/HTML/JS/client.js +++ b/src/HTML/JS/client.js @@ -9,32 +9,40 @@ */ -function $(id) { +function $(id) +{ return document.getElementById(id); }; var WALLET_KEY_NAME = "WALLET_KEY"; var WALLET_PUB_KEY_NAME = "WALLET_PUB_KEY"; -if (!Math.log2) - Math.log2 = Math.log2 || function(x) { +if(!Math.log2) + Math.log2 = Math.log2 || function (x) + { return Math.log(x) * Math.LOG2E; }; -if (!window.crypto) +if(!window.crypto) window.crypto = window.msCrypto; -if (!window.toStaticHTML) - toStaticHTML = function(Str) { +if(!window.toStaticHTML) + toStaticHTML = function (Str) + { return Str; }; -if (!String.prototype.padStart) { +if(!String.prototype.padStart) +{ window.BrowserIE = 1; - String.prototype.padStart = function padStart(targetLength, padString) { + String.prototype.padStart = function padStart(targetLength,padString) + { targetLength = targetLength >> 0; padString = String((typeof padString !== 'undefined' ? padString : ' ')); - if (this.length > targetLength) { + if(this.length > targetLength) + { return String(this); } - else { + else + { targetLength = targetLength - this.length; - if (targetLength > padString.length) { + if(targetLength > padString.length) + { padString += padString.repeat(targetLength / padString.length); } return padString.slice(0, targetLength) + String(this); @@ -42,47 +50,60 @@ if (!String.prototype.padStart) { }; } window.Storage = {}; -window.Storage.setItem = function(Key, Value) { - if (window.localStorage) +window.Storage.setItem = function (Key,Value) +{ + if(window.localStorage) localStorage.setItem(Key, Value); }; -window.Storage.getItem = function(Key) { - if (window.localStorage) +window.Storage.getItem = function (Key) +{ + if(window.localStorage) return localStorage.getItem(Key); }; -window.IsLocalClient = function() { +window.IsLocalClient = function () +{ return (window.location.protocol.substr(0, 4) !== "http"); }; var ServerHTTP; var MainServer; -if (window.nw) { - window.Open = function(path, iconname, width, height) { +if(window.nw) +{ + window.Open = function (path,iconname,width,height) + { width = width || 840; height = height || 1000; - var params = { width: width, height: height }; - if (iconname) + var params = {width:width, height:height}; + if(iconname) params.icon = "../HTML/PIC/" + iconname + ".png"; - window.nw.Window.open(path, params, function(win) { + window.nw.Window.open(path, params, function (win) + { }); }; - window.GetData = function(Method, ObjPost, Func) { - window.nw.global.RunRPC({ path: Method, obj: ObjPost }, Func); + window.GetData = function (Method,ObjPost,Func) + { + window.nw.global.RunRPC({path:Method, obj:ObjPost}, Func); }; - global.RunRPC = function(message, Func) { - if (!ServerHTTP) + global.RunRPC = function (message,Func) + { + if(!ServerHTTP) ServerHTTP = require('../core/html-server'); var reply = ServerHTTP.SendData(message); - if (Func) { + if(Func) + { Func(reply); } }; } -else { - window.Open = function(path, iconname, width, height) { - if (!window.NWMODE) { +else +{ + window.Open = function (path,iconname,width,height) + { + if(!window.NWMODE) + { var win = window.open(path); } - else { + else + { width = width || 840; height = height || 1000; var left = (screen.width - width) / 2; @@ -92,38 +113,50 @@ else { var win = window.open(path, undefined, params); } }; - window.GetData = function(Method, ObjPost, Func) { - if (Method.substr(0, 4) !== "http") { - if (Method.substr(0, 1) !== "/") + window.GetData = function (Method,ObjPost,Func) + { + if(Method.substr(0, 4) !== "http") + { + if(Method.substr(0, 1) !== "/") Method = "/" + Method; - if (MainServer) { + if(MainServer) + { Method = GetProtocolServerPath(MainServer) + Method; } - else { - if (IsLocalClient()) - return; + else + { + if(IsLocalClient()) + return ; } } var StrPost = null; var serv = new XMLHttpRequest(); - if (ObjPost !== null) { + if(ObjPost !== null) + { StrPost = JSON.stringify(ObjPost); serv.open("POST", Method, true); } - else { + else + { throw "ERROR GET-TYPE"; } var STACK = "" + new Error().stack; serv.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - serv.onreadystatechange = function() { - if (serv.readyState == 4) { - if (serv.status == 200) { - if (Func) { + serv.onreadystatechange = function () + { + if(serv.readyState == 4) + { + if(serv.status == 200) + { + if(Func) + { var Data; - try { + try + { Data = JSON.parse(serv.responseText); } - catch (e) { + catch(e) + { console.log("Error parsing: " + e); console.log(serv.responseText); console.log(STACK); @@ -131,8 +164,9 @@ else { Func(Data, serv.responseText); } } - else { - if (Func) + else + { + if(Func) Func(undefined, undefined); } } @@ -141,67 +175,78 @@ else { }; } -function IsIPAddres(Str) { +function IsIPAddres(Str) +{ var arr = Str.split("."); - if (arr.length !== 3) + if(arr.length !== 3) return 0; - for (var i = 0; i < arr.length; i++) - if (arr[i] !== "" + ParseNum(arr[i])) + for(var i = 0; i < arr.length; i++) + if(arr[i] !== "" + ParseNum(arr[i])) return 0; return 1; }; -function GetProtocolServerPath(Item) { - if (Item.port === 443) +function GetProtocolServerPath(Item) +{ + if(Item.port === 443) return "https://" + Item.ip; else - if (Item.port === 80) + if(Item.port === 80) return "http://" + Item.ip; else return "http://" + Item.ip + ":" + Item.port; }; -function SUM_TO_STRING(Value, Currency, bFloat, bLocal) { +function SUM_TO_STRING(Value,Currency,bFloat,bLocal) +{ var Str; - if (Value.SumCOIN || Value.SumCENT) - if (bFloat) { + if(Value.SumCOIN || Value.SumCENT) + if(bFloat) + { Str = "" + FLOAT_FROM_COIN(Value).toStringF(); } - else { + else + { var SumCOIN = Value.SumCOIN; - if (bLocal) + if(bLocal) SumCOIN = SumCOIN.toLocaleString(); Str = "" + SumCOIN + "." + Rigth("000000000" + Value.SumCENT, 9); } else Str = ""; - if (Currency !== undefined) { - if (Str === "") + if(Currency !== undefined) + { + if(Str === "") Str = "0"; Str += " " + CurrencyName(Currency); } return Str; }; -function GetArrFromHex(Str) { +function GetArrFromHex(Str) +{ var array = []; - for (var i = 0; Str && i < Str.length / 2; i++) { + for(var i = 0; Str && i < Str.length / 2; i++) + { array[i] = parseInt(Str.substr(i * 2, 2), 16); } return array; }; -function GetHexFromArr(arr) { - if (!(arr instanceof Array) && arr.data) +function GetHexFromArr(arr) +{ + if(!(arr instanceof Array) && arr.data) arr = arr.data; var Str = ""; - for (var i = 0; arr && i < arr.length; i++) { - if (!arr[i]) + for(var i = 0; arr && i < arr.length; i++) + { + if(!arr[i]) Str += "00"; - else { + else + { var Val = arr[i] & 255; var A = Val.toString(16); - if (A.length === 1) + if(A.length === 1) A = "0" + A; Str = Str + A; } @@ -209,48 +254,59 @@ function GetHexFromArr(arr) { return Str.toUpperCase(); }; -function GetStrFromAddr(arr) { +function GetStrFromAddr(arr) +{ return GetHexFromArr(arr); }; -function GetHexFromArrBlock(Arr, LenBlock) { +function GetHexFromArrBlock(Arr,LenBlock) +{ var Str = ""; var Arr2 = []; - for (var i = 0; i < Arr.length; i++) { + for(var i = 0; i < Arr.length; i++) + { Arr2[i % LenBlock] = Arr[i]; - if (Arr2.length >= LenBlock) { + if(Arr2.length >= LenBlock) + { Str += GetHexFromArr(Arr2) + "\n"; Arr2 = []; } } - if (Arr2.length) { + if(Arr2.length) + { Str += GetHexFromArr(Arr2); } return Str; }; -function Rigth(Str, Count) { - if (Str.length < Count) +function Rigth(Str,Count) +{ + if(Str.length < Count) return Str; else return Str.substr(Str.length - Count); }; -function toUTF8Array(str) { +function toUTF8Array(str) +{ var utf8 = []; - for (var i = 0; i < str.length; i++) { + for(var i = 0; i < str.length; i++) + { var charcode = str.charCodeAt(i); - if (charcode < 0x80) + if(charcode < 0x80) utf8.push(charcode); else - if (charcode < 0x800) { + if(charcode < 0x800) + { utf8.push(0xc0 | (charcode >> 6), 0x80 | (charcode & 0x3f)); } else - if (charcode < 0xd800 || charcode >= 0xe000) { + if(charcode < 0xd800 || charcode >= 0xe000) + { utf8.push(0xe0 | (charcode >> 12), 0x80 | ((charcode >> 6) & 0x3f), 0x80 | (charcode & 0x3f)); } - else { + else + { i++; charcode = 0x10000 + (((charcode & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff)); utf8.push(0xf0 | (charcode >> 18), 0x80 | ((charcode >> 12) & 0x3f), 0x80 | ((charcode >> 6) & 0x3f), 0x80 | (charcode & 0x3f)); @@ -259,15 +315,18 @@ function toUTF8Array(str) { return utf8; }; -function Utf8ArrayToStr(array) { +function Utf8ArrayToStr(array) +{ var out, i, len, c; var char2, char3; out = ""; len = array.length; i = 0; - while (i < len) { + while(i < len) + { c = array[i++]; - switch (c >> 4) { + switch(c >> 4) + { case 0: case 1: case 2: @@ -290,8 +349,10 @@ function Utf8ArrayToStr(array) { break; } } - for (var i = 0; i < out.length; i++) { - if (out.charCodeAt(i) === 0) { + for(var i = 0; i < out.length; i++) + { + if(out.charCodeAt(i) === 0) + { out = out.substr(0, i); break; } @@ -299,23 +360,28 @@ function Utf8ArrayToStr(array) { return out; }; -function GetArr32FromStr(Str) { +function GetArr32FromStr(Str) +{ return GetArrFromStr(Str, 32); }; -function GetArrFromStr(Str, Len) { +function GetArrFromStr(Str,Len) +{ var arr = toUTF8Array(Str); - for (var i = arr.length; i < Len; i++) { + for(var i = arr.length; i < Len; i++) + { arr[i] = 0; } return arr.slice(0, Len); }; -function WriteByte(arr, Num) { +function WriteByte(arr,Num) +{ arr[arr.length] = Num & 0xFF; }; -function WriteUint(arr, Num) { +function WriteUint(arr,Num) +{ var len = arr.length; arr[len] = Num & 0xFF; arr[len + 1] = (Num >>> 8) & 0xFF; @@ -326,13 +392,15 @@ function WriteUint(arr, Num) { arr[len + 5] = (NumH >>> 8) & 0xFF; }; -function WriteUint16(arr, Num) { +function WriteUint16(arr,Num) +{ var len = arr.length; arr[len] = Num & 0xFF; arr[len + 1] = (Num >>> 8) & 0xFF; }; -function WriteUint32(arr, Num) { +function WriteUint32(arr,Num) +{ var len = arr.length; arr[len] = Num & 0xFF; arr[len + 1] = (Num >>> 8) & 0xFF; @@ -340,48 +408,58 @@ function WriteUint32(arr, Num) { arr[len + 3] = (Num >>> 24) & 0xFF; }; -function WriteStr(arr, Str, ConstLength) { - if (!Str) +function WriteStr(arr,Str,ConstLength) +{ + if(!Str) Str = ""; var arrStr = toUTF8Array(Str); var length; var len = arr.length; - if (ConstLength) { + if(ConstLength) + { length = ConstLength; } - else { + else + { length = arrStr.length; - if (length > 65535) + if(length > 65535) length = 65535; arr[len] = length & 0xFF; arr[len + 1] = (length >>> 8) & 0xFF; len += 2; } - for (var i = 0; i < length; i++) { + for(var i = 0; i < length; i++) + { arr[len + i] = arrStr[i]; } }; -function WriteArr(arr, arr2, ConstLength) { +function WriteArr(arr,arr2,ConstLength) +{ var len = arr.length; - for (var i = 0; i < ConstLength; i++) { + for(var i = 0; i < ConstLength; i++) + { arr[len + i] = arr2[i]; } }; -function WriteTr(arr, arr2) { +function WriteTr(arr,arr2) +{ var len2 = arr2.length; var len = arr.length; arr[len] = len2 & 0xFF; arr[len + 1] = (len2 >>> 8) & 0xFF; len += 2; - for (var i = 0; i < len2; i++) { + for(var i = 0; i < len2; i++) + { arr[len + i] = arr2[i]; } }; -function ReadUintFromArr(arr, len) { - if (len === undefined) { +function ReadUintFromArr(arr,len) +{ + if(len === undefined) + { len = arr.len; arr.len += 6; } @@ -391,8 +469,10 @@ function ReadUintFromArr(arr, len) { return value; }; -function ReadUint32FromArr(arr, len) { - if (len === undefined) { +function ReadUint32FromArr(arr,len) +{ + if(len === undefined) + { len = arr.len; arr.len += 4; } @@ -400,17 +480,20 @@ function ReadUint32FromArr(arr, len) { return value; }; -function ReadArr(arr, length) { +function ReadArr(arr,length) +{ var Ret = []; var len = arr.len; - for (var i = 0; i < length; i++) { + for(var i = 0; i < length; i++) + { Ret[i] = arr[len + i]; } arr.len += length; return Ret; }; -function ReadStr(arr) { +function ReadStr(arr) +{ var length = arr[arr.len] + arr[arr.len + 1] * 256; arr.len += 2; var arr2 = arr.slice(arr.len, arr.len + length); @@ -419,39 +502,46 @@ function ReadStr(arr) { return Str; }; -function ParseNum(Str) { +function ParseNum(Str) +{ var Res = parseInt(Str); - if (isNaN(Res)) + if(isNaN(Res)) Res = 0; - if (!Res) + if(!Res) Res = 0; - if (Res < 0) + if(Res < 0) Res = 0; return Res; }; -function parseUint(Str) { +function parseUint(Str) +{ var Res = parseInt(Str); - if (isNaN(Res)) + if(isNaN(Res)) Res = 0; - if (!Res) + if(!Res) Res = 0; - if (Res < 0) + if(Res < 0) Res = 0; return Res; }; -function CopyObjKeys(dest, src) { - for (var key in src) { +function CopyObjKeys(dest,src) +{ + for(var key in src) + { dest[key] = src[key]; } }; -function SaveToArr(Arr, Obj) { - for (var key in Obj) { +function SaveToArr(Arr,Obj) +{ + for(var key in Obj) + { Arr[0]++; var Value = Obj[key]; - switch (typeof Value) { + switch(typeof Value) + { case "number": WriteByte(Arr, 241); WriteUint(Arr, Value); @@ -461,7 +551,8 @@ function SaveToArr(Arr, Obj) { WriteStr(Arr, Value); break; case "object": - if (Value && (Value.length > 0 || Value.length === 0) && Value.length <= 240) { + if(Value && (Value.length > 0 || Value.length === 0) && Value.length <= 240) + { WriteByte(Arr, Value.length); WriteArr(Arr, Value, Value.length); break; @@ -472,18 +563,21 @@ function SaveToArr(Arr, Obj) { } }; -function LoadFromArr(Arr, Obj) { - if (!Arr.length) +function LoadFromArr(Arr,Obj) +{ + if(!Arr.length) return false; var Count = Arr[0]; Arr.len = 1; - for (var key in Obj) { - if (!Count) + for(var key in Obj) + { + if(!Count) break; Count--; var Type = Arr[Arr.len]; Arr.len++; - switch (Type) { + switch(Type) + { case 241: Obj[key] = ReadUintFromArr(Arr); break; @@ -491,168 +585,200 @@ function LoadFromArr(Arr, Obj) { Obj[key] = ReadStr(Arr); break; default: - if (Type <= 240) { + if(Type <= 240) + { var length = Type; Obj[key] = ReadArr(Arr, length); break; } - else { + else + { Obj[key] = undefined; } } } - if (Arr[0]) + if(Arr[0]) return true; else return false; }; -var entityMap = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/', "\n": '
', " ": ' ', }; +var entityMap = {"&":"&", "<":"<", ">":">", '"':'"', "'":''', "/":'/', "\n":'
', " ":' ', }; -function escapeHtml(string) { +function escapeHtml(string) +{ string = string.replace(/\\n/g, "\n"); string = string.replace(/\\"/g, "\""); - return String(string).replace(/[\s\n&<>"'\/]/g, function(s) { + return String(string).replace(/[\s\n&<>"'\/]/g, function (s) + { return entityMap[s]; }); }; -function InsertAfter(elem, refElem) { +function InsertAfter(elem,refElem) +{ var parent = refElem.parentNode; var next = refElem.nextSibling; - if (next) { + if(next) + { return parent.insertBefore(elem, next); } - else { + else + { return parent.appendChild(elem); } }; -function MoveUp(elem) { +function MoveUp(elem) +{ var parent = elem.parentNode; - for (var i = 0; i < parent.children.length; i++) { + for(var i = 0; i < parent.children.length; i++) + { var item = parent.children[i]; - if (item.id && item.id !== undefined) { + if(item.id && item.id !== undefined) + { return parent.insertBefore(elem, item); } } }; -function ViewGrid(APIName, Params, nameid, bClear, TotalSum) { - GetData(APIName, Params, function(Data) { - if (!Data || !Data.result) - return; +function ViewGrid(APIName,Params,nameid,bClear,TotalSum) +{ + GetData(APIName, Params, function (Data) + { + if(!Data || !Data.result) + return ; SetGridData(Data.arr, nameid, TotalSum, bClear); }); }; -function CheckNewSearch(Def) { +function CheckNewSearch(Def) +{ var Str = $(Def.FilterName).value; - if (Str) { + if(Str) + { $(Def.NumName).value = "0"; } }; -function ViewCurrent(Def, flag, This) { - if (Def.BlockName) { +function ViewCurrent(Def,flag,This) +{ + if(Def.BlockName) + { var element = $(Def.BlockName); - if (flag) { + if(flag) + { var bVisible = IsVisibleBlock(Def.BlockName); - if (!bVisible) + if(!bVisible) MoveUp(element); SetVisibleBlock(Def.BlockName, !bVisible); } - else { + else + { SetVisibleBlock(Def.BlockName, true); } var ResVisible = IsVisibleBlock(Def.BlockName); - if (This && This.className) { + if(This && This.className) + { This.className = This.className.replace("btpress", ""); - if (ResVisible) + if(ResVisible) This.className += " btpress"; } - if (!ResVisible) - return; + if(!ResVisible) + return ; } var item = $(Def.NumName); var Filter = "", Filter2 = ""; - if (Def.FilterName) { + if(Def.FilterName) + { Filter = $(Def.FilterName).value; } - if (Def.FilterName2) { + if(Def.FilterName2) + { Filter2 = $(Def.FilterName2).value; } - if (!Def.Param3) + if(!Def.Param3) Def.Param3 = ""; - ViewGrid(Def.APIName, { - StartNum: ParseNum(item.value), CountNum: GetCountViewRows(Def), Param3: Def.Param3, Filter: Filter, Filter2: Filter2, + ViewGrid(Def.APIName, {StartNum:ParseNum(item.value), CountNum:GetCountViewRows(Def), Param3:Def.Param3, Filter:Filter, Filter2:Filter2, }, Def.TabName, 1, Def.TotalSum); SaveValues(); - if (This) + if(This) SetImg(This, Def.BlockName); }; -function ViewPrev(Def) { +function ViewPrev(Def) +{ var item = document.getElementById(Def.NumName); var Num = ParseNum(item.value); Num -= GetCountViewRows(Def); - if (Num < 0) + if(Num < 0) Num = 0; item.value = Num; ViewCurrent(Def); }; -function ViewNext(Def, MaxNum) { +function ViewNext(Def,MaxNum) +{ var item = document.getElementById(Def.NumName); var Num = ParseNum(item.value); Num += GetCountViewRows(Def); - if (Def.FilterName) { - if (document.getElementById(Def.FilterName).value) { + if(Def.FilterName) + { + if(document.getElementById(Def.FilterName).value) + { Num = document.getElementById(Def.TabName).MaxNum + 1; } } - if (Num < MaxNum) { + if(Num < MaxNum) + { item.value = Num; } - else { + else + { item.value = MaxNum - MaxNum % GetCountViewRows(Def); } ViewCurrent(Def); }; -function ViewBegin(Def) { +function ViewBegin(Def) +{ document.getElementById(Def.NumName).value = 0; ViewCurrent(Def); }; -function ViewEnd(Def, MaxNum, bInitOnly) { +function ViewEnd(Def,MaxNum,bInitOnly) +{ document.getElementById(Def.NumName).value = MaxNum - MaxNum % GetCountViewRows(Def); - if (bInitOnly) - return; + if(bInitOnly) + return ; ViewCurrent(Def); }; -function GetCountViewRows(Def) { - if (Def.CountViewRows) +function GetCountViewRows(Def) +{ + if(Def.CountViewRows) return Def.CountViewRows; else return CountViewRows; }; -function DoStableScroll() { +function DoStableScroll() +{ var item = $("idStableScroll"); - if (!item) - return; + if(!item) + return ; var scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, - document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); + document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); var itemlHeight = Math.max(item.scrollHeight, item.offsetHeight, item.clientHeight); scrollHeight = scrollHeight - itemlHeight; item.style.top = "" + scrollHeight + "px"; }; var glEvalMap = {}; -function CreateEval(formula, StrParams) { +function CreateEval(formula,StrParams) +{ var Ret = glEvalMap[formula]; - if (!Ret) { + if(!Ret) + { eval("function M(" + StrParams + "){return " + formula + "}; Ret=M;"); glEvalMap[formula] = Ret; } @@ -661,42 +787,48 @@ function CreateEval(formula, StrParams) { var glWorkNum = 0; var CUR_ROW; -function SetGridData(arr, id_name, TotalSum, bclear, revert) { +function SetGridData(arr,id_name,TotalSum,bclear,revert) +{ var htmlTable = document.getElementById(id_name); - if (!htmlTable) { + if(!htmlTable) + { console.log("Error id_name: " + id_name); - return; + return ; } - if (bclear) + if(bclear) ClearTable(htmlTable); - if (!htmlTable.ItemsMap) { + if(!htmlTable.ItemsMap) + { htmlTable.ItemsMap = {}; htmlTable.RowCount = 0; } var map = htmlTable.ItemsMap; glWorkNum++; - var ValueTotal = { SumCOIN: 0, SumCENT: 0 }; + var ValueTotal = {SumCOIN:0, SumCENT:0}; var row0 = htmlTable.rows[0]; var row0cells = row0.cells; var colcount = row0cells.length; - for (var i = 0; arr && i < arr.length; i++) { + for(var i = 0; arr && i < arr.length; i++) + { var Item = arr[i]; var ID = Item.Num; htmlTable.MaxNum = Item.Num; var row = map[ID]; - if (!row) { + if(!row) + { htmlTable.RowCount++; - if (revert) + if(revert) row = htmlTable.insertRow(1); else - row = htmlTable.insertRow(- 1); + row = htmlTable.insertRow( - 1); map[ID] = row; - for (var n = 0; n < colcount; n++) { + for(var n = 0; n < colcount; n++) + { var cell0 = row0cells[n]; - if (cell0.innerText == "") + if(cell0.innerText == "") continue; cell0.F = CreateEval(cell0.id, "Item"); - if (cell0.id.substr(0, 1) === "(") + if(cell0.id.substr(0, 1) === "(") cell0.H = 1; var cell = row.insertCell(n); cell.className = cell0.className; @@ -704,38 +836,45 @@ function SetGridData(arr, id_name, TotalSum, bclear, revert) { } row.Work = glWorkNum; CUR_ROW = row; - for (var n = 0; n < colcount; n++) { + for(var n = 0; n < colcount; n++) + { var cell = row.cells[n]; - if (!cell) + if(!cell) continue; var cell0 = row0cells[n]; - if (cell0.H) { + if(cell0.H) + { var text = "" + cell0.F(Item); text = toStaticHTML(text.trim()); - if (cell.innerHTML !== text) + if(cell.innerHTML !== text) cell.innerHTML = text; } - else { + else + { var text = "" + cell0.F(Item); text.trim(); - if (cell.innerText !== text) + if(cell.innerText !== text) cell.innerText = text; } } - if (TotalSum && Item.Currency === 0) + if(TotalSum && Item.Currency === 0) ADD(ValueTotal, Item.Value); } - for (var key in map) { + for(var key in map) + { var row = map[key]; - if (row.Work !== glWorkNum) { + if(row.Work !== glWorkNum) + { htmlTable.deleteRow(row.rowIndex); delete map[key]; } } - if (TotalSum) { + if(TotalSum) + { var id = document.getElementById(TotalSum); - if (id) { - if (!ISZERO(ValueTotal)) + if(id) + { + if(!ISZERO(ValueTotal)) id.innerText = "Total on page: " + SUM_TO_STRING(ValueTotal, 0, 0, 1); else id.innerText = ""; @@ -744,19 +883,24 @@ function SetGridData(arr, id_name, TotalSum, bclear, revert) { DoStableScroll(); }; -function ClearTable(htmlTable) { - for (var i = htmlTable.rows.length - 1; i > 0; i--) +function ClearTable(htmlTable) +{ + for(var i = htmlTable.rows.length - 1; i > 0; i--) htmlTable.deleteRow(i); htmlTable.ItemsMap = {}; htmlTable.RowCount = 0; }; -function RetOpenBlock(BlockNum, bTrDataLen) { - if (BlockNum && bTrDataLen) { - if (bTrDataLen === 2) { +function RetOpenBlock(BlockNum,bTrDataLen) +{ + if(BlockNum && bTrDataLen) + { + if(bTrDataLen === 2) + { return '' + BlockNum + ''; } - else { + else + { return ''; } } @@ -764,45 +908,55 @@ function RetOpenBlock(BlockNum, bTrDataLen) { return '' + BlockNum + ''; }; -function RetBool(Value) { - if (Value) +function RetBool(Value) +{ + if(Value) return "✔"; else return ""; }; -function RetNumDapp(Item) { +function RetNumDapp(Item) +{ return Item.Num; }; -function RetIconPath(Item, bCurrency) { - if (bCurrency && MapCurrencyIcon[Item.Num]) { +function RetIconPath(Item,bCurrency) +{ + if(bCurrency && MapCurrencyIcon[Item.Num]) + { return MapCurrencyIcon[Item.Num]; } var StrPath = ""; - if (MainServer) { + if(MainServer) + { StrPath = GetProtocolServerPath(MainServer); } - if (Item.IconBlockNum) { + if(Item.IconBlockNum) + { return StrPath + '/file/' + Item.IconBlockNum + '/' + Item.IconTrNum; } else - return StrPath + "/PIC/blank.svg"; + return StrPath + "./PIC/blank.svg"; }; -function RetIconDapp(Item) { - if (Item.IconBlockNum) { +function RetIconDapp(Item) +{ + if(Item.IconBlockNum) + { return ' '; } else return ""; }; -function RetOpenDapps(Item, bNum, AccountNum) { +function RetOpenDapps(Item,bNum,AccountNum) +{ var Name = escapeHtml(Item.Name); - if (bNum) + if(bNum) Name = "" + Item.Num + "." + Name; - if (Item.HTMLLength > 0) { + if(Item.HTMLLength > 0) + { var StrText = RetIconDapp(Item) + Name; return ''; } @@ -810,30 +964,37 @@ function RetOpenDapps(Item, bNum, AccountNum) { return RetIconDapp(Item) + Name; }; -function RetDirect(Value) { - if (Value === "-") { +function RetDirect(Value) +{ + if(Value === "-") + { return "-"; } else - if (Value === "+") { + if(Value === "+") + { return "+"; } else return ""; }; -function RetCategory(Item) { +function RetCategory(Item) +{ var Str = ""; var Num = 0; - if (Item.Category1 && MapCategory[Item.Category1]) { + if(Item.Category1 && MapCategory[Item.Category1]) + { Num++; Str += "" + Num + "." + MapCategory[Item.Category1] + "
"; } - if (Item.Category2 && MapCategory[Item.Category2]) { + if(Item.Category2 && MapCategory[Item.Category2]) + { Num++; Str += "" + Num + "." + MapCategory[Item.Category2] + "
"; } - if (Item.Category3 && MapCategory[Item.Category3]) { + if(Item.Category3 && MapCategory[Item.Category3]) + { Num++; Str += "" + Num + "." + MapCategory[Item.Category3] + "
"; } @@ -841,49 +1002,64 @@ function RetCategory(Item) { return Str; }; -function RetChangeSmart(Item) { +function RetChangeSmart(Item) +{ var Name = ""; var State = ""; var bOpen = 0; - if (Item.SmartObj) { - if (Item.SmartObj.HTMLLength) { + if(Item.SmartObj) + { + if(Item.SmartObj.HTMLLength) + { Name = RetOpenDapps(Item.SmartObj, 1, Item.Num); bOpen = 1; } else Name = "" + Item.SmartObj.Num + "." + escapeHtml(Item.SmartObj.Name) + "
"; - if (window.DEBUG_WALLET) + if(window.DEBUG_WALLET) State = "
State:" + JSON.stringify(Item.SmartState); } var Height = 20; - if (bOpen) + if(bOpen) Height = 40; return '
' + Name + '' + State + '
'; }; -function RetHistoryAccount(Item, Name) { +function RetHistoryAccount(Item,Name) +{ var Num; - if (Name) + if(Name) Num = Item[Name]; else Num = Item.Num; - if (Num < 1) + if(Num < 1) return "" + Num; - return "" + Num + ""; + var Str; + if(IsLocalClient()) + Str = "" + Num + ""; + else + Str = "" + Num + ""; + return Str; }; -function RetBaseAccount(Item) { +function RetBaseAccount(Item) +{ var Str = RetHistoryAccount(Item, "Account"); - if (Item.AccountLength > 1) + if(Item.AccountLength > 1) Str += "-" + (Item.Account + Item.AccountLength - 1); return Str; }; -function ViewTransaction(BlockNum) { - window.Open('./blockviewer.html#' + BlockNum, 'viewer', 800, 800); +function ViewTransaction(BlockNum) +{ + if(IsLocalClient()) + OpenBlockViewerPage(BlockNum); + else + window.Open('./blockviewer.html#' + BlockNum, 'viewer', 800, 800); }; -function formatDate(now) { +function formatDate(now) +{ var year = now.getFullYear(); var month = now.getMonth() + 1; var date = now.getDate(); @@ -891,108 +1067,129 @@ function formatDate(now) { var minute = now.getMinutes(); var second = now.getSeconds(); return year + "-" + String(month).padStart(2, "0") + "-" + String(date).padStart(2, "0") + " " + String(hour).padStart(2, - "0") + ":" + String(minute).padStart(2, "0") + ":" + String(second).padStart(2, "0"); + "0") + ":" + String(minute).padStart(2, "0") + ":" + String(second).padStart(2, "0"); }; -function DateFromBlock(BlockNum) { +function DateFromBlock(BlockNum) +{ var Str; - if (window.FIRST_TIME_BLOCK) { + if(window.FIRST_TIME_BLOCK) + { var now = new Date(window.FIRST_TIME_BLOCK + BlockNum * 1000); Str = formatDate(now); } - else { + else + { Str = ""; } return Str; }; -function SetCheckPoint(BlockNum) { - if (!BlockNum) { +function SetCheckPoint(BlockNum) +{ + if(!BlockNum) + { SetError("Not set BlockNum"); - return; + return ; } - GetData("SetCheckPoint", BlockNum, function(Data) { - if (Data) { + GetData("SetCheckPoint", BlockNum, function (Data) + { + if(Data) + { SetStatus(Data.text, !Data.result); } }); }; -function AddDiagramToArr(Arr, Item) { +function AddDiagramToArr(Arr,Item) +{ var bWas = 0; - for (var i = 0; i < Arr.length; i++) { - if (Arr[i].name === Item.name) { + for(var i = 0; i < Arr.length; i++) + { + if(Arr[i].name === Item.name) + { Item.Delete = 0; Arr[i] = Item; bWas = 1; break; } } - if (!bWas) { + if(!bWas) + { Item.num = Arr.length; Arr.push(Item); } }; -function SetVisibleBlock(name, bSet) { +function SetVisibleBlock(name,bSet) +{ var Item = document.getElementById(name); - if (!Item) - return; - if (bSet && typeof bSet === "string") + if(!Item) + return ; + if(bSet && typeof bSet === "string") Item.style.display = bSet; else - if (bSet) { + if(bSet) + { Item.style.display = 'block'; DoStableScroll(); } - else { + else + { Item.style.display = 'none'; } return Item; }; -function IsVisibleBlock(name) { +function IsVisibleBlock(name) +{ var Item = document.getElementById(name); - if (Item && (Item.style.display === 'block' || Item.style.display === "table-row")) + if(Item && (Item.style.display === 'block' || Item.style.display === "table-row")) return true; else return false; }; -function SetVisibleClass(Arr, Visible) { - if (typeof Arr === "string") +function SetVisibleClass(Arr,Visible) +{ + if(typeof Arr === "string") Arr = [Arr]; - for (var i = 0; i < Arr.length; i++) { + for(var i = 0; i < Arr.length; i++) + { var item = document.querySelector(Arr[i]); - if (!item) { + if(!item) + { ToLog("Error class name: " + Arr[i]); continue; } - if (!Visible) + if(!Visible) item.classList.add("hidden"); else item.classList.remove("hidden"); } }; -function IsVisibleClass(name) { +function IsVisibleClass(name) +{ var List = document.querySelector(name); - if (List.className.indexOf(" hidden") >= 0) + if(List.className.indexOf(" hidden") >= 0) return 0; else return 1; }; -function LoadValuesByArr(Arr, DopStr) { - if (!DopStr) +function LoadValuesByArr(Arr,DopStr) +{ + if(!DopStr) DopStr = ""; - if (Storage.getItem("VerSave") !== "3") + if(Storage.getItem("VerSave") !== "3") return 0; - for (var i = 0; i < Arr.length; i++) { + for(var i = 0; i < Arr.length; i++) + { var name = Arr[i]; var Item = document.getElementById(name); var name2 = DopStr + name; - if (Item.type === "checkbox") + if(Item.type === "checkbox") Item.checked = parseInt(Storage.getItem(name2)); else Item.value = Storage.getItem(name2); @@ -1000,15 +1197,17 @@ function LoadValuesByArr(Arr, DopStr) { return 1; }; -function SaveValuesByArr(Arr, DopStr) { - if (!DopStr) +function SaveValuesByArr(Arr,DopStr) +{ + if(!DopStr) DopStr = ""; Storage.setItem("VerSave", "3"); - for (var i = 0; i < Arr.length; i++) { + for(var i = 0; i < Arr.length; i++) + { var name = Arr[i]; var name2 = DopStr + name; var Item = $(name); - if (Item.type === "checkbox") + if(Item.type === "checkbox") window.Storage.setItem(name2, 0 + Item.checked); else window.Storage.setItem(name2, Item.value); @@ -1069,17 +1268,20 @@ MapCategory[44] = "Governance"; MapCategory[45] = "Property"; MapCategory[46] = "Insurance"; -function GetTokenName(Num, Name) { - if (!Name) +function GetTokenName(Num,Name) +{ + if(!Name) Name = "Token"; return "(" + Num + "." + Name + ")"; return "{" + Num + "." + Name + "}"; }; -function CurrencyNameItem(Item) { +function CurrencyNameItem(Item) +{ var Name = MapCurrency[Item.Currency]; - if (!Name) { - if (Item.CurrencyObj) + if(!Name) + { + if(Item.CurrencyObj) Name = GetTokenName(Item.Currency, Item.CurrencyObj.ShortName); else Name = GetTokenName(Item.Currency, ""); @@ -1088,11 +1290,15 @@ function CurrencyNameItem(Item) { return Name; }; -function CurrencyName(Num) { +function CurrencyName(Num) +{ var Name = MapCurrency[Num]; - if (!Name) { - GetData("GetDappList", { StartNum: Num, CountNum: 1 }, function(Data) { - if (Data && Data.result) { + if(!Name) + { + GetData("GetDappList", {StartNum:Num, CountNum:1}, function (Data) + { + if(Data && Data.result) + { var Smart = Data.arr[0]; Name = GetTokenName(Smart.Num, Smart.ShortName); MapCurrency[Smart.Num] = Name; @@ -1103,130 +1309,154 @@ function CurrencyName(Num) { return Name; }; -function FillCurrencyAsync(IdName, StartNum) { - if (!StartNum) +function FillCurrencyAsync(IdName,StartNum) +{ + if(!StartNum) StartNum = 8; var MaxCountViewRows = 10; - GetData("DappSmartList", { StartNum: StartNum, CountNum: MaxCountViewRows, TokenGenerate: 1 }, function(Data) { - if (Data && Data.result && Data.arr) { + GetData("DappSmartList", {StartNum:StartNum, CountNum:MaxCountViewRows, TokenGenerate:1}, function (Data) + { + if(Data && Data.result && Data.arr) + { var MaxNum = 0; - for (var i = 0; i < Data.arr.length; i++) { + for(var i = 0; i < Data.arr.length; i++) + { var Smart = Data.arr[i]; - if (!MapCurrency[Smart.Num]) { + if(!MapCurrency[Smart.Num]) + { Name = GetTokenName(Smart.Num, Smart.ShortName); MapCurrency[Smart.Num] = Name; } - if (Smart.Num > MaxNum) + if(Smart.Num > MaxNum) MaxNum = Smart.Num; } FillSelect(IdName, MapCurrency, 1); - if (Data.arr.length === MaxCountViewRows && MaxNum) { - SetStatus("Cet currency in next iteration: " + (MaxNum + 1)); + if(Data.arr.length === MaxCountViewRows && MaxNum) + { FillCurrencyAsync(IdName, MaxNum + 1); } } }); }; -function FillSelect(IdName, arr, bNatural) { +function FillSelect(IdName,arr,bNatural) +{ var Select = $(IdName); var Value = Select.value; var Options = Select.options; var strJSON = JSON.stringify(arr); - if (Select.strJSON === strJSON) - return; + if(Select.strJSON === strJSON) + return ; Select.strJSON = strJSON; var Value = Select.value; - if (bNatural) { + if(bNatural) + { Options.length = 0; - for (var key in arr) { + for(var key in arr) + { var name; - if (bNatural === "KEY") + if(bNatural === "KEY") name = key; else name = arr[key]; Options[Options.length] = new Option(name, key); - if (key == Value) + if(key == Value) Select.value = key; } } - else { + else + { Options.length = 0; - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { var item = arr[i]; Options[Options.length] = new Option(item.text, item.value); - if (item.value == Value) + if(item.value == Value) Select.value = item.value; } - if (!arr.length) - for (var key in arr) { + if(!arr.length) + for(var key in arr) + { var item = arr[key]; Options[Options.length] = new Option(item.text, item.value); - if (item.value == Value) + if(item.value == Value) Select.value = item.value; } } }; -function GetArrFromSelect(IdName) { +function GetArrFromSelect(IdName) +{ var Select = $(IdName); var Options = Select.options; var arr = []; - for (var i = 0; i < Options.length; i++) { + for(var i = 0; i < Options.length; i++) + { var item = Options[i]; - arr.push({ text: item.text, value: item.value }); + arr.push({text:item.text, value:item.value}); } return arr; }; -function FillCategory(IdName) { +function FillCategory(IdName) +{ var arr = []; - for (var key in MapCategory) { - arr.push({ sort: MapCategory[key].toUpperCase(), text: MapCategory[key], value: key }); + for(var key in MapCategory) + { + arr.push({sort:MapCategory[key].toUpperCase(), text:MapCategory[key], value:key}); } FillCategoryAndSort(IdName, arr); }; -function FillCategoryAndSort(IdName, arr) { - arr.sort(function(a, b) { - if (a.sort < b.sort) - return - 1; - if (a.sort > b.sort) +function FillCategoryAndSort(IdName,arr) +{ + arr.sort(function (a,b) + { + if(a.sort < b.sort) + return - 1; + if(a.sort > b.sort) return 1; return 0; }); FillSelect(IdName, arr); }; -function AddToInvoiceList(Item) { +function AddToInvoiceList(Item) +{ var arr; var Str = Storage.getItem("InvoiceList"); - if (Str) { + if(Str) + { arr = JSON.parse(Str); } - else { + else + { arr = []; } arr.unshift(Item); Storage.setItem("InvoiceList", JSON.stringify(arr)); }; -function OpenDapps(Num, AccountNum) { - if (!Num) - return; +function OpenDapps(Num,AccountNum) +{ + if(!Num) + return ; var StrPath = '/dapp/' + Num; - if (IsLocalClient()) { + if(IsLocalClient()) + { StrPath = "./dapp-frame.html?dapp=" + Num; } - if (AccountNum) + if(AccountNum) StrPath += '#' + AccountNum; window.Open(StrPath, 'dapp', 1200); }; -function ParseFileName(Str) { - var Ret = { BlockNum: 0, TrNum: 0 }; +function ParseFileName(Str) +{ + var Ret = {BlockNum:0, TrNum:0}; var index1 = Str.indexOf("file/"); - if (index1) { + if(index1) + { var index2 = Str.indexOf("/", index1 + 6); Ret.BlockNum = parseInt(Str.substr(index1 + 5, index2 - index1 - 5)); Ret.TrNum = parseInt(Str.substr(index2 + 1)); @@ -1235,54 +1465,65 @@ function ParseFileName(Str) { }; window.MapSendTransaction = {}; -function SendTransaction(Body, TR, SumPow, F) { - if (Body.length > 16000) { - if (window.SetStatus) +function SendTransaction(Body,TR,SumPow,F) +{ + if(Body.length > 16000) + { + if(window.SetStatus) SetStatus("Error length transaction =" + Body.length + " (max size=16000)"); - if (F) + if(F) F(1, TR, Body); - return; + return ; } - if (window.SetStatus) + if(window.SetStatus) SetStatus("Prepare to sending..."); CreateNonceAndSend(1, 0, 0); - - function CreateNonceAndSend(bCreateNonce, startnonce, NumNext) { - if (!NumNext) + +function CreateNonceAndSend(bCreateNonce,startnonce,NumNext) + { + if(!NumNext) NumNext = 0; var nonce = startnonce; - if (bCreateNonce) + if(bCreateNonce) nonce = CreateHashBodyPOWInnerMinPower(Body, SumPow, startnonce); var StrHex = GetHexFromArr(Body); - if (NumNext > 10) { + if(NumNext > 10) + { SetError("Not sending. Cannt calc pow."); - return; + return ; } - GetData("SendTransactionHex", { Hex: StrHex }, function(Data) { - if (Data) { + GetData("SendTransactionHex", {Hex:StrHex}, function (Data) + { + if(Data) + { var key = GetHexFromArr(sha3(Body)); - if (window.SetStatus) + if(window.SetStatus) SetStatus("Send '" + key.substr(0, 16) + "' result:" + Data.text); - if (Data.text === "Not add") { + if(Data.text === "Not add") + { CreateNonceAndSend(1, nonce + 1, NumNext + 1); } else - if (Data.text === "Bad time") { - if (window.DELTA_FOR_TIME_TX < 6) { + if(Data.text === "Bad time") + { + if(window.DELTA_FOR_TIME_TX < 6) + { window.DELTA_FOR_TIME_TX++; console.log("New set Delta time: " + window.DELTA_FOR_TIME_TX); CreateNonceAndSend(1, 0, NumNext + 1); } } - else { + else + { var key = GetHexFromArr(sha3(Body)); MapSendTransaction[key] = TR; - if (F) + if(F) F(0, TR, Body); } } - else { - if (window.SetStatus) + else + { + if(window.SetStatus) SetStatus("Error Data"); } }); @@ -1290,40 +1531,51 @@ function SendTransaction(Body, TR, SumPow, F) { }; var MapSendID = {}; -function SendCallMethod(Account, MethodName, Params, FromNum, FromSmartNum) { - var TR = { Type: 135 }; +function SendCallMethod(Account,MethodName,Params,FromNum,FromSmartNum) +{ + var TR = {Type:135}; var Body = [TR.Type]; WriteUint(Body, Account); WriteStr(Body, MethodName); WriteStr(Body, JSON.stringify(Params)); WriteUint(Body, FromNum); - if (FromNum) { - GetData("GetAccount", Account, function(Data) { - if (!Data || Data.result !== 1 || !Data.Item) { + if(FromNum) + { + GetData("GetAccount", Account, function (Data) + { + if(!Data || Data.result !== 1 || !Data.Item) + { SetStatus("Error account number: " + Account); - return; + return ; } - if (Data.Item.Value.Smart !== FromSmartNum) { + if(Data.Item.Value.Smart !== FromSmartNum) + { SetStatus("Error - The account:" + Account + " does not belong to a smart contract:" + FromSmartNum + " (have: " + Data.Item.Value.Smart + ")"); - return; + return ; } - GetData("GetAccount", FromNum, function(Data) { - if (!Data || Data.result !== 1 || !Data.Item) { + GetData("GetAccount", FromNum, function (Data) + { + if(!Data || Data.result !== 1 || !Data.Item) + { SetStatus("Error account number: " + FromNum); - return; + return ; } - if (Data.Item.Num != FromNum) { + if(Data.Item.Num != FromNum) + { SetStatus("Error read from account number: " + FromNum + " read data=" + Data.Item.Num); - return; + return ; } var OperationID; - if (!MapSendID[FromNum]) { + if(!MapSendID[FromNum]) + { OperationID = Data.Item.Value.OperationID + 10; MapSendID[FromNum] = {}; } - else { + else + { OperationID = MapSendID[FromNum].OperationID; - if ((new Date() - MapSendID[FromNum].Date) > 8 * 1000) { + if((new Date() - MapSendID[FromNum].Date) > 8 * 1000) + { OperationID += 20; } } @@ -1337,7 +1589,8 @@ function SendCallMethod(Account, MethodName, Params, FromNum, FromSmartNum) { }); }); } - else { + else + { WriteUint(Body, 0); Body.length += 10; Body.length += 64; @@ -1346,18 +1599,23 @@ function SendCallMethod(Account, MethodName, Params, FromNum, FromSmartNum) { } }; -function SendTrArrayWithSign(Body, Account, TR) { - if (MainServer || CanClientSign()) { +function SendTrArrayWithSign(Body,Account,TR) +{ + if(MainServer || CanClientSign()) + { var Sign = GetSignFromArr(Body); var Arr = GetArrFromHex(Sign); WriteArr(Body, Arr, 64); Body.length += 12; SendTransaction(Body, TR); } - else { + else + { var StrHex = GetHexFromArr(Body); - GetData("GetSignFromHEX", { Hex: StrHex, Account: Account }, function(Data) { - if (Data && Data.result) { + GetData("GetSignFromHEX", {Hex:StrHex, Account:Account}, function (Data) + { + if(Data && Data.result) + { var Arr = GetArrFromHex(Data.Sign); WriteArr(Body, Arr, 64); Body.length += 12; @@ -1367,12 +1625,14 @@ function SendTrArrayWithSign(Body, Account, TR) { } }; -function GetTrCreateAcc(Currency, PubKey, Description, Adviser, Smart) { - var TR = { Type: TYPE_TRANSACTION_CREATE, Currency: Currency, PubKey: PubKey, Name: Description, Adviser: Adviser, Smart: Smart, }; +function GetTrCreateAcc(Currency,PubKey,Description,Adviser,Smart) +{ + var TR = {Type:TYPE_TRANSACTION_CREATE, Currency:Currency, PubKey:PubKey, Name:Description, Adviser:Adviser, Smart:Smart, }; return TR; }; -function GetBodyCreateAcc(TR) { +function GetBodyCreateAcc(TR) +{ var Body = []; WriteByte(Body, TR.Type); WriteUint(Body, TR.Currency); @@ -1385,7 +1645,8 @@ function GetBodyCreateAcc(TR) { return Body; }; -function GetArrFromTR(TR) { +function GetArrFromTR(TR) +{ MaxBlockNum = GetCurrentBlockNumByTime(); var Body = []; WriteByte(Body, TR.Type); @@ -1393,23 +1654,27 @@ function GetArrFromTR(TR) { WriteUint(Body, 0); WriteUint(Body, TR.FromID); WriteUint32(Body, TR.To.length); - for (var i = 0; i < TR.To.length; i++) { + for(var i = 0; i < TR.To.length; i++) + { var Item = TR.To[i]; - if (TR.Version >= 3) + if(TR.Version >= 3) WriteTr(Body, Item.PubKey); WriteUint(Body, Item.ID); WriteUint(Body, Item.SumCOIN); WriteUint32(Body, Item.SumCENT); - if (MapAccounts && MapAccounts[Item.ID]) + if(MapAccounts && MapAccounts[Item.ID]) MapAccounts[Item.ID].MustUpdate = MaxBlockNum + 10; } WriteStr(Body, TR.Description); WriteUint(Body, TR.OperationID); - if (TR.Version >= 3) { - if (TR.Body) { + if(TR.Version >= 3) + { + if(TR.Body) + { WriteTr(Body, TR.Body); } - else { + else + { WriteByte(Body, 0); WriteByte(Body, 0); } @@ -1417,23 +1682,30 @@ function GetArrFromTR(TR) { return Body; }; -function GetSignTransaction(TR, StrPrivKey, F) { - if (window.SignLib) { - if (TR.Version === 3) { +function GetSignTransaction(TR,StrPrivKey,F) +{ + if(window.SignLib) + { + if(TR.Version === 3) + { var Arr = []; var GetCount = 0; - for (var i = 0; i < TR.To.length; i++) { + for(var i = 0; i < TR.To.length; i++) + { var Item = TR.To[i]; - GetData("GetAccountList", { StartNum: Item.ID }, function(Data) { - if (Data && Data.result === 1 && Data.arr.length) { + GetData("GetAccountList", {StartNum:Item.ID}, function (Data) + { + if(Data && Data.result === 1 && Data.arr.length) + { GetCount++; var DataItem = Data.arr[0]; var DataPubArr = DataItem.PubKey.data; - for (var j = 0; j < 33; j++) + for(var j = 0; j < 33; j++) Arr[Arr.length] = DataPubArr[j]; - if (GetCount === TR.To.length) { + if(GetCount === TR.To.length) + { var Body = GetArrFromTR(TR); - for (var j = 0; j < Body.length; j++) + for(var j = 0; j < Body.length; j++) Arr[Arr.length] = Body[j]; TR.Sign = GetArrFromHex(GetSignFromArr(Arr, StrPrivKey)); F(TR); @@ -1442,14 +1714,18 @@ function GetSignTransaction(TR, StrPrivKey, F) { }); } } - else { + else + { TR.Sign = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; F(TR); } } - else { - GetData("GetSignTransaction", TR, function(Data) { - if (Data && Data.result === 1) { + else + { + GetData("GetSignTransaction", TR, function (Data) + { + if(Data && Data.result === 1) + { TR.Sign = GetArrFromHex(Data.Sign); F(TR); } @@ -1457,74 +1733,87 @@ function GetSignTransaction(TR, StrPrivKey, F) { } }; -function GetSignFromArr(Arr, StrPrivKey) { - if (!StrPrivKey) +function GetSignFromArr(Arr,StrPrivKey) +{ + if(!StrPrivKey) StrPrivKey = GetPrivKey(); - if (!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) + if(!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) return "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; var PrivKey = GetArrFromHex(StrPrivKey); var sigObj = SignLib.sign(SHA3BUF(Arr), Buffer.from(PrivKey), null, null); return GetHexFromArr(sigObj.signature); }; -function IsHexStr(Str) { - if (!Str) +function IsHexStr(Str) +{ + if(!Str) return false; var arr = GetArrFromHex(Str); var Str2 = GetHexFromArr(arr); - if (Str2 === Str.toUpperCase()) + if(Str2 === Str.toUpperCase()) return true; else return false; }; -function RetJSON(Item) { +function RetJSON(Item) +{ return JSON.stringify(Item); }; -Number.prototype.toStringF = function() { +Number.prototype.toStringF = function () +{ var data = String(this).split(/[eE]/); - if (data.length == 1) + if(data.length == 1) return data[0]; var z = '', sign = this < 0 ? '-' : '', str = data[0].replace('.', ''), mag = Number(data[1]) + 1; - if (mag < 0) { + if(mag < 0) + { z = sign + '0.'; - while (mag++) + while(mag++) z += '0'; return z + str.replace(/^\-/, ''); } mag -= str.length; - while (mag--) + while(mag--) z += '0'; return str + z; }; -function CanClientSign() { +function CanClientSign() +{ var StrPrivKey = GetPrivKey(); - if (!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) { + if(!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) + { return 0; } return 1; }; -function random(max) { +function random(max) +{ return Math.floor(Math.random() * max); }; -function ToLog(Str) { +function ToLog(Str) +{ console.log(Str); }; -function InitMainServer() { +function InitMainServer() +{ var Str = localStorage["MainServer"]; - if (Str && !localStorage["BIGWALLET"] && Str.substr(0, 1) === "{") { + if(Str && !localStorage["BIGWALLET"] && Str.substr(0, 1) === "{") + { MainServer = JSON.parse(Str); } }; -function IsZeroArr(arr) { - if (arr) - for (var i = 0; i < arr.length; i++) { - if (arr[i]) +function IsZeroArr(arr) +{ + if(arr) + for(var i = 0; i < arr.length; i++) + { + if(arr[i]) return false; } return true; @@ -1532,75 +1821,90 @@ function IsZeroArr(arr) { var WALLET_PASSWORD; var KeyPasswordMap = {}; -function InitWalletKeyName() { - if (!localStorage["WALLET_KEY"]) { +function InitWalletKeyName() +{ + if(!localStorage["WALLET_KEY"]) + { localStorage["WALLET_KEY"] = localStorage["idPrivKey"]; } - if (!localStorage["WALLET_PUB_KEY"]) { + if(!localStorage["WALLET_PUB_KEY"]) + { localStorage["WALLET_PUB_KEY"] = localStorage["idPubKey"]; } }; -function OpenWalletKey() { +function OpenWalletKey() +{ var Key = Storage.getItem(WALLET_KEY_NAME); - if (Key && Key.substr(0, 1) === "!" && WALLET_PASSWORD) { + if(Key && Key.substr(0, 1) === "!" && WALLET_PASSWORD) + { Key = Key.substr(1); var StrKey = WALLET_PASSWORD + "-" + Key; var RetKey = KeyPasswordMap[StrKey]; - if (!RetKey) { + if(!RetKey) + { var Hash = HashProtect(WALLET_PASSWORD); RetKey = GetHexFromArr(XORHash(GetArrFromHex(Key), Hash, 32)); KeyPasswordMap[StrKey] = RetKey; } } - else { + else + { RetKey = Key; } var PubKeyStr; - if (RetKey && IsHexStr(RetKey) && RetKey.length === 64) { + if(RetKey && IsHexStr(RetKey) && RetKey.length === 64) + { var PrivKey = GetArrFromHex(RetKey); PubKeyStr = GetHexFromArr(SignLib.publicKeyCreate(PrivKey, 1)); } - else { + else + { PubKeyStr = ""; } sessionStorage[WALLET_KEY_NAME] = RetKey; sessionStorage[WALLET_PUB_KEY_NAME] = PubKeyStr; - if (!WALLET_PASSWORD) + if(!WALLET_PASSWORD) Storage.setItem(WALLET_PUB_KEY_NAME, PubKeyStr); return RetKey; }; -function IsLockedWallet() { +function IsLockedWallet() +{ var Key = Storage.getItem(WALLET_KEY_NAME); - if (Key && Key.substr(0, 1) === "!") + if(Key && Key.substr(0, 1) === "!") return 1; else return 0; }; -function GetPrivKey() { +function GetPrivKey() +{ var Key = sessionStorage[WALLET_KEY_NAME]; - if (!Key) + if(!Key) Key = Storage.getItem(WALLET_KEY_NAME); return Key; }; -function GetPubKey() { +function GetPubKey() +{ var Key = sessionStorage[WALLET_PUB_KEY_NAME]; - if (!Key) + if(!Key) Key = Storage.getItem(WALLET_PUB_KEY_NAME); return Key; }; -function SetPrivKey(StrPrivKey) { +function SetPrivKey(StrPrivKey) +{ var Key; - if (WALLET_PASSWORD) { + if(WALLET_PASSWORD) + { var Hash = HashProtect(WALLET_PASSWORD); var KeyXOR = GetHexFromArr(XORHash(GetArrFromHex(StrPrivKey), Hash, 32)); Key = "!" + KeyXOR; } - else { + else + { Key = StrPrivKey; } var PrivKey = GetArrFromHex(StrPrivKey); @@ -1612,23 +1916,28 @@ function SetPrivKey(StrPrivKey) { sessionStorage[WALLET_PUB_KEY_NAME] = StrPubKey; }; -function SetWalletPassword(Str) { +function SetWalletPassword(Str) +{ WALLET_PASSWORD = Str; - if (localStorage["idPrivKey"]) + if(localStorage["idPrivKey"]) delete localStorage["idPrivKey"]; }; -function HashProtect(Str) { +function HashProtect(Str) +{ var arr = sha3(Str); - for (var i = 0; i < 30000; i++) { + for(var i = 0; i < 30000; i++) + { arr = sha3(arr); } return arr; }; -function XORHash(arr1, arr2, length) { +function XORHash(arr1,arr2,length) +{ var arr3 = []; - for (var i = 0; i < length; i++) { + for(var i = 0; i < length; i++) + { arr3[i] = arr1[i] ^ arr2[i]; } return arr3; diff --git a/src/HTML/JS/coinlib.js b/src/HTML/JS/coinlib.js index 84916aa..2479f46 100644 --- a/src/HTML/JS/coinlib.js +++ b/src/HTML/JS/coinlib.js @@ -11,82 +11,97 @@ var MAX_SUM_TER = 1e9; var MAX_SUM_CENT = 1e9; -function ADD(Coin, Value2) { +function ADD(Coin,Value2) +{ Coin.SumCOIN += Value2.SumCOIN; Coin.SumCENT += Value2.SumCENT; - if (Coin.SumCENT >= MAX_SUM_CENT) { + if(Coin.SumCENT >= MAX_SUM_CENT) + { Coin.SumCENT -= MAX_SUM_CENT; Coin.SumCOIN++; } return true; }; -function SUB(Coin, Value2) { +function SUB(Coin,Value2) +{ Coin.SumCOIN -= Value2.SumCOIN; - if (Coin.SumCENT >= Value2.SumCENT) { + if(Coin.SumCENT >= Value2.SumCENT) + { Coin.SumCENT -= Value2.SumCENT; } - else { + else + { Coin.SumCENT = MAX_SUM_CENT + Coin.SumCENT - Value2.SumCENT; Coin.SumCOIN--; } - if (Coin.SumCOIN < 0) { + if(Coin.SumCOIN < 0) + { return false; } return true; }; -function DIV(Coin, Value) { +function DIV(Coin,Value) +{ Coin.SumCOIN = Coin.SumCOIN / Value; Coin.SumCENT = Math.floor(Coin.SumCENT / Value); var SumCOIN = Math.floor(Coin.SumCOIN); var SumCENT = Math.floor((Coin.SumCOIN - SumCOIN) * MAX_SUM_CENT); Coin.SumCOIN = SumCOIN; Coin.SumCENT = Coin.SumCENT + SumCENT; - if (Coin.SumCENT >= MAX_SUM_CENT) { + if(Coin.SumCENT >= MAX_SUM_CENT) + { Coin.SumCENT -= MAX_SUM_CENT; Coin.SumCOIN++; } return true; }; -function FLOAT_FROM_COIN(Coin) { +function FLOAT_FROM_COIN(Coin) +{ var Sum = Coin.SumCOIN + Coin.SumCENT / MAX_SUM_CENT; return Sum; }; -function STRING_FROM_COIN(Coin) { +function STRING_FROM_COIN(Coin) +{ var Sum = FLOAT_FROM_COIN(Coin); - return Sum.toLocaleString(undefined, { useGrouping: true, style: 'decimal', maximumFractionDigits: 9 }); + return Sum.toLocaleString(undefined, {useGrouping:true, style:'decimal', maximumFractionDigits:9}); }; -function COIN_FROM_FLOAT(Sum) { +function COIN_FROM_FLOAT(Sum) +{ var SumCOIN = Math.floor(Sum); var SumCENT = Math.floor((Sum - SumCOIN) * MAX_SUM_CENT); - var Coin = { SumCOIN: SumCOIN, SumCENT: SumCENT }; + var Coin = {SumCOIN:SumCOIN, SumCENT:SumCENT}; return Coin; }; -function COIN_FROM_FLOAT2(Sum) { +function COIN_FROM_FLOAT2(Sum) +{ var SumCOIN = Math.floor(Sum); var SumCENT = Math.floor(Sum * MAX_SUM_CENT - SumCOIN * MAX_SUM_CENT); - var Coin = { SumCOIN: SumCOIN, SumCENT: SumCENT }; + var Coin = {SumCOIN:SumCOIN, SumCENT:SumCENT}; return Coin; }; -if (typeof window === "object") +if(typeof window === "object") window.COIN_FROM_FLOAT = COIN_FROM_FLOAT2; -function ISZERO(Coin) { - if (Coin.SumCOIN === 0 && Coin.SumCENT === 0) +function ISZERO(Coin) +{ + if(Coin.SumCOIN === 0 && Coin.SumCENT === 0) return true; else return false; }; -function COIN_FROM_STRING(Str) { +function COIN_FROM_STRING(Str) +{ throw "TODO: COIN_FROM_STRING"; }; -if (typeof global === "object") { +if(typeof global === "object") +{ global.ADD = ADD; global.SUB = SUB; global.DIV = DIV; diff --git a/src/HTML/JS/crypto-client.js b/src/HTML/JS/crypto-client.js index ddf87d1..7a467cb 100644 --- a/src/HTML/JS/crypto-client.js +++ b/src/HTML/JS/crypto-client.js @@ -11,9 +11,10 @@ var MAX_SUPER_VALUE_POW = (1 << 30) * 2; window.TYPE_TRANSACTION_CREATE = 100; -function GetHashWithValues(hash0, value1, value2, bNotCopy) { +function GetHashWithValues(hash0,value1,value2,bNotCopy) +{ var hash; - if (bNotCopy) + if(bNotCopy) hash = hash0; else hash = hash0.slice(); @@ -29,14 +30,20 @@ function GetHashWithValues(hash0, value1, value2, bNotCopy) { return arrhash; }; -function GetPowPower(arrhash) { +function GetPowPower(arrhash) +{ var SumBit = 0; - for (var i = 0; i < arrhash.length; i++) { + for(var i = 0; i < arrhash.length; i++) + { var byte = arrhash[i]; - for (var b = 7; b >= 0; b--) { - if ((byte >> b) & 1) { + for(var b = 7; b >= 0; b--) + { + if((byte >> b) & 1) + { return SumBit; - } else { + } + else + { SumBit++; } } @@ -44,25 +51,29 @@ function GetPowPower(arrhash) { return SumBit; }; -function GetPowValue(arrhash) { +function GetPowValue(arrhash) +{ var value = (arrhash[0] << 23) * 2 + (arrhash[1] << 16) + (arrhash[2] << 8) + arrhash[3]; value = value * 256 + arrhash[4]; value = value * 256 + arrhash[5]; return value; }; -function CreateNoncePOWExtern(arr0, BlockNum, count, startnone) { +function CreateNoncePOWExtern(arr0,BlockNum,count,startnone) +{ var arr = []; - for (var i = 0; i < arr0.length; i++) + for(var i = 0; i < arr0.length; i++) arr[i] = arr0[i]; - if (!startnone) + if(!startnone) startnone = 0; var maxnonce = 0; var supervalue = MAX_SUPER_VALUE_POW; - for (var nonce = startnone; nonce <= startnone + count; nonce++) { + for(var nonce = startnone; nonce <= startnone + count; nonce++) + { var arrhash = GetHashWithValues(arr, nonce, BlockNum, true); var value = GetPowValue(arrhash); - if (value < supervalue) { + if(value < supervalue) + { maxnonce = nonce; supervalue = value; } @@ -71,7 +82,8 @@ function CreateNoncePOWExtern(arr0, BlockNum, count, startnone) { }; window.TR_TICKET_HASH_LENGTH = 10; -function CreateHashBody(body, Num, Nonce) { +function CreateHashBody(body,Num,Nonce) +{ var length = body.length - 12; body[length + 0] = Num & 0xFF; body[length + 1] = (Num >>> 8) & 0xFF; @@ -88,7 +100,7 @@ function CreateHashBody(body, Num, Nonce) { body[length + 5] = 0; var HASH = sha3(body); var FullHashTicket = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - for (var i = 0; i < TR_TICKET_HASH_LENGTH; i++) + for(var i = 0; i < TR_TICKET_HASH_LENGTH; i++) FullHashTicket[i] = HASH[i]; WriteUintToArrOnPos(FullHashTicket, Num, TR_TICKET_HASH_LENGTH); return sha3(FullHashTicket); @@ -99,16 +111,18 @@ window.MIN_POWER_POW_TR = 0; window.CONSENSUS_PERIOD_TIME = 1000; window.FIRST_TIME_BLOCK = 1530446400000; window.NEW_SIGN_TIME = 25500000; -window.SetBlockChainConstant = function(Data) { +window.SetBlockChainConstant = function (Data) +{ var DeltaServerClient = new Date() - Data.CurTime; - if (!Data.DELTA_CURRENT_TIME) + if(!Data.DELTA_CURRENT_TIME) Data.DELTA_CURRENT_TIME = 0; window.DELTA_CURRENT_TIME2 = Data.DELTA_CURRENT_TIME - DeltaServerClient; window.MIN_POWER_POW_TR = DELTA_POWER_POW_TR + Data.MIN_POWER_POW_TR; window.FIRST_TIME_BLOCK = Data.FIRST_TIME_BLOCK; window.NEW_SIGN_TIME = Data.NEW_SIGN_TIME; window.CONSENSUS_PERIOD_TIME = Data.CONSENSUS_PERIOD_TIME; - window.GetCurrentBlockNumByTime = function() { + window.GetCurrentBlockNumByTime = function () + { var CurrentTime = Date.now() + DELTA_CURRENT_TIME2; var CurTimeNum = CurrentTime - FIRST_TIME_BLOCK; var StartBlockNum = Math.floor((CurTimeNum + CONSENSUS_PERIOD_TIME) / CONSENSUS_PERIOD_TIME); @@ -116,15 +130,18 @@ window.SetBlockChainConstant = function(Data) { }; window.NWMODE = Data.NWMODE; }; -window.GetCurrentBlockNumByTime = function() { +window.GetCurrentBlockNumByTime = function () +{ return 0; }; -function GetBlockNumTr(arr) { +function GetBlockNumTr(arr) +{ var BlockNum = window.DELTA_FOR_TIME_TX + GetCurrentBlockNumByTime(); - if (arr[0] === TYPE_TRANSACTION_CREATE) { + if(arr[0] === TYPE_TRANSACTION_CREATE) + { var BlockNum2 = Math.floor(BlockNum / 10) * 10; - if (BlockNum2 < BlockNum) + if(BlockNum2 < BlockNum) BlockNum2 = BlockNum2 + 10; BlockNum = BlockNum2; } @@ -134,20 +151,26 @@ var LastCreatePOWTrType = 0; var LastCreatePOWBlockNum = 0; var LastCreatePOWHash = [255, 255, 255, 255]; -function CreateHashBodyPOWInnerMinPower(arr, MinPow, startnonce) { +function CreateHashBodyPOWInnerMinPower(arr,MinPow,startnonce) +{ var TrType = arr[0]; var BlockNum = GetBlockNumTr(arr); - if (MinPow === undefined) { + if(MinPow === undefined) + { MinPow = MIN_POWER_POW_TR + Math.log2(arr.length / 128); } var nonce = startnonce; - while (1) { + while(1) + { var arrhash = CreateHashBody(arr, BlockNum, nonce); var power = GetPowPower(arrhash); - if (power >= MinPow) { - if (LastCreatePOWBlockNum === BlockNum && LastCreatePOWTrType === TrType && CompareArr(LastCreatePOWHash, arrhash) > 0) { + if(power >= MinPow) + { + if(LastCreatePOWBlockNum === BlockNum && LastCreatePOWTrType === TrType && CompareArr(LastCreatePOWHash, arrhash) > 0) + { } - else { + else + { LastCreatePOWBlockNum = BlockNum; LastCreatePOWTrType = TrType; LastCreatePOWHash = arrhash; @@ -155,31 +178,35 @@ function CreateHashBodyPOWInnerMinPower(arr, MinPow, startnonce) { } } nonce++; - if (nonce % 2000 === 0) { + if(nonce % 2000 === 0) + { BlockNum = GetBlockNumTr(arr); } } }; -function CalcHashFromArray(ArrHashes, bOriginalSeq) { - if (bOriginalSeq === undefined) +function CalcHashFromArray(ArrHashes,bOriginalSeq) +{ + if(bOriginalSeq === undefined) ArrHashes.sort(CompareArr); var Buf = []; - for (var i = 0; i < ArrHashes.length; i++) { + for(var i = 0; i < ArrHashes.length; i++) + { var Value = ArrHashes[i]; - for (var n = 0; n < Value.length; n++) + for(var n = 0; n < Value.length; n++) Buf.push(Value[n]); } - if (Buf.length === 0) + if(Buf.length === 0) return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; else - if (Buf.length === 32) + if(Buf.length === 32) return Buf; var Hash = shaarr(Buf); return Hash; }; -function GetArrFromValue(Num) { +function GetArrFromValue(Num) +{ var arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; arr[0] = Num & 0xFF; arr[1] = (Num >>> 8) & 0xFF; @@ -191,44 +218,54 @@ function GetArrFromValue(Num) { return arr; }; -function LoadLib(Path) { +function LoadLib(Path) +{ var item = document.createElement('script'); item.type = "text/javascript"; item.src = Path; document.getElementsByTagName('head')[0].appendChild(item); }; -function IsMS() { +function IsMS() +{ var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); - if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { + if(msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) + { return 1; } - else { + else + { return 0; } }; -function LoadSignLib() { - if (window.SignLib) - return; +function LoadSignLib() +{ + if(window.SignLib) + return ; LoadLib("./JS/sign-lib-min.js"); }; -function ComputeSecretWithCheck(PubKey, StrPrivKey, F) { - if (!window.SignLib) { +function ComputeSecretWithCheck(PubKey,StrPrivKey,F) +{ + if(!window.SignLib) + { SetError("Error - SignLib not installed"); - return; + return ; } - if (!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) { + if(!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) + { SetError("Error set PrivKey"); - return; + return ; } var PrivKey = Buffer.from(GetArrFromHex(StrPrivKey)); - if (typeof PubKey === "string") { - if (!IsHexStr(PubKey) || PubKey.length !== 66) { + if(typeof PubKey === "string") + { + if(!IsHexStr(PubKey) || PubKey.length !== 66) + { SetError("Error PubKey"); - return; + return ; } PubKey = Buffer.from(GetArrFromHex(PubKey)); } @@ -236,29 +273,35 @@ function ComputeSecretWithCheck(PubKey, StrPrivKey, F) { F(sha3(Result)); }; -function ComputeSecret(Account, PubKey, F) { - if (GetPrivKey()) { +function ComputeSecret(Account,PubKey,F) +{ + if(GetPrivKey()) + { ComputeSecretWithCheck(PubKey, GetPrivKey(), F); } - else { - GetData("GetWalletInfo", { Account: Account }, function(Data) { - if (!Data || !Data.result) - return; + else + { + GetData("GetWalletInfo", {Account:Account}, function (Data) + { + if(!Data || !Data.result) + return ; ComputeSecretWithCheck(PubKey, Data.PrivateKey, F); }); } }; -function Encrypt(ArrSecret, StartEncrypt, StrName, StrValue) { +function Encrypt(ArrSecret,StartEncrypt,StrName,StrValue) +{ var arrRnd = sha3arr2(ArrSecret, sha3(StrName + StartEncrypt)); var Arr = toUTF8Array(StrValue); return DoSecret(Arr, arrRnd); }; -function Decrypt(ArrSecret, StartEncrypt, StrName, Arr) { - if (!ArrSecret) +function Decrypt(ArrSecret,StartEncrypt,StrName,Arr) +{ + if(!ArrSecret) return "".padEnd(Arr.length / 2, "."); - if (typeof Arr === "string") + if(typeof Arr === "string") Arr = GetArrFromHex(Arr); var arrRnd = sha3arr2(ArrSecret, sha3(StrName + StartEncrypt)); var Arr2 = DoSecret(Arr, arrRnd); @@ -266,15 +309,18 @@ function Decrypt(ArrSecret, StartEncrypt, StrName, Arr) { return Str; }; -function DoSecret(Arr, arrRnd) { +function DoSecret(Arr,arrRnd) +{ var Arr2 = []; var CryptID = 0; var Pos = 0; - while (Pos < Arr.length) { + while(Pos < Arr.length) + { CryptID++; WriteUintToArrOnPos(arrRnd, CryptID, 0); var CurBuf = sha3(arrRnd); - for (var i = 0; i < 32 && Pos < Arr.length; i++ , Pos++) { + for(var i = 0; i < 32 && Pos < Arr.length; i++, Pos++) + { Arr2[Pos] = Arr[Pos] ^ CurBuf[i]; } } @@ -282,22 +328,26 @@ function DoSecret(Arr, arrRnd) { }; var glEncryptInit = 0; -function EncryptInit() { +function EncryptInit() +{ glEncryptInit++; var Time = Date.now() - new Date(2019, 0, 1); return Math.floor(Time * 100 + Math.random() * 100) * 100 + glEncryptInit; }; -function EncryptID(ArrSecret, StartEncrypt, id) { +function EncryptID(ArrSecret,StartEncrypt,id) +{ var Value = $(id).value; Value = Value.padEnd(Value.length + random(5), " "); return GetHexFromArr(Encrypt(ArrSecret, StartEncrypt, id, Value)); }; -function EncryptFields(ArrSecret, Params, ArrName) { - if (!Params.Crypto) +function EncryptFields(ArrSecret,Params,ArrName) +{ + if(!Params.Crypto) Params.Crypto = EncryptInit(); - for (var i = 0; i < ArrName.length; i++) { + for(var i = 0; i < ArrName.length; i++) + { var Name = ArrName[i]; var Value = Params[Name]; Value = Value.padEnd(Value.length + random(5), " "); @@ -305,13 +355,17 @@ function EncryptFields(ArrSecret, Params, ArrName) { } }; -function DecryptFields(ArrSecret, Params, ArrName) { - for (var i = 0; i < ArrName.length; i++) { +function DecryptFields(ArrSecret,Params,ArrName) +{ + for(var i = 0; i < ArrName.length; i++) + { var Name = ArrName[i]; - if (Params[Name]) { + if(Params[Name]) + { Params[Name] = Decrypt(ArrSecret, Params.Crypto, Name, GetArrFromHex(Params[Name])); } - else { + else + { Params[Name] = ""; } } diff --git a/src/HTML/JS/dapp-inner.js b/src/HTML/JS/dapp-inner.js index 59dc630..cc1eb56 100644 --- a/src/HTML/JS/dapp-inner.js +++ b/src/HTML/JS/dapp-inner.js @@ -9,147 +9,181 @@ */ -function SendPay(Data) { +function SendPay(Data) +{ Data.cmd = "pay"; SendData(Data); }; -function SetStorage(Key, Value) { - var Data = { cmd: "setstorage", Key: Key, Value: Value }; +function SetStorage(Key,Value) +{ + var Data = {cmd:"setstorage", Key:Key, Value:Value}; SendData(Data); }; -function GetStorage(Key, F) { - var Data = { cmd: "getstorage", Key: Key }; +function GetStorage(Key,F) +{ + var Data = {cmd:"getstorage", Key:Key}; SendData(Data, F); }; -function SetCommon(Key, Value) { - var Data = { cmd: "setcommon", Key: Key, Value: Value }; +function SetCommon(Key,Value) +{ + var Data = {cmd:"setcommon", Key:Key, Value:Value}; SendData(Data); }; -function GetCommon(Key, F) { - var Data = { cmd: "getcommon", Key: Key }; +function GetCommon(Key,F) +{ + var Data = {cmd:"getcommon", Key:Key}; SendData(Data, F); }; -function GetInfo(F, bUseCache) { - var Data = { cmd: "DappInfo", AllAccounts: ALL_ACCOUNTS, AllData: !bUseCache }; +function GetInfo(F,bUseCache) +{ + var Data = {cmd:"DappInfo", AllAccounts:ALL_ACCOUNTS, AllData:!bUseCache}; SendData(Data, F); }; -function Call(Account, MethodName, Params, F) { - var Data = { cmd: "DappCall", MethodName: MethodName, Params: Params, Account: Account }; +function Call(Account,MethodName,Params,F) +{ + var Data = {cmd:"DappCall", MethodName:MethodName, Params:Params, Account:Account}; SendData(Data, F); }; -function SendCall(Account, MethodName, Params, FromNum) { - if (!INFO.WalletCanSign) { +function SendCall(Account,MethodName,Params,FromNum) +{ + if(!INFO.WalletCanSign) + { SetError("Pls, open wallet"); return 0; } - var Data = { cmd: "DappSendCall", MethodName: MethodName, Params: Params, Account: Account, FromNum: FromNum }; + var Data = {cmd:"DappSendCall", MethodName:MethodName, Params:Params, Account:Account, FromNum:FromNum}; SendData(Data); return 1; }; -function GetWalletAccounts(F) { - var Data = { cmd: "DappWalletList" }; +function GetWalletAccounts(F) +{ + var Data = {cmd:"DappWalletList"}; SendData(Data, F); }; -function GetAccountList(Params, F) { - var Data = { cmd: "DappAccountList", Params: Params }; +function GetAccountList(Params,F) +{ + var Data = {cmd:"DappAccountList", Params:Params}; SendData(Data, F); }; -function GetSmartList(Params, F) { - var Data = { cmd: "DappSmartList", Params: Params }; +function GetSmartList(Params,F) +{ + var Data = {cmd:"DappSmartList", Params:Params}; SendData(Data, F); }; -function GetBlockList(Params, F) { - var Data = { cmd: "DappBlockList", Params: Params }; +function GetBlockList(Params,F) +{ + var Data = {cmd:"DappBlockList", Params:Params}; SendData(Data, F); }; -function GetTransactionList(Params, F) { - var Data = { cmd: "DappTransactionList", Params: Params }; +function GetTransactionList(Params,F) +{ + var Data = {cmd:"DappTransactionList", Params:Params}; SendData(Data, F); }; -function DappSmartHTMLFile(Smart, F) { - var Data = { cmd: "DappSmartHTMLFile", Params: { Smart: Smart } }; +function DappSmartHTMLFile(Smart,F) +{ + var Data = {cmd:"DappSmartHTMLFile", Params:{Smart:Smart}}; SendData(Data, F); }; -function DappBlockFile(BlockNum, TrNum, F) { - var Data = { cmd: "DappBlockFile", Params: { BlockNum: BlockNum, TrNum: TrNum } }; +function DappBlockFile(BlockNum,TrNum,F) +{ + var Data = {cmd:"DappBlockFile", Params:{BlockNum:BlockNum, TrNum:TrNum}}; SendData(Data, F); }; -function SetStatus(Str) { - SendData({ cmd: "SetStatus", Message: Str }); +function SetStatus(Str) +{ + SendData({cmd:"SetStatus", Message:Str}); }; -function SetError(Str) { - SendData({ cmd: "SetError", Message: Str }); +function SetError(Str) +{ + SendData({cmd:"SetError", Message:Str}); }; -function SetLocationPath(Str) { - SendData({ cmd: "SetLocationHash", Message: Str }); +function SetLocationPath(Str) +{ + SendData({cmd:"SetLocationHash", Message:Str}); }; -function CreateNewAccount(Currency) { - SendData({ cmd: "CreateNewAccount", Currency: Currency }); +function CreateNewAccount(Currency) +{ + SendData({cmd:"CreateNewAccount", Currency:Currency}); }; -function OpenLink(Str) { - SendData({ cmd: "OpenLink", Message: Str }); +function OpenLink(Str) +{ + SendData({cmd:"OpenLink", Message:Str}); }; -function SetMobileMode() { - SendData({ cmd: "SetMobileMode" }); +function SetMobileMode() +{ + SendData({cmd:"SetMobileMode"}); }; -function ComputeSecret(PubKey, F, Account) { - if (!INFO.WalletCanSign) { +function ComputeSecret(PubKey,F,Account) +{ + if(!INFO.WalletCanSign) + { SetError("Pls, open wallet"); return 0; } - if (!Account && USER_ACCOUNT.length) + if(!Account && USER_ACCOUNT.length) Account = USER_ACCOUNT[0].Num; - if (typeof PubKey === "number") { + if(typeof PubKey === "number") + { var AccNum = PubKey; - GetAccountList({ StartNum: AccNum, CountNum: 1 }, function(Err, Arr) { - if (Err) { + GetAccountList({StartNum:AccNum, CountNum:1}, function (Err,Arr) + { + if(Err) + { SetError(Err); } - else { - SendData({ cmd: "ComputeSecret", Account: Account, PubKey: Arr[0].PubKey.data }, F); + else + { + SendData({cmd:"ComputeSecret", Account:Account, PubKey:Arr[0].PubKey.data}, F); } }); } - else { - SendData({ cmd: "ComputeSecret", Account: Account, PubKey: PubKey }, F); + else + { + SendData({cmd:"ComputeSecret", Account:Account, PubKey:PubKey}, F); } }; -function CheckInstall() { - SendData({ cmd: "CheckInstall" }); +function CheckInstall() +{ + SendData({cmd:"CheckInstall"}); }; -function SendTransaction(Body, TR, SumPow, F) { +function SendTransaction(Body,TR,SumPow,F) +{ SetError("Cannt SEND TR: " + JSON.stringify(TR)); }; -function CurrencyName(Num) { +function CurrencyName(Num) +{ var Name = MapCurrency[Num]; - if (!Name) { - GetSmartList({ StartNum: Num, CountNum: 1, TokenGenerate: 1 }, function(Err, Arr) { - if (Err || Arr.length === 0) - return; + if(!Name) + { + GetSmartList({StartNum:Num, CountNum:1, TokenGenerate:1}, function (Err,Arr) + { + if(Err || Arr.length === 0) + return ; var Smart = Arr[0]; Name = GetTokenName(Smart.Num, Smart.ShortName); MapCurrency[Smart.Num] = Name; @@ -160,15 +194,19 @@ function CurrencyName(Num) { }; var SendCountUpdate = 0; -function FindAllCurrency() { +function FindAllCurrency() +{ SendCountUpdate++; - GetSmartList({ StartNum: 8, CountNum: 100, TokenGenerate: 1 }, function(Err, Arr) { + GetSmartList({StartNum:8, CountNum:100, TokenGenerate:1}, function (Err,Arr) + { SendCountUpdate--; - if (Err) - return; - for (var i = 0; i < Arr.length; i++) { + if(Err) + return ; + for(var i = 0; i < Arr.length; i++) + { var Smart = Arr[i]; - if (!MapCurrency[Smart.Num]) { + if(!MapCurrency[Smart.Num]) + { var Name = GetTokenName(Smart.Num, Smart.ShortName); MapCurrency[Smart.Num] = Name; } @@ -176,50 +214,62 @@ function FindAllCurrency() { }); }; -function GetFilePath(Path) { - if (window.PROTOCOL_SERVER_PATH && Path.indexOf("file/")) { - if (Path.substr(0, 1) !== "/") +function GetFilePath(Path) +{ + if(window.PROTOCOL_SERVER_PATH && Path.indexOf("file/")) + { + if(Path.substr(0, 1) !== "/") Path = "/" + Path; Path = window.PROTOCOL_SERVER_PATH + Path; } return Path; }; -function GetParamsFromPath(Name) { - if (!OPEN_PATH) +function GetParamsFromPath(Name) +{ + if(!OPEN_PATH) return undefined; var arr = OPEN_PATH.split("&"); - for (var i = 0; i < arr.length; i++) { - if (arr[i].indexOf(Name + "=") === 0) { + for(var i = 0; i < arr.length; i++) + { + if(arr[i].indexOf(Name + "=") === 0) + { return arr[i].split("=")[1]; } } }; -function GetState(AccNum, F, FErr) { +function GetState(AccNum,F,FErr) +{ SendCountUpdate++; - GetAccountList({ StartNum: AccNum, CountNum: 1 }, function(Err, Arr) { + GetAccountList({StartNum:AccNum, CountNum:1}, function (Err,Arr) + { SendCountUpdate--; - if (!Err && Arr.length) { + if(!Err && Arr.length) + { var Item = Arr[0].SmartState; - if (Item) { + if(Item) + { F(Item); - return; + return ; } } - if (FErr) { + if(FErr) + { FErr(); - return; + return ; } }); }; var glMapF = {}; var glKeyF = 0; -function SendData(Data, F) { - if (!window.parent) - return; - if (F) { +function SendData(Data,F) +{ + if(!window.parent) + return ; + if(F) + { glKeyF++; Data.CallID = glKeyF; glMapF[glKeyF] = F; @@ -227,18 +277,22 @@ function SendData(Data, F) { window.parent.postMessage(Data, "*"); }; -function OnMessage(event) { +function OnMessage(event) +{ var Data = event.data; - if (!Data || typeof Data !== "object") - return; + if(!Data || typeof Data !== "object") + return ; var CallID = Data.CallID; var cmd = Data.cmd; - if (CallID) { + if(CallID) + { var F = glMapF[CallID]; - if (F) { + if(F) + { delete Data.CallID; delete Data.cmd; - switch (cmd) { + switch(cmd) + { case "getstorage": case "getcommon": F(Data.Key, Data.Value); @@ -269,40 +323,49 @@ function OnMessage(event) { delete glMapF[CallID]; } } - else { - switch (cmd) { + else + { + switch(cmd) + { case "History": - var eventEvent = new CustomEvent("History", { detail: Data }); + var eventEvent = new CustomEvent("History", {detail:Data}); window.dispatchEvent(eventEvent); break; case "OnEvent": - if (window.OnEvent) { + if(window.OnEvent) + { window.OnEvent(Data); } - var eventEvent = new CustomEvent("Event", { detail: Data }); + var eventEvent = new CustomEvent("Event", {detail:Data}); window.dispatchEvent(eventEvent); } } }; -function OpenRefFile(Str) { +function OpenRefFile(Str) +{ var Param = ParseFileName(Str); - if (Param.BlockNum) - DappBlockFile(Param.BlockNum, Param.TrNum, function(Err, Body) { + if(Param.BlockNum) + DappBlockFile(Param.BlockNum, Param.TrNum, function (Err,Body) + { document.write(Body); }); - else { + else + { OpenLink(Str); } }; -function SaveToStorageByArr(Arr) { +function SaveToStorageByArr(Arr) +{ SetStorage("VerSave", "1"); - for (var i = 0; i < Arr.length; i++) { + for(var i = 0; i < Arr.length; i++) + { var name = Arr[i]; var Item = $(name); - if (Item) { - if (Item.type === "checkbox") + if(Item) + { + if(Item.type === "checkbox") SetStorage(name, 0 + Item.checked); else SetStorage(name, Item.value); @@ -310,74 +373,94 @@ function SaveToStorageByArr(Arr) { } }; -function LoadFromStorageByArr(Arr, F, bAll) { - GetStorage("VerSave", function(Key, Value) { - if (Value === "1") { - for (var i = 0; i < Arr.length; i++) { - if (i === Arr.length - 1) +function LoadFromStorageByArr(Arr,F,bAll) +{ + GetStorage("VerSave", function (Key,Value) + { + if(Value === "1") + { + for(var i = 0; i < Arr.length; i++) + { + if(i === Arr.length - 1) LoadFromStorageById(Arr[i], F); else LoadFromStorageById(Arr[i]); } } - if (bAll && F) + if(bAll && F) F(0); }); }; -function LoadFromStorageById(Name, F) { - GetStorage(Name, function(Key, Value) { +function LoadFromStorageById(Name,F) +{ + GetStorage(Name, function (Key,Value) + { var Item = document.getElementById(Name); - if (Item) { - if (Item.type === "checkbox") + if(Item) + { + if(Item.type === "checkbox") Item.checked = parseInt(Value); else Item.value = Value; } - if (F) + if(F) F(Key, Value); }); }; var SendCountDappParams = 0; -function GetDappParams(BNum, TrNum, F, bAll) { - if (!BNum) { - if (bAll) +function GetDappParams(BNum,TrNum,F,bAll) +{ + if(!BNum) + { + if(bAll) F(); - return; + return ; } SendCountDappParams++; - DappBlockFile(BNum, TrNum, function(Err, Data) { + DappBlockFile(BNum, TrNum, function (Err,Data) + { SendCountDappParams--; - if (!Err && Data.Type === 135) { - try { + if(!Err && Data.Type === 135) + { + try + { var Params = JSON.parse(Data.Params); } - catch (e) { + catch(e) + { } - if (Params) { + if(Params) + { F(Params, Data.MethodName, Data.FromNum); - return; + return ; } } - if (bAll) + if(bAll) F(); }); }; -document.addEventListener("DOMContentLoaded", function() { +document.addEventListener("DOMContentLoaded", function () +{ var refs = document.getElementsByTagName("A"); - for (var i = 0, L = refs.length; i < L; i++) { - if (refs[i].href.indexOf("/file/") >= 0) { - refs[i].onclick = function() { + for(var i = 0, L = refs.length; i < L; i++) + { + if(refs[i].href.indexOf("/file/") >= 0) + { + refs[i].onclick = function () + { OpenRefFile(this.href); }; } } }); -if (window.addEventListener) { +if(window.addEventListener) +{ window.addEventListener("message", OnMessage); } -else { +else +{ window.attachEvent("onmessage", OnMessage); } var SMART = {}, BASE_ACCOUNT = {}, INFO = {}, USER_ACCOUNT = [], USER_ACCOUNT_MAP = {}, OPEN_PATH = "", ACCOUNT_OPEN_NUM = 0; @@ -385,10 +468,13 @@ var ALL_ACCOUNTS = 0; var WasStartInit = 0, WasStartInit2 = 0; var eventInfo = new Event("UpdateInfo"); -function UpdateDappInfo() { - GetInfo(function(Err, Data) { - if (Err) { - return; +function UpdateDappInfo() +{ + GetInfo(function (Err,Data) + { + if(Err) + { + return ; } INFO = Data; SMART = Data.Smart; @@ -398,32 +484,37 @@ function UpdateDappInfo() { SetBlockChainConstant(Data); USER_ACCOUNT = Data.ArrWallet; USER_ACCOUNT_MAP = {}; - for (var i = 0; i < USER_ACCOUNT.length; i++) + for(var i = 0; i < USER_ACCOUNT.length; i++) USER_ACCOUNT_MAP[USER_ACCOUNT[i].Num] = USER_ACCOUNT[i]; - if (window.OnInit && !WasStartInit) { + if(window.OnInit && !WasStartInit) + { WasStartInit = 1; window.OnInit(1); } else - if (window.OnUpdateInfo) { + if(window.OnUpdateInfo) + { window.OnUpdateInfo(); } - if (!WasStartInit2) { + if(!WasStartInit2) + { WasStartInit2 = 1; var eventInit = new Event("Init"); window.dispatchEvent(eventInit); } window.dispatchEvent(eventInfo); - if (Data.ArrEvent) - for (var i = 0; i < Data.ArrEvent.length; i++) { + if(Data.ArrEvent) + for(var i = 0; i < Data.ArrEvent.length; i++) + { var Item = Data.ArrEvent[i]; Item.cmd = "OnEvent"; - OnMessage({ data: Item }); + OnMessage({data:Item}); } }, 1); }; -window.addEventListener('load', function() { - if (!window.sha3) +window.addEventListener('load', function () +{ + if(!window.sha3) LoadLib("./JS/sha3.js"); UpdateDappInfo(); setInterval(UpdateDappInfo, 1000); diff --git a/src/HTML/JS/diagram.js b/src/HTML/JS/diagram.js index 485f510..cd2178e 100644 --- a/src/HTML/JS/diagram.js +++ b/src/HTML/JS/diagram.js @@ -11,67 +11,80 @@ var DiagramMap = {}; var DiagramMapId = {}; var LMouseOn = false; -if (!window.toStaticHTML) - toStaticHTML = function(Str) { +if(!window.toStaticHTML) + toStaticHTML = function (Str) + { return Str; }; -function Rigth(Str, Count) { - if (Str.length < Count) +function Rigth(Str,Count) +{ + if(Str.length < Count) return Str; else return Str.substr(Str.length - Count); }; -function SetHTMLDiagramItem(Item, width) { +function SetHTMLDiagramItem(Item,width) +{ Item.mouseX = width - 50; - if (Item.Extern || Item.Delete) - return; + if(Item.Extern || Item.Delete) + return ; var MinHeight = 80; - if (!Item.id) + if(!Item.id) Item.id = "DgrmId" + Item.num; DiagramMap[Item.name] = Item; DiagramMapId[Item.id] = Item; - if (Item.isLine) { - if (Item.text) + if(Item.isLine) + { + if(Item.text) Str = "
" + Item.text + ''; else Str = "
"; } - else { - Str = '
' + Item.text + '
\ + else + { + Str = '
' + Item.text + '
\
'; } var ElBlock = document.getElementById("B" + Item.id); - if (ElBlock) + if(ElBlock) ElBlock.innerHTML = toStaticHTML(Str); - else { + else + { var diargams = document.getElementById("diargams"); diargams.innerHTML = toStaticHTML(diargams.innerHTML + "
" + Str + "
"); } }; -function SetDiagramMouseX(event, mode) { - if (event.srcElement && event.srcElement.className && event.srcElement.className.indexOf && event.srcElement.className.indexOf("DIAGRAM") >= 0) { - if (mode === "down") +function SetDiagramMouseX(event,mode) +{ + if(event.srcElement && event.srcElement.className && event.srcElement.className.indexOf && event.srcElement.className.indexOf("DIAGRAM") >= 0) + { + if(mode === "down") LMouseOn = true; else - if (mode === "up") + if(mode === "up") LMouseOn = false; event.preventDefault(); - if (LMouseOn === true) { + if(LMouseOn === true) + { var obj = event.srcElement; var mouse = getMouse(obj, event); - if (event.ctrlKey === true) { - for (var key in DiagramMapId) { + if(event.ctrlKey === true) + { + for(var key in DiagramMapId) + { var Item = DiagramMapId[key]; Item.mouseX = mouse.x; DrawDiagram(Item); } } - else { + else + { var Item = DiagramMapId[obj.id]; - if (Item) { + if(Item) + { Item.mouseX = mouse.x; DrawDiagram(Item); } @@ -80,11 +93,12 @@ function SetDiagramMouseX(event, mode) { } }; -function DrawDiagram(Item) { - if (Item.Delete) - return; +function DrawDiagram(Item) +{ + if(Item.Delete) + return ; var arr = Item.arr; - if (!arr) + if(!arr) arr = Item.ArrList; var arrX = Item.arrX; var GreenValue = Item.value; @@ -93,69 +107,71 @@ function DrawDiagram(Item) { var StartServer = Item.starttime; var mouseX = Item.mouseX; var KPrecision = Item.KPrecision; - if (!KPrecision) + if(!KPrecision) KPrecision = 1; - if (!arr) - return; + if(!arr) + return ; var obj = document.getElementById(Item.id); var ctx = obj.getContext('2d'); var Left = 50; var Top = 11; var Button = 15; var Right = 50; - if (Item.fillStyle) + if(Item.fillStyle) ctx.fillStyle = Item.fillStyle; else ctx.fillStyle = "#FFF"; ctx.fillRect(0, 0, obj.width, obj.height); - if (arr.length <= 0) - return; + if(arr.length <= 0) + return ; var Pow2 = 0; - if (Item.name.substr(Item.name.length - 2) === "**") + if(Item.name.substr(Item.name.length - 2) === "**") Pow2 = 1; var MaxValue = arr[0]; var MinValue = arr[0]; var AvgValue = 0; - for (var i = 0; i < arr.length; i++) { - if (arr[i] > MaxValue) + for(var i = 0; i < arr.length; i++) + { + if(arr[i] > MaxValue) MaxValue = arr[i]; - if (arr[i] < MinValue) + if(arr[i] < MinValue) MinValue = arr[i]; - if (arr[i]) + if(arr[i]) AvgValue += arr[i]; } - if (Item.name.substr(0, 4) !== "MAX:" || !Item.AvgValue) + if(Item.name.substr(0, 4) !== "MAX:" || !Item.AvgValue) AvgValue = AvgValue / arr.length; else AvgValue = Item.AvgValue; - if (Pow2 && AvgValue) + if(Pow2 && AvgValue) AvgValue = Math.pow(2, AvgValue) / 1000000; - if (AvgValue < 50) + if(AvgValue < 50) AvgValue = AvgValue.toFixed(2); else AvgValue = Math.floor(AvgValue); - if (Item.MaxValue !== undefined) + if(Item.MaxValue !== undefined) MaxValue = Item.MaxValue; - if (Pow2 && MaxValue) + if(Pow2 && MaxValue) MaxValue = Math.pow(2, MaxValue) / 1000000; var HValue = MaxValue; - if (HValue <= 0) + if(HValue <= 0) HValue = 1; var KX = (obj.width - Left - Right) / arr.length; var KY = (obj.height - Top - Button) / HValue; var DeltaY = 0; var bLine = Item.line; - if (Item.zero) { + if(Item.zero) + { bLine = 1; DeltaY -= Item.zero * KY; MaxValue -= Item.zero; AvgValue -= Item.zero; } MaxValue = Math.floor(MaxValue + 0.5); - if (bLine) + if(bLine) ctx.lineWidth = 3; else - if (KX > 1) + if(KX > 1) ctx.lineWidth = KX; else ctx.lineWidth = 1; @@ -164,58 +180,69 @@ function DrawDiagram(Item) { var mouseValueX = 0; var mouseValue = undefined; var mouseColor = undefined; - - function DrawLines(arr, mode, color) { + +function DrawLines(arr,mode,color) + { var WasMove0 = 0; ctx.beginPath(); ctx.moveTo(Left, obj.height - Button); ctx.strokeStyle = color; var PrevX = undefined; - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { var Value = arr[i]; - if (!Value) + if(!Value) Value = 0; - if (Value) { - if (Pow2) + if(Value) + { + if(Pow2) Value = Math.pow(2, Value) / 1000000; } - if (mode === "green") { - if (Value > GreenValue) + if(mode === "green") + { + if(Value > GreenValue) continue; } else - if (mode === "red") { - if (Value <= GreenValue) + if(mode === "red") + { + if(Value <= GreenValue) continue; } var Value1 = Value; - if (Value1 > GreenValue) + if(Value1 > GreenValue) Value1 = GreenValue; var VX1 = Math.floor(Value1 * KY); var VX2 = Math.floor(Value * KY); - if (VX1 === VX2) + if(VX1 === VX2) VX1 -= 2; var x = StartX + ctx.lineWidth / 2 + (i) * KX; - if (bLine) { - if (!WasMove0) { + if(bLine) + { + if(!WasMove0) + { WasMove0 = 1; ctx.moveTo(x, StartY - VX2); } - else { + else + { ctx.lineTo(x, StartY - VX2); } } - else { + else + { ctx.moveTo(x, StartY - VX1); ctx.lineTo(x, StartY - VX2); } - if (mouseX) { + if(mouseX) + { var deltaCur = Math.abs(x - mouseX); var deltaWas = Math.abs(mouseValueX - mouseX); - if (deltaCur < deltaWas) { + if(deltaCur < deltaWas) + { mouseValueX = x; mouseValue = Value; - if (Item.zero) + if(Item.zero) mouseValue -= Item.zero; mouseColor = color; } @@ -223,14 +250,16 @@ function DrawDiagram(Item) { } ctx.stroke(); }; - if (!Item.red) + if(!Item.red) Item.red = "#A00"; - if (bLine) { + if(bLine) + { DrawLines(arr, "line", Item.red); } - else { + else + { DrawLines(arr, "red", Item.red); - if (GreenValue > 0) + if(GreenValue > 0) DrawLines(arr, "green", "#0A0"); } var MaxValueText = GetValueByItemProperty(MaxValue, Item); @@ -246,18 +275,20 @@ function DrawDiagram(Item) { ctx.moveTo(StartX, StartY + DeltaY); ctx.lineTo(obj.width - 10, StartY + DeltaY); ctx.stroke(); - if (mouseX !== undefined) { + if(mouseX !== undefined) + { ctx.beginPath(); ctx.lineWidth = 0.5; ctx.strokeStyle = "#00F"; ctx.moveTo(mouseX, Top); ctx.lineTo(mouseX, StartY); ctx.stroke(); - if (mouseValue !== undefined) { + if(mouseValue !== undefined) + { ctx.fillStyle = mouseColor; var Val = GetValueByItemProperty(mouseValue, Item); var mouseTextX = mouseX; - if (Item.MouseText) + if(Item.MouseText) mouseTextX -= 3 * Item.MouseText.length; else Item.MouseText = ""; @@ -265,14 +296,16 @@ function DrawDiagram(Item) { } } ctx.fillStyle = "#000"; - if (!Item.NoTextMax) + if(!Item.NoTextMax) ctx.fillText(Rigth("          " + MaxValueText, 8), 0, Top - 3); - if (MaxValue > 0 && AvgValue > 0) { + if(MaxValue > 0 && AvgValue > 0) + { var heigh = StartY - Top; var KKY = AvgValue / MaxValue; var y = (heigh - Math.floor(KKY * heigh)); var yT = y; - if (yT < 10) { + if(yT < 10) + { yT = 10; } ctx.beginPath(); @@ -283,58 +316,67 @@ function DrawDiagram(Item) { ctx.fillText(Rigth("          " + AvgValueText, 8), 0, yT + Top); } var CountNameX = 10; - if (arr.length < CountNameX) + if(arr.length < CountNameX) CountNameX = arr.length; var KX3 = (obj.width - Left - Right) / CountNameX; var KDelitel = 1; var Step = arr.length / CountNameX; var StartTime, bNumber; - if (arrX) { + if(arrX) + { } else - if (StartNumber !== undefined) { + if(StartNumber !== undefined) + { bNumber = 1; StartTime = StartNumber; } else - if (StartServer) { + if(StartServer) + { bNumber = 1; StartTime = Math.floor(((Date.now() - StartServer) - StepTime * arr.length * 1000) / 1000); - if (StartTime < 0) + if(StartTime < 0) StartTime = 0; var KDelitel = Math.floor(Step / 10) * 10; - if (KDelitel == 0) + if(KDelitel == 0) KDelitel = 1; } - else { + else + { bNumber = 0; StartTime = Date.now() - StepTime * arr.length * 1000; StartX = StartX - 16; } - for (i = 0; i <= CountNameX; i++) { + for(i = 0; i <= CountNameX; i++) + { var Val; - if (i === CountNameX) { + if(i === CountNameX) + { Val = arr.length * StepTime; KDelitel = 1; } else - if (i === 0) + if(i === 0) Val = 0; else Val = i * Step * StepTime; var Str; - if (arrX) { + if(arrX) + { Val = Math.floor(Val); Str = arrX[Val]; - if (Str === undefined) + if(Str === undefined) Str = ""; } else - if (bNumber) { + if(bNumber) + { Val = Math.floor((StartTime + Val) / KDelitel) * KDelitel; Str = Val; } - else { + else + { var Time = new Date(StartTime + Val * 1000); Str = "" + Time.getHours(); Str += ":" + Rigth("0" + Time.getMinutes(), 2); @@ -344,56 +386,68 @@ function DrawDiagram(Item) { } }; -function GetValueByItemProperty(Value, Item) { - if (Item.MathPow && Item.MathDiv) { +function GetValueByItemProperty(Value,Item) +{ + if(Item.MathPow && Item.MathDiv) + { Value = Math.pow(Item.MathPow, Value) / Item.MathDiv; } var KPrecision = Item.KPrecision; - if (!Item.KPrecision) + if(!Item.KPrecision) KPrecision = 1; Value = Math.floor(Value * KPrecision + 0.5) / KPrecision; return Value; }; -function InitDiagramByArr(Arr, width) { - for (var i = 0; i < Arr.length; i++) { +function InitDiagramByArr(Arr,width) +{ + for(var i = 0; i < Arr.length; i++) + { Arr[i].num = i + 1; SetHTMLDiagramItem(Arr[i], width); } - window.addEventListener('mousedown', function(event) { + window.addEventListener('mousedown', function (event) + { SetDiagramMouseX(event, "down"); }, false); - window.addEventListener('mouseup', function(event) { + window.addEventListener('mouseup', function (event) + { SetDiagramMouseX(event, "up"); }, false); - window.addEventListener('onmousemove', function(event) { + window.addEventListener('onmousemove', function (event) + { SetDiagramMouseX(event, "move"); }, false); }; -function getMouse(canvas, e) { +function getMouse(canvas,e) +{ var x = e.clientX - getTrueOffsetLeft(canvas); - if (window.pageXOffset) + if(window.pageXOffset) x = x + window.pageXOffset; var y = e.clientY - getTrueOffsetTop(canvas); - if (window.pageYOffset) + if(window.pageYOffset) y = y + window.pageYOffset; - var coord = { x: x, y: y }; + var coord = {x:x, y:y}; return coord; }; -function getTrueOffsetLeft(ele) { +function getTrueOffsetLeft(ele) +{ var n = 0; - while (ele) { + while(ele) + { n += ele.offsetLeft || 0; ele = ele.offsetParent; } return n; }; -function getTrueOffsetTop(ele) { +function getTrueOffsetTop(ele) +{ var n = 0; - while (ele) { + while(ele) + { n += ele.offsetTop || 0; ele = ele.offsetParent; } diff --git a/src/HTML/JS/highlight.js b/src/HTML/JS/highlight.js index 918d313..858ed5a 100644 --- a/src/HTML/JS/highlight.js +++ b/src/HTML/JS/highlight.js @@ -1 +1 @@ -!function(e) { var n = "object" == typeof window && window || "object" == typeof self && self; "undefined" != typeof exports ? e(exports) : n && (n.hljs = e({}), "function" == typeof define && define.amd && define([], function() { return n.hljs })) }(function(r) { var g = [], c = Object.keys, b = {}, o = {}, n = /^(no-?highlight|plain|text)$/i, l = /\blang(?:uage)?-([\w-]+)\b/i, t = /((^(<[^>]+>|\t|)+|(?:\n)))/gm, h = "", R = { classPrefix: "hljs-", tabReplace: null, useBR: !1, languages: void 0 }; function _(e) { return e.replace(/&/g, "&").replace(//g, ">") } function f(e) { return e.nodeName.toLowerCase() } function N(e, n) { var t = e && e.exec(n); return t && 0 === t.index } function u(e) { return n.test(e) } function d(e) { var n, t = {}, a = Array.prototype.slice.call(arguments, 1); for (n in e) t[n] = e[n]; return a.forEach(function(e) { for (n in e) t[n] = e[n] }), t } function E(e) { var r = []; return function e(n, t) { for (var a = n.firstChild; a; a = a.nextSibling)3 === a.nodeType ? t += a.nodeValue.length : 1 === a.nodeType && (r.push({ event: "start", offset: t, node: a }), t = e(a, t), f(a).match(/br|hr|img|input/) || r.push({ event: "stop", offset: t, node: a })); return t }(e, 0), r } function w(s) { function o(e) { return e && e.source || e } function l(e, n) { return new RegExp(o(e), "m" + (s.case_insensitive ? "i" : "") + (n ? "g" : "")) } !function n(t, e) { if (!t.compiled) { if (t.compiled = !0, t.keywords = t.keywords || t.beginKeywords, t.keywords) { function a(t, e) { s.case_insensitive && (e = e.toLowerCase()), e.split(" ").forEach(function(e) { var n = e.split("|"); r[n[0]] = [t, n[1] ? Number(n[1]) : 1] }) } var r = {}; "string" == typeof t.keywords ? a("keyword", t.keywords) : c(t.keywords).forEach(function(e) { a(e, t.keywords[e]) }), t.keywords = r } t.lexemesRe = l(t.lexemes || /\w+/, !0), e && (t.beginKeywords && (t.begin = "\\b(" + t.beginKeywords.split(" ").join("|") + ")\\b"), t.begin || (t.begin = /\B|\b/), t.beginRe = l(t.begin), t.endSameAsBegin && (t.end = t.begin), t.end || t.endsWithParent || (t.end = /\B|\b/), t.end && (t.endRe = l(t.end)), t.terminator_end = o(t.end) || "", t.endsWithParent && e.terminator_end && (t.terminator_end += (t.end ? "|" : "") + e.terminator_end)), t.illegal && (t.illegalRe = l(t.illegal)), null == t.relevance && (t.relevance = 1), t.contains || (t.contains = []), t.contains = Array.prototype.concat.apply([], t.contains.map(function(e) { return function(n) { return n.variants && !n.cached_variants && (n.cached_variants = n.variants.map(function(e) { return d(n, { variants: null }, e) })), n.cached_variants || n.endsWithParent && [d(n)] || [n] }("self" === e ? t : e) })), t.contains.forEach(function(e) { n(e, t) }), t.starts && n(t.starts, e); var i = t.contains.map(function(e) { return e.beginKeywords ? "\\.?(" + e.begin + ")\\.?" : e.begin }).concat([t.terminator_end, t.illegal]).map(o).filter(Boolean); t.terminators = i.length ? l(i.join("|"), !0) : { exec: function() { return null } } } }(s) } function M(e, n, i, t) { function o(e, n, t, a) { var r = '') + n + (t ? "" : h) } function s() { f += null != u.subLanguage ? function() { var e = "string" == typeof u.subLanguage; if (e && !b[u.subLanguage]) return _(d); var n = e ? M(u.subLanguage, d, !0, g[u.subLanguage]) : x(d, u.subLanguage.length ? u.subLanguage : void 0); return 0 < u.relevance && (E += n.relevance), e && (g[u.subLanguage] = n.top), o(n.language, n.value, !1, !0) }() : function() { var e, n, t, a, r, i, s; if (!u.keywords) return _(d); for (a = "", n = 0, u.lexemesRe.lastIndex = 0, t = u.lexemesRe.exec(d); t;)a += _(d.substring(n, t.index)), r = u, i = t, void 0, s = c.case_insensitive ? i[0].toLowerCase() : i[0], (e = r.keywords.hasOwnProperty(s) && r.keywords[s]) ? (E += e[1], a += o(e[0], _(t[0]))) : a += _(t[0]), n = u.lexemesRe.lastIndex, t = u.lexemesRe.exec(d); return a + _(d.substr(n)) }(), d = "" } function l(e) { f += e.className ? o(e.className, "", !0) : "", u = Object.create(e, { parent: { value: u } }) } function a(e, n) { if (d += e, null == n) return s(), 0; var t = function(e, n) { var t, a, r; for (t = 0, a = n.contains.length; t < a; t++)if (N(n.contains[t].beginRe, e)) return n.contains[t].endSameAsBegin && (n.contains[t].endRe = (r = n.contains[t].beginRe.exec(e)[0], new RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), "m"))), n.contains[t] }(n, u); if (t) return t.skip ? d += n : (t.excludeBegin && (d += n), s(), t.returnBegin || t.excludeBegin || (d = n)), l(t), t.returnBegin ? 0 : n.length; var a = function e(n, t) { if (N(n.endRe, t)) { for (; n.endsParent && n.parent;)n = n.parent; return n } if (n.endsWithParent) return e(n.parent, t) }(u, n); if (a) { var r = u; for (r.skip ? d += n : (r.returnEnd || r.excludeEnd || (d += n), s(), r.excludeEnd && (d = n)); u.className && (f += h), u.skip || u.subLanguage || (E += u.relevance), (u = u.parent) !== a.parent;); return a.starts && (a.endSameAsBegin && (a.starts.endRe = a.endRe), l(a.starts)), r.returnEnd ? 0 : n.length } if (function(e, n) { return !i && N(n.illegalRe, e) }(n, u)) throw new Error('Illegal lexeme "' + n + '" for mode "' + (u.className || "") + '"'); return d += n, n.length || 1 } var c = O(e); if (!c) throw new Error('Unknown language: "' + e + '"'); w(c); var r, u = t || c, g = {}, f = ""; for (r = u; r !== c; r = r.parent)r.className && (f = o(r.className, "", !0) + f); var d = "", E = 0; try { for (var v, m, p = 0; u.terminators.lastIndex = p, v = u.terminators.exec(n);)m = a(n.substring(p, v.index), v[0]), p = v.index + m; for (a(n.substr(p)), r = u; r.parent; r = r.parent)r.className && (f += h); return { relevance: E, value: f, language: e, top: u } } catch (e) { if (e.message && -1 !== e.message.indexOf("Illegal")) return { relevance: 0, value: _(n) }; throw e } } function x(t, e) { e = e || R.languages || c(b); var a = { relevance: 0, value: _(t) }, r = a; return e.filter(O).filter(s).forEach(function(e) { var n = M(e, t, !1); n.language = e, n.relevance > r.relevance && (r = n), n.relevance > a.relevance && (r = a, a = n) }), r.language && (a.second_best = r), a } function v(e) { return R.tabReplace || R.useBR ? e.replace(t, function(e, n) { return R.useBR && "\n" === e ? "
" : R.tabReplace ? n.replace(/\t/g, R.tabReplace) : "" }) : e } function a(e) { var n, t, a, r, i, s = function(e) { var n, t, a, r, i = e.className + " "; if (i += e.parentNode ? e.parentNode.className : "", t = l.exec(i)) return O(t[1]) ? t[1] : "no-highlight"; for (n = 0, a = (i = i.split(/\s+/)).length; n < a; n++)if (u(r = i[n]) || O(r)) return r }(e); u(s) || (R.useBR ? (n = document.createElementNS("http://www.w3.org/1999/xhtml", "div")).innerHTML = e.innerHTML.replace(/\n/g, "").replace(//g, "\n") : n = e, i = n.textContent, a = s ? M(s, i, !0) : x(i), (t = E(n)).length && ((r = document.createElementNS("http://www.w3.org/1999/xhtml", "div")).innerHTML = a.value, a.value = function(e, n, t) { var a = 0, r = "", i = []; function s() { return e.length && n.length ? e[0].offset !== n[0].offset ? e[0].offset < n[0].offset ? e : n : "start" === n[0].event ? e : n : e.length ? e : n } function o(e) { r += "<" + f(e) + g.map.call(e.attributes, function(e) { return " " + e.nodeName + '="' + _(e.value).replace('"', """) + '"' }).join("") + ">" } function l(e) { r += "" } function c(e) { ("start" === e.event ? o : l)(e.node) } for (; e.length || n.length;) { var u = s(); if (r += _(t.substring(a, u[0].offset)), a = u[0].offset, u === e) { for (i.reverse().forEach(l); c(u.splice(0, 1)[0]), (u = s()) === e && u.length && u[0].offset === a;); i.reverse().forEach(o) } else "start" === u[0].event ? i.push(u[0].node) : i.pop(), c(u.splice(0, 1)[0]) } return r + _(t.substr(a)) }(t, E(r), i)), a.value = v(a.value), e.innerHTML = a.value, e.className = function(e, n, t) { var a = n ? o[n] : t, r = [e.trim()]; return e.match(/\bhljs\b/) || r.push("hljs"), -1 === e.indexOf(a) && r.push(a), r.join(" ").trim() }(e.className, s, a.language), e.result = { language: a.language, re: a.relevance }, a.second_best && (e.second_best = { language: a.second_best.language, re: a.second_best.relevance })) } function i() { if (!i.called) { i.called = !0; var e = document.querySelectorAll("pre code"); g.forEach.call(e, a) } } function O(e) { return e = (e || "").toLowerCase(), b[e] || b[o[e]] } function s(e) { var n = O(e); return n && !n.disableAutodetect } return r.highlight = M, r.highlightAuto = x, r.fixMarkup = v, r.highlightBlock = a, r.configure = function(e) { R = d(R, e) }, r.initHighlighting = i, r.initHighlightingOnLoad = function() { addEventListener("DOMContentLoaded", i, !1), addEventListener("load", i, !1) }, r.registerLanguage = function(n, e) { var t = b[n] = e(r); t.aliases && t.aliases.forEach(function(e) { o[e] = n }) }, r.listLanguages = function() { return c(b) }, r.getLanguage = O, r.autoDetection = s, r.inherit = d, r.IDENT_RE = "[a-zA-Z]\\w*", r.UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*", r.NUMBER_RE = "\\b\\d+(\\.\\d+)?", r.C_NUMBER_RE = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", r.BINARY_NUMBER_RE = "\\b(0b[01]+)", r.RE_STARTERS_RE = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", r.BACKSLASH_ESCAPE = { begin: "\\\\[\\s\\S]", relevance: 0 }, r.APOS_STRING_MODE = { className: "string", begin: "'", end: "'", illegal: "\\n", contains: [r.BACKSLASH_ESCAPE] }, r.QUOTE_STRING_MODE = { className: "string", begin: '"', end: '"', illegal: "\\n", contains: [r.BACKSLASH_ESCAPE] }, r.PHRASAL_WORDS_MODE = { begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ }, r.COMMENT = function(e, n, t) { var a = r.inherit({ className: "comment", begin: e, end: n, contains: [] }, t || {}); return a.contains.push(r.PHRASAL_WORDS_MODE), a.contains.push({ className: "doctag", begin: "(?:TODO|FIXME|NOTE|BUG|XXX):", relevance: 0 }), a }, r.C_LINE_COMMENT_MODE = r.COMMENT("//", "$"), r.C_BLOCK_COMMENT_MODE = r.COMMENT("/\\*", "\\*/"), r.HASH_COMMENT_MODE = r.COMMENT("#", "$"), r.NUMBER_MODE = { className: "number", begin: r.NUMBER_RE, relevance: 0 }, r.C_NUMBER_MODE = { className: "number", begin: r.C_NUMBER_RE, relevance: 0 }, r.BINARY_NUMBER_MODE = { className: "number", begin: r.BINARY_NUMBER_RE, relevance: 0 }, r.CSS_NUMBER_MODE = { className: "number", begin: r.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", relevance: 0 }, r.REGEXP_MODE = { className: "regexp", begin: /\//, end: /\/[gimuy]*/, illegal: /\n/, contains: [r.BACKSLASH_ESCAPE, { begin: /\[/, end: /\]/, relevance: 0, contains: [r.BACKSLASH_ESCAPE] }] }, r.TITLE_MODE = { className: "title", begin: r.IDENT_RE, relevance: 0 }, r.UNDERSCORE_TITLE_MODE = { className: "title", begin: r.UNDERSCORE_IDENT_RE, relevance: 0 }, r.METHOD_GUARD = { begin: "\\.\\s*" + r.UNDERSCORE_IDENT_RE, relevance: 0 }, r }); \ No newline at end of file +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(r){var g=[],c=Object.keys,b={},o={},n=/^(no-?highlight|plain|text)$/i,l=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,h="
",R={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function f(e){return e.nodeName.toLowerCase()}function N(e,n){var t=e&&e.exec(n);return t&&0===t.index}function u(e){return n.test(e)}function d(e){var n,t={},a=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return a.forEach(function(e){for(n in e)t[n]=e[n]}),t}function E(e){var r=[];return function e(n,t){for(var a=n.firstChild;a;a=a.nextSibling)3===a.nodeType?t+=a.nodeValue.length:1===a.nodeType&&(r.push({event:"start",offset:t,node:a}),t=e(a,t),f(a).match(/br|hr|img|input/)||r.push({event:"stop",offset:t,node:a}));return t}(e,0),r}function w(s){function o(e){return e&&e.source||e}function l(e,n){return new RegExp(o(e),"m"+(s.case_insensitive?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.keywords=t.keywords||t.beginKeywords,t.keywords){function a(t,e){s.case_insensitive&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");r[n[0]]=[t,n[1]?Number(n[1]):1]})}var r={};"string"==typeof t.keywords?a("keyword",t.keywords):c(t.keywords).forEach(function(e){a(e,t.keywords[e])}),t.keywords=r}t.lexemesRe=l(t.lexemes||/\w+/,!0),e&&(t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")\\b"),t.begin||(t.begin=/\B|\b/),t.beginRe=l(t.begin),t.endSameAsBegin&&(t.end=t.begin),t.end||t.endsWithParent||(t.end=/\B|\b/),t.end&&(t.endRe=l(t.end)),t.terminator_end=o(t.end)||"",t.endsWithParent&&e.terminator_end&&(t.terminator_end+=(t.end?"|":"")+e.terminator_end)),t.illegal&&(t.illegalRe=l(t.illegal)),null==t.relevance&&(t.relevance=1),t.contains||(t.contains=[]),t.contains=Array.prototype.concat.apply([],t.contains.map(function(e){return function(n){return n.variants&&!n.cached_variants&&(n.cached_variants=n.variants.map(function(e){return d(n,{variants:null},e)})),n.cached_variants||n.endsWithParent&&[d(n)]||[n]}("self"===e?t:e)})),t.contains.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.contains.map(function(e){return e.beginKeywords?"\\.?("+e.begin+")\\.?":e.begin}).concat([t.terminator_end,t.illegal]).map(o).filter(Boolean);t.terminators=i.length?l(i.join("|"),!0):{exec:function(){return null}}}}(s)}function M(e,n,i,t){function o(e,n,t,a){var r='')+n+(t?"":h)}function s(){f+=null!=u.subLanguage?function(){var e="string"==typeof u.subLanguage;if(e&&!b[u.subLanguage])return _(d);var n=e?M(u.subLanguage,d,!0,g[u.subLanguage]):x(d,u.subLanguage.length?u.subLanguage:void 0);return 0")+'"');return d+=n,n.length||1}var c=O(e);if(!c)throw new Error('Unknown language: "'+e+'"');w(c);var r,u=t||c,g={},f="";for(r=u;r!==c;r=r.parent)r.className&&(f=o(r.className,"",!0)+f);var d="",E=0;try{for(var v,m,p=0;u.terminators.lastIndex=p,v=u.terminators.exec(n);)m=a(n.substring(p,v.index),v[0]),p=v.index+m;for(a(n.substr(p)),r=u;r.parent;r=r.parent)r.className&&(f+=h);return{relevance:E,value:f,language:e,top:u}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{relevance:0,value:_(n)};throw e}}function x(t,e){e=e||R.languages||c(b);var a={relevance:0,value:_(t)},r=a;return e.filter(O).filter(s).forEach(function(e){var n=M(e,t,!1);n.language=e,n.relevance>r.relevance&&(r=n),n.relevance>a.relevance&&(r=a,a=n)}),r.language&&(a.second_best=r),a}function v(e){return R.tabReplace||R.useBR?e.replace(t,function(e,n){return R.useBR&&"\n"===e?"
":R.tabReplace?n.replace(/\t/g,R.tabReplace):""}):e}function a(e){var n,t,a,r,i,s=function(e){var n,t,a,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=l.exec(i))return O(t[1])?t[1]:"no-highlight";for(n=0,a=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,a=s?M(s,i,!0):x(i),(t=E(n)).length&&((r=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=a.value,a.value=function(e,n,t){var a=0,r="",i=[];function s(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function l(e){r+=""}function c(e){("start"===e.event?o:l)(e.node)}for(;e.length||n.length;){var u=s();if(r+=_(t.substring(a,u[0].offset)),a=u[0].offset,u===e){for(i.reverse().forEach(l);c(u.splice(0,1)[0]),(u=s())===e&&u.length&&u[0].offset===a;);i.reverse().forEach(o)}else"start"===u[0].event?i.push(u[0].node):i.pop(),c(u.splice(0,1)[0])}return r+_(t.substr(a))}(t,E(r),i)),a.value=v(a.value),e.innerHTML=a.value,e.className=function(e,n,t){var a=n?o[n]:t,r=[e.trim()];return e.match(/\bhljs\b/)||r.push("hljs"),-1===e.indexOf(a)&&r.push(a),r.join(" ").trim()}(e.className,s,a.language),e.result={language:a.language,re:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance}))}function i(){if(!i.called){i.called=!0;var e=document.querySelectorAll("pre code");g.forEach.call(e,a)}}function O(e){return e=(e||"").toLowerCase(),b[e]||b[o[e]]}function s(e){var n=O(e);return n&&!n.disableAutodetect}return r.highlight=M,r.highlightAuto=x,r.fixMarkup=v,r.highlightBlock=a,r.configure=function(e){R=d(R,e)},r.initHighlighting=i,r.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",i,!1),addEventListener("load",i,!1)},r.registerLanguage=function(n,e){var t=b[n]=e(r);t.aliases&&t.aliases.forEach(function(e){o[e]=n})},r.listLanguages=function(){return c(b)},r.getLanguage=O,r.autoDetection=s,r.inherit=d,r.IDENT_RE="[a-zA-Z]\\w*",r.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",r.NUMBER_RE="\\b\\d+(\\.\\d+)?",r.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",r.BINARY_NUMBER_RE="\\b(0b[01]+)",r.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",r.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},r.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},r.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},r.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},r.COMMENT=function(e,n,t){var a=r.inherit({className:"comment",begin:e,end:n,contains:[]},t||{});return a.contains.push(r.PHRASAL_WORDS_MODE),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),a},r.C_LINE_COMMENT_MODE=r.COMMENT("//","$"),r.C_BLOCK_COMMENT_MODE=r.COMMENT("/\\*","\\*/"),r.HASH_COMMENT_MODE=r.COMMENT("#","$"),r.NUMBER_MODE={className:"number",begin:r.NUMBER_RE,relevance:0},r.C_NUMBER_MODE={className:"number",begin:r.C_NUMBER_RE,relevance:0},r.BINARY_NUMBER_MODE={className:"number",begin:r.BINARY_NUMBER_RE,relevance:0},r.CSS_NUMBER_MODE={className:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},r.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[r.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[r.BACKSLASH_ESCAPE]}]},r.TITLE_MODE={className:"title",begin:r.IDENT_RE,relevance:0},r.UNDERSCORE_TITLE_MODE={className:"title",begin:r.UNDERSCORE_IDENT_RE,relevance:0},r.METHOD_GUARD={begin:"\\.\\s*"+r.UNDERSCORE_IDENT_RE,relevance:0},r}); \ No newline at end of file diff --git a/src/HTML/JS/lexer.js b/src/HTML/JS/lexer.js index 6b11161..ac78a0e 100644 --- a/src/HTML/JS/lexer.js +++ b/src/HTML/JS/lexer.js @@ -9,7 +9,8 @@ */ const LOC_ADD_NAME = "$"; -module.exports = function() { +module.exports = function () +{ 'use strict'; this.ErrorIgnore = false; this.ErrorOne = true; @@ -18,7 +19,8 @@ module.exports = function() { this.FileNumber = 0; this.InjectCheck = true; this.SideMode = "client"; - this.Clear = function() { + this.Clear = function () + { this.ExternMap = {}; this.FunctionMap = {}; this.WasPlus = 0; @@ -36,22 +38,18 @@ module.exports = function() { this.ErrCount = 0; this.WasEnter = false; this.lastComment = 0; - this.lastAddCode = - 1; + this.lastAddCode = - 1; this.LineNumber = 0; this.posLineNumber = 0; this.IgnoreCodeLevel = false; this.AddToStream = this.AddToStreamAddTab; }; - this.AllowedWords = { true: 1, false: 1, undefined: 1, Infinity: 1, NaN: 1, null: 1, context: 5, this: 5, arguments: 5, }; - this.KeyWords = { - break: 1, return: 1, case: 1, do: 1, if: 1, switch: 1, var: 1, throw: 1, while: 1, default: 1, for: 1, try: 1, continue: 1, - with: 1, function: 3, void: 3, new: 3, delete: 3, typeof: 3, finally: 5, catch: 5, else: 5, instanceof: 4, in: 4, - }; - this.ProcessWords = { - break: "break", return: "return", case: "case", do: "do", if: "if", switch: "switch", var: "var", throw: "throw", - with: "with", while: "while", default: "default", for: "for", try: "try", continue: "continue", function: "function", void: "void", - new: "new", delete: "delete", typeof: "typeof", finally: "finally", catch: "catch", else: "else", - }; + this.AllowedWords = {true:1, false:1, undefined:1, Infinity:1, NaN:1, null:1, context:5, this:5, arguments:5, }; + this.KeyWords = {break:1, return:1, case:1, do:1, if:1, switch:1, var:1, throw:1, while:1, default:1, for:1, try:1, continue:1, + with:1, function:3, void:3, new:3, delete:3, typeof:3, finally:5, catch:5, else:5, instanceof:4, in:4, }; + this.ProcessWords = {break:"break", return:"return", case:"case", do:"do", if:"if", switch:"switch", var:"var", throw:"throw", + with:"with", while:"while", default:"default", for:"for", try:"try", continue:"continue", function:"function", void:"void", + new:"new", delete:"delete", typeof:"typeof", finally:"finally", catch:"catch", else:"else", }; this.enIndenifier = "1"; this.enString = "2"; this.enNumber = "3"; @@ -69,7 +67,8 @@ module.exports = function() { this.lexTypeNewLines = new Array(0x10000); this.lexTypeRegStart = new Array(0x10000); this.SpacesArray = new Array(100); - this.Init = function() { + this.Init = function () + { var BufNumbers = "0123456789"; var BufNumbers16 = "0123456789ABCDEFabcdef"; var BufChars = "~!%^&*-+/<>`@#()=\\|{}[];':\"?,."; @@ -97,34 +96,42 @@ module.exports = function() { Normalize(this.lexTypeIdentifier); this.SpacesArray[0] = ""; this.SpacesArray[1] = ""; - for (var i = 2; i < 100; i++) + for(var i = 2; i < 100; i++) this.SpacesArray[i] = this.SpacesArray[i - 1] + " "; - - function SetType(type, buf, TypeArray) { - for (var pos = 0; pos < buf.length; pos++) { + +function SetType(type,buf,TypeArray) + { + for(var pos = 0; pos < buf.length; pos++) + { var c = buf.charCodeAt(pos); TypeArray[c] = type; } }; - - function SetLetterType(type, lexTypeAll, TypeArray) { - for (var i = 32; i < 0x10000; i++) { - if (!lexTypeAll[i] || lexTypeAll[i] == "L") + +function SetLetterType(type,lexTypeAll,TypeArray) + { + for(var i = 32; i < 0x10000; i++) + { + if(!lexTypeAll[i] || lexTypeAll[i] == "L") TypeArray[i] = "L"; } TypeArray[92] = "L"; }; - - function Normalize(TypeArray) { - for (var i = 0; i < 0x10000; i++) { + +function Normalize(TypeArray) + { + for(var i = 0; i < 0x10000; i++) + { TypeArray[i] = TypeArray[i] || false; } }; - - function SetVeryQuickly(TypeArray) { + +function SetVeryQuickly(TypeArray) + { var Ret = 0; - for (var i = 0; i < 0x10000; i++) { - if (TypeArray[i]) + for(var i = 0; i < 0x10000; i++) + { + if(TypeArray[i]) Ret = 1; else Ret = 0; @@ -133,73 +140,87 @@ module.exports = function() { }; }; this.Init(); - - function LANG(Str) { - for (var i = 1; i < arguments.length; i++) + +function LANG(Str) + { + for(var i = 1; i < arguments.length; i++) Str = Str.replace("%" + i, arguments[i]); return Str; }; - this.Error = function() { + this.Error = function () + { var Str1 = LANG.apply(this, arguments); var begin = 0; - for (var i = this.start; i >= 0; i--) - if (this.buf[i] == "\n" || this.buf[i] == "\r") { + for(var i = this.start; i >= 0; i--) + if(this.buf[i] == "\n" || this.buf[i] == "\r") + { begin = i + 1; break; } var end = this.buf.length - 1; - for (var i = this.pos; i < this.buf.length; i++) - if (this.buf[i] == "\n" || this.buf[i] == "\r") { + for(var i = this.pos; i < this.buf.length; i++) + if(this.buf[i] == "\n" || this.buf[i] == "\r") + { end = i; break; } var line = 1; - for (var i = 0; i < this.start; i++) - if (this.buf[i] == "\n") { + for(var i = 0; i < this.start; i++) + if(this.buf[i] == "\n") + { line++; } var col = this.start + 1 - begin; var Dots1 = ""; var Dots2 = ""; - if (this.start - begin > 100) { + if(this.start - begin > 100) + { begin = this.start - 100; Dots1 = "..."; } - if (end - this.start > 100) { + if(end - this.start > 100) + { end = this.start + 100; Dots2 = "..."; } this.ErrCount++; var ErrLabel; - if (!this.ErrorOne && this.ErrorIgnore) + if(!this.ErrorOne && this.ErrorIgnore) ErrLabel = " <> "; else ErrLabel = " <> "; var StrLine = this.buf.substring(begin, this.start) + ErrLabel + this.buf.substring(this.start, end); var Str2 = LANG("At line: %1 col: %2", line - 1, col - 1); var Str = "SyntaxError: " + Str1 + ". " + Str2 + "\n" + Dots1 + StrLine + Dots2; - if (this.ErrorIgnore) { + if(this.ErrorIgnore) + { console.log(Str); this.stream += ErrLabel; this.stream += this.value + " "; - if (this.ErrorOne) { + if(this.ErrorOne) + { this.stream += "\n\n" + Str; } - else { + else + { this.NotBackPos(); - return; + return ; } } throw Str; }; this.code_base = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\ufffd\u2122\u0459\u203a\u045a\u045c\u045b\u045f\xa0\u040e\u045e\u0408\xa4\u0490\xa6\xa7\u0401\xa9\u0404\xab\xac\xad\xae\u0407\xb0\xb1\u0406\u0456\u0491\xb5\xb6\xb7\u0451\u2116\u0454\xbb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f'; - this.FromBackSlashString = function(str) { + this.FromBackSlashString = function (str) + { var Ret = ""; - for (var i = 0; i < str.length; i++) { + for(var i = 0; i < str.length; i++) + { var s = str[i]; - if (s == "\\") { + if(s == "\\") + { var s2 = str[i + 1]; - switch (s2) { + switch(s2) + { case "r": i = i + 1; Ret = Ret + "\r"; @@ -223,7 +244,7 @@ module.exports = function() { case "u": var s = str.substring(i + 2, i + 6); var code = parseInt(s); - if (isNaN(code)) + if(isNaN(code)) this.Error("Unrecognize unicode symbol: '%1'", "\\u" + s); else Ret = Ret + String.fromCharCode(code); @@ -232,7 +253,7 @@ module.exports = function() { case "x": var s = str.substring(i + 2, i + 4); var code = parseInt(s, 16); - if (isNaN(code)) + if(isNaN(code)) this.Error("Unrecognize Latin symbol: '%1'", "\\x" + s); else Ret = Ret + this.code_base.charAt(code); @@ -240,10 +261,11 @@ module.exports = function() { break; default: var c = str.charCodeAt(i + 1); - if (this.lexTypeNumbers[c] == "N") { + if(this.lexTypeNumbers[c] == "N") + { var s = str.substring(i + 1, i + 4); var code = parseInt(s, 8); - if (isNaN(code)) + if(isNaN(code)) this.Error("Unrecognize Latin symbol: '%1'", "\\" + s); else Ret = Ret + this.code_base.charAt(code); @@ -252,159 +274,194 @@ module.exports = function() { break; } } - else { + else + { Ret = Ret + s; } } return Ret; }; - this.PosString = function() { + this.PosString = function () + { var separator = this.buf[this.pos]; this.pos++; - while (this.pos < this.buf.length) { + while(this.pos < this.buf.length) + { var s = this.buf[this.pos]; - if (s == separator) { + if(s == separator) + { this.pos++; - return; + return ; } else - if (s == "\\") { + if(s == "\\") + { this.pos++; this.bWasBackSlash = true; } else - if (s == "\n") { + if(s == "\n") + { this.Error("Found end of line during calculate string"); - return; + return ; } this.pos++; } this.Error("Found end of file during calculate string"); }; - this.PosRegExp = function() { + this.PosRegExp = function () + { this.Error("RegExp not support"); - return; + return ; var separator = "/"; this.pos++; - while (this.pos < this.buf.length) { + while(this.pos < this.buf.length) + { var s = this.buf[this.pos]; - if (s == separator) { + if(s == separator) + { this.pos++; - return; + return ; } else - if (s == "[") { + if(s == "[") + { separator = ""; } else - if (s == "]" && separator == "") { + if(s == "]" && separator == "") + { separator = "/"; } else - if (s == "\\") { + if(s == "\\") + { this.pos++; this.bWasBackSlash = true; } else - if (s == "\n") { + if(s == "\n") + { this.Error("Found end of line during calculate regexp"); - return; + return ; } this.pos++; } this.Error("Found end of file during calculate regexp"); }; - this.PosCurrentType = function(TypeArray) { - while (this.pos < this.buf.length) { + this.PosCurrentType = function (TypeArray) + { + while(this.pos < this.buf.length) + { var c = this.buf.charCodeAt(this.pos); - if (!TypeArray[c]) + if(!TypeArray[c]) break; - if (c == 92) + if(c == 92) this.bWasBackSlash = true; this.pos++; } }; - this.PosIdentifier = function() { + this.PosIdentifier = function () + { this.PosCurrentType(this.lexTypeIdentifier); }; - this.PosSpaces = function() { + this.PosSpaces = function () + { this.PosCurrentType(this.lexTypeSpaces); }; - this.PosNewLines = function() { + this.PosNewLines = function () + { this.PosCurrentType(this.lexTypeNewLines); }; - this.PosNumber = function() { - if (this.buf[this.pos] == "0") { + this.PosNumber = function () + { + if(this.buf[this.pos] == "0") + { this.pos++; var s = this.buf[this.pos]; - if (s == "x" || s == "X") { + if(s == "x" || s == "X") + { this.pos++; this.PosCurrentType(this.lexTypeNumbers16); } else - if (s == ".") { + if(s == ".") + { this.pos++; this.PosCurrentType(this.lexTypeNumbers); } - else { + else + { this.PosCurrentType(this.lexTypeNumbers); } - return; + return ; } this.PosCurrentType(this.lexTypeNumbers); - if (this.buf[this.pos] == ".") { + if(this.buf[this.pos] == ".") + { this.pos++; this.PosCurrentType(this.lexTypeNumbers); } - if (this.buf[this.pos] == "e" || this.buf[this.pos] == "E") { + if(this.buf[this.pos] == "e" || this.buf[this.pos] == "E") + { this.pos++; var s2 = this.buf[this.pos]; - if (s2 == "+" || s2 == "-") + if(s2 == "+" || s2 == "-") this.pos++; var posstart = this.pos; this.PosCurrentType(this.lexTypeNumbers); - if (posstart == this.pos) + if(posstart == this.pos) this.Error("Unrecognize exponent number"); } var c = this.buf.charCodeAt(this.pos); var type = this.lexTypeAll[c]; - if (type == "L") + if(type == "L") this.Error("Unrecognize number"); }; - this.PosCommentsOneLine = function() { - while (this.pos < this.buf.length) { + this.PosCommentsOneLine = function () + { + while(this.pos < this.buf.length) + { var s = this.buf[this.pos]; - if (s == '\n') + if(s == '\n') break; else - if (s == '\r') + if(s == '\r') break; this.pos++; } }; - this.PosCommentsMultiLine = function() { - while (this.pos < this.buf.length) { + this.PosCommentsMultiLine = function () + { + while(this.pos < this.buf.length) + { var s = this.buf[this.pos] + this.buf[this.pos + 1]; - if (s == '*/') { + if(s == '*/') + { this.pos += 2; break; } this.pos++; } }; - this.BackPos = function() { - if (this.type != this.enEndFile) + this.BackPos = function () + { + if(this.type != this.enEndFile) this.pos = this.start; }; - this.NotBackPos = function() { - if (this.pos == this.start) + this.NotBackPos = function () + { + if(this.pos == this.start) this.PosNextItem(); }; - this.PosNextToken = function() { + this.PosNextToken = function () + { this.WasEnter = false; - while (true) { + while(true) + { this.PosNextItem(); - switch (this.type) { + switch(this.type) + { case this.enNewLine: this.WasEnter = true; break; @@ -416,24 +473,28 @@ module.exports = function() { } } }; - this.PosNextItem = function() { + this.PosNextItem = function () + { this.start = this.pos; - if (this.pos >= this.buf.length) { + if(this.pos >= this.buf.length) + { this.type = this.enEndFile; return this.enEndFile; } var c = this.buf.charCodeAt(this.pos); var lex = this.lexTypeAll[c]; - switch (lex) { + switch(lex) + { case "L": this.bWasBackSlash = false; this.PosIdentifier(); this.value = this.buf.substring(this.start, this.pos); - if (this.bWasBackSlash) + if(this.bWasBackSlash) this.value = this.FromBackSlashString(this.value); this.beforeRegExp = 65; this.type = this.enIndenifier; - if (this.value == "in" || this.value == "of" || this.value == "instanceof") { + if(this.value == "in" || this.value == "of" || this.value == "instanceof") + { return this.value; } return this.enIndenifier; @@ -453,7 +514,8 @@ module.exports = function() { return this.enNewLine; case "C": var s = this.buf[this.pos]; - switch (s) { + switch(s) + { case '"': case "'": this.bWasBackSlash = false; @@ -464,9 +526,11 @@ module.exports = function() { return this.enString; case "/": var s2 = this.buf[this.pos + 1]; - if (s2 == '/') { + if(s2 == '/') + { this.PosCommentsOneLine(); - if (!this.CommentIgnore && this.lastComment <= this.start) { + if(!this.CommentIgnore && this.lastComment <= this.start) + { this.lastComment = this.start + 1; this.value = this.buf.substring(this.start, this.pos); this.AddToStream(this.value); @@ -476,13 +540,16 @@ module.exports = function() { return this.enComments; } else - if (s2 == '*') { + if(s2 == '*') + { this.PosCommentsMultiLine(); - if (!this.CommentIgnore && this.lastComment <= this.start) { + if(!this.CommentIgnore && this.lastComment <= this.start) + { this.lastComment = this.start + 1; this.value = this.buf.substring(this.start, this.pos); this.AddToStream(this.value); - if (this.buf[this.pos] == "\n") { + if(this.buf[this.pos] == "\n") + { this.AddToStream("\n"); this.pos++; } @@ -491,10 +558,12 @@ module.exports = function() { return this.enComments; } else - if (this.lexTypeRegStart[this.beforeRegExp] == "R") { + if(this.lexTypeRegStart[this.beforeRegExp] == "R") + { this.PosRegExp(); this.beforeRegExp = 65; - while ("gmi".indexOf(this.buf[this.pos]) >= 0) { + while("gmi".indexOf(this.buf[this.pos]) >= 0) + { this.pos++; } this.value = this.buf.substring(this.start, this.pos); @@ -514,7 +583,7 @@ module.exports = function() { case ">": s += this.AddNextOperator(">"); s += this.AddNextOperator("="); - if (s == ">>=") + if(s == ">>=") break; s += this.AddNextOperator(">"); s += this.AddNextOperator("="); @@ -531,13 +600,13 @@ module.exports = function() { break; case "+": s += this.AddNextOperator("+"); - if (s == "++") + if(s == "++") break; s += this.AddNextOperator("="); break; case "-": s += this.AddNextOperator("-"); - if (s == "--") + if(s == "--") break; s += this.AddNextOperator("="); break; @@ -546,13 +615,13 @@ module.exports = function() { break; case "&": s += this.AddNextOperator("&"); - if (s == "&&") + if(s == "&&") break; s += this.AddNextOperator("="); break; case "|": s += this.AddNextOperator("|"); - if (s == "||") + if(s == "||") break; s += this.AddNextOperator("="); break; @@ -564,7 +633,8 @@ module.exports = function() { break; case ".": var c2 = this.buf.charCodeAt(this.pos + 1); - if (this.lexTypeNumbers[c2]) { + if(this.lexTypeNumbers[c2]) + { this.pos++; this.PosNumber(); this.value = this.buf.substring(this.start, this.pos); @@ -585,90 +655,109 @@ module.exports = function() { this.type = this.enNewLine; return this.enNewLine; }; - this.AddNextOperator = function(find) { + this.AddNextOperator = function (find) + { var s2 = this.buf[this.pos + 1]; - if (s2 == find) { + if(s2 == find) + { this.pos++; return s2; } - else { + else + { return ""; } }; - this.ParseLexem = function(Code, bWrite) { + this.ParseLexem = function (Code,bWrite) + { this.Clear(); this.buf = Code; this.beforeRegExp = 61; var AllStr = ""; - while (true) { + while(true) + { var type = this.PosNextItem(); - if (type == this.enEndFile) + if(type == this.enEndFile) break; - if (bWrite) { + if(bWrite) + { AllStr = AllStr + this.value + "\n"; } } - if (AllStr) { + if(AllStr) + { console.log(AllStr); } return AllStr; }; - this.ParseLexem2 = function(Code) { + this.ParseLexem2 = function (Code) + { this.Clear(); this.buf = Code; this.beforeRegExp = 61; var n = 0; var Value1 = new Uint32Array(Code.length); var Value2 = new Uint32Array(Code.length); - while (true) { + while(true) + { var type = this.PosNextItem(); - if (type == this.enEndFile) + if(type == this.enEndFile) break; Value1[n] = this.start; Value2[n] = this.pos; n++; } - return { Value1: Value1, Value2: Value2 }; + return {Value1:Value1, Value2:Value2}; }; - this.ParseCode = function(Code) { + this.ParseCode = function (Code) + { this.Clear(); this.buf = Code; this.ParseSmart(); }; - this.ParseSmart = function() { + this.ParseSmart = function () + { var bPublic = 0; - while (true) { + while(true) + { var type = this.PosNextToken(); - if (type === this.enEndFile) + if(type === this.enEndFile) break; - if (type === this.enString && this.value === '"public"') { + if(type === this.enString && this.value === '"public"') + { bPublic = 1; continue; } - if (this.value === "function") { + if(this.value === "function") + { var FuncName = this.Parse_function(0, 1); - if (bPublic) + if(bPublic) this.ExternMap[FuncName] = bPublic; bPublic = 0; this.AddNewLineToStream(";\n"); } - else { + else + { this.Error("Require 'function' indenifier"); } } }; - this.ParseBlock = function(sConditions, bOneIteration, bSimpleMode, bNotCheck) { - if (!bOneIteration) + this.ParseBlock = function (sConditions,bOneIteration,bSimpleMode,bNotCheck) + { + if(!bOneIteration) this.BlockLevel++; var WasIgnoreCodeLevel = this.IgnoreCodeLevel; var bWasLabel = false; this.beforeRegExp = 61; Main: - while (true) { + while(true) + { var posSave = this.pos; var type = this.PosNextToken(); - if (!bNotCheck && !bSimpleMode && !bWasLabel) { - switch (type) { + if(!bNotCheck && !bSimpleMode && !bWasLabel) + { + switch(type) + { case ";": case ":": case "{": @@ -680,7 +769,8 @@ module.exports = function() { this.AddCheckLineToStream(); } } - switch (type) { + switch(type) + { case ";": bWasLabel = false; break; @@ -702,9 +792,11 @@ module.exports = function() { bNotCheck = false; var Name = this.value; var key = this.KeyWords[Name]; - if (key == 1 || Name == "function") { + if(key == 1 || Name == "function") + { this["Parse_" + this.ProcessWords[Name]](); - if (!bSimpleMode) { + if(!bSimpleMode) + { this.AddNewLineToStream(";\n"); } type = this.type; @@ -713,55 +805,67 @@ module.exports = function() { default: this.pos = posSave; type = this.ParseExpressionWithComma(false, false, true); - if (type === ":") { + if(type === ":") + { bWasLabel = true; } - else { + else + { bWasLabel = false; - if (!bSimpleMode) { + if(!bSimpleMode) + { this.AddNewLineToStream(";\n"); } } } - if (bOneIteration && type != ":") + if(bOneIteration && type != ":") break; } - if (sConditions) { - if (sConditions.indexOf(type) == - 1) { + if(sConditions) + { + if(sConditions.indexOf(type) == - 1) + { this.Error("Error block closing. Unexpected token: '%1'", this.GetTokenName(type)); } } this.IgnoreCodeLevel = WasIgnoreCodeLevel; - if (!bOneIteration) + if(!bOneIteration) this.BlockLevel--; return type; }; - this.ParseOneBlock = function() { + this.ParseOneBlock = function () + { var type = this.PosNextToken(); - if (type == "{") { + if(type == "{") + { this.AddNewLineToStream("\n"); this.AddNewLineToStream("{\n", true); var type = this.ParseBlock("}"); this.AddNewLineToStream("}\n", true); } else - if (type == ";") { - if (this.InjectCheck) { + if(type == ";") + { + if(this.InjectCheck) + { this.AddCheckLineToStream(); this.AddNewLineToStream("\n"); } else this.AddNewLineToStream(";\n"); } - else { - if (this.InjectCheck) { + else + { + if(this.InjectCheck) + { this.AddNewLineToStream("\n"); this.AddNewLineToStream("{\n", true); this.BackPos(); var type = this.ParseBlock(false, true); this.AddNewLineToStream("}\n", true); } - else { + else + { this.AddNewLineToStream("\n"); this.BackPos(); this.BlockLevel++; @@ -769,52 +873,59 @@ module.exports = function() { this.BlockLevel--; } } - if (type == ";") { + if(type == ";") + { this.NotBackPos(); } return type; }; - this.ParseExpressionWithComma = function(sConditions, bCanEmpty, bCanLabel) { + this.ParseExpressionWithComma = function (sConditions,bCanEmpty,bCanLabel) + { var sConditions2; - if (sConditions) + if(sConditions) sConditions2 = "," + sConditions; - while (true) { + while(true) + { var prev = this.pos; var type = this.ParseExpression(sConditions2, bCanEmpty, bCanLabel); - if (type != ",") + if(type != ",") break; - if (prev == this.pos || !sConditions2) + if(prev == this.pos || !sConditions2) this.PosNextItem(); bCanLabel = false; - if (this.CountCol <= this.PrintMargin) + if(this.CountCol <= this.PrintMargin) this.AddToStream(", "); else this.AddNewLineToStream(",\n", true); } return type; }; - this.ParseExpression = function(sConditions, bCanEmpty, bCanLabel) { + this.ParseExpression = function (sConditions,bCanEmpty,bCanLabel) + { var WasPlus2 = this.WasPlus; var stream2 = this.stream; this.WasPlus = 0; this.stream = ""; var type = this.ParseExpression0(sConditions, bCanEmpty, bCanLabel); - if (this.WasPlus) + if(this.WasPlus) this.stream = stream2 + "CHKL(" + this.stream + ")"; else this.stream = stream2 + this.stream; this.WasPlus = WasPlus2; return type; }; - this.ParseExpression0 = function(sConditions, bCanEmpty, bCanLabel) { + this.ParseExpression0 = function (sConditions,bCanEmpty,bCanLabel) + { var bWasExpr = false; var bCanDot = false; var bCanLeftSide = false; this.beforeRegExp = 61; Main: - while (true) { + while(true) + { var type = this.PosNextItem(); - switch (type) { + switch(type) + { case this.enSpaces: case this.enComments: continue; @@ -827,36 +938,43 @@ module.exports = function() { case this.enString: case this.enRegular: case "{": - if (bWasExpr) + if(bWasExpr) break Main; } - switch (type) { + switch(type) + { case this.enIndenifier: var Name = this.value; var key = this.KeyWords[Name]; - if (key == 3) { + if(key == 3) + { this["Parse_" + this.ProcessWords[Name]](); } else - if (key == 1 || key == 5) { + if(key == 1 || key == 5) + { type = this.enOperator; this.BackPos(); break Main; } - else { - if (!this.AllowedWords[Name]) + else + { + if(!this.AllowedWords[Name]) Name = LOC_ADD_NAME + Name; this.AddToStream(Name); - if (bCanLabel) { + if(bCanLabel) + { var posSave2 = this.pos; var type2 = this.PosNextToken(); - if (type2 == ":") { + if(type2 == ":") + { type = type2; bWasExpr = true; this.AddNewLineToStream(":\n", true); return ":"; } - else { + else + { this.pos = posSave2; } } @@ -902,7 +1020,7 @@ module.exports = function() { bWasExpr = true; break; case ".": - if (!bCanDot) + if(!bCanDot) this.Error("Unexpected token: '%1'", type); this.AddToStream("."); this.RequireIndenifier(); @@ -911,7 +1029,7 @@ module.exports = function() { bWasExpr = true; break; case "?": - if (!bWasExpr) + if(!bWasExpr) this.Error("Require expression before token: '%1'", type); this.ParseIfCondition(); bCanLeftSide = false; @@ -920,9 +1038,9 @@ module.exports = function() { break; case "=": case "+=": - if (type === "+=") + if(type === "+=") this.WasPlus = 1; - if (!bCanLeftSide) + if(!bCanLeftSide) this.Error("Unexpected token: '%1'", type); this.AddToStream(" " + type + " "); var type2 = this.ParseExpression(undefined, false, false); @@ -940,7 +1058,7 @@ module.exports = function() { case "|=": case "^=": case "%=": - if (!bCanLeftSide) + if(!bCanLeftSide) this.Error("Unexpected token: '%1'", type); this.AddToStream(" " + type + " "); bCanLeftSide = false; @@ -977,7 +1095,7 @@ module.exports = function() { case "/": case "&&": case "||": - if (!bWasExpr) + if(!bWasExpr) this.Error("Require expression before token: '%1'", type); bWasExpr = false; this.AddToStream(" " + type + " "); @@ -986,7 +1104,7 @@ module.exports = function() { break; case "-": case "+": - if (type === "+") + if(type === "+") this.WasPlus = 1; bWasExpr = false; this.AddToStream(" " + type + " "); @@ -995,13 +1113,14 @@ module.exports = function() { break; case "++": case "--": - if (this.WasEnter) - if (bWasExpr) { + if(this.WasEnter) + if(bWasExpr) + { type = ";"; break Main; } - if (bWasExpr) - if (!bCanDot) + if(bWasExpr) + if(!bCanDot) this.Error("Invalid left-side argument before token: '%1'", type); this.AddToStream(type); bCanLeftSide = false; @@ -1010,7 +1129,7 @@ module.exports = function() { case "in": case "of": case "instanceof": - if (!bWasExpr) + if(!bWasExpr) this.Error("Invalid argument before: '%1'", type); this.AddToStream(" " + type + " "); this.ParseExpressionWithComma(false, false); @@ -1031,38 +1150,46 @@ module.exports = function() { } this.WasEnter = false; } - if (sConditions) { - if (sConditions.indexOf(type) == - 1) { - if (type == this.enOperator) + if(sConditions) + { + if(sConditions.indexOf(type) == - 1) + { + if(type == this.enOperator) this.Error("Unexpected keywords: '%1'", Name); - else { + else + { var str = this.GetTokenName(type); - if (str == type) + if(str == type) this.Error("Error expression closing. Unexpected token: '%1'", str); else this.Error("Error expression closing. Unexpected %1", str); } } } - else { + else + { this.BackPos(); } - if (!bCanEmpty && !bWasExpr) { + if(!bCanEmpty && !bWasExpr) + { var str; - if (type == this.enOperator) + if(type == this.enOperator) str = Name; - else { + else + { str = this.GetTokenName(type); } - if (str == type) + if(str == type) this.Error("Require expression before token: '%1'", str); else this.Error("Require expression before: %1", str); } return type; }; - this.GetTokenName = function(type) { - switch (type) { + this.GetTokenName = function (type) + { + switch(type) + { case this.enNumber: return "number"; case this.enIndenifier: @@ -1077,81 +1204,98 @@ module.exports = function() { return type; } }; - this.RequireChar = function(sFind) { + this.RequireChar = function (sFind) + { var type = this.PosNextToken(); - if (type != sFind) + if(type != sFind) this.Error("Require token: '%1'", sFind); }; - this.RequireIndenifier = function(Name, DopStr) { + this.RequireIndenifier = function (Name,DopStr) + { var type = this.PosNextToken(); - if (type != this.enIndenifier || (Name && this.value != Name)) { - if (Name) + if(type != this.enIndenifier || (Name && this.value != Name)) + { + if(Name) this.Error("Require indenifier: '%1'", Name); else this.Error("Require indenifier"); } - if (DopStr) + if(DopStr) this.AddToStream(DopStr + this.value); else this.AddToStream(this.value); return this.value; }; - this.RequireIndenifierOptional = function() { + this.RequireIndenifierOptional = function () + { var type = this.PosNextToken(); - if (type != this.enIndenifier) { + if(type != this.enIndenifier) + { this.BackPos(); } - else { + else + { this.AddToStream(" " + this.value); } }; - this.HasEnter = function() { + this.HasEnter = function () + { this.PosNextToken(); this.BackPos(); return this.WasEnter; }; - this.Parse_var = function() { + this.Parse_var = function () + { this.AddToStream("var "); - while (true) { + while(true) + { this.RequireIndenifier(undefined, LOC_ADD_NAME); var type = this.PosNextToken(); this.AddToStream(type); - if (type === "=") + if(type === "=") this.ParseExpressionWithComma(false, false); - if (type !== ",") { + if(type !== ",") + { break; } } }; - this.Parse_function = function(bGetSet, bFindExternal) { - if (!bGetSet) { + this.Parse_function = function (bGetSet,bFindExternal) + { + if(!bGetSet) + { this.AddToStream("function "); } var FuncName; var type = this.PosNextToken(); - if (type == this.enIndenifier) { + if(type == this.enIndenifier) + { FuncName = this.value; - if (bGetSet) + if(bGetSet) this.AddToStream(FuncName); else this.AddToStream(LOC_ADD_NAME + FuncName); type = this.PosNextToken(); } else - if (bGetSet) { + if(bGetSet) + { this.Error("Require name before: '%1'", type); } - if (type != "(") + if(type != "(") this.Error("Require token: '%1'", "("); this.AddToStream("("); var bMustIdentifier = false; - while (true) { + while(true) + { type = this.PosNextToken(); - if (type == this.enIndenifier) { + if(type == this.enIndenifier) + { var Name = this.value; this.AddToStream(LOC_ADD_NAME + Name); type = this.PosNextToken(); - if (type == ",") { + if(type == ",") + { this.AddToStream(","); bMustIdentifier = true; continue; @@ -1159,28 +1303,33 @@ module.exports = function() { bMustIdentifier = false; } else - if (bMustIdentifier) { + if(bMustIdentifier) + { this.Error("Require indenifier"); break; } - if (type == ")") + if(type == ")") break; this.Error("Require indenifier"); } - if (FuncName && bFindExternal) { + if(FuncName && bFindExternal) + { this.FunctionMap[FuncName] = 1; type = this.PosNextToken(); - if (this.value === 'public') { + if(this.value === 'public') + { this.ExternMap[FuncName] = 1; } - else { + else + { this.BackPos(); } } this.RequireChar("{"); this.AddNewLineToStream(")\n", true); this.AddNewLineToStream("{\n", true); - if (this.InjectCheck) { + if(this.InjectCheck) + { this.AddCheckLineToStream(30); } this.ParseBlock("}", false, false, false); @@ -1188,71 +1337,86 @@ module.exports = function() { this.AddToStream("}", "} "); return FuncName; }; - this.ParseFunctionCall = function(bCanEmpty) { + this.ParseFunctionCall = function (bCanEmpty) + { this.AddToStream("("); this.ParseExpressionWithComma(")", true); this.AddToStream(")"); }; - this.Parse_void = function() { + this.Parse_void = function () + { this.AddToStream("void "); var type = this.ParseExpression(); }; - this.Parse_new = function() { + this.Parse_new = function () + { this.AddToStream("new "); var type = this.ParseExpression(); }; - this.Parse_delete = function() { + this.Parse_delete = function () + { this.AddToStream("delete "); this.ParseExpression(); }; - this.ParseIfCondition = function() { + this.ParseIfCondition = function () + { this.AddToStream(" ? "); this.ParseExpression(":"); this.AddToStream(" : "); this.ParseExpression(); }; - this.ParseDefArray = function() { + this.ParseDefArray = function () + { this.AddToStream("["); this.ParseExpressionWithComma("]", true); this.AddToStream("]"); }; - this.ParseDefObject = function() { + this.ParseDefObject = function () + { this.BlockLevel++; this.AddToStream("{"); - while (true) { + while(true) + { var type = this.PosNextToken(); - if (type == this.enIndenifier || type == this.enString || type == this.enNumber) { + if(type == this.enIndenifier || type == this.enString || type == this.enNumber) + { var Name = this.value; - if (Name === "get" || Name === "set") { + if(Name === "get" || Name === "set") + { type = this.PosNextToken(); - if (type == ":") { + if(type == ":") + { this.AddToStream(Name + ":"); type = this.ParseExpression(",}"); } - else { + else + { this.AddToStream(Name + " "); this.BackPos(); this.Parse_function(true); type = this.PosNextToken(); } } - else { + else + { this.RequireChar(":"); this.AddToStream(Name + ":"); type = this.ParseExpression(",}"); } } - if (type == "}") + if(type == "}") break; else - if (type == ",") { - if (this.CountCol <= this.PrintMargin) + if(type == ",") + { + if(this.CountCol <= this.PrintMargin) this.AddToStream(", "); else this.AddNewLineToStream(",\n", true); continue; } - else { + else + { this.Error("Unexpected token: '%1'", this.GetTokenName(type)); break; } @@ -1260,29 +1424,34 @@ module.exports = function() { this.BlockLevel--; this.AddToStream("}", "} "); }; - this.Parse_break = function() { + this.Parse_break = function () + { this.AddToStream("break"); - if (this.HasEnter()) - return; + if(this.HasEnter()) + return ; this.RequireIndenifierOptional(); }; - this.Parse_continue = function() { + this.Parse_continue = function () + { this.AddToStream("continue"); - if (this.HasEnter()) - return; + if(this.HasEnter()) + return ; this.RequireIndenifierOptional(); }; - this.Parse_return = function() { + this.Parse_return = function () + { this.AddToStream("return "); - if (this.HasEnter()) - return; + if(this.HasEnter()) + return ; this.ParseExpressionWithComma(false, true); }; - this.Parse_typeof = function() { + this.Parse_typeof = function () + { this.AddToStream("typeof "); this.ParseExpression(); }; - this.Parse_for = function() { + this.Parse_for = function () + { this.AddToStream("for("); this.RequireChar("("); var bForInMode = false; @@ -1290,27 +1459,32 @@ module.exports = function() { var bWasName; var posSave = this.pos; var type = this.PosNextToken(); - if (type == this.enIndenifier) { - if (this.value == "var") { + if(type == this.enIndenifier) + { + if(this.value == "var") + { type = this.PosNextToken(); bWasVar = true; } - if (type == this.enIndenifier) { + if(type == this.enIndenifier) + { bWasName = this.value; type = this.PosNextToken(); - if (type == this.enIndenifier && (this.value == "in" || this.value == "of")) + if(type == this.enIndenifier && (this.value == "in" || this.value == "of")) bForInMode = true; } } - if (bForInMode) { - if (bWasVar) + if(bForInMode) + { + if(bWasVar) this.AddToStream("var "); this.AddToStream(LOC_ADD_NAME + bWasName + " " + this.value + " "); } - else { + else + { this.pos = posSave; var type = this.ParseBlock(";", true, true); - if (type == ";") + if(type == ";") this.NotBackPos(); this.AddToStream("; "); this.ParseExpressionWithComma(";", true); @@ -1320,14 +1494,16 @@ module.exports = function() { this.AddToStream(")"); this.ParseOneBlock(); }; - this.Parse_while = function() { + this.Parse_while = function () + { this.RequireChar("("); this.AddToStream("while("); this.ParseExpressionWithComma(")"); this.AddToStream(")"); this.ParseOneBlock(); }; - this.Parse_do = function() { + this.Parse_do = function () + { this.AddToStream("do"); this.ParseOneBlock(); this.RequireIndenifier("while"); @@ -1336,22 +1512,26 @@ module.exports = function() { this.ParseExpressionWithComma(")"); this.AddToStream(")"); }; - this.Parse_if = function() { + this.Parse_if = function () + { this.AddToStream("if("); this.RequireChar("("); this.ParseExpressionWithComma(")"); this.AddToStream(")"); this.ParseOneBlock(); var type = this.PosNextToken(); - if (type == this.enIndenifier && this.ProcessWords[this.value] == "else") { + if(type == this.enIndenifier && this.ProcessWords[this.value] == "else") + { this.AddToStream("else"); this.ParseOneBlock(); } - else { + else + { this.BackPos(); } }; - this.Parse_switch = function() { + this.Parse_switch = function () + { this.RequireChar("("); this.AddToStream("switch("); this.ParseExpressionWithComma(")"); @@ -1363,36 +1543,41 @@ module.exports = function() { this.BlockLevel--; this.AddNewLineToStream("}\n", true); }; - this.Parse_case = function() { + this.Parse_case = function () + { this.BlockLevel--; this.AddToStream("case "); this.ParseExpressionWithComma(":"); this.AddNewLineToStream(":\n", true); this.BlockLevel++; }; - this.Parse_default = function() { + this.Parse_default = function () + { this.RequireChar(":"); this.BlockLevel--; this.AddNewLineToStream("default:\n", true); this.BlockLevel++; }; - this.Parse_with = function() { + this.Parse_with = function () + { this.RequireChar("("); this.AddToStream("with("); this.ParseExpressionWithComma(")"); this.AddToStream(")"); this.ParseOneBlock(); }; - this.Parse_try = function() { + this.Parse_try = function () + { this.Error("try-catch not support"); - return; + return ; this.RequireChar("{"); this.AddToStream("try\n"); this.AddNewLineToStream("{\n", true); this.ParseBlock("}"); this.AddNewLineToStream("}\n", true); var type = this.PosNextToken(); - if (type == this.enIndenifier && this.ProcessWords[this.value] == "catch") { + if(type == this.enIndenifier && this.ProcessWords[this.value] == "catch") + { this.AddToStream("catch("); this.RequireChar("("); this.RequireIndenifier(); @@ -1404,7 +1589,8 @@ module.exports = function() { this.AddToStream("}"); type = this.PosNextToken(); } - if (type == this.enIndenifier && this.ProcessWords[this.value] == "finally") { + if(type == this.enIndenifier && this.ProcessWords[this.value] == "finally") + { this.RequireChar("{"); this.AddNewLineToStream("\n"); this.AddNewLineToStream("finally\n", true); @@ -1412,69 +1598,86 @@ module.exports = function() { this.ParseBlock("}"); this.AddToStream("}"); } - else { + else + { this.BackPos(); } }; - this.Parse_throw = function() { + this.Parse_throw = function () + { this.AddToStream("throw "); - if (this.HasEnter()) - return; + if(this.HasEnter()) + return ; var type = this.ParseExpressionWithComma(); }; - this.AddCheckLineToStream = function(Count) { - if (this.InjectCheck) { - if (!Count) + this.AddCheckLineToStream = function (Count) + { + if(this.InjectCheck) + { + if(!Count) Count = 1; this.CalculateLineNumber(); this.AddToStream("DO(" + Count + ");"); } }; - this.CalculateLineNumber = function() { - for (var i = this.posLineNumber; i < this.pos; i++) - if (this.buf[i] == "\n") + this.CalculateLineNumber = function () + { + for(var i = this.posLineNumber; i < this.pos; i++) + if(this.buf[i] == "\n") this.LineNumber++; this.posLineNumber = this.pos; }; - this.CalculateLineNumber0 = function(str) { - for (var i = 0; i < str.length; i++) - if (str[i] == "\n") + this.CalculateLineNumber0 = function (str) + { + for(var i = 0; i < str.length; i++) + if(str[i] == "\n") this.LineNumber++; }; - this.AddCheckToStream = function(str) { - if (this.InjectCheck) { + this.AddCheckToStream = function (str) + { + if(this.InjectCheck) + { this.AddToStream(str); } }; - this.AddToStreamSimple = function(str, strMustLast) { - if (strMustLast) + this.AddToStreamSimple = function (str,strMustLast) + { + if(strMustLast) this.LastStreamValue = strMustLast; else this.LastStreamValue = str; - if (!this.IgnoreCodeLevel) + if(!this.IgnoreCodeLevel) this.stream += str; }; - this.AddToStreamAddTab = function(str, strMustLast) { - if (this.LastStreamValue[this.LastStreamValue.length - 1] == "\n") { + this.AddToStreamAddTab = function (str,strMustLast) + { + if(this.LastStreamValue[this.LastStreamValue.length - 1] == "\n") + { this.CountCol = 0; - if (!this.IgnoreCodeLevel) + if(!this.IgnoreCodeLevel) this.stream += this.SpacesArray[this.BlockLevel >= 100 ? 99 : this.BlockLevel]; } - if (str[str.length - 1] == "\n") { + if(str[str.length - 1] == "\n") + { this.CountCol = 0; } - else { + else + { this.CountCol += str.length; } this.AddToStreamSimple(str, strMustLast); }; - this.AddNewLineToStream = function(str, bAlways) { + this.AddNewLineToStream = function (str,bAlways) + { var sLast = this.LastStreamValue[this.LastStreamValue.length - 1]; - if (bAlways || sLast != "\n") { - if (str == ";\n" && (sLast == "}" || sLast == ";")) { + if(bAlways || sLast != "\n") + { + if(str == ";\n" && (sLast == "}" || sLast == ";")) + { this.AddToStream("\n"); } - else { + else + { this.AddToStream(str); } } diff --git a/src/HTML/JS/marked.js b/src/HTML/JS/marked.js index d73b226..048f972 100644 --- a/src/HTML/JS/marked.js +++ b/src/HTML/JS/marked.js @@ -1 +1 @@ -!function(e) { "use strict"; var k = { newline: /^\n+/, code: /^( {4}[^\n]+\n*)+/, fences: g, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/, nptable: g, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: "^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))", def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: g, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, text: /^[^\n]+/ }; function a(e) { this.tokens = [], this.tokens.links = Object.create(null), this.options = e || d.defaults, this.rules = k.normal, this.options.pedantic ? this.rules = k.pedantic : this.options.gfm && (this.options.tables ? this.rules = k.tables : this.rules = k.gfm) } k._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/, k._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/, k.def = t(k.def).replace("label", k._label).replace("title", k._title).getRegex(), k.bullet = /(?:[*+-]|\d+\.)/, k.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/, k.item = t(k.item, "gm").replace(/bull/g, k.bullet).getRegex(), k.list = t(k.list).replace(/bull/g, k.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + k.def.source + ")").getRegex(), k._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", k._comment = //, k.html = t(k.html, "i").replace("comment", k._comment).replace("tag", k._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), k.paragraph = t(k.paragraph).replace("hr", k.hr).replace("heading", k.heading).replace("lheading", k.lheading).replace("tag", k._tag).getRegex(), k.blockquote = t(k.blockquote).replace("paragraph", k.paragraph).getRegex(), k.normal = f({}, k), k.gfm = f({}, k.normal, { fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/, paragraph: /^/, heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }), k.gfm.paragraph = t(k.paragraph).replace("(?!", "(?!" + k.gfm.fences.source.replace("\\1", "\\2") + "|" + k.list.source.replace("\\1", "\\3") + "|").getRegex(), k.tables = f({}, k.gfm, { nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ }), k.pedantic = f({}, k.normal, { html: t("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", k._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ }), a.rules = k, a.lex = function(e, t) { return new a(t).lex(e) }, a.prototype.lex = function(e) { return e = e.replace(/\r\n|\r/g, "\n").replace(/\t/g, " ").replace(/\u00a0/g, " ").replace(/\u2424/g, "\n"), this.token(e, !0) }, a.prototype.token = function(e, t) { var n, r, s, i, l, o, a, h, p, c, u, g, f, d, b, m; for (e = e.replace(/^ +$/gm, ""); e;)if ((s = this.rules.newline.exec(e)) && (e = e.substring(s[0].length), 1 < s[0].length && this.tokens.push({ type: "space" })), s = this.rules.code.exec(e)) e = e.substring(s[0].length), s = s[0].replace(/^ {4}/gm, ""), this.tokens.push({ type: "code", text: this.options.pedantic ? s : y(s, "\n") }); else if (s = this.rules.fences.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: "code", lang: s[2], text: s[3] || "" }); else if (s = this.rules.heading.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: "heading", depth: s[1].length, text: s[2] }); else if (t && (s = this.rules.nptable.exec(e)) && (o = { type: "table", header: x(s[1].replace(/^ *| *\| *$/g, "")), align: s[2].replace(/^ *|\| *$/g, "").split(/ *\| */), cells: s[3] ? s[3].replace(/\n$/, "").split("\n") : [] }).header.length === o.align.length) { for (e = e.substring(s[0].length), u = 0; u < o.align.length; u++)/^ *-+: *$/.test(o.align[u]) ? o.align[u] = "right" : /^ *:-+: *$/.test(o.align[u]) ? o.align[u] = "center" : /^ *:-+ *$/.test(o.align[u]) ? o.align[u] = "left" : o.align[u] = null; for (u = 0; u < o.cells.length; u++)o.cells[u] = x(o.cells[u], o.header.length); this.tokens.push(o) } else if (s = this.rules.hr.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: "hr" }); else if (s = this.rules.blockquote.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: "blockquote_start" }), s = s[0].replace(/^ *> ?/gm, ""), this.token(s, t), this.tokens.push({ type: "blockquote_end" }); else if (s = this.rules.list.exec(e)) { for (e = e.substring(s[0].length), a = { type: "list_start", ordered: d = 1 < (i = s[2]).length, start: d ? +i : "", loose: !1 }, this.tokens.push(a), n = !(h = []), f = (s = s[0].match(this.rules.item)).length, u = 0; u < f; u++)c = (o = s[u]).length, ~(o = o.replace(/^ *([*+-]|\d+\.) +/, "")).indexOf("\n ") && (c -= o.length, o = this.options.pedantic ? o.replace(/^ {1,4}/gm, "") : o.replace(new RegExp("^ {1," + c + "}", "gm"), "")), this.options.smartLists && u !== f - 1 && (i === (l = k.bullet.exec(s[u + 1])[0]) || 1 < i.length && 1 < l.length || (e = s.slice(u + 1).join("\n") + e, u = f - 1)), r = n || /\n\n(?!\s*$)/.test(o), u !== f - 1 && (n = "\n" === o.charAt(o.length - 1), r = r || n), r && (a.loose = !0), m = void 0, (b = /^\[[ xX]\] /.test(o)) && (m = " " !== o[1], o = o.replace(/^\[[ xX]\] +/, "")), p = { type: "list_item_start", task: b, checked: m, loose: r }, h.push(p), this.tokens.push(p), this.token(o, !1), this.tokens.push({ type: "list_item_end" }); if (a.loose) for (f = h.length, u = 0; u < f; u++)h[u].loose = !0; this.tokens.push({ type: "list_end" }) } else if (s = this.rules.html.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: this.options.sanitize ? "paragraph" : "html", pre: !this.options.sanitizer && ("pre" === s[1] || "script" === s[1] || "style" === s[1]), text: s[0] }); else if (t && (s = this.rules.def.exec(e))) e = e.substring(s[0].length), s[3] && (s[3] = s[3].substring(1, s[3].length - 1)), g = s[1].toLowerCase().replace(/\s+/g, " "), this.tokens.links[g] || (this.tokens.links[g] = { href: s[2], title: s[3] }); else if (t && (s = this.rules.table.exec(e)) && (o = { type: "table", header: x(s[1].replace(/^ *| *\| *$/g, "")), align: s[2].replace(/^ *|\| *$/g, "").split(/ *\| */), cells: s[3] ? s[3].replace(/(?: *\| *)?\n$/, "").split("\n") : [] }).header.length === o.align.length) { for (e = e.substring(s[0].length), u = 0; u < o.align.length; u++)/^ *-+: *$/.test(o.align[u]) ? o.align[u] = "right" : /^ *:-+: *$/.test(o.align[u]) ? o.align[u] = "center" : /^ *:-+ *$/.test(o.align[u]) ? o.align[u] = "left" : o.align[u] = null; for (u = 0; u < o.cells.length; u++)o.cells[u] = x(o.cells[u].replace(/^ *\| *| *\| *$/g, ""), o.header.length); this.tokens.push(o) } else if (s = this.rules.lheading.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: "heading", depth: "=" === s[2] ? 1 : 2, text: s[1] }); else if (t && (s = this.rules.paragraph.exec(e))) e = e.substring(s[0].length), this.tokens.push({ type: "paragraph", text: "\n" === s[1].charAt(s[1].length - 1) ? s[1].slice(0, -1) : s[1] }); else if (s = this.rules.text.exec(e)) e = e.substring(s[0].length), this.tokens.push({ type: "text", text: s[0] }); else if (e) throw new Error("Infinite loop on byte: " + e.charCodeAt(0)); return this.tokens }; var n = { escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: g, tag: "^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^", link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, strong: /^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: g, text: /^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g, n._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/, n._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/, n.autolink = t(n.autolink).replace("scheme", n._scheme).replace("email", n._email).getRegex(), n._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/, n.tag = t(n.tag).replace("comment", k._comment).replace("attribute", n._attribute).getRegex(), n._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/, n._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/, n._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/, n.link = t(n.link).replace("label", n._label).replace("href", n._href).replace("title", n._title).getRegex(), n.reflink = t(n.reflink).replace("label", n._label).getRegex(), n.normal = f({}, n), n.pedantic = f({}, n.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, link: t(/^!?\[(label)\]\((.*?)\)/).replace("label", n._label).getRegex(), reflink: t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", n._label).getRegex() }), n.gfm = f({}, n.normal, { escape: t(n.escape).replace("])", "~|])").getRegex(), _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, del: /^~+(?=\S)([\s\S]*?\S)~+/, text: t(n.text).replace("]|", "~]|").replace("|$", "|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex() }), n.gfm.url = t(n.gfm.url).replace("email", n.gfm._extended_email).getRegex(), n.breaks = f({}, n.gfm, { br: t(n.br).replace("{2,}", "*").getRegex(), text: t(n.gfm.text).replace("{2,}", "*").getRegex() }), h.rules = n, h.output = function(e, t, n) { return new h(t, n).output(e) }, h.prototype.output = function(e) { for (var t, n, r, s, i, l, o = ""; e;)if (i = this.rules.escape.exec(e)) e = e.substring(i[0].length), o += i[1]; else if (i = this.rules.autolink.exec(e)) e = e.substring(i[0].length), r = "@" === i[2] ? "mailto:" + (n = c(this.mangle(i[1]))) : n = c(i[1]), o += this.renderer.link(r, null, n); else if (this.inLink || !(i = this.rules.url.exec(e))) { if (i = this.rules.tag.exec(e)) !this.inLink && /^/i.test(i[0]) && (this.inLink = !1), !this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(i[0]) ? this.inRawBlock = !0 : this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0]) && (this.inRawBlock = !1), e = e.substring(i[0].length), o += this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(i[0]) : c(i[0]) : i[0]; else if (i = this.rules.link.exec(e)) e = e.substring(i[0].length), this.inLink = !0, r = i[2], s = this.options.pedantic ? (t = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r)) ? (r = t[1], t[3]) : "" : i[3] ? i[3].slice(1, -1) : "", r = r.trim().replace(/^<([\s\S]*)>$/, "$1"), o += this.outputLink(i, { href: h.escapes(r), title: h.escapes(s) }), this.inLink = !1; else if ((i = this.rules.reflink.exec(e)) || (i = this.rules.nolink.exec(e))) { if (e = e.substring(i[0].length), t = (i[2] || i[1]).replace(/\s+/g, " "), !(t = this.links[t.toLowerCase()]) || !t.href) { o += i[0].charAt(0), e = i[0].substring(1) + e; continue } this.inLink = !0, o += this.outputLink(i, t), this.inLink = !1 } else if (i = this.rules.strong.exec(e)) e = e.substring(i[0].length), o += this.renderer.strong(this.output(i[4] || i[3] || i[2] || i[1])); else if (i = this.rules.em.exec(e)) e = e.substring(i[0].length), o += this.renderer.em(this.output(i[6] || i[5] || i[4] || i[3] || i[2] || i[1])); else if (i = this.rules.code.exec(e)) e = e.substring(i[0].length), o += this.renderer.codespan(c(i[2].trim(), !0)); else if (i = this.rules.br.exec(e)) e = e.substring(i[0].length), o += this.renderer.br(); else if (i = this.rules.del.exec(e)) e = e.substring(i[0].length), o += this.renderer.del(this.output(i[1])); else if (i = this.rules.text.exec(e)) e = e.substring(i[0].length), this.inRawBlock ? o += this.renderer.text(i[0]) : o += this.renderer.text(c(this.smartypants(i[0]))); else if (e) throw new Error("Infinite loop on byte: " + e.charCodeAt(0)) } else { if ("@" === i[2]) r = "mailto:" + (n = c(i[0])); else { for (; l = i[0], i[0] = this.rules._backpedal.exec(i[0])[0], l !== i[0];); n = c(i[0]), r = "www." === i[1] ? "http://" + n : n } e = e.substring(i[0].length), o += this.renderer.link(r, null, n) } return o }, h.escapes = function(e) { return e ? e.replace(h.rules._escapes, "$1") : e }, h.prototype.outputLink = function(e, t) { var n = t.href, r = t.title ? c(t.title) : null; return "!" !== e[0].charAt(0) ? this.renderer.link(n, r, this.output(e[1])) : this.renderer.image(n, r, c(e[1])) }, h.prototype.smartypants = function(e) { return this.options.smartypants ? e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…") : e }, h.prototype.mangle = function(e) { if (!this.options.mangle) return e; for (var t, n = "", r = e.length, s = 0; s < r; s++)t = e.charCodeAt(s), .5 < Math.random() && (t = "x" + t.toString(16)), n += "&#" + t + ";"; return n }, r.prototype.code = function(e, t, n) { if (this.options.highlight) { var r = this.options.highlight(e, t); null != r && r !== e && (n = !0, e = r) } return t ? '
' + (n ? e : c(e, !0)) + "
\n" : "
" + (n ? e : c(e, !0)) + "
" }, r.prototype.blockquote = function(e) { return "
\n" + e + "
\n" }, r.prototype.html = function(e) { return e }, r.prototype.heading = function(e, t, n) { return this.options.headerIds ? "' + e + "\n" : "" + e + "\n" }, r.prototype.hr = function() { return this.options.xhtml ? "
\n" : "
\n" }, r.prototype.list = function(e, t, n) { var r = t ? "ol" : "ul"; return "<" + r + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + e + "\n" }, r.prototype.listitem = function(e) { return "
  • " + e + "
  • \n" }, r.prototype.checkbox = function(e) { return " " }, r.prototype.paragraph = function(e) { return "

    " + e + "

    \n" }, r.prototype.table = function(e, t) { return "\n\n" + e + "\n" + (t = t && "" + t + "") + "
    \n" }, r.prototype.tablerow = function(e) { return "\n" + e + "\n" }, r.prototype.tablecell = function(e, t) { var n = t.header ? "th" : "td"; return (t.align ? "<" + n + ' align="' + t.align + '">' : "<" + n + ">") + e + "\n" }, r.prototype.strong = function(e) { return "" + e + "" }, r.prototype.em = function(e) { return "" + e + "" }, r.prototype.codespan = function(e) { return "" + e + "" }, r.prototype.br = function() { return this.options.xhtml ? "
    " : "
    " }, r.prototype.del = function(e) { return "" + e + "" }, r.prototype.link = function(e, t, n) { if (this.options.sanitize) { try { var r = decodeURIComponent(u(e)).replace(/[^\w:]/g, "").toLowerCase() } catch (e) { return n } if (0 === r.indexOf("javascript:") || 0 === r.indexOf("vbscript:") || 0 === r.indexOf("data:")) return n } this.options.baseUrl && !o.test(e) && (e = i(this.options.baseUrl, e)); try { e = encodeURI(e).replace(/%25/g, "%") } catch (e) { return n } var s = '
    " }, r.prototype.image = function(e, t, n) { this.options.baseUrl && !o.test(e) && (e = i(this.options.baseUrl, e)); var r = '' + n + '" : ">" }, r.prototype.text = function(e) { return e }, s.prototype.strong = s.prototype.em = s.prototype.codespan = s.prototype.del = s.prototype.text = function(e) { return e }, s.prototype.link = s.prototype.image = function(e, t, n) { return "" + n }, s.prototype.br = function() { return "" }, p.parse = function(e, t) { return new p(t).parse(e) }, p.prototype.parse = function(e) { this.inline = new h(e.links, this.options), this.inlineText = new h(e.links, f({}, this.options, { renderer: new s })), this.tokens = e.reverse(); for (var t = ""; this.next();)t += this.tok(); return t }, p.prototype.next = function() { return this.token = this.tokens.pop() }, p.prototype.peek = function() { return this.tokens[this.tokens.length - 1] || 0 }, p.prototype.parseText = function() { for (var e = this.token.text; "text" === this.peek().type;)e += "\n" + this.next().text; return this.inline.output(e) }, p.prototype.tok = function() { switch (this.token.type) { case "space": return ""; case "hr": return this.renderer.hr(); case "heading": return this.renderer.heading(this.inline.output(this.token.text), this.token.depth, u(this.inlineText.output(this.token.text))); case "code": return this.renderer.code(this.token.text, this.token.lang, this.token.escaped); case "table": var e, t, n, r, s = "", i = ""; for (n = "", e = 0; e < this.token.header.length; e++)n += this.renderer.tablecell(this.inline.output(this.token.header[e]), { header: !0, align: this.token.align[e] }); for (s += this.renderer.tablerow(n), e = 0; e < this.token.cells.length; e++) { for (t = this.token.cells[e], n = "", r = 0; r < t.length; r++)n += this.renderer.tablecell(this.inline.output(t[r]), { header: !1, align: this.token.align[r] }); i += this.renderer.tablerow(n) } return this.renderer.table(s, i); case "blockquote_start": for (i = ""; "blockquote_end" !== this.next().type;)i += this.tok(); return this.renderer.blockquote(i); case "list_start": i = ""; for (var l = this.token.ordered, o = this.token.start; "list_end" !== this.next().type;)i += this.tok(); return this.renderer.list(i, l, o); case "list_item_start": i = ""; var a = this.token.loose; for (this.token.task && (i += this.renderer.checkbox(this.token.checked)); "list_item_end" !== this.next().type;)i += a || "text" !== this.token.type ? this.tok() : this.parseText(); return this.renderer.listitem(i); case "html": return this.renderer.html(this.token.text); case "paragraph": return this.renderer.paragraph(this.inline.output(this.token.text)); case "text": return this.renderer.paragraph(this.parseText()) } }, c.escapeTest = /[&<>"']/, c.escapeReplace = /[&<>"']/g, c.replacements = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, c.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/, c.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; var l = {}, o = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; function g() { } function f(e) { for (var t, n, r = 1; r < arguments.length; r++)for (n in t = arguments[r]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e } function x(e, t) { var n = e.replace(/\|/g, function(e, t, n) { for (var r = !1, s = t; 0 <= --s && "\\" === n[s];)r = !r; return r ? "|" : " |" }).split(/ \|/), r = 0; if (n.length > t) n.splice(t); else for (; n.length < t;)n.push(""); for (; r < n.length; r++)n[r] = n[r].trim().replace(/\\\|/g, "|"); return n } function y(e, t, n) { if (0 === e.length) return ""; for (var r = 0; r < e.length;) { var s = e.charAt(e.length - r - 1); if (s !== t || n) { if (s === t || !n) break; r++ } else r++ } return e.substr(0, e.length - r) } function d(e, n, r) { if (null == e) throw new Error("marked(): input parameter is undefined or null"); if ("string" != typeof e) throw new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"); if (r || "function" == typeof n) { r || (r = n, n = null); var s, i, l = (n = f({}, d.defaults, n || {})).highlight, t = 0; try { s = a.lex(e, n) } catch (e) { return r(e) } i = s.length; var o = function(t) { if (t) return n.highlight = l, r(t); var e; try { e = p.parse(s, n) } catch (e) { t = e } return n.highlight = l, t ? r(t) : r(null, e) }; if (!l || l.length < 3) return o(); if (delete n.highlight, !i) return o(); for (; t < s.length; t++)!function(n) { "code" !== n.type ? --i || o() : l(n.text, n.lang, function(e, t) { return e ? o(e) : null == t || t === n.text ? --i || o() : (n.text = t, n.escaped = !0, void (--i || o())) }) }(s[t]) } else try { return n = n && f({}, d.defaults, n), p.parse(a.lex(e, n), n) } catch (e) { if (e.message += "\nPlease report this to https://github.com/markedjs/marked.", (n || d.defaults).silent) return "

    An error occurred:

    " + c(e.message + "", !0) + "
    "; throw e } } g.exec = g, d.options = d.setOptions = function(e) { return f(d.defaults, e), d }, d.getDefaults = function() { return { baseUrl: null, breaks: !1, gfm: !0, headerIds: !0, headerPrefix: "", highlight: null, langPrefix: "language-", mangle: !0, pedantic: !1, renderer: new r, sanitize: !0, sanitizer: null, silent: !1, smartLists: !1, smartypants: !1, tables: !0, xhtml: !1 } }, d.defaults = d.getDefaults(), d.Parser = p, d.parser = p.parse, d.Renderer = r, d.TextRenderer = s, d.Lexer = a, d.lexer = a.lex, d.InlineLexer = h, d.inlineLexer = h.output, d.parse = d, "undefined" != typeof module && "object" == typeof exports ? module.exports = d : "function" == typeof define && define.amd ? define(function() { return d }) : e.marked = d }(this || ("undefined" != typeof window ? window : global)); \ No newline at end of file +!function(e){"use strict";var k={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:g,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:g,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:g,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function a(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||d.defaults,this.rules=k.normal,this.options.pedantic?this.rules=k.pedantic:this.options.gfm&&(this.options.tables?this.rules=k.tables:this.rules=k.gfm)}k._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,k._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,k.def=t(k.def).replace("label",k._label).replace("title",k._title).getRegex(),k.bullet=/(?:[*+-]|\d+\.)/,k.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,k.item=t(k.item,"gm").replace(/bull/g,k.bullet).getRegex(),k.list=t(k.list).replace(/bull/g,k.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+k.def.source+")").getRegex(),k._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",k._comment=//,k.html=t(k.html,"i").replace("comment",k._comment).replace("tag",k._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),k.paragraph=t(k.paragraph).replace("hr",k.hr).replace("heading",k.heading).replace("lheading",k.lheading).replace("tag",k._tag).getRegex(),k.blockquote=t(k.blockquote).replace("paragraph",k.paragraph).getRegex(),k.normal=f({},k),k.gfm=f({},k.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),k.gfm.paragraph=t(k.paragraph).replace("(?!","(?!"+k.gfm.fences.source.replace("\\1","\\2")+"|"+k.list.source.replace("\\1","\\3")+"|").getRegex(),k.tables=f({},k.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),k.pedantic=f({},k.normal,{html:t("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",k._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),a.rules=k,a.lex=function(e,t){return new a(t).lex(e)},a.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},a.prototype.token=function(e,t){var n,r,s,i,l,o,a,h,p,c,u,g,f,d,b,m;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),1 ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),a={type:"list_start",ordered:d=1<(i=s[2]).length,start:d?+i:"",loose:!1},this.tokens.push(a),n=!(h=[]),f=(s=s[0].match(this.rules.item)).length,u=0;u?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:g,text:/^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g,n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=t(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,n.tag=t(n.tag).replace("comment",k._comment).replace("attribute",n._attribute).getRegex(),n._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,n._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/,n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,n.link=t(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex(),n.reflink=t(n.reflink).replace("label",n._label).getRegex(),n.normal=f({},n),n.pedantic=f({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:t(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()}),n.gfm=f({},n.normal,{escape:t(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:t(n.text).replace("]|","~]|").replace("|$","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex()}),n.gfm.url=t(n.gfm.url).replace("email",n.gfm._extended_email).getRegex(),n.breaks=f({},n.gfm,{br:t(n.br).replace("{2,}","*").getRegex(),text:t(n.gfm.text).replace("{2,}","*").getRegex()}),h.rules=n,h.output=function(e,t,n){return new h(t,n).output(e)},h.prototype.output=function(e){for(var t,n,r,s,i,l,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?"mailto:"+(n=c(this.mangle(i[1]))):n=c(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.inRawBlock=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):c(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,r=i[2],s=this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],t[3]):"":i[3]?i[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(i,{href:h.escapes(r),title:h.escapes(s)}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[4]||i[3]||i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[6]||i[5]||i[4]||i[3]||i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(c(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.inRawBlock?o+=this.renderer.text(i[0]):o+=this.renderer.text(c(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===i[2])r="mailto:"+(n=c(i[0]));else{for(;l=i[0],i[0]=this.rules._backpedal.exec(i[0])[0],l!==i[0];);n=c(i[0]),r="www."===i[1]?"http://"+n:n}e=e.substring(i[0].length),o+=this.renderer.link(r,null,n)}return o},h.escapes=function(e){return e?e.replace(h.rules._escapes,"$1"):e},h.prototype.outputLink=function(e,t){var n=t.href,r=t.title?c(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,c(e[1]))},h.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},h.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s'+(n?e:c(e,!0))+"\n":"
    "+(n?e:c(e,!0))+"
    "},r.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},r.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},r.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},r.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},r.prototype.checkbox=function(e){return" "},r.prototype.paragraph=function(e){return"

    "+e+"

    \n"},r.prototype.table=function(e,t){return"\n\n"+e+"\n"+(t=t&&""+t+"")+"
    \n"},r.prototype.tablerow=function(e){return"\n"+e+"\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(u(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!o.test(e)&&(e=i(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='
    "},r.prototype.image=function(e,t,n){this.options.baseUrl&&!o.test(e)&&(e=i(this.options.baseUrl,e));var r=''+n+'":">"},r.prototype.text=function(e){return e},s.prototype.strong=s.prototype.em=s.prototype.codespan=s.prototype.del=s.prototype.text=function(e){return e},s.prototype.link=s.prototype.image=function(e,t,n){return""+n},s.prototype.br=function(){return""},p.parse=function(e,t){return new p(t).parse(e)},p.prototype.parse=function(e){this.inline=new h(e.links,this.options),this.inlineText=new h(e.links,f({},this.options,{renderer:new s})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},p.prototype.next=function(){return this.token=this.tokens.pop()},p.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},p.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},p.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e"']/,c.escapeReplace=/[&<>"']/g,c.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},c.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,c.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var l={},o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(){}function f(e){for(var t,n,r=1;rt)n.splice(t);else for(;n.lengthAn error occurred:

    "+c(e.message+"",!0)+"
    ";throw e}}g.exec=g,d.options=d.setOptions=function(e){return f(d.defaults,e),d},d.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new r,sanitize:!0,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},d.defaults=d.getDefaults(),d.Parser=p,d.parser=p.parse,d.Renderer=r,d.TextRenderer=s,d.Lexer=a,d.lexer=a.lex,d.InlineLexer=h,d.inlineLexer=h.output,d.parse=d,"undefined"!=typeof module&&"object"==typeof exports?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):e.marked=d}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file diff --git a/src/HTML/JS/mobile-wallet.js b/src/HTML/JS/mobile-wallet.js index 3151a85..eab5f48 100644 --- a/src/HTML/JS/mobile-wallet.js +++ b/src/HTML/JS/mobile-wallet.js @@ -9,30 +9,34 @@ */ var SaveIdArr = ["idAccount", "idTo", "idSumSend", "idDescription", "idCurTabName", "idViewBlockNum", "idViewAccountNum", "idViewDappNum", - "idLang"]; -var CONFIG_DATA = { PRICE_DAO: { NewAccount: 10 }, MaxNumBlockDB: 0, MaxAccID: 0, MaxDappsID: 0 }; +"idLang"]; +var CONFIG_DATA = {PRICE_DAO:{NewAccount:10}, MaxNumBlockDB:0, MaxAccID:0, MaxDappsID:0}; var CountViewRows = 20; -var DefAccounts = { BlockName: "idPaginationAccount", NumName: "idViewAccountNum", TabName: "explorer_accounts", APIName: "GetAccountList" }; -var DefBlock = { BlockName: "idPaginationBlock", NumName: "idViewBlockNum", TabName: "explorer_blocks", APIName: "GetBlockList" }; -var DefDapps = { - BlockName: "idPaginationDapps", NumName: "idViewDappNum", TabName: "dapps_list", APIName: "GetDappList", CountViewRows: 10, - FilterName: "idCategory" -}; +var DefAccounts = {BlockName:"idPaginationAccount", NumName:"idViewAccountNum", TabName:"explorer_accounts", APIName:"GetAccountList"}; +var DefBlock = {BlockName:"idPaginationBlock", NumName:"idViewBlockNum", TabName:"explorer_blocks", APIName:"GetBlockList"}; +var DefDapps = {BlockName:"idPaginationDapps", NumName:"idViewDappNum", TabName:"dapps_list", APIName:"GetDappList", CountViewRows:10, + FilterName:"idCategory"}; -function SetImg() { +function SetImg() +{ }; var CONNECT_STATUS = 0; var NotModalClose = 0; -window.onload = function() { +window.onload = function () +{ InitAccountsCard(); DoLangScript(); InitWalletKeyName(); - if (Storage.getItem("NETWORK") || IsLocalClient()) { + if(Storage.getItem("NETWORK") || IsLocalClient()) + { OnLoad(); } - else { - GetData("/GetCurrentInfo", {}, function(Data) { - if (Data && Data.result) { + else + { + GetData("/GetCurrentInfo", {}, function (Data) + { + if(Data && Data.result) + { Storage.setItem("NETWORK", Data.NETWORK); console.log("Default network: " + Data.NETWORK); OnLoad(); @@ -40,25 +44,39 @@ window.onload = function() { }); } var HasPassword = IsLockedWallet(); - if (HasPassword) { + if(HasPassword) + { NotModalClose = 1; openModal('password-modal-enter'); } - else { + else + { OpenWalletKey(); } SetUsePassword(HasPassword); - window.onkeydown = function(e) { - if (e.keyCode === 27) { - if (IsVisibleBlock("overlay")) + window.onkeydown = function (e) + { + if(e.keyCode === 27) + { + if(IsVisibleBlock("overlay")) closeModal(); } }; $("idAccountsList").addEventListener("click", MyToggleList); + if(window.addEventListener) + { + window.addEventListener("message", OnMessage); + } + else + { + window.attachEvent("onmessage", OnMessage); + } }; -function OnLoad() { - if (Storage.getItem("NETWORK")) { +function OnLoad() +{ + if(Storage.getItem("NETWORK")) + { NETWORK = Storage.getItem("NETWORK"); } $("idCurNetwork").value = NETWORK; @@ -70,18 +88,22 @@ function OnLoad() { setInterval(UpdatesExplorerData, 1000); setInterval(UpdatesAccountsData, 1000); DoStableScroll(); - window.onmousemove = function(event) { + window.onmousemove = function (event) + { SetDiagramMouseX(event); }; - if (window.location.hash) { + if(window.location.hash) + { var LocationPath = window.location.hash.substr(1); - if (LocationPath) { + if(LocationPath) + { SelectTab(LocationPath); } } }; -function ChangeNetwork() { +function ChangeNetwork() +{ CONNECT_STATUS = 0; NETWORK = $("idCurNetwork").value; Storage.setItem("NETWORK", NETWORK); @@ -90,164 +112,196 @@ function ChangeNetwork() { UpdatesAccountsData(); }; -function OnFindServer() { - if (!MainServer) { - CONNECT_STATUS = - 1; +function OnFindServer() +{ + if(!MainServer) + { + CONNECT_STATUS = - 1; SetStatus("Server not found"); Storage.setItem("MainServer", undefined); - return; + return ; } CONNECT_STATUS = 2; - Storage.setItem("MainServer", JSON.stringify({ ip: MainServer.ip, port: MainServer.port })); + Storage.setItem("MainServer", JSON.stringify({ip:MainServer.ip, port:MainServer.port})); FillCurrencyAsync("idAccountCur"); }; -function LoadValues() { +function LoadValues() +{ var StrDelList = localStorage["DelList"]; - if (StrDelList) + if(StrDelList) DelList = JSON.parse(StrDelList); - if (LoadValuesByArr(SaveIdArr)) { + if(LoadValuesByArr(SaveIdArr)) + { ChangeLang(); } InitPrivKey(); }; -function SaveValues() { +function SaveValues() +{ SaveValuesByArr(SaveIdArr); localStorage["DelList"] = JSON.stringify(DelList); }; -var TabArr = [{ name: "TabWelcome" }, { name: "TabWalletSet" }, { name: "TabKeySet" }, { name: "TabAccounts" }, { name: "TabSend" }, { name: "TabDapps" }, -{ name: "TabExplorer" }, { name: "TabLogo" }]; +var TabArr = [{name:"TabWelcome"}, {name:"TabWalletSet"}, {name:"TabKeySet"}, {name:"TabAccounts"}, {name:"TabSend"}, {name:"TabDapps"}, + {name:"TabExplorer"}, {name:"TabLogo"}]; -function SelectTab(name) { +function SelectTab(name) +{ SetStatus(""); $("idCurTabName").value = name; SetVisibleTab(); SaveValues(); OnSelectTab(name); - if (name && history.pushState) + if(name && history.pushState) history.pushState(null, null, "#" + name); }; -function OnSelectTab(name) { - if (!GetPrivKey()) { +function OnSelectTab(name) +{ + if(!GetPrivKey()) + { GenerateKeyNew(); SetPrivKey($("idPrivKeyEdit").value.trim()); InitPrivKey(); } - if (name === "TabDapps") { + if(name === "TabDapps") + { ViewDapps(); } }; -function SetVisibleTab() { +function SetVisibleTab() +{ var CurTabName = $("idCurTabName").value; - if (!CurTabName || CurTabName === "undefined") + if(!CurTabName || CurTabName === "undefined") CurTabName = TabArr[0].name; var str; - for (var i = 0; i < TabArr.length; i++) { + for(var i = 0; i < TabArr.length; i++) + { var name = TabArr[i].name; var Item = $(name); - if (!Item) + if(!Item) continue; - if (CurTabName === name) { + if(CurTabName === name) + { Item.style.display = 'block'; str = "active"; } - else { + else + { Item.style.display = 'none'; str = ""; } var ItemM = $("M" + name); - if (ItemM) { - if (str) { + if(ItemM) + { + if(str) + { ItemM.classList.add(str); } - else { + else + { ItemM.classList.remove("active"); } } } }; -function IsPrivateMode() { +function IsPrivateMode() +{ var PrivKeyStr = GetPrivKey(); - if (PrivKeyStr && PrivKeyStr.length === 64) + if(PrivKeyStr && PrivKeyStr.length === 64) return 1; else return 0; }; -function SetVisiblePrivKey() { - if (bShowPrivKey) +function SetVisiblePrivKey() +{ + if(bShowPrivKey) $("idPrivKeyStatic").innerText = GetPrivKey(); else $("idPrivKeyStatic").innerText = "••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••"; }; var bShowPrivKey = 0; -function OnVisiblePrivKey() { +function OnVisiblePrivKey() +{ bShowPrivKey = !bShowPrivKey; SetVisiblePrivKey(); }; -function SetPubKeyHTML() { +function SetPubKeyHTML() +{ $("idPubKeyStatic").innerText = GetPubKey(); }; -function GenerateKeyNew() { +function GenerateKeyNew() +{ var arr = new Uint8Array(32); window.crypto.getRandomValues(arr); var Str = GetHexFromArr(sha3(arr)); $("idPrivKeyEdit").value = Str; }; -function OnGenerateKeyNew() { +function OnGenerateKeyNew() +{ GenerateKeyNew(); }; -function OnEditPrivKey() { +function OnEditPrivKey() +{ }; -function OnPrivKeyOK() { +function OnPrivKeyOK() +{ SetPrivKey($("idPrivKeyEdit").value.trim()); InitPrivKey(); SelectTab('TabKeySet'); ClearSend(); }; -function OnPrivKeyCancel() { +function OnPrivKeyCancel() +{ InitPrivKey(); SelectTab('TabKeySet'); }; var FirstAccountsData = 1; -var AccountsCount = - 1; +var AccountsCount = - 1; -function UpdatesAccountsData() { - if (IsVisibleClass(".accounts-info__add")) - return; - if (!CONNECT_STATUS) - return; +function UpdatesAccountsData() +{ + if(IsVisibleClass(".accounts-info__add")) + return ; + if(!CONNECT_STATUS) + return ; var Str = GetPubKey(); - if (!Str) { - return; + if(!Str) + { + return ; } - GetData("/GetAccountListByKey", { Key: Str, AllData: FirstAccountsData }, function(Data, responseText) { - if (!Data || !Data.result || !Data.arr) - return; - if (AccountsCount === Data.arr.length) { - if (IsVisibleClass(".accounts-info__add2")) - return; + GetData("/GetAccountListByKey", {Key:Str, AllData:FirstAccountsData}, function (Data,responseText) + { + if(!Data || !Data.result || !Data.arr) + return ; + if(AccountsCount === Data.arr.length) + { + if(IsVisibleClass(".accounts-info__add2")) + return ; } AccountsCount = Data.arr.length; SetVisibleClass(".accounts-info__acc-list", AccountsCount); SetVisibleClass(".accounts-info__empty", !AccountsCount); SetVisibleClass(".accounts-info__add2", 0); - if (AccountsCount) { + if(AccountsCount) + { SetAccountsCard(Data, responseText); } - else { - if (FirstAccountsData && !Data.arr.length) { + else + { + if(FirstAccountsData && !Data.arr.length) + { SelectTab('TabAccounts'); } } @@ -255,34 +309,41 @@ function UpdatesAccountsData() { }); }; -function ViewAddAccount(Visible) { +function ViewAddAccount(Visible) +{ SetVisibleClass(".accounts-info__add", Visible); SetVisibleClass(".accounts-info__acc-list", !Visible); SetVisibleClass(".accounts-info__empty", 0); }; -function OnViewAddAccount() { +function OnViewAddAccount() +{ OnChangeAccName(); ViewAddAccount(1); $("idAccountName").focus(); }; -function CancelAddAccount() { +function CancelAddAccount() +{ ViewAddAccount(0); }; -function OnChangeAccName() { +function OnChangeAccName() +{ $("idBtAddAccount").disabled = !($("idAccountName").value.length); }; -function CancelCreateAccount() { +function CancelCreateAccount() +{ }; -function OnAddAccount() { +function OnAddAccount() +{ var Name = $("idAccountName").value; - if (!Name) { + if(!Name) + { SetError("Enter the account name"); - return; + return ; } var Smart = 0; var Currency = ParseNum($("idAccountCur").value); @@ -294,29 +355,36 @@ function OnAddAccount() { var WasAccountsDataStr; var StrAccCardTemplate; -function InitAccountsCard() { - if ($("AccCardTemplate")) { +function InitAccountsCard() +{ + if($("AccCardTemplate")) + { StrAccCardTemplate = $("AccCardTemplate").outerHTML; $("AccCardTemplate").outerHTML = ""; } }; -function SetAccountsCard(Data, AccountsDataStr) { - if (!Data || !Data.result) { - return; +function SetAccountsCard(Data,AccountsDataStr) +{ + if(!Data || !Data.result) + { + return ; } - if (AccountsDataStr === WasAccountsDataStr) - return; + if(AccountsDataStr === WasAccountsDataStr) + return ; WasAccountsDataStr = AccountsDataStr; var arr = []; - for (var i = 0; Data.arr && i < Data.arr.length; i++) { + for(var i = 0; Data.arr && i < Data.arr.length; i++) + { var Item = Data.arr[i]; - if (!DelList[Item.Num]) { + if(!DelList[Item.Num]) + { arr.push(Item); } } var Select = $("idAccount"); - if (arr.length !== Select.options.length) { + if(arr.length !== Select.options.length) + { var options = Select.options; options.length = arr.length; } @@ -324,16 +392,17 @@ function SetAccountsCard(Data, AccountsDataStr) { $("idListCount").innerText = arr.length; var StrList = ""; var ListTotal = {}; - for (var i = 0; arr && i < arr.length; i++) { + for(var i = 0; arr && i < arr.length; i++) + { var Item = arr[i]; Item.MyAccount = true; var Num = ParseNum(Item.Num); - if (!MapAccounts[Num]) + if(!MapAccounts[Num]) MapAccounts[Num] = {}; CopyObjKeys(MapAccounts[Num], Item); var option = Select.options[i]; var StrText = GetAccountText(Item, Num, 1); - if (option.text !== StrText) + if(option.text !== StrText) CheckNameAccTo(); option.value = Num; option.text = StrText; @@ -344,32 +413,35 @@ function SetAccountsCard(Data, AccountsDataStr) { Str = Str.replace("{Value.SumCENT}", Item.Value.SumCENT); Str = Str.replace("{Value.CurrencyName}", CurrencyName(Item.Currency)); var CurrencyObj = Item.CurrencyObj; - if (!CurrencyObj) - CurrencyObj = { IconBlockNum: 0, Num: 0 }; + if(!CurrencyObj) + CurrencyObj = {IconBlockNum:0, Num:0}; Str = Str.replace("{Value.CurrencyIconPath}", RetIconPath(CurrencyObj, 1)); var CurrencyPath = RetIconPath(CurrencyObj); - if (CurrencyPath.substr(0, 6) !== "/file/") + if(CurrencyPath.substr(0, 6) !== "/file/") Str = Str.replace("prod-card__currency--with-dot", ""); Str = Str.replace("{Item.Name}", escapeHtml(Item.Name)); var SmartObj = Item.SmartObj; - if (!SmartObj) - SmartObj = { Name: "", Num: 0 }; + if(!SmartObj) + SmartObj = {Name:"", Num:0}; SmartObj.IconPath = RetIconPath(SmartObj, 0); Str = Str.replace("{SmartObj.IconPath}", SmartObj.IconPath); Str = Str.replace("{SmartObj.Name}", escapeHtml(SmartObj.Name)); Str = Str.replace(/{SmartObj.Num}/g, SmartObj.Num); - if (SmartObj.Num) { + if(SmartObj.Num) + { Str = Str.replace("prod-card__link--connect", "myhidden"); } - else { + else + { Str = Str.replace("prod-card__link--dapp", "myhidden"); Str = Str.replace("prod-card__dropdown", "prod-card__dropdown nodapp"); } StrList += Str; Str = ""; var Total = ListTotal[Item.Currency]; - if (!Total) { - Total = { SumCOIN: 0, SumCENT: 0, Name: CurrencyName(Item.Currency) }; + if(!Total) + { + Total = {SumCOIN:0, SumCENT:0, Name:CurrencyName(Item.Currency)}; ListTotal[Item.Currency] = Total; } ADD(Total, Item.Value); @@ -377,61 +449,73 @@ function SetAccountsCard(Data, AccountsDataStr) { $("idAccountsList").innerHTML = StrList; StrList = ""; var StrTotal = ""; - for (var key in ListTotal) { + for(var key in ListTotal) + { var Total = ListTotal[key]; StrTotal += '
    ' + Total.Name + '
    ' + STRING_FROM_COIN(Total) + '
    '; } $("idTotalList").innerHTML = StrTotal; var CurentValue = LoadMapAfter["idAccount"]; - if (CurentValue) { + if(CurentValue) + { Select.value = CurentValue; delete LoadMapAfter["idAccount"]; } }; -function ConnectSmart(NumAccount) { +function ConnectSmart(NumAccount) +{ ChangeSmart(NumAccount, 0); }; -function SetSmart(NumAccount, WasSmart) { +function SetSmart(NumAccount,WasSmart) +{ ChangeSmart(NumAccount, WasSmart); }; -function DelSmart(NumAccount, WasSmart) { +function DelSmart(NumAccount,WasSmart) +{ SetSmartToAccount(NumAccount, 0); }; -function DelAccount(NumAccount) { +function DelAccount(NumAccount) +{ DelList[NumAccount] = 1; AccountsCount = 0; WasAccountsDataStr = ""; SaveValues(); }; -function RestoreAllAccounts() { +function RestoreAllAccounts() +{ DelList = {}; DelAccount(0); }; -function UpdatesExplorerData() { +function UpdatesExplorerData() +{ var WasSendTr = 0; - for (var key in MapSendTransaction) { + for(var key in MapSendTransaction) + { var Item = MapSendTransaction[key]; - if (!Item.WasProcess && !Item.final) { + if(!Item.WasProcess && !Item.final) + { WasSendTr = 1; break; } } - GetData("GetCurrentInfo", { Diagram: IsVisibleBlock("idStatBlock") ? 1 : 0, ArrLog: WasSendTr }, function(Data) { - if (!Data || !Data.result) - return; + GetData("GetCurrentInfo", {Diagram:IsVisibleBlock("idStatBlock") ? 1 : 0, ArrLog:WasSendTr}, function (Data) + { + if(!Data || !Data.result) + return ; SetExplorerData(Data); SetBlockChainConstant(Data); var arr = Data.arr; - for (var i = 0; arr && i < arr.length; i++) { + for(var i = 0; arr && i < arr.length; i++) + { var ItemServer = arr[i]; var ItemClient = DiagramMap[ItemServer.name]; - if (!ItemClient || ItemClient.Extern) + if(!ItemClient || ItemClient.Extern) continue; ItemClient.arr = ItemServer.arr; ItemClient.AvgValue = ItemServer.AvgValue; @@ -443,12 +527,14 @@ function UpdatesExplorerData() { }; var FirstCallDiagram = 1; -function SetExplorerData(Data) { - if (!Data || !Data.result) - return; +function SetExplorerData(Data) +{ + if(!Data || !Data.result) + return ; CONFIG_DATA = Data; window.FIRST_TIME_BLOCK = Data.FIRST_TIME_BLOCK; - if (FirstCallDiagram) { + if(FirstCallDiagram) + { ViewEnd(DefAccounts, CONFIG_DATA.MaxAccID, 1); ViewEnd(DefBlock, CONFIG_DATA.MaxNumBlockDB, 1); InitDiagram(); @@ -461,25 +547,31 @@ function SetExplorerData(Data) { SetArrLog(Data.ArrLog); }; -function SetArrLog(arr) { - if (!arr) - return; - for (var i = 0; i < arr.length; i++) { +function SetArrLog(arr) +{ + if(!arr) + return ; + for(var i = 0; i < arr.length; i++) + { var Item = arr[i]; - if (!Item.final) + if(!Item.final) continue; var TR = MapSendTransaction[Item.key]; - if (TR && !TR.WasProcess && Item.final) { + if(TR && !TR.WasProcess && Item.final) + { TR.WasProcess = 1; SetStatus(Item.text); - if (Item.text.indexOf("Add to blockchain") >= 0) { - if (TR.Run) { + if(Item.text.indexOf("Add to blockchain") >= 0) + { + if(TR.Run) + { TR.Run(TR); TR.Run = undefined; } } var Account = MapCheckTransaction[Item.key]; - if (Account) { + if(Account) + { delete MapCheckTransaction[Item.key]; Account.NextSendTime = 0; } @@ -487,43 +579,47 @@ function SetArrLog(arr) { } CheckSending(); }; -var DiagramArr = [{ name: "MAX:ALL_NODES", text: "All nodes count", value: 0, red: "#1d506b", MouseText: " nodes" }, { - name: "MAX:HASH_RATE_B", - text: "HashRate, Tera hash/s", value: 0, red: "#286b16", MathPow: 2, MathDiv: 1024 * 1024 * 1024 * 1024, KPrecision: 10, NoTextMax: 1, - MouseText: " T h/s" -},]; +var DiagramArr = [{name:"MAX:ALL_NODES", text:"All nodes count", value:0, red:"#1d506b", MouseText:" nodes"}, {name:"MAX:HASH_RATE_B", + text:"HashRate, Tera hash/s", value:0, red:"#286b16", MathPow:2, MathDiv:1024 * 1024 * 1024 * 1024, KPrecision:10, NoTextMax:1, + MouseText:" T h/s"}, ]; -function InitDiagram() { +function InitDiagram() +{ InitDiagramByArr(DiagramArr, 1120); }; -function ViewCounters(This) { +function ViewCounters(This) +{ var BlockName = "idStatBlock"; var element = $(BlockName); var bVisible = IsVisibleBlock(BlockName); - if (!bVisible) + if(!bVisible) MoveUp(element); SetVisibleBlock(BlockName, !bVisible); var ResVisible = IsVisibleBlock(BlockName); - if (This && This.className) { + if(This && This.className) + { This.className = This.className.replace("btpress", ""); - if (ResVisible) + if(ResVisible) This.className += " btpress"; } }; setInterval(CheckSending, 1000); -function OpenAddressBook() { - return; +function OpenAddressBook() +{ + return ; var bVisible = IsVisibleBlock("idAddressBook"); SetVisibleBlock("idAddressBook", !bVisible); }; -function CloaseAddressBook() { +function CloaseAddressBook() +{ OpenAddressBook(); }; -function ClearSend() { +function ClearSend() +{ $("idAccount").value = ""; $("idTo").value = ""; $("idSumSend").value = ""; @@ -531,9 +627,10 @@ function ClearSend() { $("idNameTo2").innerText = ""; }; -function downloadKey(fieldID) { +function downloadKey(fieldID) +{ var text = document.getElementById(fieldID).value; - var blob = new Blob([text], { type: "text/plain" }); + var blob = new Blob([text], {type:"text/plain"}); var anchor = document.createElement("a"); anchor.download = "tera-key.txt"; anchor.href = window.URL.createObjectURL(blob); @@ -544,48 +641,59 @@ function downloadKey(fieldID) { document.body.removeChild(anchor); }; -function openModal(id) { +function openModal(id) +{ var modal = document.querySelector("#" + id); var overlay = document.querySelector("#overlay"); modal.style.display = "block"; overlay.style.display = "block"; }; -function closeModal() { - if (NotModalClose) - return; +function closeModal() +{ + if(NotModalClose) + return ; var modals = document.querySelectorAll(".modal"); var overlay = document.querySelector("#overlay"); - modals.forEach(function(item) { + modals.forEach(function (item) + { item.style.display = "none"; }); overlay.style.display = "none"; }; -function showMenu(Num) { +function showMenu(Num) +{ var menu = document.querySelector("#idBt" + Num); - if (menu.style.display === "none") { + if(menu.style.display === "none") + { menu.style.display = "block"; } - else { + else + { menu.style.display = "none"; } }; -function closeMenu(Num) { +function closeMenu(Num) +{ var menu = document.querySelector("#idBt" + Num); - setTimeout(function() { + setTimeout(function () + { menu.style.display = "none"; }, 115); }; -function UploadKey(id) { +function UploadKey(id) +{ var file = $(id).files[0]; var reader = new FileReader(); - reader.onload = function() { - if (reader.result.byteLength !== 64) + reader.onload = function () + { + if(reader.result.byteLength !== 64) SetError("Error file length (" + reader.result.byteLength + ")"); - else { + else + { var view = new Uint8Array(reader.result); var Key = Utf8ArrayToStr(view); SetStatus("OK"); @@ -598,32 +706,38 @@ function UploadKey(id) { reader.readAsArrayBuffer(file); }; -function InitPrivKey() { +function InitPrivKey() +{ $("idPrivKeyEdit").value = GetPrivKey(); SetPubKeyHTML(); SetVisiblePrivKey(); $("idSave2").disabled = !IsPrivateMode(); }; -function SendMobileBefore() { - if ($("idSendButton").disabled) - return; +function SendMobileBefore() +{ + if($("idSendButton").disabled) + return ; var FromID = ParseNum($("idAccount").value); var Item = MapAccounts[FromID]; - if (!Item) { + if(!Item) + { SetError("Error FROM ID"); - return; + return ; } $("idConfirmFromID").innerText = Item.Num; $("idConfirmFromName").innerText = Item.Name + " (" + STRING_FROM_COIN(Item.Value) + " " + CurrencyNameItem(Item) + ")"; - var ToID = ParseNum($("idTo").value); + var ToID = ($("idTo").value); + $("idConfirmToID").innerText = ToID; var Item2 = MapAccounts[ToID]; - if (!Item2) { - SetError("Error TO ID"); - return; + if(Item2) + { + $("idConfirmToName").innerText = Item2.Name + " (" + STRING_FROM_COIN(Item2.Value) + " " + CurrencyNameItem(Item2) + ")"; + } + else + { + $("idConfirmToName").innerText = ""; } - $("idConfirmToID").innerText = Item2.Num; - $("idConfirmToName").innerText = Item2.Name + " (" + STRING_FROM_COIN(Item2.Value) + " " + CurrencyNameItem(Item2) + ")"; var CoinAmount = COIN_FROM_FLOAT($("idSumSend").value); $("idConfirmAmount").innerText = STRING_FROM_COIN(CoinAmount); $("idConfirmCurrency").innerText = CurrencyNameItem(Item); @@ -633,23 +747,28 @@ function SendMobileBefore() { SetStatus(""); }; -function OKSend() { +function OKSend() +{ SendMoney(); - $("idSumSend").value = 0; + ClearSend(); + SaveValues(); CancelSend(); }; -function CancelSend() { +function CancelSend() +{ SetVisibleClass(".send-page__setting", 1); SetVisibleClass(".send-page__confirm", 0); }; -function SetNewPassword() { +function SetNewPassword() +{ var Str1 = $("Password1").value.trim(); var Str2 = $("Password2").value.trim(); - if (Str1 !== Str2) { + if(Str1 !== Str2) + { SetError("Wrong passwords"); - return; + return ; } var Key = GetPrivKey(); SetWalletPassword(Str1); @@ -658,7 +777,7 @@ function SetNewPassword() { closeModal(); $("Password1").value = ""; $("Password2").value = ""; - if (Str1) + if(Str1) SetStatus("Password changed successfully"); else SetStatus("Password has been reset successfully"); @@ -666,45 +785,53 @@ function SetNewPassword() { }; var MultipleMode = 0; -function MyOpenWallet(bCheck) { +function MyOpenWallet(bCheck) +{ var Str = $("Password").value.trim(); - if (!Str) { + if(!Str) + { SetError("Type password, pls"); - return; + return ; } $("Password").value = ""; - if (Str.substr(0, 11) === "--subwallet") { + if(Str.substr(0, 11) === "--subwallet") + { Str = Str.substr(11); - if (Str === " off") { + if(Str === " off") + { Storage.setItem("USESUBWALLET", 0); SetStatus("Set off subwallet mode"); } - else { + else + { Storage.setItem("USESUBWALLET", 1); SetStatus("Set subwallet mode"); } SetUsePassword(1); - return; + return ; } - if (Str === "--reset") { + if(Str === "--reset") + { SetWalletPassword(""); OpenWalletKey(); SetUsePassword(0); NotModalClose = 0; closeModal(); - return; + return ; } SetWalletPassword(Str); OpenWalletKey(); SetStatus(""); - if (bCheck) { + if(bCheck) + { var WasPubKey = Storage.getItem("WALLET_PUB_KEY_MAIN"); var PrivKey = GetArrFromHex(GetPrivKey()); var TestPubKey = GetHexFromArr(SignLib.publicKeyCreate(PrivKey, 1)); - if (WasPubKey !== TestPubKey) { + if(WasPubKey !== TestPubKey) + { SetWalletPassword(""); SetError("Wrong password"); - return; + return ; } SetStatus("Password ok"); MultipleMode = 0; @@ -712,7 +839,8 @@ function MyOpenWallet(bCheck) { SetVisibleBlock("idLoad2", 1); SetVisibleBlock("idPasswordEdit", 1); } - else { + else + { MultipleMode = 1; SetVisibleBlock("idKeyEdit", 0); SetVisibleBlock("idLoad2", 0); @@ -725,13 +853,15 @@ function MyOpenWallet(bCheck) { SetUsePassword(1); }; -function SetUsePassword(bUse) { +function SetUsePassword(bUse) +{ document.documentElement.style.setProperty('--fill--password', bUse ? 'blue' : 'black'); SetVisibleBlock("idWalletExit", !!bUse); SetVisibleBlock("idEntrance", Storage.getItem("USESUBWALLET") === "1"); }; -function DoExitWallet() { +function DoExitWallet() +{ ClearSend(); NotModalClose = 1; $("Password").value = ""; @@ -743,53 +873,63 @@ var StrDappCardTemplate; var StrDappRowCardTemplate; var CardMapList = {}; -function InitDappsCard() { - if ($("DappRowCardTemplate")) { +function InitDappsCard() +{ + if($("DappRowCardTemplate")) + { StrDappRowCardTemplate = $("DappRowCardTemplate").outerHTML; $("DappRowCardTemplate").outerHTML = ""; } - if ($("DappCardTemplate")) { + if($("DappCardTemplate")) + { StrDappCardTemplate = $("DappCardTemplate").outerHTML; } }; -function ViewDapps() { +function ViewDapps() +{ ViewCurrent(DefDapps); - GetData("/GetDappCategory", {}, function(Data) { - if (Data && Data.result && Data.arr) { + GetData("/GetDappCategory", {}, function (Data) + { + if(Data && Data.result && Data.arr) + { var arr = Data.arr; - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { var key = arr[i]; - arr[i] = { sort: MapCategory[key].toUpperCase(), text: MapCategory[key], value: key }; + arr[i] = {sort:MapCategory[key].toUpperCase(), text:MapCategory[key], value:key}; } - arr.push({ sort: "-", text: "Choose the category", value: 0 }); + arr.push({sort:"-", text:"Choose the category", value:0}); FillCategoryAndSort("idCategory", arr); } }); }; -function FillDappCard(Str, Item) { +function FillDappCard(Str,Item) +{ CardMapList[Item.Num] = Item; Str = Str.replace(/{Item.Num}/g, Item.Num); Str = Str.replace("{Item.Name}", escapeHtml(Item.Name)); Str = Str.replace("{Item.Description}", escapeHtml(Item.Description)); Str = Str.replace("{Item.Owner}", Item.Owner); - if (!Item.TokenGenerate) + if(!Item.TokenGenerate) Str = Str.replace("dapp-modal__ok-token", "myhidden"); Str = Str.replace("{Item.IconPath}", RetIconPath(Item, 0)); return Str; }; -function RetDappCard(Item) { +function RetDappCard(Item) +{ var Str = FillDappCard(StrDappRowCardTemplate, Item); Str = Str.replace("DappRowCardTemplate", "idCard" + Item.Num); return Str; }; -function OpenDappCard(Num) { +function OpenDappCard(Num) +{ var Item = CardMapList[Num]; - if (!Item) - return; + if(!Item) + return ; var Str = FillDappCard(StrDappCardTemplate, Item); Str = Str.replace("{Item.Account}", RetBaseAccount(Item)); Str = Str.replace("{Item.BlockNum}", RetOpenBlock(Item.BlockNum, 2)); @@ -800,38 +940,47 @@ function OpenDappCard(Num) { openModal('DappCardTemplate'); }; -function OpenDapp(Num) { +function OpenDapp(Num) +{ OpenDapps(Num); closeModal(); }; -function FillDappCategory(Str, Item, Num) { +function FillDappCategory(Str,Item,Num) +{ var Value = Item["Category" + Num]; - if (Value && MapCategory[Value]) { + if(Value && MapCategory[Value]) + { Str = Str.replace("{Item.Category" + Num + "}", MapCategory[Value]); } - else { + else + { Str = Str.replace("dappcategory" + Num, "myhidden"); } return Str; }; -function MyToggleList(e) { +function MyToggleList(e) +{ var item = e.target; - while (true) { - if (!item) + while(true) + { + if(!item) break; - if (!item.classList) + if(!item.classList) break; - if (item.onclick && item.onclick !== MyToggleList) + if(item.onclick && item.onclick !== MyToggleList) break; - if (item.classList.contains("find--switch")) { - if (item.classList.contains("prod-card--switch")) { + if(item.classList.contains("find--switch")) + { + if(item.classList.contains("prod-card--switch")) + { item.classList.add("prod-card--active"); item.classList.add("prod-card--toggle"); item.classList.remove("prod-card--switch"); } - else { + else + { item.classList.remove("prod-card--active"); item.classList.remove("prod-card--toggle"); item.classList.add("prod-card--switch"); @@ -841,61 +990,128 @@ function MyToggleList(e) { item = item.parentNode; } }; + +function OpenHistoryPage(Num) +{ + if(!IsLocalClient()) + { + window.open("./history.html#" + Num); + return ; + } + SetVisibleFrame("idHistoryPage", 1); + SendMessage("HistoryPage", {Account:Num, FrameName:"idHistoryPage"}); +}; + +function OpenBlockViewerPage(Num) +{ + if(!IsLocalClient()) + { + window.open("./blockviewer.html#" + Num); + return ; + } + SetVisibleFrame("idBlockViewerPage", 1); + SendMessage("BlockViewerPage", {BlockNum:Num, FrameName:"idBlockViewerPage"}); +}; + +function SetVisibleFrame(name,bVisible) +{ + SetVisibleBlock("idMainHeader", !bVisible); + SetVisibleBlock("idMain", !bVisible); + SetVisibleBlock(name, bVisible); + if(bVisible) + $(name).focus(); +}; + +function SendMessage(name,Data) +{ + var win = window.frames[name]; + win.postMessage(Data, "*"); +}; + +function OnMessage(event) +{ + var Data = event.data; + if(!Data || typeof Data !== "object") + return ; + var cmd = Data.cmd; + if(cmd === "Close") + { + SetVisibleFrame(Data.FrameName, 0); + } + else + if(cmd === "OpenBlockViewerPage") + { + SetVisibleFrame(Data.FrameName, 0); + OpenBlockViewerPage(Data.BlockNum); + } +}; var LangItems = []; -function InitLangItems() { +function InitLangItems() +{ var tags = ["TITLE", "BUTTON", "DIV", "INPUT", "TH", "TD", "SPAN", "A", "H1", "H2", "H3", "H4", "H5", "P", "DT"]; var Map2 = {}; - for (var n = 0; n < tags.length; n++) { + for(var n = 0; n < tags.length; n++) + { var tagname = tags[n]; var elems = document.getElementsByTagName(tagname); - for (var elem, i = 0; elem = elems[i++];) { + for(var elem, i = 0; elem = elems[i++]; ) + { var Text = elem.innerText; - if (elem.innerHTML !== Text) + if(elem.innerHTML !== Text) continue; - if (!Text) + if(!Text) continue; - if (Text.substr(0, 1) === "{") + if(Text.substr(0, 1) === "{") continue; - if (Text.toUpperCase() == Text.toLowerCase()) + if(Text.toUpperCase() == Text.toLowerCase()) continue; - LangItems.push({ key: Text, elem: elem }); + LangItems.push({key:Text, elem:elem}); } } }; -function DoLangItems(Map) { +function DoLangItems(Map) +{ var Map2 = {}; - for (var n = 0; n < LangItems.length; n++) { + for(var n = 0; n < LangItems.length; n++) + { var key = LangItems[n].key; var elem = LangItems[n].elem; - if (Map) { + if(Map) + { var TextNew = Map[key]; - if (TextNew === undefined) { + if(TextNew === undefined) + { ToLog("Not found translate for key: " + key); Map[key] = key; TextNew = key; } - if (elem.innerText !== TextNew) { + if(elem.innerText !== TextNew) + { elem.innerText = TextNew; } } - else { + else + { Map2[key] = key; } } return Map2; }; -function DoLangScript() { +function DoLangScript() +{ InitLangItems(); LangMap["ENG"] = DoLangItems(); FillSelect("idLang", LangMap, "KEY"); }; -function ChangeLang() { +function ChangeLang() +{ var key = $("idLang").value; - if (!key) { + if(!key) + { key = "ENG"; $("idLang").value = key; } @@ -903,50 +1119,65 @@ function ChangeLang() { SaveValues(); }; -function GetNewLangItem() { +function GetNewLangItem() +{ ToLog(JSON.stringify(LangMap["ENG"])); }; var LangMap = {}; LangMap["ENG"] = {}; -LangMap["RUS"] = { - "TERA WALLET": "TERA КОШЕЛЕК", "Generate key": "Сгенерировать ключ", "OK": "OK", "Cancel": "Отмена", "Edit": "Редактирование", - "Save key": "Сохран.", "+ CREATE A NEW ACCOUNT": "+ СОЗДАТЬ НОВЫЙ СЧЕТ", "Create account": "Создать счет", "Send": "Отправить", - "CONFIRM": "Подтверждение", "Accounts": "Счета", "Account(s)": "Счет(а,ов)", "Blocks and Tx": "Блоки и Транзакции", "Counters": "Показатели", - "Open DApp": "Открыть Дапп", "Back": "Назад", "Delete": "Удалить", "Save to book": "Сохранить в книгу", "Choose": "Выбрать", "RECONNECT": "КОННЕКТ", - "DApps": "ДАппс", "ID": "ИД", "Amount": "Величина", "Cur": "Вал", "Name": "Имя", "PubKey": "Пуб.ключ", "Operation": "Операция", "Smart": "Смарт", - "Block Num": "Ном блока", "Num": "Ном", "Date": "Дата", "Data Hash": "Хеш данных", "PowHash": "Хеш сложности", "Block Hash": "Хеш блока", - "Bytes": "Байт", "Pow": "Сложн", "Miner": "Майнер", "(secret)": "(секрет)", "Show": "Показать", "TERA": "TERA", "Blockchain height:": "Высота блокчейна:", - "Current create:": "Текущий блок:", "Protocol ver:": "Версия протокола:", "ID: {Item.Num}": "ИД: {Item.Num}", "Token generate": "Генерация токенов", - "ACCOUNTS": "СЧЕТА", "SEND": "ПОСЛАТЬ", "DAPPS": "ДАППС", "EXPLORER": "ПРОСМ", "ATTENTION: Before using the wallet, save the private key.": "ВНИМАНИЕ: Перед использованием кошелька сохраните приватный ключ", - "Web-site": "Веб-сайт", "Bitcointalk": "Bitcointalk", "Twitter": "Твиттер", "Telegram": "Телеграм", "Discord": "Дискорд", "QQchat": "QQchat", - "Buy/sell/mine TERA": "Купить/Продать", "+ CREATE NEW": "+ СОЗДАТЬ НОВЫЙ", "Confirm Transaction": "Подтверждение транзакции", - "CREATE DAPPS": "СОЗДАТЬ", "Set pass": "Установить пароль", "Unlock": "Разблокировать", "Entrance to sub-wallet": "Войти в под-кошелек", - "Public name": "Публичное имя", "Currency": "Валюта", "Pay to:": "Получатель:", "Amount:": "Сумма:", "Description:": "Описание:", - "Welcome to TERA Wallet": "Добропожаловать в кошелек TERA", "Edit your wallet": "Редактирование вашего кошелька", "Key settings": "Задание ключей", - "KEY SETTINGS": "ЗАДАНИЕ КЛЮЧЕЙ", "Create an account": "Создание счета", "Sending coins": "Отправка монет", "Decentralized applications (dApps)": "Децентрализованные приложения (Даппс)", - "Secure your wallet": "Безопасность вашего кошелька", "Wallet is secured": "Установлен пароль", "Total": "Всего", "Item.Name": "Item.Name", - "You have no accounts yet": "У вас нет ни одного счета", "Wait 10-15 sec": "Ждите 10-15 сек", "Creating your account": "Идет создание вашего счета", - "From:": "Отправитель:", "Set a password for protect entry": "Установите пароль для безопасности", "Enter password to unlock wallet": "Введите пароль для разблокировки кошелька", - "From ID:": "Отправитель:", "Pay to ID:": "Получатель:", "Account": "Счет", "Owner": "Владелец", "Block num": "Ном блока", "Private key (secret)": "Приватный ключ (секретно)", - "Load key": "Загруз.", "Create your first account and start using TERA": "Создайте свой первый счет и начните использовать TERA", - "0 Accounts": "0 Счетов", "OWNER: {Item.Owner}": "Владелец: {Item.Owner}", "More info": "Информация", "Public key": "Публичный ключ" -}; -LangMap["简体中文"] = { - "TERA WALLET": "TERA 钱包", "Generate key": "生成私钥", "OK": "OK", "Cancel": "取消", "Edit": "编辑", "Save key": "保存私钥", - "+ CREATE A NEW ACCOUNT": "+ 新建账号", "Create account": "创建账号", "Send": "发送", "SEND": "转账", "CONFIRM": "确认", "Accounts": "账号", "Account(s)": "账号", - "Blocks and Tx": "区块和交易", "Counters": "状态统计", "Open DApp": "打开DApp", "Back": "返回", "Delete": "删除", "Save to book": "保存到地址本", "Choose": "选择", - "RECONNECT": "重连", "DApps": "DApps", "ID": "ID", "Amount": "余额", "Cur": "币种", "Name": "名称", "PubKey": "公钥", "Operation": "操作次数", "Smart": "DApp", - "Block Num": "区块编号", "Num": "编号", "Date": "日期", "Data Hash": "数据哈希", "PowHash": "Pow哈希", "Block Hash": "区块哈希", "Bytes": "字节", "Pow": "Pow", - "Miner": "矿工", "(secret)": "(机密)", "Show": "显示", "TERA": "TERA", "Blockchain height:": "区块高度:", "Current create:": "最近区块:", "Protocol ver:": "协议版本:", - "ID: {Item.Num}": "ID: {Item.Num}", "Token generate": "生成代币", "ACCOUNTS": "账号", "DAPPS": "DAPPS", "EXPLORER": "浏览器", "ATTENTION: Before using the wallet, save the private key.": "注意: 使用钱包前,务必保存好私钥。", - "Web-site": "官网", "Bitcointalk": "创世贴", "Twitter": "推特", "Telegram": "电报", "Discord": "Discord", "QQchat": "QQ群", "Buy/sell/mine TERA": "TERA 交易/挖矿", - "+ CREATE NEW": "+ 新建", "Confirm Transaction": "确认交易", "CREATE DAPPS": "创建DAPPS", "Set pass": "设置密码", "Unlock": "解锁", "Entrance to sub-wallet": "进入子钱包", - "Public name": "名称", "Currency": "币种", "Pay to:": "收款:", "Amount:": "金额:", "Description:": "描述:", "Welcome to TERA Wallet": "欢迎使用TERA钱包", - "Edit your wallet": "编辑钱包", "Key settings": "设置私钥", "KEY SETTINGS": "设置私钥", "Create an account": "创建账号", "Sending coins": "转账", - "Decentralized applications (dApps)": "去中心化应用 (DApps)", "Secure your wallet": "设置钱包密码", "Wallet is secured": "钱包密码已设置", "Total": "总计", - "Item.Name": "Item.Name", "You have no accounts yet": "你还没有账号", "Wait 10-15 sec": "等待10-15秒", "Creating your account": "创建你的账号", - "From:": "付款:", "Set a password for protect entry": "设置密码保护钱包", "Enter password to unlock wallet": "输入密码解锁钱包", "From ID:": "付款ID:", - "Pay to ID:": "收款ID:", "Account": "账号", "Owner": "拥有者", "Block num": "区块编号", "Private key (secret)": "私钥 (机密)", "Load key": "载入私钥", - "Create your first account and start using TERA": "创建你的第一个账号,开启TERA之旅", "0 Accounts": "0 账号", "OWNER: {Item.Owner}": "拥有者: {Item.Owner}", - "More info": "详情", "Public key": "公钥" -}; +LangMap["RUS"] = {"TERA WALLET":"TERA КОШЕЛЕК", "Generate key":"Сгенерировать ключ", "OK":"OK", "Cancel":"Отмена", "Edit":"Редактирование", + "Save key":"Сохран.", "+ CREATE A NEW ACCOUNT":"+ СОЗДАТЬ НОВЫЙ СЧЕТ", "Create account":"Создать счет", "Send":"Отправить", + "CONFIRM":"Подтверждение", "Accounts":"Счета", "Account(s)":"Счет(а,ов)", "Blocks and Tx":"Блоки и Транзакции", "Counters":"Показатели", + "Open DApp":"Открыть Дапп", "Back":"Назад", "Delete":"Удалить", "Save to book":"Сохранить в книгу", "Choose":"Выбрать", "RECONNECT":"КОННЕКТ", + "DApps":"ДАппс", "ID":"ИД", "Amount":"Величина", "Cur":"Вал", "Name":"Имя", "PubKey":"Пуб.ключ", "Operation":"Операция", "Smart":"Смарт", + "Block Num":"Ном блока", "Num":"Ном", "Date":"Дата", "Data Hash":"Хеш данных", "PowHash":"Хеш сложности", "Block Hash":"Хеш блока", + "Bytes":"Байт", "Pow":"Сложн", "Miner":"Майнер", "(secret)":"(секрет)", "Show":"Показать", "TERA":"TERA", "Blockchain height:":"Высота блокчейна:", + "Current create:":"Текущий блок:", "Protocol ver:":"Версия протокола:", "ID: {Item.Num}":"ИД: {Item.Num}", "Token generate":"Генерация токенов", + "ACCOUNTS":"СЧЕТА", "SEND":"ПОСЛАТЬ", "DAPPS":"ДАППС", "EXPLORER":"ПРОСМ", "ATTENTION: Before using the wallet, save the private key.":"ВНИМАНИЕ: Перед использованием кошелька сохраните приватный ключ", + "Web-site":"Веб-сайт", "Bitcointalk":"Bitcointalk", "Twitter":"Твиттер", "Telegram":"Телеграм", "Discord":"Дискорд", "QQchat":"QQchat", + "Buy/sell/mine TERA":"Купить/Продать", "+ CREATE NEW":"+ СОЗДАТЬ НОВЫЙ", "Confirm Transaction":"Подтверждение транзакции", + "CREATE DAPPS":"СОЗДАТЬ", "Set pass":"Установить пароль", "Unlock":"Разблокировать", "Entrance to sub-wallet":"Войти в под-кошелек", + "Public name":"Публичное имя", "Currency":"Валюта", "Pay to:":"Получатель:", "Amount:":"Сумма:", "Description:":"Описание:", + "Welcome to TERA Wallet":"Добропожаловать в кошелек TERA", "Edit your wallet":"Редактирование вашего кошелька", "Key settings":"Задание ключей", + "KEY SETTINGS":"ЗАДАНИЕ КЛЮЧЕЙ", "Create an account":"Создание счета", "Sending coins":"Отправка монет", "Decentralized applications (dApps)":"Децентрализованные приложения (Даппс)", + "Secure your wallet":"Безопасность вашего кошелька", "Wallet is secured":"Установлен пароль", "Total":"Всего", "Item.Name":"Item.Name", + "You have no accounts yet":"У вас нет ни одного счета", "Wait 10-15 sec":"Ждите 10-15 сек", "Creating your account":"Идет создание вашего счета", + "From:":"Отправитель:", "Set a password for protect entry":"Установите пароль для безопасности", "Enter password to unlock wallet":"Введите пароль для разблокировки кошелька", + "From ID:":"Отправитель:", "Pay to ID:":"Получатель:", "Account":"Счет", "Owner":"Владелец", "Block num":"Ном блока", "Private key (secret)":"Приватный ключ (секретно)", + "Load key":"Загруз.", "Create your first account and start using TERA":"Создайте свой первый счет и начните использовать TERA", + "0 Accounts":"0 Счетов", "OWNER: {Item.Owner}":"Владелец: {Item.Owner}", "More info":"Информация", "Public key":"Публичный ключ"}; +LangMap["简体中文"] = {"TERA WALLET":"TERA 钱包", "Generate key":"生成私钥", "OK":"OK", "Cancel":"取消", "Edit":"编辑", "Save key":"保存私钥", + "+ CREATE A NEW ACCOUNT":"+ 新建账号", "Create account":"创建账号", "Send":"发送", "SEND":"转账", "CONFIRM":"确认", "Accounts":"账号", "Account(s)":"账号", + "Blocks and Tx":"区块和交易", "Counters":"状态统计", "Open DApp":"打开DApp", "Back":"返回", "Delete":"删除", "Save to book":"保存到地址本", "Choose":"选择", + "RECONNECT":"重连", "DApps":"DApps", "ID":"ID", "Amount":"余额", "Cur":"币种", "Name":"名称", "PubKey":"公钥", "Operation":"操作次数", "Smart":"DApp", + "Block Num":"区块编号", "Num":"编号", "Date":"日期", "Data Hash":"数据哈希", "PowHash":"Pow哈希", "Block Hash":"区块哈希", "Bytes":"字节", "Pow":"Pow", + "Miner":"矿工", "(secret)":"(机密)", "Show":"显示", "TERA":"TERA", "Blockchain height:":"区块高度:", "Current create:":"最近区块:", "Protocol ver:":"协议版本:", + "ID: {Item.Num}":"ID: {Item.Num}", "Token generate":"生成代币", "ACCOUNTS":"账号", "DAPPS":"DAPPS", "EXPLORER":"浏览器", "ATTENTION: Before using the wallet, save the private key.":"注意: 使用钱包前,务必保存好私钥。", + "Web-site":"官网", "Bitcointalk":"创世贴", "Twitter":"推特", "Telegram":"电报", "Discord":"Discord", "QQchat":"QQ群", "Buy/sell/mine TERA":"TERA 交易/挖矿", + "+ CREATE NEW":"+ 新建", "Confirm Transaction":"确认交易", "CREATE DAPPS":"创建DAPPS", "Set pass":"设置密码", "Unlock":"解锁", "Entrance to sub-wallet":"进入子钱包", + "Public name":"名称", "Currency":"币种", "Pay to:":"收款:", "Amount:":"金额:", "Description:":"描述:", "Welcome to TERA Wallet":"欢迎使用TERA钱包", + "Edit your wallet":"编辑钱包", "Key settings":"设置私钥", "KEY SETTINGS":"设置私钥", "Create an account":"创建账号", "Sending coins":"转账", + "Decentralized applications (dApps)":"去中心化应用 (DApps)", "Secure your wallet":"设置钱包密码", "Wallet is secured":"钱包密码已设置", "Total":"总计", + "Item.Name":"Item.Name", "You have no accounts yet":"你还没有账号", "Wait 10-15 sec":"等待10-15秒", "Creating your account":"创建你的账号", + "From:":"付款:", "Set a password for protect entry":"设置密码保护钱包", "Enter password to unlock wallet":"输入密码解锁钱包", "From ID:":"付款ID:", + "Pay to ID:":"收款ID:", "Account":"账号", "Owner":"拥有者", "Block num":"区块编号", "Private key (secret)":"私钥 (机密)", "Load key":"载入私钥", + "Create your first account and start using TERA":"创建你的第一个账号,开启TERA之旅", "0 Accounts":"0 账号", "OWNER: {Item.Owner}":"拥有者: {Item.Owner}", + "More info":"详情", "Public key":"公钥"}; +LangMap["한글"] = {"TERA WALLET":"TERA 지갑", "Generate key":"개인 키 생성", "OK":"OK", "Cancel":"취소", "Edit":"편집", "Save key":"개인 키 저장", + "+ CREATE A NEW ACCOUNT":"+ 새 계정 만들기", "Create account":"계정 만들기", "Send":"발송", "CONFIRM":"확인", "Accounts":"계정", "Account(s)":"계정", + "Blocks & Tx":"블록 & 교역 번호", "Counters":"컨디션 통계", "Open DApp":" DApp을 열기", "Back":"되돌아가기", "Delete":"삭제", "Save to book":"저장", + "Choose":"선택", "RECONNECT":"다시 연결", "DApps":"DApps", "ID":"ID", "Amount":"잔금", "Cur":"화폐", "Name":"이름", "PubKey":"공공키", "Operation":"조작 횟수", + "Smart":"DApp", "Block Num":"블록 번호", "Num":"번호", "Date":"날짜", "Data Hash":"데이터 하희", "PowHash":"Pow하희", "Block Hash":"블록 하희", + "Bytes":"바이트", "Pow":"Pow", "Miner":"바이트", "(secret)":"(비밀)", "Show":"쇼", "TERA":"TERA", "Blockchain height:":"블록높이:", "Current create:":"최근 블록:", + "Protocol ver:":"프로토콜 버전:", "ID: {Item.Num}":"ID: {Item.Num}", "Token generate":"생성대폐", "ACCOUNTS":"계정", "SEND":"발송", "DAPPS":"DAPPS", + "EXPLORER":"브라우저", "ATTENTION: Before using the wallet, save the private key.":"주의: 지갑을 사용하기 전에 반드시 개인 키를 저장해야 한다.", "Web-site":"사이트", + "Bitcointalk":"비트 화폐포럼", "Twitter":"트위터", "Telegram":"전보", "Discord":"Discord", "QQchat":"QQ ", "Buy/sell/mine TERA":"TERA거래 /채광", + "+ CREATE NEW":"+신건", "Confirm Transaction":"거래 확인", "CREATE DAPPS":" DAPPS만들기", "Set pass":"비밀번호 설정", "Unlock":"잠금 풀기", "Entrance to sub-wallet":"부속 지갑 들어가기", + "Public name":"이름", "Currency":"화폐", "Pay to:":"지불:", "Amount:":"수량:", "Description:":"묘사:", "Welcome to TERA Wallet":"TERA 지갑을 환영합니다", + "Edit your wallet":"지갑 편집", "Key settings":"개인 키 설정", "KEY SETTINGS":"개인 키 설정", "Create an account":"계정 만들기", "Sending coins":"동전 보내기", + "Decentralized applications (dApps)":"분산식 응용(DApps)", "Secure your wallet":"지갑 비밀번호 설정", "Wallet is secured":"지갑 비밀번호가 설정되었습니다. ", + "Total":"총계", "Item.Name":"Item.Name", "You have no accounts yet":"당신 아직 계정이 없다", "Wait 10-15 sec":" 10 -15초 기다리기", "Creating your account":"계정 만들기", + "From:":"부터:", "\n Item.Description\n ":"\n Item.Description\n ", "Set a password for protect entry":"접근 비밀번호 설정", "Enter password to unlock wallet":"비밀번호 잠금 풀기", + "From ID:":" ID부터:", "Pay to ID:":"ID 에게 지불:", "Account":"계정", "Owner":"소유자", "Block num":"블록 번호", "Private key (secret)":"개인 키", + "Load key":"개인 키 불러오기", "Create your first account and start using TERA":"첫 번째 계정 만들기, TERA 의 여정을 열고", "0 Accounts":"0계정", + "OWNER: {Item.Owner}":"소유자: {Item.Owner}", "More info":"자세", "Public key":"공공키", }; diff --git a/src/HTML/JS/sec256k1.js b/src/HTML/JS/sec256k1.js index 0a05101..4053c2d 100644 --- a/src/HTML/JS/sec256k1.js +++ b/src/HTML/JS/sec256k1.js @@ -11,150 +11,180 @@ "use strict"; var der = require("./der"), toString = Object.prototype.toString, exports = {}, assert = exports; -exports.isArray = function(e, s) { - if (!Array.isArray(e)) +exports.isArray = function (e,s) +{ + if(!Array.isArray(e)) throw TypeError(s); -}, exports.isBoolean = function(e, s) { - if ("[object Boolean]" !== toString.call(e)) +}, exports.isBoolean = function (e,s) +{ + if("[object Boolean]" !== toString.call(e)) throw TypeError(s); -}, exports.isBuffer = function(e, s) { - if (!Buffer.isBuffer(e)) +}, exports.isBuffer = function (e,s) +{ + if(!Buffer.isBuffer(e)) throw TypeError(s); -}, exports.isFunction = function(e, s) { - if ("[object Function]" !== toString.call(e)) +}, exports.isFunction = function (e,s) +{ + if("[object Function]" !== toString.call(e)) throw TypeError(s); -}, exports.isNumber = function(e, s) { - if ("[object Number]" !== toString.call(e)) +}, exports.isNumber = function (e,s) +{ + if("[object Number]" !== toString.call(e)) throw TypeError(s); -}, exports.isObject = function(e, s) { - if ("[object Object]" !== toString.call(e)) +}, exports.isObject = function (e,s) +{ + if("[object Object]" !== toString.call(e)) throw TypeError(s); -}, exports.isBufferLength = function(e, s, r) { - if (e.length !== s) +}, exports.isBufferLength = function (e,s,r) +{ + if(e.length !== s) throw RangeError(r); -}, exports.isBufferLength2 = function(e, s, r, _) { - if (e.length !== s && e.length !== r) +}, exports.isBufferLength2 = function (e,s,r,_) +{ + if(e.length !== s && e.length !== r) throw RangeError(_); -}, exports.isLengthGTZero = function(e, s) { - if (0 === e.length) +}, exports.isLengthGTZero = function (e,s) +{ + if(0 === e.length) throw RangeError(s); -}, exports.isNumberInInterval = function(e, s, r, _) { - if (e <= s || r <= e) +}, exports.isNumberInInterval = function (e,s,r,_) +{ + if(e <= s || r <= e) throw RangeError(_); }; -var messages = { - COMPRESSED_TYPE_INVALID: "compressed should be a boolean", EC_PRIVATE_KEY_TYPE_INVALID: "private key should be a Buffer", - EC_PRIVATE_KEY_LENGTH_INVALID: "private key length is invalid", EC_PRIVATE_KEY_RANGE_INVALID: "private key range is invalid", - EC_PRIVATE_KEY_TWEAK_ADD_FAIL: "tweak out of range or resulting private key is invalid", EC_PRIVATE_KEY_TWEAK_MUL_FAIL: "tweak out of range", - EC_PRIVATE_KEY_EXPORT_DER_FAIL: "couldn't export to DER format", EC_PRIVATE_KEY_IMPORT_DER_FAIL: "couldn't import from DER format", - EC_PUBLIC_KEYS_TYPE_INVALID: "public keys should be an Array", EC_PUBLIC_KEYS_LENGTH_INVALID: "public keys Array should have at least 1 element", - EC_PUBLIC_KEY_TYPE_INVALID: "public key should be a Buffer", EC_PUBLIC_KEY_LENGTH_INVALID: "public key length is invalid", EC_PUBLIC_KEY_PARSE_FAIL: "the public key could not be parsed or is invalid", - EC_PUBLIC_KEY_CREATE_FAIL: "private was invalid, try again", EC_PUBLIC_KEY_TWEAK_ADD_FAIL: "tweak out of range or resulting public key is invalid", - EC_PUBLIC_KEY_TWEAK_MUL_FAIL: "tweak out of range", EC_PUBLIC_KEY_COMBINE_FAIL: "the sum of the public keys is not valid", ECDH_FAIL: "scalar was invalid (zero or overflow)", - ECDSA_SIGNATURE_TYPE_INVALID: "signature should be a Buffer", ECDSA_SIGNATURE_LENGTH_INVALID: "signature length is invalid", - ECDSA_SIGNATURE_PARSE_FAIL: "couldn't parse signature", ECDSA_SIGNATURE_PARSE_DER_FAIL: "couldn't parse DER signature", ECDSA_SIGNATURE_SERIALIZE_DER_FAIL: "couldn't serialize signature to DER format", - ECDSA_SIGN_FAIL: "nonce generation function failed or private key is invalid", ECDSA_RECOVER_FAIL: "couldn't recover public key from signature", - MSG32_TYPE_INVALID: "message should be a Buffer", MSG32_LENGTH_INVALID: "message length is invalid", OPTIONS_TYPE_INVALID: "options should be an Object", - OPTIONS_DATA_TYPE_INVALID: "options.data should be a Buffer", OPTIONS_DATA_LENGTH_INVALID: "options.data length is invalid", - OPTIONS_NONCEFN_TYPE_INVALID: "options.noncefn should be a Function", RECOVERY_ID_TYPE_INVALID: "recovery should be a Number", - RECOVERY_ID_VALUE_INVALID: "recovery should have value between -1 and 4", TWEAK_TYPE_INVALID: "tweak should be a Buffer", TWEAK_LENGTH_INVALID: "tweak length is invalid" -}; +var messages = {COMPRESSED_TYPE_INVALID:"compressed should be a boolean", EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer", + EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid", EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid", + EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid", EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range", + EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format", EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format", + EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array", EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element", + EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer", EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid", EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid", + EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again", EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid", + EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range", EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid", ECDH_FAIL:"scalar was invalid (zero or overflow)", + ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer", ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid", + ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature", ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature", ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format", + ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid", ECDSA_RECOVER_FAIL:"couldn't recover public key from signature", + MSG32_TYPE_INVALID:"message should be a Buffer", MSG32_LENGTH_INVALID:"message length is invalid", OPTIONS_TYPE_INVALID:"options should be an Object", + OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer", OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid", + OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function", RECOVERY_ID_TYPE_INVALID:"recovery should be a Number", + RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4", TWEAK_TYPE_INVALID:"tweak should be a Buffer", TWEAK_LENGTH_INVALID:"tweak length is invalid"}; -function initCompressedValue(e, s) { +function initCompressedValue(e,s) +{ return void 0 === e ? s : (assert.isBoolean(e, messages.COMPRESSED_TYPE_INVALID), e); }; -module.exports = function(E) { - return { - privateKeyVerify: function(e) { +module.exports = function (E) +{ + return {privateKeyVerify:function (e) + { return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), 32 === e.length && E.privateKeyVerify(e); - }, privateKeyExport: function(e, s) { + }, privateKeyExport:function (e,s) + { assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - s = initCompressedValue(s, !0); + s = initCompressedValue(s, !0); var r = E.privateKeyExport(e, s); return der.privateKeyExport(e, r, s); - }, privateKeyImport: function(e) { - if (assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), (e = der.privateKeyImport(e)) && 32 === e.length && E.privateKeyVerify(e)) + }, privateKeyImport:function (e) + { + if(assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), (e = der.privateKeyImport(e)) && 32 === e.length && E.privateKeyVerify(e)) return e; throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL); - }, privateKeyNegate: function(e) { + }, privateKeyNegate:function (e) + { return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - E.privateKeyNegate(e); - }, privateKeyModInverse: function(e) { + E.privateKeyNegate(e); + }, privateKeyModInverse:function (e) + { return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - E.privateKeyModInverse(e); - }, privateKeyTweakAdd: function(e, s) { + E.privateKeyModInverse(e); + }, privateKeyTweakAdd:function (e,s) + { return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakAdd(e, - s); - }, privateKeyTweakMul: function(e, s) { + assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakAdd(e, + s); + }, privateKeyTweakMul:function (e,s) + { return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakMul(e, - s); - }, publicKeyCreate: function(e, s) { + assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakMul(e, + s); + }, publicKeyCreate:function (e,s) + { return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - s = initCompressedValue(s, !0), E.publicKeyCreate(e, s); - }, publicKeyConvert: function(e, s) { + s = initCompressedValue(s, !0), E.publicKeyCreate(e, s); + }, publicKeyConvert:function (e,s) + { return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), - s = initCompressedValue(s, !0), E.publicKeyConvert(e, s); - }, publicKeyVerify: function(e) { + s = initCompressedValue(s, !0), E.publicKeyConvert(e, s); + }, publicKeyVerify:function (e) + { return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), E.publicKeyVerify(e); - }, publicKeyTweakAdd: function(e, s, r) { + }, publicKeyTweakAdd:function (e,s,r) + { return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), - assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r, - !0), E.publicKeyTweakAdd(e, s, r); - }, publicKeyTweakMul: function(e, s, r) { + assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r, + !0), E.publicKeyTweakAdd(e, s, r); + }, publicKeyTweakMul:function (e,s,r) + { return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), - assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r, - !0), E.publicKeyTweakMul(e, s, r); - }, publicKeyCombine: function(e, s) { + assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r, + !0), E.publicKeyTweakMul(e, s, r); + }, publicKeyCombine:function (e,s) + { assert.isArray(e, messages.EC_PUBLIC_KEYS_TYPE_INVALID), assert.isLengthGTZero(e, messages.EC_PUBLIC_KEYS_LENGTH_INVALID); - for (var r = 0; r < e.length; ++r) + for(var r = 0; r < e.length; ++r) assert.isBuffer(e[r], messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e[r], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID); return s = initCompressedValue(s, !0), E.publicKeyCombine(e, s); - }, signatureNormalize: function(e) { + }, signatureNormalize:function (e) + { return assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(e, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), - E.signatureNormalize(e); - }, signatureExport: function(e) { + E.signatureNormalize(e); + }, signatureExport:function (e) + { assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(e, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID); var s = E.signatureExport(e); return der.signatureExport(s); - }, signatureImport: function(e) { + }, signatureImport:function (e) + { assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isLengthGTZero(e, messages.ECDSA_SIGNATURE_LENGTH_INVALID); var s = der.signatureImport(e); - if (s) + if(s) return E.signatureImport(s); throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL); - }, signatureImportLax: function(e) { + }, signatureImportLax:function (e) + { assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isLengthGTZero(e, messages.ECDSA_SIGNATURE_LENGTH_INVALID); var s = der.signatureImportLax(e); - if (s) + if(s) return E.signatureImport(s); throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL); - }, sign: function(e, s, r) { + }, sign:function (e,s,r) + { assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s, - messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID); + messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID); var _ = null, t = null; return void 0 !== r && (assert.isObject(r, messages.OPTIONS_TYPE_INVALID), void 0 !== r.data && (assert.isBuffer(r.data, messages.OPTIONS_DATA_TYPE_INVALID), - assert.isBufferLength(r.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID), _ = r.data), void 0 !== r.noncefn && (assert.isFunction(r.noncefn, - messages.OPTIONS_NONCEFN_TYPE_INVALID), t = r.noncefn)), E.sign(e, s, t, _); - }, verify: function(e, s, r) { + assert.isBufferLength(r.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID), _ = r.data), void 0 !== r.noncefn && (assert.isFunction(r.noncefn, + messages.OPTIONS_NONCEFN_TYPE_INVALID), t = r.noncefn)), E.sign(e, s, t, _); + }, verify:function (e,s,r) + { return assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s, - messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isBuffer(r, - messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(r, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), E.verify(e, - s, r); - }, recover: function(e, s, r, _) { + messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isBuffer(r, + messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(r, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), E.verify(e, + s, r); + }, recover:function (e,s,r,_) + { return assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s, - messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isNumber(r, - messages.RECOVERY_ID_TYPE_INVALID), assert.isNumberInInterval(r, - 1, 4, messages.RECOVERY_ID_VALUE_INVALID), _ = initCompressedValue(_, - !0), E.recover(e, s, r, _); - }, ecdh: function(e, s) { + messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isNumber(r, + messages.RECOVERY_ID_TYPE_INVALID), assert.isNumberInInterval(r, - 1, 4, messages.RECOVERY_ID_VALUE_INVALID), _ = initCompressedValue(_, + !0), E.recover(e, s, r, _); + }, ecdh:function (e,s) + { return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), - assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - E.ecdh(e, s); - }, ecdhUnsafe: function(e, s, r) { + assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), + E.ecdh(e, s); + }, ecdhUnsafe:function (e,s,r) + { return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), - assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), - r = initCompressedValue(r, !0), E.ecdhUnsafe(e, s, r); - } - }; + assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID), + r = initCompressedValue(r, !0), E.ecdhUnsafe(e, s, r); + }}; }, global.SIGN_LIB = module.exports; diff --git a/src/HTML/JS/sha3.js b/src/HTML/JS/sha3.js index da42d9f..255d5df 100644 --- a/src/HTML/JS/sha3.js +++ b/src/HTML/JS/sha3.js @@ -8,14 +8,17 @@ * Telegram: https://t.me/terafoundation */ -(function() { +(function () +{ 'use strict'; var root = typeof window === 'object' ? window : {}; var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; - if (NODE_JS && !root.RUN_NW_CLIENT) { + if(NODE_JS && !root.RUN_NW_CLIENT) + { root = global; } - if (root.RUN_CLIENT) { + if(root.RUN_CLIENT) + { root = window; } var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports; @@ -27,132 +30,157 @@ var PADDING = [6, 1536, 393216, 100663296]; var SHIFT = [0, 8, 16, 24]; var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, - 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, - 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, - 0, 2147516424, 2147483648]; + 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, + 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, + 0, 2147516424, 2147483648]; var BITS = [224, 256, 384, 512]; var SHAKE_BITS = [128, 256]; var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array']; - var CSHAKE_BYTEPAD = { '128': 168, '256': 136 }; - if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) { - Array.isArray = function(obj) { + var CSHAKE_BYTEPAD = {'128':168, '256':136}; + if(root.JS_SHA3_NO_NODE_JS || !Array.isArray) + { + Array.isArray = function (obj) + { return Object.prototype.toString.call(obj) === '[object Array]'; }; } - var createOutputMethod = function(bits, padding, outputType) { - return function(message) { + var createOutputMethod = function (bits,padding,outputType) + { + return function (message) + { return new Keccak(bits, padding, bits).update(message)[outputType](); }; }; - var createShakeOutputMethod = function(bits, padding, outputType) { - return function(message, outputBits) { + var createShakeOutputMethod = function (bits,padding,outputType) + { + return function (message,outputBits) + { return new Keccak(bits, padding, outputBits).update(message)[outputType](); }; }; - var createCshakeOutputMethod = function(bits, padding, outputType) { - return function(message, outputBits, n, s) { + var createCshakeOutputMethod = function (bits,padding,outputType) + { + return function (message,outputBits,n,s) + { return methods['cshake' + bits].update(message, outputBits, n, s)[outputType](); }; }; - var createKmacOutputMethod = function(bits, padding, outputType) { - return function(key, message, outputBits, s) { + var createKmacOutputMethod = function (bits,padding,outputType) + { + return function (key,message,outputBits,s) + { return methods['kmac' + bits].update(key, message, outputBits, s)[outputType](); }; }; - var createOutputMethods = function(method, createMethod, bits, padding) { - for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var createOutputMethods = function (method,createMethod,bits,padding) + { + for(var i = 0; i < OUTPUT_TYPES.length; ++i) + { var type = OUTPUT_TYPES[i]; method[type] = createMethod(bits, padding, type); } return method; }; - var createMethod = function(bits, padding, outputs) { + var createMethod = function (bits,padding,outputs) + { var method = createOutputMethod(bits, padding, outputs); - method.create = function() { + method.create = function () + { return new Keccak(bits, padding, bits); }; - method.update = function(message) { + method.update = function (message) + { return method.create().update(message); }; return createOutputMethods(method, createOutputMethod, bits, padding); }; - var createMethodArray = function(bits, padding) { + var createMethodArray = function (bits,padding) + { var method = createOutputMethod(bits, padding, 'array'); - method.create = function() { + method.create = function () + { return new Keccak(bits, padding, bits); }; - method.update = function(message) { + method.update = function (message) + { return method.create().update(message); }; return createOutputMethods(method, createOutputMethod, bits, padding); }; - var createShakeMethod = function(bits, padding) { + var createShakeMethod = function (bits,padding) + { var method = createShakeOutputMethod(bits, padding, 'hex'); - method.create = function(outputBits) { + method.create = function (outputBits) + { return new Keccak(bits, padding, outputBits); }; - method.update = function(message, outputBits) { + method.update = function (message,outputBits) + { return method.create(outputBits).update(message); }; return createOutputMethods(method, createShakeOutputMethod, bits, padding); }; - var createCshakeMethod = function(bits, padding) { + var createCshakeMethod = function (bits,padding) + { var w = CSHAKE_BYTEPAD[bits]; var method = createCshakeOutputMethod(bits, padding, 'hex'); - method.create = function(outputBits, n, s) { - if (!n && !s) { + method.create = function (outputBits,n,s) + { + if(!n && !s) + { return methods['shake' + bits].create(outputBits); } - else { + else + { return new Keccak(bits, padding, outputBits).bytepad([n, s], w); } }; - method.update = function(message, outputBits, n, s) { + method.update = function (message,outputBits,n,s) + { return method.create(outputBits, n, s).update(message); }; return createOutputMethods(method, createCshakeOutputMethod, bits, padding); }; - var createKmacMethod = function(bits, padding) { + var createKmacMethod = function (bits,padding) + { var w = CSHAKE_BYTEPAD[bits]; var method = createKmacOutputMethod(bits, padding, 'hex'); - method.create = function(key, outputBits, s) { + method.create = function (key,outputBits,s) + { return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w); }; - method.update = function(key, message, outputBits, s) { + method.update = function (key,message,outputBits,s) + { return method.create(key, outputBits, s).update(message); }; return createOutputMethods(method, createKmacOutputMethod, bits, padding); }; - var algorithms = [{ name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod }, { - name: 'sha3', padding: PADDING, - bits: BITS, createMethod: createMethod, outputs: 'hex' - }, { - name: 'sha3_array', padding: PADDING, bits: BITS, createMethod: createMethod, - outputs: 'array' - }, { name: 'sha3_buf', padding: PADDING, bits: BITS, createMethod: createMethod, outputs: 'buffer' }, { - name: 'shake', - padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod - }, { - name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, - createMethod: createCshakeMethod - }, { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }]; + var algorithms = [{name:'keccak', padding:KECCAK_PADDING, bits:BITS, createMethod:createMethod}, {name:'sha3', padding:PADDING, + bits:BITS, createMethod:createMethod, outputs:'hex'}, {name:'sha3_array', padding:PADDING, bits:BITS, createMethod:createMethod, + outputs:'array'}, {name:'sha3_buf', padding:PADDING, bits:BITS, createMethod:createMethod, outputs:'buffer'}, {name:'shake', + padding:SHAKE_PADDING, bits:SHAKE_BITS, createMethod:createShakeMethod}, {name:'cshake', padding:CSHAKE_PADDING, bits:SHAKE_BITS, + createMethod:createCshakeMethod}, {name:'kmac', padding:CSHAKE_PADDING, bits:SHAKE_BITS, createMethod:createKmacMethod}]; var methods = {}, methodNames = []; - for (var i = 0; i < algorithms.length; ++i) { + for(var i = 0; i < algorithms.length; ++i) + { var algorithm = algorithms[i]; var bits = algorithm.bits; - for (var j = 0; j < bits.length; ++j) { + for(var j = 0; j < bits.length; ++j) + { var methodName = algorithm.name + '_' + bits[j]; methodNames.push(methodName); methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding, algorithm.outputs); - if (algorithm.name !== 'sha3') { + if(algorithm.name !== 'sha3') + { var newMethodName = algorithm.name + bits[j]; methodNames.push(newMethodName); methods[newMethodName] = methods[methodName]; } } } - - function Keccak(bits, padding, outputBits) { + +function Keccak(bits,padding,outputBits) + { this.blocks = []; this.s = []; this.padding = padding; @@ -164,55 +192,71 @@ this.byteCount = this.blockCount << 2; this.outputBlocks = outputBits >> 5; this.extraBytes = (outputBits & 31) >> 3; - for (var i = 0; i < 50; ++i) { + for(var i = 0; i < 50; ++i) + { this.s[i] = 0; } }; - Keccak.prototype.update = function(message) { + Keccak.prototype.update = function (message) + { var notString = typeof message !== 'string'; - if (notString && message.constructor === root.ArrayBuffer) { + if(notString && message.constructor === root.ArrayBuffer) + { TO_ERROR_LOG("SHA3", 10, 'ERROR: Error type ArrayBuffer, use Uint8Array instead!'); return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } var length = message.length; - if (notString) { - if (typeof length !== 'number' || !Array.isArray(message) && !(ARRAY_BUFFER && ArrayBuffer.isView(message))) { + if(notString) + { + if(typeof length !== 'number' || !Array.isArray(message) && !(ARRAY_BUFFER && ArrayBuffer.isView(message))) + { TO_ERROR_LOG("SHA3", 20, 'ERROR: Input is invalid type, message=' + JSON.stringify(message)); return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } } var blocks = this.blocks, byteCount = this.byteCount, blockCount = this.blockCount, index = 0, s = this.s, i, code; - while (index < length) { - if (this.reset) { + while(index < length) + { + if(this.reset) + { this.reset = false; blocks[0] = this.block; - for (i = 1; i < blockCount + 1; ++i) { + for(i = 1; i < blockCount + 1; ++i) + { blocks[i] = 0; } } - if (notString) { - for (i = this.start; index < length && i < byteCount; ++index) { + if(notString) + { + for(i = this.start; index < length && i < byteCount; ++index) + { blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; } } - else { - for (i = this.start; index < length && i < byteCount; ++index) { + else + { + for(i = this.start; index < length && i < byteCount; ++index) + { code = message.charCodeAt(index); - if (code < 0x80) { + if(code < 0x80) + { blocks[i >> 2] |= code << SHIFT[i++ & 3]; } else - if (code < 0x800) { + if(code < 0x800) + { blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; } else - if (code < 0xd800 || code >= 0xe000) { + if(code < 0xd800 || code >= 0xe000) + { blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; } - else { + else + { code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; @@ -222,73 +266,91 @@ } } this.lastByteIndex = i; - if (i >= byteCount) { + if(i >= byteCount) + { this.start = i - byteCount; this.block = blocks[blockCount]; - for (i = 0; i < blockCount; ++i) { + for(i = 0; i < blockCount; ++i) + { s[i] ^= blocks[i]; } f(s); this.reset = true; } - else { + else + { this.start = i; } } return this; }; - Keccak.prototype.encode = function(x, right) { + Keccak.prototype.encode = function (x,right) + { var o = x & 255, n = 1; var bytes = [o]; x = x >> 8; o = x & 255; - while (o > 0) { + while(o > 0) + { bytes.unshift(o); x = x >> 8; o = x & 255; ++n; } - if (right) { + if(right) + { bytes.push(n); } - else { + else + { bytes.unshift(n); } this.update(bytes); return bytes.length; }; - Keccak.prototype.encodeString = function(str) { + Keccak.prototype.encodeString = function (str) + { str = str || ''; var notString = typeof str !== 'string'; - if (notString && str.constructor === root.ArrayBuffer) { + if(notString && str.constructor === root.ArrayBuffer) + { str = new Uint8Array(str); } var length = str.length; - if (notString) { - if (typeof length !== 'number' || !Array.isArray(str) && !(ARRAY_BUFFER && ArrayBuffer.isView(str))) { + if(notString) + { + if(typeof length !== 'number' || !Array.isArray(str) && !(ARRAY_BUFFER && ArrayBuffer.isView(str))) + { TO_ERROR_LOG("SHA3", 30, 'ERROR: Input is invalid type, str=' + JSON.stringify(str)); return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } } var bytes = 0; - if (notString) { + if(notString) + { bytes = length; } - else { - for (var i = 0; i < str.length; ++i) { + else + { + for(var i = 0; i < str.length; ++i) + { var code = str.charCodeAt(i); - if (code < 0x80) { + if(code < 0x80) + { bytes += 1; } else - if (code < 0x800) { + if(code < 0x800) + { bytes += 2; } else - if (code < 0xd800 || code >= 0xe000) { + if(code < 0xd800 || code >= 0xe000) + { bytes += 3; } - else { + else + { code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff)); bytes += 4; } @@ -298,9 +360,11 @@ this.update(str); return bytes; }; - Keccak.prototype.bytepad = function(strs, w) { + Keccak.prototype.bytepad = function (strs,w) + { var bytes = this.encode(w); - for (var i = 0; i < strs.length; ++i) { + for(var i = 0; i < strs.length; ++i) + { bytes += this.encodeString(strs[i]); } var paddingBytes = w - bytes % w; @@ -309,82 +373,104 @@ this.update(zeros); return this; }; - Keccak.prototype.finalize = function() { + Keccak.prototype.finalize = function () + { var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s; blocks[i >> 2] |= this.padding[i & 3]; - if (this.lastByteIndex === this.byteCount) { + if(this.lastByteIndex === this.byteCount) + { blocks[0] = blocks[blockCount]; - for (i = 1; i < blockCount + 1; ++i) { + for(i = 1; i < blockCount + 1; ++i) + { blocks[i] = 0; } } blocks[blockCount - 1] |= 0x80000000; - for (i = 0; i < blockCount; ++i) { + for(i = 0; i < blockCount; ++i) + { s[i] ^= blocks[i]; } f(s); }; - Keccak.prototype.toString = Keccak.prototype.hex = function() { + Keccak.prototype.toString = Keccak.prototype.hex = function () + { this.finalize(); var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0; var hex = '', block; - while (j < outputBlocks) { - for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { + while(j < outputBlocks) + { + for(i = 0; i < blockCount && j < outputBlocks; ++i, ++j) + { block = s[i]; hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] + HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] + HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F]; } - if (j % blockCount === 0) { + if(j % blockCount === 0) + { f(s); i = 0; } } - if (extraBytes) { + if(extraBytes) + { block = s[i]; - if (extraBytes > 0) { + if(extraBytes > 0) + { hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F]; } - if (extraBytes > 1) { + if(extraBytes > 1) + { hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F]; } - if (extraBytes > 2) { + if(extraBytes > 2) + { hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F]; } } return hex; }; - Keccak.prototype.arrayBuffer = function() { + Keccak.prototype.arrayBuffer = function () + { this.finalize(); var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0; var bytes = this.outputBits >> 3; var buffer; - if (extraBytes) { + if(extraBytes) + { buffer = new ArrayBuffer((outputBlocks + 1) << 2); } - else { + else + { buffer = new ArrayBuffer(bytes); } var array = new Uint32Array(buffer); - while (j < outputBlocks) { - for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { + while(j < outputBlocks) + { + for(i = 0; i < blockCount && j < outputBlocks; ++i, ++j) + { array[j] = s[i]; } - if (j % blockCount === 0) { + if(j % blockCount === 0) + { f(s); } } - if (extraBytes) { + if(extraBytes) + { array[i] = s[i]; buffer = buffer.slice(0, bytes); } return buffer; }; Keccak.prototype.buffer = Keccak.prototype.arrayBuffer; - Keccak.prototype.digest = Keccak.prototype.array = function() { + Keccak.prototype.digest = Keccak.prototype.array = function () + { this.finalize(); var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0; var array = [], offset, block; - while (j < outputBlocks) { - for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { + while(j < outputBlocks) + { + for(i = 0; i < blockCount && j < outputBlocks; ++i, ++j) + { offset = j << 2; block = s[i]; array[offset] = block & 0xFF; @@ -392,39 +478,48 @@ array[offset + 2] = (block >> 16) & 0xFF; array[offset + 3] = (block >> 24) & 0xFF; } - if (j % blockCount === 0) { + if(j % blockCount === 0) + { f(s); } } - if (extraBytes) { + if(extraBytes) + { offset = j << 2; block = s[i]; - if (extraBytes > 0) { + if(extraBytes > 0) + { array[offset] = block & 0xFF; } - if (extraBytes > 1) { + if(extraBytes > 1) + { array[offset + 1] = (block >> 8) & 0xFF; } - if (extraBytes > 2) { + if(extraBytes > 2) + { array[offset + 2] = (block >> 16) & 0xFF; } } return array; }; - - function Kmac(bits, padding, outputBits) { + +function Kmac(bits,padding,outputBits) + { Keccak.call(this, bits, padding, outputBits); }; Kmac.prototype = new Keccak(); - Kmac.prototype.finalize = function() { + Kmac.prototype.finalize = function () + { this.encode(this.outputBits, true); return Keccak.prototype.finalize.call(this); }; - var f = function(s) { + var f = function (s) + { var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, - b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, - b41, b42, b43, b44, b45, b46, b47, b48, b49; - for (n = 0; n < 48; n += 2) { + b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, + b41, b42, b43, b44, b45, b46, b47, b48, b49; + for(n = 0; n < 48; n += 2) + { c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; @@ -602,47 +697,58 @@ root.sha3_str = methods.sha3_256; root.sha3_array_256 = methods.sha3_array_256; root.sha3 = methods.sha3_array_256; - root.sha = function(data) { + root.sha = function (data) + { return meshhash(methods.sha3_256(data)); }; - root.shaarr = function(data) { + root.shaarr = function (data) + { return meshhash(methods.sha3_array_256(data)); }; - root.shabuf = function(data) { + root.shabuf = function (data) + { return Buffer.from(shaarr(data)); }; - root.shabuf = function(data) { + root.shabuf = function (data) + { return Buffer.from(shaarr(data)); }; - root.SHA3BUF = function(data, num) { + root.SHA3BUF = function (data,num) + { return Buffer.from(SHA3ARR(data, num)); }; - root.SHA3ARR = function(data, num) { - if (!NEW_SIGN_TIME || !num || num >= NEW_SIGN_TIME) + root.SHA3ARR = function (data,num) + { + if(!NEW_SIGN_TIME || !num || num >= NEW_SIGN_TIME) return sha3(data); else return meshhash(methods.sha3_array_256(data)); }; - root.shaarrblock = function(data, num) { + root.shaarrblock = function (data,num) + { return meshhash(methods.sha3_array_256(data), num); }; })(); -function meshhash(hash, num) { +function meshhash(hash,num) +{ var regs = [hash[3], hash[2], hash[1], hash[0]]; var mem = []; - for (var i = 0; i < 16; i++) { + for(var i = 0; i < 16; i++) + { mem[i] = hash[i * 2] + (hash[i * 2 + 1] << 8); } var WasGoto = 0; var L = 0; - for (var i = 0; i < 64; i++) { + for(var i = 0; i < 64; i++) + { var c = hash[L & 31]; L++; var a = (c >> 4) & 0xF; var b = c & 0xF; var r = c & 0x3; - switch (a) { + switch(a) + { case 0: regs[0] = regs[0] + regs[r]; break; @@ -662,13 +768,15 @@ function meshhash(hash, num) { regs[0] = regs[0] + regs[1] + regs[2] + regs[3]; break; case 8: - if ((regs[0] & 0xFFFF) < 32768 && !WasGoto) { + if((regs[0] & 0xFFFF) < 32768 && !WasGoto) + { L = 32 + L - b; WasGoto = 1; } break; case 9: - if ((regs[0] & 0xFFFF) > 32768 && !WasGoto) { + if((regs[0] & 0xFFFF) > 32768 && !WasGoto) + { L += b; WasGoto = 1; } @@ -678,14 +786,16 @@ function meshhash(hash, num) { } var index1 = regs[0] & 0xF; var index2 = (regs[0] >> 8) & 0xF; - if (index1 !== index2) { + if(index1 !== index2) + { var temp = mem[index1]; mem[index1] = mem[index2]; mem[index2] = temp; } } var ret = []; - for (var i = 0; i < 16; i++) { + for(var i = 0; i < 16; i++) + { ret[i * 2] = mem[i] & 0xFF; ret[i * 2 + 1] = mem[i] >> 8; } diff --git a/src/HTML/JS/sign-lib-min.js b/src/HTML/JS/sign-lib-min.js index e7eb921..02a8be2 100644 --- a/src/HTML/JS/sign-lib-min.js +++ b/src/HTML/JS/sign-lib-min.js @@ -1,3485 +1 @@ -/* - * @project: TERA - * @version: Development (beta) - * @license: MIT (not for evil) - * @copyright: Yuriy Ivanov (Vtools) 2017-2019 [progr76@gmail.com] - * Web: https://terafoundation.org - * Twitter: https://twitter.com/terafoundation - * Telegram: https://t.me/terafoundation -*/ - -var $jscomp = $jscomp || {}; -$jscomp.scope = {}, $jscomp.arrayIteratorImpl = function(t) { - var e = 0; - return function() { - return e < t.length ? { done: !1, value: t[e++] } : { done: !0 }; - }; -}, $jscomp.arrayIterator = function(t) { - return { next: $jscomp.arrayIteratorImpl(t) }; -}, $jscomp.ASSUME_ES5 = !1, $jscomp.ASSUME_NO_NATIVE_MAP = !1, $jscomp.ASSUME_NO_NATIVE_SET = !1, $jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function(t, e, r) { - t != Array.prototype && t != Object.prototype && (t[e] = r.value); -}, $jscomp.getGlobal = function(t) { - return "undefined" != typeof window && window === t ? t : "undefined" != typeof global && null != global ? global : t; -}, $jscomp.global = $jscomp.getGlobal(this), $jscomp.SYMBOL_PREFIX = "jscomp_symbol_", $jscomp.initSymbol = function() { - $jscomp.initSymbol = function() { - }, $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol); -}, $jscomp.Symbol = function() { - var e = 0; - return function(t) { - return $jscomp.SYMBOL_PREFIX + (t || "") + e++; - }; -}(), $jscomp.initSymbolIterator = function() { - $jscomp.initSymbol(); - var t = $jscomp.global.Symbol.iterator; - t = t || ($jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator")), "function" != typeof Array.prototype[t] && $jscomp.defineProperty(Array.prototype, - t, { - configurable: !0, writable: !0, value: function() { - return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this)); - } - }), $jscomp.initSymbolIterator = function() { - }; -}, $jscomp.initSymbolAsyncIterator = function() { - $jscomp.initSymbol(); - var t = $jscomp.global.Symbol.asyncIterator; - t = t || ($jscomp.global.Symbol.asyncIterator = $jscomp.global.Symbol("asyncIterator")), $jscomp.initSymbolAsyncIterator = function() { - }; -}, $jscomp.iteratorPrototype = function(t) { - return $jscomp.initSymbolIterator(), (t = { next: t })[$jscomp.global.Symbol.iterator] = function() { - return this; - }, t; -}, function i(n, s, o) { - - function a(e, t) { - if (!s[e]) { - if (!n[e]) { - var r = "function" == typeof require && require; - if (!t && r) - return r(e, !0); - if (h) - return h(e, !0); - throw (r = Error("Cannot find module '" + e + "'")).code = "MODULE_NOT_FOUND", r; - } - r = s[e] = { exports: {} }, n[e][0].call(r.exports, function(t) { - return a(n[e][1][t] || t); - }, r, r.exports, i, n, s, o); - } - return s[e].exports; - }; - for (var h = "function" == typeof require && require, t = 0; t < o.length; t++) - a(o[t]); - return a; -}({ - 1: [function(t, e, r) { - - function a(t) { - var e = t.length; - if (0 < e % 4) - throw Error("Invalid string. Length must be a multiple of 4"); - return - 1 === (t = t.indexOf("=")) && (t = e), [t, t === e ? 0 : 4 - t % 4]; - }; - - function o(t, e, r) { - for (var i = [], n = e; n < r; n += 3) - e = (t[n] << 16 & 16711680) + (t[n + 1] << 8 & 65280) + (255 & t[n + 2]), i.push(h[e >> 18 & 63] + h[e >> 12 & 63] + h[e >> 6 & 63] + h[63 & e]); - return i.join(""); - }; - r.byteLength = function(t) { - var e = (t = a(t))[1]; - return 3 * (t[0] + e) / 4 - e; - }, r.toByteArray = function(t) { - var e = a(t), r = e[0]; - e = e[1]; - for (var i = new l(3 * (r + e) / 4 - e), n = 0, s = 0 < e ? r - 4 : r, o = 0; o < s; o += 4) - r = u[t.charCodeAt(o)] << 18 | u[t.charCodeAt(o + 1)] << 12 | u[t.charCodeAt(o + 2)] << 6 | u[t.charCodeAt(o + 3)], i[n++] = r >> 16 & 255, - i[n++] = r >> 8 & 255, i[n++] = 255 & r; - return 2 === e && (r = u[t.charCodeAt(o)] << 2 | u[t.charCodeAt(o + 1)] >> 4, i[n++] = 255 & r), 1 === e && (r = u[t.charCodeAt(o)] << 10 | u[t.charCodeAt(o + 1)] << 4 | u[t.charCodeAt(o + 2)] >> 2, - i[n++] = r >> 8 & 255, i[n++] = 255 & r), i; - }, r.fromByteArray = function(t) { - for (var e = t.length, r = e % 3, i = [], n = 0, s = e - r; n < s; n += 16383) - i.push(o(t, n, s < n + 16383 ? s : n + 16383)); - return 1 == r ? (t = t[e - 1], i.push(h[t >> 2] + h[t << 4 & 63] + "==")) : 2 == r && (t = (t[e - 2] << 8) + t[e - 1], i.push(h[t >> 10] + h[t >> 4 & 63] + h[t << 2 & 63] + "=")), - i.join(""); - }; - var h = [], u = [], l = "undefined" != typeof Uint8Array ? Uint8Array : Array; - for (t = 0; t < 64; ++t) - h[t] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t], u["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)] = t; - u[45] = 62, u[95] = 63; - }, {}], 2: [function(t, e, r) { - }, {}], 3: [function(t, e, r) { - - function n(t) { - if (B < t) - throw new RangeError("Invalid typed array length"); - return (t = new Uint8Array(t)).__proto__ = h.prototype, t; - }; - - function h(t, e, r) { - if ("number" != typeof t) - return i(t, e, r); - if ("string" == typeof e) - throw Error("If encoding is specified then the first argument must be a string"); - return o(t); - }; - - function i(t, e, r) { - if ("number" == typeof t) - throw new TypeError('"value" argument must not be a number'); - if (S(t) || t && S(t.buffer)) { - if (e < 0 || t.byteLength < e) - throw new RangeError('"offset" is outside of buffer bounds'); - if (t.byteLength < e + (r || 0)) - throw new RangeError('"length" is outside of buffer bounds'); - return (t = void 0 === e && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, e) : new Uint8Array(t, e, r)).__proto__ = h.prototype, - t; - } - if ("string" != typeof t) - return function(t) { - if (h.isBuffer(t)) { - var e = 0 | u(t.length), r = n(e); - return 0 === r.length || t.copy(r, 0, 0, e), r; - } - if (t) { - if (ArrayBuffer.isView(t) || "length" in t) - return (e = "number" != typeof t.length) || (e = (e = t.length) != e), e ? n(0) : a(t); - if ("Buffer" === t.type && Array.isArray(t.data)) - return a(t.data); - } - throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object."); - }(t); - var i = e; - if ("string" == typeof i && "" !== i || (i = "utf8"), !h.isEncoding(i)) - throw new TypeError("Unknown encoding: " + i); - return (t = (r = n(e = 0 | l(t, i))).write(t, i)) !== e && (r = r.slice(0, t)), r; - }; - - function s(t) { - if ("number" != typeof t) - throw new TypeError('"size" argument must be of type number'); - if (t < 0) - throw new RangeError('"size" argument must not be negative'); - }; - - function o(t) { - return s(t), n(t < 0 ? 0 : 0 | u(t)); - }; - - function a(t) { - for (var e = t.length < 0 ? 0 : 0 | u(t.length), r = n(e), i = 0; i < e; i += 1) - r[i] = 255 & t[i]; - return r; - }; - - function u(t) { - if (B <= t) - throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + B.toString(16) + " bytes"); - return 0 | t; - }; - - function l(t, e) { - if (h.isBuffer(t)) - return t.length; - if (ArrayBuffer.isView(t) || S(t)) - return t.byteLength; - "string" != typeof t && (t = "" + t); - var r = t.length; - if (0 === r) - return 0; - for (var i = !1; ;) - switch (e) { - case "ascii": - case "latin1": - case "binary": - return r; - case "utf8": - case "utf-8": - case void 0: - return v(t).length; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return 2 * r; - case "hex": - return r >>> 1; - case "base64": - return I.toByteArray(w(t)).length; - default: - if (i) - return v(t).length; - e = ("" + e).toLowerCase(), i = !0; - } - }; - - function f(t, e, r) { - var i = t[e]; - t[e] = t[r], t[r] = i; - }; - - function c(t, e, r, i, n) { - if (0 === t.length) - return - 1; - if ("string" == typeof r ? (i = r, r = 0) : 2147483647 < r ? r = 2147483647 : r < - 2147483648 && (r = - 2147483648), (r = + r) != r && (r = n ? 0 : t.length - 1), - r < 0 && (r = t.length + r), r >= t.length) { - if (n) - return - 1; - r = t.length - 1; - } - else - if (r < 0) { - if (!n) - return - 1; - r = 0; - } - if ("string" == typeof e && (e = h.from(e, i)), h.isBuffer(e)) - return 0 === e.length ? - 1 : d(t, e, r, i, n); - if ("number" == typeof e) - return e &= 255, "function" == typeof Uint8Array.prototype.indexOf ? n ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, - e, r) : d(t, [e], r, i, n); - throw new TypeError("val must be string, number or Buffer"); - }; - - function d(t, e, r, i, n) { - - function s(t, e) { - return 1 === o ? t[e] : t.readUInt16BE(e * o); - }; - var o = 1, a = t.length, h = e.length; - if (void 0 !== i && ("ucs2" === (i = String(i).toLowerCase()) || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) { - if (t.length < 2 || e.length < 2) - return - 1; - a /= o = 2, h /= 2, r /= 2; - } - if (n) - for (i = - 1; r < a; r++) - if (s(t, r) === s(e, - 1 === i ? 0 : r - i)) { - if (- 1 === i && (i = r), r - i + 1 === h) - return i * o; - } - else - - 1 !== i && (r -= r - i), i = - 1; - else - for (a < r + h && (r = a - h); 0 <= r; r--) { - for (a = !0, i = 0; i < h; i++) - if (s(t, r + i) !== s(e, i)) { - a = !1; - break; - } - if (a) - return r; - } - return - 1; - }; - - function p(t, e, r) { - r = Math.min(t.length, r); - for (var i = []; e < r;) { - var n = t[e], s = null, o = 239 < n ? 4 : 223 < n ? 3 : 191 < n ? 2 : 1; - if (e + o <= r) - switch (o) { - case 1: - n < 128 && (s = n); - break; - case 2: - var a = t[e + 1]; - 128 == (192 & a) && (127 < (n = (31 & n) << 6 | 63 & a) && (s = n)); - break; - case 3: - a = t[e + 1]; - var h = t[e + 2]; - 128 == (192 & a) && 128 == (192 & h) && (2047 < (n = (15 & n) << 12 | (63 & a) << 6 | 63 & h) && (n < 55296 || 57343 < n) && (s = n)); - break; - case 4: - a = t[e + 1], h = t[e + 2]; - var u = t[e + 3]; - 128 == (192 & a) && 128 == (192 & h) && 128 == (192 & u) && (65535 < (n = (15 & n) << 18 | (63 & a) << 12 | (63 & h) << 6 | 63 & u) && n < 1114112 && (s = n)); - } - null === s ? (s = 65533, o = 1) : 65535 < s && (s -= 65536, i.push(s >>> 10 & 1023 | 55296), s = 56320 | 1023 & s), i.push(s), - e += o; - } - if ((t = i.length) <= x) - i = String.fromCharCode.apply(String, i); - else { - for (r = "", e = 0; e < t;) - r += String.fromCharCode.apply(String, i.slice(e, e += x)); - i = r; - } - return i; - }; - - function m(t, e, r) { - if (0 != t % 1 || t < 0) - throw new RangeError("offset is not uint"); - if (r < t + e) - throw new RangeError("Trying to access beyond buffer length"); - }; - - function _(t, e, r, i, n, s) { - if (!h.isBuffer(t)) - throw new TypeError('"buffer" argument must be a Buffer instance'); - if (n < e || e < s) - throw new RangeError('"value" argument is out of bounds'); - if (r + i > t.length) - throw new RangeError("Index out of range"); - }; - - function g(t, e, r, i) { - if (r + i > t.length) - throw new RangeError("Index out of range"); - if (r < 0) - throw new RangeError("Index out of range"); - }; - - function b(t, e, r, i, n) { - return e = + e, r >>>= 0, n || g(t, 0, r, 4), A.write(t, e, r, i, 23, 4), r + 4; - }; - - function y(t, e, r, i, n) { - return e = + e, r >>>= 0, n || g(t, 0, r, 8), A.write(t, e, r, i, 52, 8), r + 8; - }; - - function w(t) { - if ((t = (t = t.split("=")[0]).trim().replace(L, "")).length < 2) - return ""; - for (; 0 != t.length % 4;) - t += "="; - return t; - }; - - function v(t, e) { - e = e || 1 / 0; - for (var r, i = t.length, n = null, s = [], o = 0; o < i; ++o) { - if (55295 < (r = t.charCodeAt(o)) && r < 57344) { - if (!n) { - if (56319 < r) { - - 1 < (e -= 3) && s.push(239, 191, 189); - continue; - } - if (o + 1 === i) { - - 1 < (e -= 3) && s.push(239, 191, 189); - continue; - } - n = r; - continue; - } - if (r < 56320) { - - 1 < (e -= 3) && s.push(239, 191, 189), n = r; - continue; - } - r = 65536 + (n - 55296 << 10 | r - 56320); - } - else - n && - 1 < (e -= 3) && s.push(239, 191, 189); - if (n = null, r < 128) { - if (--e < 0) - break; - s.push(r); - } - else - if (r < 2048) { - if ((e -= 2) < 0) - break; - s.push(r >> 6 | 192, 63 & r | 128); - } - else - if (r < 65536) { - if ((e -= 3) < 0) - break; - s.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128); - } - else { - if (!(r < 1114112)) - throw Error("Invalid code point"); - if ((e -= 4) < 0) - break; - s.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128); - } - } - return s; - }; - - function M(t) { - for (var e = [], r = 0; r < t.length; ++r) - e.push(255 & t.charCodeAt(r)); - return e; - }; - - function E(t, e, r, i) { - for (var n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) - e[n + r] = t[n]; - return n; - }; - - function S(t) { - return t instanceof ArrayBuffer || null != t && null != t.constructor && "ArrayBuffer" === t.constructor.name && "number" == typeof t.byteLength; - }; - var I = t("base64-js"), A = t("ieee754"); - r.Buffer = h, r.SlowBuffer = function(t) { - return + t != t && (t = 0), h.alloc(+ t); - }, r.INSPECT_MAX_BYTES = 50; - var B = 2147483647; - r.kMaxLength = B, (h.TYPED_ARRAY_SUPPORT = function() { - try { - var t = new Uint8Array(1); - return t.__proto__ = { - __proto__: Uint8Array.prototype, foo: function() { - return 42; - } - }, 42 === t.foo(); - } - catch (t) { - return !1; - } - }()) || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), - Object.defineProperty(h.prototype, "parent", { - get: function() { - if (this instanceof h) - return this.buffer; - } - }), Object.defineProperty(h.prototype, "offset", { - get: function() { - if (this instanceof h) - return this.byteOffset; - } - }), $jscomp.initSymbol(), $jscomp.initSymbol(), $jscomp.initSymbol(), "undefined" != typeof Symbol && Symbol.species && h[Symbol.species] === h && ($jscomp.initSymbol(), - Object.defineProperty(h, Symbol.species, { value: null, configurable: !0, enumerable: !1, writable: !1 })), h.poolSize = 8192, h.from = function(t, e, r) { - return i(t, e, r); - }, h.prototype.__proto__ = Uint8Array.prototype, h.__proto__ = Uint8Array, h.alloc = function(t, e, r) { - return s(t), t = t <= 0 ? n(t) : void 0 !== e ? "string" == typeof r ? n(t).fill(e, r) : n(t).fill(e) : n(t); - }, h.allocUnsafe = function(t) { - return o(t); - }, h.allocUnsafeSlow = function(t) { - return o(t); - }, h.isBuffer = function(t) { - return null != t && !0 === t._isBuffer; - }, h.compare = function(t, e) { - if (!h.isBuffer(t) || !h.isBuffer(e)) - throw new TypeError("Arguments must be Buffers"); - if (t === e) - return 0; - for (var r = t.length, i = e.length, n = 0, s = Math.min(r, i); n < s; ++n) - if (t[n] !== e[n]) { - r = t[n], i = e[n]; - break; - } - return r < i ? - 1 : i < r ? 1 : 0; - }, h.isEncoding = function(t) { - switch (String(t).toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "latin1": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return !0; - default: - return !1; - } - }, h.concat = function(t, e) { - if (!Array.isArray(t)) - throw new TypeError('"list" argument must be an Array of Buffers'); - if (0 === t.length) - return h.alloc(0); - var r; - if (void 0 === e) - for (r = e = 0; r < t.length; ++r) - e += t[r].length; - var i = h.allocUnsafe(e), n = 0; - for (r = 0; r < t.length; ++r) { - var s = t[r]; - if (ArrayBuffer.isView(s) && (s = h.from(s)), !h.isBuffer(s)) - throw new TypeError('"list" argument must be an Array of Buffers'); - s.copy(i, n), n += s.length; - } - return i; - }, h.byteLength = l, h.prototype._isBuffer = !0, h.prototype.swap16 = function() { - var t = this.length; - if (0 != t % 2) - throw new RangeError("Buffer size must be a multiple of 16-bits"); - for (var e = 0; e < t; e += 2) - f(this, e, e + 1); - return this; - }, h.prototype.swap32 = function() { - var t = this.length; - if (0 != t % 4) - throw new RangeError("Buffer size must be a multiple of 32-bits"); - for (var e = 0; e < t; e += 4) - f(this, e, e + 3), f(this, e + 1, e + 2); - return this; - }, h.prototype.swap64 = function() { - var t = this.length; - if (0 != t % 8) - throw new RangeError("Buffer size must be a multiple of 64-bits"); - for (var e = 0; e < t; e += 8) - f(this, e, e + 7), f(this, e + 1, e + 6), f(this, e + 2, e + 5), f(this, e + 3, e + 4); - return this; - }, h.prototype.toLocaleString = h.prototype.toString = function() { - var t = this.length; - return 0 === t ? "" : 0 === arguments.length ? p(this, 0, t) : function(t, e, r) { - var i = !1; - if ((void 0 === e || e < 0) && (e = 0), e > this.length) - return ""; - if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) - return ""; - if ((r >>>= 0) <= (e >>>= 0)) - return ""; - for (t = t || "utf8"; ;) - switch (t) { - case "hex": - for (t = e, e = r, r = this.length, (!t || t < 0) && (t = 0), (!e || e < 0 || r < e) && (e = r), i = "", r = t; r < e; ++r) - i = (t = i) + (i = (i = this[r]) < 16 ? "0" + i.toString(16) : i.toString(16)); - return i; - case "utf8": - case "utf-8": - return p(this, e, r); - case "ascii": - for (t = "", r = Math.min(this.length, r); e < r; ++e) - t += String.fromCharCode(127 & this[e]); - return t; - case "latin1": - case "binary": - for (t = "", r = Math.min(this.length, r); e < r; ++e) - t += String.fromCharCode(this[e]); - return t; - case "base64": - return e = 0 === e && r === this.length ? I.fromByteArray(this) : I.fromByteArray(this.slice(e, r)); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - for (e = this.slice(e, r), r = "", t = 0; t < e.length; t += 2) - r += String.fromCharCode(e[t] + 256 * e[t + 1]); - return r; - default: - if (i) - throw new TypeError("Unknown encoding: " + t); - t = (t + "").toLowerCase(), i = !0; - } - }.apply(this, arguments); - }, h.prototype.equals = function(t) { - if (!h.isBuffer(t)) - throw new TypeError("Argument must be a Buffer"); - return this === t || 0 === h.compare(this, t); - }, h.prototype.inspect = function() { - var t = "", e = r.INSPECT_MAX_BYTES; - return 0 < this.length && (t = this.toString("hex", 0, e).match(/.{2}/g).join(" "), this.length > e && (t += " ... ")), ""; - }, h.prototype.compare = function(t, e, r, i, n) { - if (!h.isBuffer(t)) - throw new TypeError("Argument must be a Buffer"); - if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === i && (i = 0), void 0 === n && (n = this.length), - e < 0 || r > t.length || i < 0 || n > this.length) - throw new RangeError("out of range index"); - if (n <= i && r <= e) - return 0; - if (n <= i) - return - 1; - if (r <= e) - return 1; - if (this === t) - return 0; - var s = (n >>>= 0) - (i >>>= 0), o = (r >>>= 0) - (e >>>= 0), a = Math.min(s, o); - for (i = this.slice(i, n), t = t.slice(e, r), e = 0; e < a; ++e) - if (i[e] !== t[e]) { - s = i[e], o = t[e]; - break; - } - return s < o ? - 1 : o < s ? 1 : 0; - }, h.prototype.includes = function(t, e, r) { - return - 1 !== this.indexOf(t, e, r); - }, h.prototype.indexOf = function(t, e, r) { - return c(this, t, e, r, !0); - }, h.prototype.lastIndexOf = function(t, e, r) { - return c(this, t, e, r, !1); - }, h.prototype.write = function(t, e, r, i) { - if (void 0 === e) - i = "utf8", r = this.length, e = 0; - else - if (void 0 === r && "string" == typeof e) - i = e, r = this.length, e = 0; - else { - if (!isFinite(e)) - throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); - e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === i && (i = "utf8")) : (i = r, r = void 0); - } - var n = this.length - e; - if ((void 0 === r || n < r) && (r = n), 0 < t.length && (r < 0 || e < 0) || e > this.length) - throw new RangeError("Attempt to write outside buffer bounds"); - for (i = i || "utf8", n = !1; ;) - switch (i) { - case "hex": - t: - { - for (e = Number(e) || 0, i = this.length - e, r ? i < (r = Number(r)) && (r = i) : r = i, (i = t.length) / 2 < r && (r = i / 2), - i = 0; i < r; ++i) { - if ((n = parseInt(t.substr(2 * i, 2), 16)) != n) { - t = i; - break t; - } - this[e + i] = n; - } - t = i; - } - return t; - case "utf8": - case "utf-8": - return E(v(t, this.length - e), this, e, r); - case "ascii": - return E(M(t), this, e, r); - case "latin1": - case "binary": - return E(M(t), this, e, r); - case "base64": - return E(I.toByteArray(w(t)), this, e, r); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - i = t, n = this.length - e; - for (var s = [], o = 0; o < i.length && !((n -= 2) < 0); ++o) { - var a = i.charCodeAt(o); - t = a >> 8, a %= 256, s.push(a), s.push(t); - } - return E(s, this, e, r); - default: - if (n) - throw new TypeError("Unknown encoding: " + i); - i = ("" + i).toLowerCase(), n = !0; - } - }, h.prototype.toJSON = function() { - return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; - }; - var x = 4096; - h.prototype.slice = function(t, e) { - var r = this.length; - return (t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : r < t && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : r < e && (e = r), - e < t && (e = t), (r = this.subarray(t, e)).__proto__ = h.prototype, r; - }, h.prototype.readUIntLE = function(t, e, r) { - t >>>= 0, e >>>= 0, r || m(t, e, this.length), r = this[t]; - for (var i = 1, n = 0; ++n < e && (i *= 256);) - r += this[t + n] * i; - return r; - }, h.prototype.readUIntBE = function(t, e, r) { - t >>>= 0, e >>>= 0, r || m(t, e, this.length), r = this[t + --e]; - for (var i = 1; 0 < e && (i *= 256);) - r += this[t + --e] * i; - return r; - }, h.prototype.readUInt8 = function(t, e) { - return t >>>= 0, e || m(t, 1, this.length), this[t]; - }, h.prototype.readUInt16LE = function(t, e) { - return t >>>= 0, e || m(t, 2, this.length), this[t] | this[t + 1] << 8; - }, h.prototype.readUInt16BE = function(t, e) { - return t >>>= 0, e || m(t, 2, this.length), this[t] << 8 | this[t + 1]; - }, h.prototype.readUInt32LE = function(t, e) { - return t >>>= 0, e || m(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]; - }, h.prototype.readUInt32BE = function(t, e) { - return t >>>= 0, e || m(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]); - }, h.prototype.readIntLE = function(t, e, r) { - t >>>= 0, e >>>= 0, r || m(t, e, this.length), r = this[t]; - for (var i = 1, n = 0; ++n < e && (i *= 256);) - r += this[t + n] * i; - return 128 * i <= r && (r -= Math.pow(2, 8 * e)), r; - }, h.prototype.readIntBE = function(t, e, r) { - t >>>= 0, e >>>= 0, r || m(t, e, this.length), r = e; - for (var i = 1, n = this[t + --r]; 0 < r && (i *= 256);) - n += this[t + --r] * i; - return 128 * i <= n && (n -= Math.pow(2, 8 * e)), n; - }, h.prototype.readInt8 = function(t, e) { - return t >>>= 0, e || m(t, 1, this.length), 128 & this[t] ? - 1 * (255 - this[t] + 1) : this[t]; - }, h.prototype.readInt16LE = function(t, e) { - t >>>= 0, e || m(t, 2, this.length); - var r = this[t] | this[t + 1] << 8; - return 32768 & r ? 4294901760 | r : r; - }, h.prototype.readInt16BE = function(t, e) { - t >>>= 0, e || m(t, 2, this.length); - var r = this[t + 1] | this[t] << 8; - return 32768 & r ? 4294901760 | r : r; - }, h.prototype.readInt32LE = function(t, e) { - return t >>>= 0, e || m(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24; - }, h.prototype.readInt32BE = function(t, e) { - return t >>>= 0, e || m(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]; - }, h.prototype.readFloatLE = function(t, e) { - return t >>>= 0, e || m(t, 4, this.length), A.read(this, t, !0, 23, 4); - }, h.prototype.readFloatBE = function(t, e) { - return t >>>= 0, e || m(t, 4, this.length), A.read(this, t, !1, 23, 4); - }, h.prototype.readDoubleLE = function(t, e) { - return t >>>= 0, e || m(t, 8, this.length), A.read(this, t, !0, 52, 8); - }, h.prototype.readDoubleBE = function(t, e) { - return t >>>= 0, e || m(t, 8, this.length), A.read(this, t, !1, 52, 8); - }, h.prototype.writeUIntLE = function(t, e, r, i) { - t = + t, e >>>= 0, r >>>= 0, i || _(this, t, e, r, Math.pow(2, 8 * r) - 1, 0), i = 1; - var n = 0; - for (this[e] = 255 & t; ++n < r && (i *= 256);) - this[e + n] = t / i & 255; - return e + r; - }, h.prototype.writeUIntBE = function(t, e, r, i) { - t = + t, e >>>= 0, r >>>= 0, i || _(this, t, e, r, Math.pow(2, 8 * r) - 1, 0); - var n = 1; - for (this[e + (i = r - 1)] = 255 & t; 0 <= --i && (n *= 256);) - this[e + i] = t / n & 255; - return e + r; - }, h.prototype.writeUInt8 = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1; - }, h.prototype.writeUInt16LE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2; - }, h.prototype.writeUInt16BE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2; - }, h.prototype.writeUInt32LE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, - this[e] = 255 & t, e + 4; - }, h.prototype.writeUInt32BE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, - this[e + 3] = 255 & t, e + 4; - }, h.prototype.writeIntLE = function(t, e, r, i) { - t = + t, e >>>= 0, i || _(this, t, e, r, (i = Math.pow(2, 8 * r - 1)) - 1, - i); - var n = 1, s = i = 0; - for (this[e] = 255 & t; ++i < r && (n *= 256);) - t < 0 && 0 === s && 0 !== this[e + i - 1] && (s = 1), this[e + i] = (t / n >> 0) - s & 255; - return e + r; - }, h.prototype.writeIntBE = function(t, e, r, i) { - t = + t, e >>>= 0, i || _(this, t, e, r, (i = Math.pow(2, 8 * r - 1)) - 1, - i); - var n = 1, s = 0; - for (this[e + (i = r - 1)] = 255 & t; 0 <= --i && (n *= 256);) - t < 0 && 0 === s && 0 !== this[e + i + 1] && (s = 1), this[e + i] = (t / n >> 0) - s & 255; - return e + r; - }, h.prototype.writeInt8 = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 1, 127, - 128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1; - }, h.prototype.writeInt16LE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 2, 32767, - 32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2; - }, h.prototype.writeInt16BE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 2, 32767, - 32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2; - }, h.prototype.writeInt32LE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 4, 2147483647, - 2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, - this[e + 3] = t >>> 24, e + 4; - }, h.prototype.writeInt32BE = function(t, e, r) { - return t = + t, e >>>= 0, r || _(this, t, e, 4, 2147483647, - 2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, - this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4; - }, h.prototype.writeFloatLE = function(t, e, r) { - return b(this, t, e, !0, r); - }, h.prototype.writeFloatBE = function(t, e, r) { - return b(this, t, e, !1, r); - }, h.prototype.writeDoubleLE = function(t, e, r) { - return y(this, t, e, !0, r); - }, h.prototype.writeDoubleBE = function(t, e, r) { - return y(this, t, e, !1, r); - }, h.prototype.copy = function(t, e, r, i) { - if (!h.isBuffer(t)) - throw new TypeError("argument should be a Buffer"); - if (r = r || 0, i || 0 === i || (i = this.length), e >= t.length && (e = t.length), e = e || 0, 0 < i && i < r && (i = r), i === r || 0 === t.length || 0 === this.length) - return 0; - if (e < 0) - throw new RangeError("targetStart out of bounds"); - if (r < 0 || r >= this.length) - throw new RangeError("Index out of range"); - if (i < 0) - throw new RangeError("sourceEnd out of bounds"); - i > this.length && (i = this.length), t.length - e < i - r && (i = t.length - e + r); - var n = i - r; - if (this === t && "function" == typeof Uint8Array.prototype.copyWithin) - this.copyWithin(e, r, i); - else - if (this === t && r < e && e < i) - for (i = n - 1; 0 <= i; --i) - t[i + e] = this[i + r]; - else - Uint8Array.prototype.set.call(t, this.subarray(r, i), e); - return n; - }, h.prototype.fill = function(t, e, r, i) { - if ("string" == typeof t) { - if ("string" == typeof e ? (i = e, e = 0, r = this.length) : "string" == typeof r && (i = r, r = this.length), void 0 !== i && "string" != typeof i) - throw new TypeError("encoding must be a string"); - if ("string" == typeof i && !h.isEncoding(i)) - throw new TypeError("Unknown encoding: " + i); - if (1 === t.length) { - var n = t.charCodeAt(0); - ("utf8" === i && n < 128 || "latin1" === i) && (t = n); - } - } - else - "number" == typeof t && (t &= 255); - if (e < 0 || this.length < e || this.length < r) - throw new RangeError("Out of range index"); - if (r <= e) - return this; - if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, "number" == typeof (t = t || 0)) - for (i = e; i < r; ++i) - this[i] = t; - else { - var s = (n = h.isBuffer(t) ? t : new h(t, i)).length; - if (0 === s) - throw new TypeError('The value "' + t + '" is invalid for argument "value"'); - for (i = 0; i < r - e; ++i) - this[i + e] = n[i % s]; - } - return this; - }; - var L = /[^+/0-9A-Za-z-_]/g; - }, { "base64-js": 1, ieee754: 6 }], 4: [function(t, e, r) { - (function(t) { - r.isArray = function(t) { - return Array.isArray ? Array.isArray(t) : "[object Array]" === Object.prototype.toString.call(t); - }, r.isBoolean = function(t) { - return "boolean" == typeof t; - }, r.isNull = function(t) { - return null === t; - }, r.isNullOrUndefined = function(t) { - return null == t; - }, r.isNumber = function(t) { - return "number" == typeof t; - }, r.isString = function(t) { - return "string" == typeof t; - }, r.isSymbol = function(t) { - return "symbol" == typeof t; - }, r.isUndefined = function(t) { - return void 0 === t; - }, r.isRegExp = function(t) { - return "[object RegExp]" === Object.prototype.toString.call(t); - }, r.isObject = function(t) { - return "object" == typeof t && null !== t; - }, r.isDate = function(t) { - return "[object Date]" === Object.prototype.toString.call(t); - }, r.isError = function(t) { - return "[object Error]" === Object.prototype.toString.call(t) || t instanceof Error; - }, r.isFunction = function(t) { - return "function" == typeof t; - }, r.isPrimitive = function(t) { - return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" == typeof t || void 0 === t; - }, r.isBuffer = t.isBuffer; - }).call(this, { isBuffer: t("../../is-buffer/index.js") }); - }, { "../../is-buffer/index.js": 8 }], 5: [function(t, e, r) { - - function o() { - this._events && Object.prototype.hasOwnProperty.call(this, "_events") || (this._events = l(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; - }; - - function i(t, e, r, i) { - var n; - if ("function" != typeof r) - throw new TypeError('"listener" argument must be a function'); - if (n = t._events) { - n.newListener && (t.emit("newListener", e, r.listener ? r.listener : r), n = t._events); - var s = n[e]; - } - else - n = t._events = l(null), t._eventsCount = 0; - return s ? ("function" == typeof s ? s = n[e] = i ? [r, s] : [s, r] : i ? s.unshift(r) : s.push(r), s.warned || (r = void 0 === t._maxListeners ? o.defaultMaxListeners : t._maxListeners) && 0 < r && s.length > r && (s.warned = !0, - (r = Error("Possible EventEmitter memory leak detected. " + s.length + ' "' + String(e) + '" listeners added. Use emitter.setMaxListeners() to increase limit.')).name = "MaxListenersExceededWarning", - r.emitter = t, r.type = e, r.count = s.length, "object" == typeof console && console.warn && console.warn("%s: %s", r.name, - r.message))) : (n[e] = r, ++t._eventsCount), t; - }; - - function n() { - if (!this.fired) - switch (this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length) { - case 0: - return this.listener.call(this.target); - case 1: - return this.listener.call(this.target, arguments[0]); - case 2: - return this.listener.call(this.target, arguments[0], arguments[1]); - case 3: - return this.listener.call(this.target, arguments[0], arguments[1], arguments[2]); - default: - for (var t = Array(arguments.length), e = 0; e < t.length; ++e) - t[e] = arguments[e]; - this.listener.apply(this.target, t); - } - }; - - function s(t, e, r) { - return t = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, (e = c.call(n, t)).listener = r, t.wrapFn = e; - }; - - function a(t, e, r) { - if (!(t = t._events)) - return []; - if (!(e = t[e])) - return []; - if ("function" == typeof e) - return r ? [e.listener || e] : [e]; - if (r) - for (r = Array(e.length), t = 0; t < r.length; ++t) - r[t] = e[t].listener || e[t]; - else - r = u(e, e.length); - return r; - }; - - function h(t) { - var e = this._events; - if (e) { - if ("function" == typeof (t = e[t])) - return 1; - if (t) - return t.length; - } - return 0; - }; - - function u(t, e) { - for (var r = Array(e), i = 0; i < e; ++i) - r[i] = t[i]; - return r; - }; - var l = Object.create || function(t) { - - function e() { - }; - return e.prototype = t, new e; - }, f = Object.keys || function(t) { - var e, r = []; - for (e in t) - Object.prototype.hasOwnProperty.call(t, e) && r.push(e); - return e; - }, c = Function.prototype.bind || function(t) { - var e = this; - return function() { - return e.apply(t, arguments); - }; - }; - ((e.exports = o).EventEmitter = o).prototype._events = void 0, o.prototype._maxListeners = void 0; - var d = 10; - try { - t = {}, Object.defineProperty && Object.defineProperty(t, "x", { value: 0 }); - var p = 0 === t.x; - } - catch (t) { - p = !1; - } - p ? Object.defineProperty(o, "defaultMaxListeners", { - enumerable: !0, get: function() { - return d; - }, set: function(t) { - if ("number" != typeof t || t < 0 || t != t) - throw new TypeError('"defaultMaxListeners" must be a positive number'); - d = t; - } - }) : o.defaultMaxListeners = d, o.prototype.setMaxListeners = function(t) { - if ("number" != typeof t || t < 0 || isNaN(t)) - throw new TypeError('"n" argument must be a positive number'); - return this._maxListeners = t, this; - }, o.prototype.getMaxListeners = function() { - return void 0 === this._maxListeners ? o.defaultMaxListeners : this._maxListeners; - }, o.prototype.emit = function(t) { - var e, r, i, n = "error" === t; - if (i = this._events) - n = n && null == i.error; - else - if (!n) - return !1; - if (n) { - if (1 < arguments.length && (e = arguments[1]), e instanceof Error) - throw e; - throw (i = Error('Unhandled "error" event. (' + e + ")")).context = e, i; - } - if (!(e = i[t])) - return !1; - i = "function" == typeof e; - var s = arguments.length; - switch (s) { - case 1: - if (i) - e.call(this); - else - for (e = u(e, i = e.length), n = 0; n < i; ++n) - e[n].call(this); - break; - case 2: - if (n = arguments[1], i) - e.call(this, n); - else - for (e = u(e, i = e.length), s = 0; s < i; ++s) - e[s].call(this, n); - break; - case 3: - if (n = arguments[1], s = arguments[2], i) - e.call(this, n, s); - else - for (e = u(e, i = e.length), r = 0; r < i; ++r) - e[r].call(this, n, s); - break; - case 4: - if (n = arguments[1], s = arguments[2], r = arguments[3], i) - e.call(this, n, s, r); - else { - e = u(e, i = e.length); - for (var o = 0; o < i; ++o) - e[o].call(this, n, s, r); - } - break; - default: - for (n = Array(s - 1), r = 1; r < s; r++) - n[r - 1] = arguments[r]; - if (i) - e.apply(this, n); - else - for (e = u(e, i = e.length), s = 0; s < i; ++s) - e[s].apply(this, n); - } - return !0; - }, o.prototype.on = o.prototype.addListener = function(t, e) { - return i(this, t, e, !1); - }, o.prototype.prependListener = function(t, e) { - return i(this, t, e, !0); - }, o.prototype.once = function(t, e) { - if ("function" != typeof e) - throw new TypeError('"listener" argument must be a function'); - return this.on(t, s(this, t, e)), this; - }, o.prototype.prependOnceListener = function(t, e) { - if ("function" != typeof e) - throw new TypeError('"listener" argument must be a function'); - return this.prependListener(t, s(this, t, e)), this; - }, o.prototype.removeListener = function(t, e) { - var r; - if ("function" != typeof e) - throw new TypeError('"listener" argument must be a function'); - var i = this._events; - if (!i) - return this; - var n = i[t]; - if (!n) - return this; - if (n === e || n.listener === e) - 0 == --this._eventsCount ? this._events = l(null) : (delete i[t], i.removeListener && this.emit("removeListener", t, n.listener || e)); - else - if ("function" != typeof n) { - var s = - 1; - for (r = n.length - 1; 0 <= r; r--) - if (n[r] === e || n[r].listener === e) { - var o = n[r].listener; - s = r; - break; - } - if (s < 0) - return this; - if (0 === s) - n.shift(); - else { - r = s + 1; - for (var a = n.length; r < a; s += 1, r += 1) - n[s] = n[r]; - n.pop(); - } - 1 === n.length && (i[t] = n[0]), i.removeListener && this.emit("removeListener", t, o || e); - } - return this; - }, o.prototype.removeAllListeners = function(t) { - var e = this._events; - if (!e) - return this; - if (!e.removeListener) - return 0 === arguments.length ? (this._events = l(null), this._eventsCount = 0) : e[t] && (0 == --this._eventsCount ? this._events = l(null) : delete e[t]), - this; - if (0 === arguments.length) { - var r = f(e); - for (e = 0; e < r.length; ++e) { - var i = r[e]; - "removeListener" !== i && this.removeAllListeners(i); - } - return this.removeAllListeners("removeListener"), this._events = l(null), this._eventsCount = 0, this; - } - if ("function" == typeof (r = e[t])) - this.removeListener(t, r); - else - if (r) - for (e = r.length - 1; 0 <= e; e--) - this.removeListener(t, r[e]); - return this; - }, o.prototype.listeners = function(t) { - return a(this, t, !0); - }, o.prototype.rawListeners = function(t) { - return a(this, t, !1); - }, o.listenerCount = function(t, e) { - return "function" == typeof t.listenerCount ? t.listenerCount(e) : h.call(t, e); - }, o.prototype.listenerCount = h, o.prototype.eventNames = function() { - return 0 < this._eventsCount ? Reflect.ownKeys(this._events) : []; - }; - }, {}], 6: [function(t, e, r) { - r.read = function(t, e, r, i, n) { - var s = 8 * n - i - 1, o = (1 << s) - 1, a = o >> 1, h = - 7, u = r ? - 1 : 1, l = t[e + (n = r ? n - 1 : 0)]; - for (n += u, r = l & (1 << - h) - 1, l >>= - h, h += s; 0 < h; r = 256 * r + t[e + n], n += u, h -= 8); - for (s = r & (1 << - h) - 1, r >>= - h, h += i; 0 < h; s = 256 * s + t[e + n], n += u, h -= 8); - if (0 === r) - r = 1 - a; - else { - if (r === o) - return s ? NaN : 1 / 0 * (l ? - 1 : 1); - s += Math.pow(2, i), r -= a; - } - return (l ? - 1 : 1) * s * Math.pow(2, r - i); - }, r.write = function(t, e, r, i, n, s) { - var o, a = 8 * s - n - 1, h = (1 << a) - 1, u = h >> 1, l = 23 === n ? Math.pow(2, - 24) - Math.pow(2, - 77) : 0; - s = i ? 0 : s - 1; - var f = i ? 1 : - 1, c = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0; - for (e = Math.abs(e), isNaN(e) || 1 / 0 === e ? (e = isNaN(e) ? 1 : 0, i = h) : (i = Math.floor(Math.log(e) / Math.LN2), e * (o = Math.pow(2, - - i)) < 1 && (i-- , o *= 2), 2 <= (e = 1 <= i + u ? e + l / o : e + l * Math.pow(2, 1 - u)) * o && (i++ , o /= 2), h <= i + u ? (e = 0, - i = h) : 1 <= i + u ? (e = (e * o - 1) * Math.pow(2, n), i += u) : (e = e * Math.pow(2, u - 1) * Math.pow(2, n), i = 0)); 8 <= n; t[r + s] = 255 & e, - s += f, e /= 256, n -= 8); - for (i = i << n | e, a += n; 0 < a; t[r + s] = 255 & i, s += f, i /= 256, a -= 8); - t[r + s - f] |= 128 * c; - }; - }, {}], 7: [function(t, e, r) { - e.exports = "function" == typeof Object.create ? function(t, e) { - t.super_ = e, t.prototype = Object.create(e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }); - } : function(t, e) { - t.super_ = e; - - function r() { - }; - r.prototype = e.prototype, t.prototype = new r, t.prototype.constructor = t; - }; - }, {}], 8: [function(t, e, r) { - - function i(t) { - return !!t.constructor && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t); - }; - e.exports = function(t) { - return null != t && (i(t) || "function" == typeof t.readFloatLE && "function" == typeof t.slice && i(t.slice(0, 0)) || !!t._isBuffer); - }; - }, {}], 9: [function(t, e, r) { - var i = {}.toString; - e.exports = Array.isArray || function(t) { - return "[object Array]" == i.call(t); - }; - }, {}], 10: [function(t, e, r) { - (function(o) { - !o.version || 0 === o.version.indexOf("v0.") || 0 === o.version.indexOf("v1.") && 0 !== o.version.indexOf("v1.8.") ? e.exports = { - nextTick: function(t, e, r, i) { - if ("function" != typeof t) - throw new TypeError('"callback" argument must be a function'); - var n = arguments.length; - switch (n) { - case 0: - case 1: - return o.nextTick(t); - case 2: - return o.nextTick(function() { - t.call(null, e); - }); - case 3: - return o.nextTick(function() { - t.call(null, e, r); - }); - case 4: - return o.nextTick(function() { - t.call(null, e, r, i); - }); - default: - var s = Array(n - 1); - for (n = 0; n < s.length;) - s[n++] = arguments[n]; - return o.nextTick(function() { - t.apply(null, s); - }); - } - } - } : e.exports = o; - }).call(this, t("_process")); - }, { _process: 11 }], 11: [function(t, e, r) { - - function i() { - throw Error("setTimeout has not been defined"); - }; - - function n() { - throw Error("clearTimeout has not been defined"); - }; - - function s(e) { - if (l === setTimeout) - return setTimeout(e, 0); - if ((l === i || !l) && setTimeout) - return l = setTimeout, setTimeout(e, 0); - try { - return l(e, 0); - } - catch (t) { - try { - return l.call(null, e, 0); - } - catch (t) { - return l.call(this, e, 0); - } - } - }; - - function o() { - p && c && (p = !1, c.length ? d = c.concat(d) : m = - 1, d.length && a()); - }; - - function a() { - if (!p) { - var t = s(o); - p = !0; - for (var e = d.length; e;) { - for (c = d, d = []; ++m < e;) - c && c[m].run(); - m = - 1, e = d.length; - } - c = null, p = !1, function(e) { - if (f === clearTimeout) - return clearTimeout(e); - if ((f === n || !f) && clearTimeout) - return f = clearTimeout, clearTimeout(e); - try { - f(e); - } - catch (t) { - try { - return f.call(null, e); - } - catch (t) { - return f.call(this, e); - } - } - }(t); - } - }; - - function h(t, e) { - this.fun = t, this.array = e; - }; - - function u() { - }; - t = e.exports = {}; - try { - var l = "function" == typeof setTimeout ? setTimeout : i; - } - catch (t) { - l = i; - } - try { - var f = "function" == typeof clearTimeout ? clearTimeout : n; - } - catch (t) { - f = n; - } - var c, d = [], p = !1, m = - 1; - t.nextTick = function(t) { - var e = Array(arguments.length - 1); - if (1 < arguments.length) - for (var r = 1; r < arguments.length; r++) - e[r - 1] = arguments[r]; - d.push(new h(t, e)), 1 !== d.length || p || s(a); - }, h.prototype.run = function() { - this.fun.apply(null, this.array); - }, t.title = "browser", t.browser = !0, t.env = {}, t.argv = [], t.version = "", t.versions = {}, t.on = u, t.addListener = u, - t.once = u, t.off = u, t.removeListener = u, t.removeAllListeners = u, t.emit = u, t.prependListener = u, t.prependOnceListener = u, - t.listeners = function(t) { - return []; - }, t.binding = function(t) { - throw Error("process.binding is not supported"); - }, t.cwd = function() { - return "/"; - }, t.chdir = function(t) { - throw Error("process.chdir is not supported"); - }, t.umask = function() { - return 0; - }; - }, {}], 12: [function(t, e, r) { - e.exports = t("./lib/_stream_duplex.js"); - }, { "./lib/_stream_duplex.js": 13 }], 13: [function(t, e, r) { - - function i(t) { - if (!(this instanceof i)) - return new i(t); - a.call(this, t), h.call(this, t), t && !1 === t.readable && (this.readable = !1), t && !1 === t.writable && (this.writable = !1), - this.allowHalfOpen = !0, t && !1 === t.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", n); - }; - - function n() { - this.allowHalfOpen || this._writableState.ended || o.nextTick(s, this); - }; - - function s(t) { - t.end(); - }; - var o = t("process-nextick-args"); - r = Object.keys || function(t) { - var e, r = []; - for (e in t) - r.push(e); - return r; - }, e.exports = i, (e = t("core-util-is")).inherits = t("inherits"); - var a = t("./_stream_readable"), h = t("./_stream_writable"); - for (e.inherits(i, a), t = r(h.prototype), e = 0; e < t.length; e++) - r = t[e], i.prototype[r] || (i.prototype[r] = h.prototype[r]); - Object.defineProperty(i.prototype, "writableHighWaterMark", { - enumerable: !1, get: function() { - return this._writableState.highWaterMark; - } - }), Object.defineProperty(i.prototype, "destroyed", { - get: function() { - return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed); - }, set: function(t) { - void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = t, this._writableState.destroyed = t); - } - }), i.prototype._destroy = function(t, e) { - this.push(null), this.end(), o.nextTick(e, t); - }; - }, { "./_stream_readable": 15, "./_stream_writable": 17, "core-util-is": 4, inherits: 7, "process-nextick-args": 10 }], 14: [function(t, e, r) { - - function i(t) { - if (!(this instanceof i)) - return new i(t); - n.call(this, t); - }; - e.exports = i; - var n = t("./_stream_transform"); - (e = t("core-util-is")).inherits = t("inherits"), e.inherits(i, n), i.prototype._transform = function(t, e, r) { - r(null, t); - }; - }, { "./_stream_transform": 16, "core-util-is": 4, inherits: 7 }], 15: [function(L, k, t) { - (function(p, t) { - - function e(t, e) { - t = t || {}; - var r = e instanceof (b = b || L("./_stream_duplex")); - this.objectMode = !!t.objectMode, r && (this.objectMode = this.objectMode || !!t.readableObjectMode); - var i = t.highWaterMark, n = t.readableHighWaterMark, s = this.objectMode ? 16 : 16384; - this.highWaterMark = i || 0 === i ? i : r && (n || 0 === n) ? n : s, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new B, - this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.reading = this.endEmitted = this.ended = !1, - this.sync = !0, this.destroyed = this.resumeScheduled = this.readableListening = this.emittedReadable = this.needReadable = !1, - this.defaultEncoding = t.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.encoding = this.decoder = null, - t.encoding && (A = A || L("string_decoder/").StringDecoder, this.decoder = new A(t.encoding), this.encoding = t.encoding); - }; - - function r(t) { - if (b = b || L("./_stream_duplex"), !(this instanceof r)) - return new r(t); - this._readableState = new e(t, this), this.readable = !0, t && ("function" == typeof t.read && (this._read = t.read), "function" == typeof t.destroy && (this._destroy = t.destroy)), - w.call(this); - }; - - function n(t, e, r, i, n) { - var s = t._readableState; - if (null === e) - s.reading = !1, s.ended || (s.decoder && (e = s.decoder.end()) && e.length && (s.buffer.push(e), s.length += s.objectMode ? 1 : e.length), - s.ended = !0, u(t)); - else { - if (!n) { - var o; - n = e, v.isBuffer(n) || n instanceof M || "string" == typeof n || void 0 === n || s.objectMode || (o = new TypeError("Invalid non-string/buffer chunk")); - var a = o; - } - a ? t.emit("error", a) : s.objectMode || e && 0 < e.length ? ("string" == typeof e || s.objectMode || Object.getPrototypeOf(e) === v.prototype || (e = v.from(e)), - i ? s.endEmitted ? t.emit("error", Error("stream.unshift() after end event")) : h(t, s, e, !0) : s.ended ? t.emit("error", - Error("stream.push() after EOF")) : (s.reading = !1, s.decoder && !r ? (e = s.decoder.write(e), s.objectMode || 0 !== e.length ? h(t, - s, e, !1) : s.readingMore || (s.readingMore = !0, g.nextTick(l, t, s))) : h(t, s, e, !1))) : i || (s.reading = !1); - } - return !s.ended && (s.needReadable || s.length < s.highWaterMark || 0 === s.length); - }; - - function h(t, e, r, i) { - e.flowing && 0 === e.length && !e.sync ? (t.emit("data", r), t.read(0)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), - e.needReadable && u(t)), e.readingMore || (e.readingMore = !0, g.nextTick(l, t, e)); - }; - - function s(t, e) { - if (t <= 0 || 0 === e.length && e.ended) - return 0; - if (e.objectMode) - return 1; - if (t != t) - return e.flowing && e.length ? e.buffer.head.data.length : e.length; - if (t > e.highWaterMark) { - var r = t; - 8388608 <= r ? r = 8388608 : (r-- , r |= r >>> 1, r |= r >>> 2, r |= r >>> 4, r |= r >>> 8, r |= r >>> 16, r++), e.highWaterMark = r; - } - return t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0); - }; - - function u(t) { - var e = t._readableState; - e.needReadable = !1, e.emittedReadable || (I("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? g.nextTick(i, t) : i(t)); - }; - - function i(t) { - I("emit readable"), t.emit("readable"), m(t); - }; - - function l(t, e) { - for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (I("maybeReadMore read 0"), t.read(0), - r !== e.length);) - r = e.length; - e.readingMore = !1; - }; - - function o(t) { - I("readable nexttick read 0"), t.read(0); - }; - - function a(t, e) { - e.reading || (I("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), m(t), e.flowing && !e.reading && t.read(0); - }; - - function m(t) { - var e = t._readableState; - for (I("flow", e.flowing); e.flowing && null !== t.read();); - }; - - function f(t, e) { - if (0 === e.length) - return null; - if (e.objectMode) - var r = e.buffer.shift(); - else - if (!t || t >= e.length) - r = e.decoder ? e.buffer.join("") : 1 === e.buffer.length ? e.buffer.head.data : e.buffer.concat(e.length), e.buffer.clear(); - else { - r = e.buffer; - var i = e.decoder; - if (t < r.head.data.length) - i = r.head.data.slice(0, t), r.head.data = r.head.data.slice(t); - else { - if (t === r.head.data.length) - r = r.shift(); - else - if (i) { - var n = r.head, s = 1, o = n.data; - for (i = t - o.length; n = n.next;) { - var a = n.data, h = i > a.length ? a.length : i; - if (o = h === a.length ? o + a : o + a.slice(0, i), 0 === (i -= h)) { - h === a.length ? (++s, r.head = n.next ? n.next : r.tail = null) : (r.head = n).data = a.slice(h); - break; - } - ++s; - } - r.length -= s, r = o; - } - else { - for (i = t, n = v.allocUnsafe(i), o = 1, (s = r.head).data.copy(n), i -= s.data.length; s = s.next;) { - if (h = i > (a = s.data).length ? a.length : i, a.copy(n, n.length - i, 0, h), 0 === (i -= h)) { - h === a.length ? (++o, r.head = s.next ? s.next : r.tail = null) : (r.head = s).data = a.slice(h); - break; - } - ++o; - } - r.length -= o, r = n; - } - i = r; - } - r = i; - } - return r; - }; - - function c(t) { - var e = t._readableState; - if (0 < e.length) - throw Error('"endReadable()" called on non-empty stream'); - e.endEmitted || (e.ended = !0, g.nextTick(d, e, t)); - }; - - function d(t, e) { - t.endEmitted || 0 !== t.length || (t.endEmitted = !0, e.readable = !1, e.emit("end")); - }; - - function _(t, e) { - for (var r = 0, i = t.length; r < i; r++) - if (t[r] === e) - return r; - return - 1; - }; - var g = L("process-nextick-args"); - k.exports = r; - var b, y = L("isarray"); - r.ReadableState = e, L("events"); - var w = L("./internal/streams/stream"), v = L("safe-buffer").Buffer, M = t.Uint8Array || function() { - }, E = L("core-util-is"); - E.inherits = L("inherits"); - var S = L("util"), I = void 0; - I = S && S.debuglog ? S.debuglog("stream") : function() { - }; - var A, B = L("./internal/streams/BufferList"); - S = L("./internal/streams/destroy"), E.inherits(r, w); - var x = ["error", "close", "destroy", "pause", "resume"]; - Object.defineProperty(r.prototype, "destroyed", { - get: function() { - return void 0 !== this._readableState && this._readableState.destroyed; - }, set: function(t) { - this._readableState && (this._readableState.destroyed = t); - } - }), r.prototype.destroy = S.destroy, r.prototype._undestroy = S.undestroy, r.prototype._destroy = function(t, e) { - this.push(null), e(t); - }, r.prototype.push = function(t, e) { - var r = this._readableState; - if (r.objectMode) - var i = !0; - else - "string" == typeof t && ((e = e || r.defaultEncoding) !== r.encoding && (t = v.from(t, e), e = ""), i = !0); - return n(this, t, e, !1, i); - }, r.prototype.unshift = function(t) { - return n(this, t, null, !0, !1); - }, r.prototype.isPaused = function() { - return !1 === this._readableState.flowing; - }, r.prototype.setEncoding = function(t) { - return A = A || L("string_decoder/").StringDecoder, this._readableState.decoder = new A(t), this._readableState.encoding = t, - this; - }, r.prototype.read = function(t) { - I("read", t), t = parseInt(t, 10); - var e = this._readableState, r = t; - if (0 !== t && (e.emittedReadable = !1), 0 === t && e.needReadable && (e.length >= e.highWaterMark || e.ended)) - return I("read: emitReadable", e.length, e.ended), 0 === e.length && e.ended ? c(this) : u(this), null; - if (0 === (t = s(t, e)) && e.ended) - return 0 === e.length && c(this), null; - var i = e.needReadable; - return I("need readable", i), (0 === e.length || e.length - t < e.highWaterMark) && I("length less than watermark", i = !0), - e.ended || e.reading ? I("reading or ended", !1) : i && (I("do read"), e.reading = !0, e.sync = !0, 0 === e.length && (e.needReadable = !0), - this._read(e.highWaterMark), e.sync = !1, e.reading || (t = s(r, e))), null === (i = 0 < t ? f(t, e) : null) ? (e.needReadable = !0, - t = 0) : e.length -= t, 0 === e.length && (e.ended || (e.needReadable = !0), r !== t && e.ended && c(this)), null !== i && this.emit("data", - i), i; - }, r.prototype._read = function(t) { - this.emit("error", Error("_read() is not implemented")); - }, r.prototype.pipe = function(i, t) { - - function n() { - I("onend"), i.end(); - }; - - function s(t) { - I("ondata"), (r = !1) !== i.write(t) || r || ((1 === f.pipesCount && f.pipes === i || 1 < f.pipesCount && - 1 !== _(f.pipes, - i)) && !d && (I("false write response, pause", l._readableState.awaitDrain), l._readableState.awaitDrain++ , r = !0), l.pause()); - }; - - function o(t) { - I("onerror", t), u(), i.removeListener("error", o), 0 === i.listeners("error").length && i.emit("error", t); - }; - - function a() { - i.removeListener("finish", h), u(); - }; - - function h() { - I("onfinish"), i.removeListener("close", a), u(); - }; - - function u() { - I("unpipe"), l.unpipe(i); - }; - var l = this, f = this._readableState; - switch (f.pipesCount) { - case 0: - f.pipes = i; - break; - case 1: - f.pipes = [f.pipes, i]; - break; - default: - f.pipes.push(i); - } - f.pipesCount += 1, I("pipe count=%d opts=%j", f.pipesCount, t); - var e = t && !1 === t.end || i === p.stdout || i === p.stderr ? u : n; - f.endEmitted ? g.nextTick(e) : l.once("end", e), i.on("unpipe", function t(e, r) { - I("onunpipe"), e === l && r && !1 === r.hasUnpiped && (r.hasUnpiped = !0, I("cleanup"), i.removeListener("close", a), i.removeListener("finish", - h), i.removeListener("drain", c), i.removeListener("error", o), i.removeListener("unpipe", t), l.removeListener("end", n), - l.removeListener("end", u), l.removeListener("data", s), d = !0, !f.awaitDrain || i._writableState && !i._writableState.needDrain || c()); - }); - var c = function(e) { - return function() { - var t = e._readableState; - I("pipeOnDrain", t.awaitDrain), t.awaitDrain && t.awaitDrain-- , 0 === t.awaitDrain && e.listeners("data").length && (t.flowing = !0, - m(e)); - }; - }(l); - i.on("drain", c); - var d = !1, r = !1; - return l.on("data", s), function(t, e, r) { - if ("function" == typeof t.prependListener) - return t.prependListener(e, r); - t._events && t._events[e] ? y(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]] : t.on(e, r); - }(i, "error", o), i.once("close", a), i.once("finish", h), i.emit("pipe", l), f.flowing || (I("pipe resume"), l.resume()), - i; - }, r.prototype.unpipe = function(t) { - var e = this._readableState, r = { hasUnpiped: !1 }; - if (0 === e.pipesCount) - return this; - if (1 === e.pipesCount) - return t && t !== e.pipes || (t = t || e.pipes, e.pipes = null, e.pipesCount = 0, e.flowing = !1, t && t.emit("unpipe", this, - r)), this; - if (t) - return - 1 === (i = _(e.pipes, t)) || (e.pipes.splice(i, 1), --e.pipesCount, 1 === e.pipesCount && (e.pipes = e.pipes[0]), - t.emit("unpipe", this, r)), this; - t = e.pipes; - var i = e.pipesCount; - for (e.pipes = null, e.pipesCount = 0, e.flowing = !1, e = 0; e < i; e++) - t[e].emit("unpipe", this, r); - return this; - }, r.prototype.addListener = r.prototype.on = function(t, e) { - var r = w.prototype.on.call(this, t, e); - if ("data" === t) - !1 !== this._readableState.flowing && this.resume(); - else - if ("readable" === t) { - var i = this._readableState; - i.endEmitted || i.readableListening || (i.readableListening = i.needReadable = !0, i.emittedReadable = !1, i.reading ? i.length && u(this) : g.nextTick(o, - this)); - } - return r; - }, r.prototype.resume = function() { - var t = this._readableState; - return t.flowing || (I("resume"), t.flowing = !0, t.resumeScheduled || (t.resumeScheduled = !0, g.nextTick(a, this, t))), this; - }, r.prototype.pause = function() { - return I("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (I("pause"), this._readableState.flowing = !1, - this.emit("pause")), this; - }, r.prototype.wrap = function(e) { - var r = this, i = this._readableState, n = !1; - for (var t in e.on("end", function() { - if (I("wrapped end"), i.decoder && !i.ended) { - var t = i.decoder.end(); - t && t.length && r.push(t); - } - r.push(null); - }), e.on("data", function(t) { - I("wrapped data"), i.decoder && (t = i.decoder.write(t)), i.objectMode && null == t || !(i.objectMode || t && t.length) || r.push(t) || (n = !0, - e.pause()); - }), e) - void 0 === this[t] && "function" == typeof e[t] && (this[t] = function(t) { - return function() { - return e[t].apply(e, arguments); - }; - }(t)); - for (t = 0; t < x.length; t++) - e.on(x[t], this.emit.bind(this, x[t])); - return this._read = function(t) { - I("wrapped _read", t), n && (n = !1, e.resume()); - }, this; - }, Object.defineProperty(r.prototype, "readableHighWaterMark", { - enumerable: !1, get: function() { - return this._readableState.highWaterMark; - } - }), r._fromList = f; - }).call(this, L("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); - }, { - "./_stream_duplex": 13, "./internal/streams/BufferList": 18, "./internal/streams/destroy": 19, "./internal/streams/stream": 20, - _process: 11, "core-util-is": 4, events: 5, inherits: 7, isarray: 9, "process-nextick-args": 10, "safe-buffer": 25, "string_decoder/": 27, - util: 2 - }], 16: [function(t, e, r) { - - function i(t) { - if (!(this instanceof i)) - return new i(t); - o.call(this, t), this._transformState = { - afterTransform: function(t, e) { - var r = this._transformState; - r.transforming = !1; - var i = r.writecb; - if (!i) - return this.emit("error", Error("write callback called multiple times")); - r.writechunk = null, (r.writecb = null) != e && this.push(e), i(t), (r = this._readableState).reading = !1, (r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark); - }.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null - }, this._readableState.needReadable = !0, - this._readableState.sync = !1, t && ("function" == typeof t.transform && (this._transform = t.transform), "function" == typeof t.flush && (this._flush = t.flush)), - this.on("prefinish", n); - }; - - function n() { - var r = this; - "function" == typeof this._flush ? this._flush(function(t, e) { - s(r, t, e); - }) : s(this, null, null); - }; - - function s(t, e, r) { - if (e) - return t.emit("error", e); - if (null != r && t.push(r), t._writableState.length) - throw Error("Calling transform done when ws.length != 0"); - if (t._transformState.transforming) - throw Error("Calling transform done when still transforming"); - return t.push(null); - }; - e.exports = i; - var o = t("./_stream_duplex"); - (e = t("core-util-is")).inherits = t("inherits"), e.inherits(i, o), i.prototype.push = function(t, e) { - return this._transformState.needTransform = !1, o.prototype.push.call(this, t, e); - }, i.prototype._transform = function(t, e, r) { - throw Error("_transform() is not implemented"); - }, i.prototype._write = function(t, e, r) { - var i = this._transformState; - i.writecb = r, i.writechunk = t, i.writeencoding = e, i.transforming || (t = this._readableState, (i.needTransform || t.needReadable || t.length < t.highWaterMark) && this._read(t.highWaterMark)); - }, i.prototype._read = function(t) { - null !== (t = this._transformState).writechunk && t.writecb && !t.transforming ? (t.transforming = !0, this._transform(t.writechunk, - t.writeencoding, t.afterTransform)) : t.needTransform = !0; - }, i.prototype._destroy = function(t, e) { - var r = this; - o.prototype._destroy.call(this, t, function(t) { - e(t), r.emit("close"); - }); - }; - }, { "./_stream_duplex": 13, "core-util-is": 4, inherits: 7 }], 17: [function(v, M, t) { - (function(t, e, r) { - - function a(r) { - var i = this; - this.entry = this.next = null, this.finish = function() { - var t = i.entry; - for (i.entry = null; t;) { - var e = t.callback; - r.pendingcb-- , e(void 0), t = t.next; - } - r.corkedRequestsFree ? r.corkedRequestsFree.next = i : r.corkedRequestsFree = i; - }; - }; - - function l() { - }; - - function i(t, n) { - p = p || v("./_stream_duplex"), t = t || {}; - var e = n instanceof p; - this.objectMode = !!t.objectMode, e && (this.objectMode = this.objectMode || !!t.writableObjectMode); - var r = t.highWaterMark, i = t.writableHighWaterMark, s = this.objectMode ? 16 : 16384; - this.highWaterMark = r || 0 === r ? r : e && (i || 0 === i) ? i : s, this.highWaterMark = Math.floor(this.highWaterMark), this.destroyed = this.finished = this.ended = this.ending = this.needDrain = this.finalCalled = !1, - this.decodeStrings = !1 !== t.decodeStrings, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, - this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(t) { - var e = n._writableState, r = e.sync, i = e.writecb; - e.writing = !1, e.writecb = null, e.length -= e.writelen, e.writelen = 0, t ? (--e.pendingcb, r ? (d.nextTick(i, t), d.nextTick(c, - n, e), n._writableState.errorEmitted = !0, n.emit("error", t)) : (i(t), n._writableState.errorEmitted = !0, n.emit("error", - t), c(n, e))) : ((t = u(e)) || e.corked || e.bufferProcessing || !e.bufferedRequest || h(n, e), r ? m(o, n, e, t, i) : o(n, - e, t, i)); - }, this.writecb = null, this.writelen = 0, this.lastBufferedRequest = this.bufferedRequest = null, this.pendingcb = 0, this.errorEmitted = this.prefinished = !1, - this.bufferedRequestCount = 0, this.corkedRequestsFree = new a(this); - }; - - function n(t) { - if (p = p || v("./_stream_duplex"), !(w.call(n, this) || this instanceof p)) - return new n(t); - this._writableState = new i(t, this), this.writable = !0, t && ("function" == typeof t.write && (this._write = t.write), "function" == typeof t.writev && (this._writev = t.writev), - "function" == typeof t.destroy && (this._destroy = t.destroy), "function" == typeof t.final && (this._final = t.final)), g.call(this); - }; - - function f(t, e, r, i, n, s, o) { - e.writelen = i, e.writecb = o, e.writing = !0, e.sync = !0, r ? t._writev(n, e.onwrite) : t._write(n, s, e.onwrite), e.sync = !1; - }; - - function o(t, e, r, i) { - !r && 0 === e.length && e.needDrain && (e.needDrain = !1, t.emit("drain")), e.pendingcb-- , i(), c(t, e); - }; - - function h(t, e) { - e.bufferProcessing = !0; - var r = e.bufferedRequest; - if (t._writev && r && r.next) { - var i = Array(e.bufferedRequestCount), n = e.corkedRequestsFree; - n.entry = r; - for (var s = 0, o = !0; r;) - (i[s] = r).isBuf || (o = !1), r = r.next, s += 1; - i.allBuffers = o, f(t, e, !0, e.length, i, "", n.finish), e.pendingcb++ , e.lastBufferedRequest = null, n.next ? (e.corkedRequestsFree = n.next, - n.next = null) : e.corkedRequestsFree = new a(e), e.bufferedRequestCount = 0; - } - else { - for (; r && (i = r.chunk, f(t, e, !1, e.objectMode ? 1 : i.length, i, r.encoding, r.callback), r = r.next, e.bufferedRequestCount-- , - !e.writing);); - null === r && (e.lastBufferedRequest = null); - } - e.bufferedRequest = r, e.bufferProcessing = !1; - }; - - function u(t) { - return t.ending && 0 === t.length && null === t.bufferedRequest && !t.finished && !t.writing; - }; - - function s(e, r) { - e._final(function(t) { - r.pendingcb-- , t && e.emit("error", t), r.prefinished = !0, e.emit("prefinish"), c(e, r); - }); - }; - - function c(t, e) { - var r = u(e); - return r && (e.prefinished || e.finalCalled || ("function" == typeof t._final ? (e.pendingcb++ , e.finalCalled = !0, d.nextTick(s, - t, e)) : (e.prefinished = !0, t.emit("prefinish"))), 0 === e.pendingcb && (e.finished = !0, t.emit("finish"))), r; - }; - var d = v("process-nextick-args"); - M.exports = n; - var p, m = !t.browser && - 1 < ["v0.10", "v0.9."].indexOf(t.version.slice(0, 5)) ? r : d.nextTick; - n.WritableState = i, (t = v("core-util-is")).inherits = v("inherits"); - var _ = { deprecate: v("util-deprecate") }, g = v("./internal/streams/stream"), b = v("safe-buffer").Buffer, y = e.Uint8Array || function() { - }; - if (e = v("./internal/streams/destroy"), t.inherits(n, g), i.prototype.getBuffer = function() { - for (var t = this.bufferedRequest, e = []; t;) - e.push(t), t = t.next; - return e; - }, function() { - try { - Object.defineProperty(i.prototype, "buffer", { - get: _.deprecate(function() { - return this.getBuffer(); - }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") - }); - } - catch (t) { - } - }(), $jscomp.initSymbol(), $jscomp.initSymbol(), $jscomp.initSymbol(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance]) { - $jscomp.initSymbol(); - var w = Function.prototype[Symbol.hasInstance]; - $jscomp.initSymbol(), Object.defineProperty(n, Symbol.hasInstance, { - value: function(t) { - return !!w.call(this, t) || this === n && (t && t._writableState instanceof i); - } - }); - } - else - w = function(t) { - return t instanceof this; - }; - n.prototype.pipe = function() { - this.emit("error", Error("Cannot pipe, not readable")); - }, n.prototype.write = function(t, e, r) { - var i, n = this._writableState, s = !1; - if ((i = !n.objectMode) && (i = t, i = b.isBuffer(i) || i instanceof y), i && !b.isBuffer(t) && (t = b.from(t)), "function" == typeof e && (r = e, - e = null), e = i ? "buffer" : e || n.defaultEncoding, "function" != typeof r && (r = l), n.ended) - n = r, r = Error("write after end"), this.emit("error", r), d.nextTick(n, r); - else { - var o; - if (!(o = i)) { - var a = r, h = !0, u = !1; - null === (o = t) ? u = new TypeError("May not write null values to stream") : "string" == typeof o || void 0 === o || n.objectMode || (u = new TypeError("Invalid non-string/buffer chunk")), - u && (this.emit("error", u), d.nextTick(a, u), h = !1), o = h; - } - o && (n.pendingcb++ , (s = i) || (i = t, n.objectMode || !1 === n.decodeStrings || "string" != typeof i || (i = b.from(i, e)), - t !== i && (s = !0, e = "buffer", t = i)), o = n.objectMode ? 1 : t.length, n.length += o, (i = n.length < n.highWaterMark) || (n.needDrain = !0), - n.writing || n.corked ? (o = n.lastBufferedRequest, n.lastBufferedRequest = { chunk: t, encoding: e, isBuf: s, callback: r, next: null }, - o ? o.next = n.lastBufferedRequest : n.bufferedRequest = n.lastBufferedRequest, n.bufferedRequestCount += 1) : f(this, n, !1, - o, t, e, r), s = i); - } - return s; - }, n.prototype.cork = function() { - this._writableState.corked++; - }, n.prototype.uncork = function() { - var t = this._writableState; - t.corked && (t.corked-- , t.writing || t.corked || t.finished || t.bufferProcessing || !t.bufferedRequest || h(this, t)); - }, n.prototype.setDefaultEncoding = function(t) { - if ("string" == typeof t && (t = t.toLowerCase()), !(- 1 < "hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((t + "").toLowerCase()))) - throw new TypeError("Unknown encoding: " + t); - return this._writableState.defaultEncoding = t, this; - }, Object.defineProperty(n.prototype, "writableHighWaterMark", { - enumerable: !1, get: function() { - return this._writableState.highWaterMark; - } - }), n.prototype._write = function(t, e, r) { - r(Error("_write() is not implemented")); - }, n.prototype._writev = null, n.prototype.end = function(t, e, r) { - var i = this._writableState; - "function" == typeof t ? (r = t, e = t = null) : "function" == typeof e && (r = e, e = null), null != t && this.write(t, e), - i.corked && (i.corked = 1, this.uncork()), i.ending || i.finished || (t = r, i.ending = !0, c(this, i), t && (i.finished ? d.nextTick(t) : this.once("finish", - t)), i.ended = !0, this.writable = !1); - }, Object.defineProperty(n.prototype, "destroyed", { - get: function() { - return void 0 !== this._writableState && this._writableState.destroyed; - }, set: function(t) { - this._writableState && (this._writableState.destroyed = t); - } - }), n.prototype.destroy = e.destroy, n.prototype._undestroy = e.undestroy, n.prototype._destroy = function(t, e) { - this.end(), e(t); - }; - }).call(this, v("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, - v("timers").setImmediate); - }, { - "./_stream_duplex": 13, "./internal/streams/destroy": 19, "./internal/streams/stream": 20, _process: 11, "core-util-is": 4, - inherits: 7, "process-nextick-args": 10, "safe-buffer": 25, timers: 28, "util-deprecate": 29 - }], 18: [function(t, e, r) { - var i = t("safe-buffer").Buffer, n = t("util"); - - function s() { - if (!(this instanceof s)) - throw new TypeError("Cannot call a class as a function"); - this.tail = this.head = null, this.length = 0; - }; - e.exports = (s.prototype.push = function(t) { - t = { data: t, next: null }, 0 < this.length ? this.tail.next = t : this.head = t, this.tail = t, ++this.length; - }, s.prototype.unshift = function(t) { - t = { data: t, next: this.head }, 0 === this.length && (this.tail = t), this.head = t, ++this.length; - }, s.prototype.shift = function() { - if (0 !== this.length) { - var t = this.head.data; - return this.head = 1 === this.length ? this.tail = null : this.head.next, --this.length, t; - } - }, s.prototype.clear = function() { - this.head = this.tail = null, this.length = 0; - }, s.prototype.join = function(t) { - if (0 === this.length) - return ""; - for (var e = this.head, r = "" + e.data; e = e.next;) - r += t + e.data; - return r; - }, s.prototype.concat = function(t) { - if (0 === this.length) - return i.alloc(0); - if (1 === this.length) - return this.head.data; - t = i.allocUnsafe(t >>> 0); - for (var e = this.head, r = 0; e;) - e.data.copy(t, r), r += e.data.length, e = e.next; - return t; - }, s), n && n.inspect && n.inspect.custom && (e.exports.prototype[n.inspect.custom] = function() { - var t = n.inspect({ length: this.length }); - return this.constructor.name + " " + t; - }); - }, { "safe-buffer": 25, util: 2 }], 19: [function(t, e, r) { - - function n(t, e) { - t.emit("error", e); - }; - var s = t("process-nextick-args"); - e.exports = { - destroy: function(t, e) { - var r = this, i = this._writableState && this._writableState.destroyed; - return this._readableState && this._readableState.destroyed || i ? e ? e(t) : !t || this._writableState && this._writableState.errorEmitted || s.nextTick(n, - this, t) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), - this._destroy(t || null, function(t) { - !e && t ? (s.nextTick(n, r, t), r._writableState && (r._writableState.errorEmitted = !0)) : e && e(t); - })), this; - }, undestroy: function() { - this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, - this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, - this._writableState.ending = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1); - } - }; - }, { "process-nextick-args": 10 }], 20: [function(t, e, r) { - e.exports = t("events").EventEmitter; - }, { events: 5 }], 21: [function(t, e, r) { - e.exports = t("./readable").PassThrough; - }, { "./readable": 22 }], 22: [function(t, e, r) { - (((r = e.exports = t("./lib/_stream_readable.js")).Stream = r).Readable = r).Writable = t("./lib/_stream_writable.js"), r.Duplex = t("./lib/_stream_duplex.js"), - r.Transform = t("./lib/_stream_transform.js"), r.PassThrough = t("./lib/_stream_passthrough.js"); - }, { - "./lib/_stream_duplex.js": 13, "./lib/_stream_passthrough.js": 14, "./lib/_stream_readable.js": 15, "./lib/_stream_transform.js": 16, - "./lib/_stream_writable.js": 17 - }], 23: [function(t, e, r) { - e.exports = t("./readable").Transform; - }, { "./readable": 22 }], 24: [function(t, e, r) { - e.exports = t("./lib/_stream_writable.js"); - }, { "./lib/_stream_writable.js": 17 }], 25: [function(t, e, r) { - - function i(t, e) { - for (var r in t) - e[r] = t[r]; - }; - - function n(t, e, r) { - return o(t, e, r); - }; - var s = t("buffer"), o = s.Buffer; - o.from && o.alloc && o.allocUnsafe && o.allocUnsafeSlow ? e.exports = s : (i(s, r), r.Buffer = n), i(o, n), n.from = function(t, e, r) { - if ("number" == typeof t) - throw new TypeError("Argument must not be a number"); - return o(t, e, r); - }, n.alloc = function(t, e, r) { - if ("number" != typeof t) - throw new TypeError("Argument must be a number"); - return t = o(t), void 0 !== e ? "string" == typeof r ? t.fill(e, r) : t.fill(e) : t.fill(0), t; - }, n.allocUnsafe = function(t) { - if ("number" != typeof t) - throw new TypeError("Argument must be a number"); - return o(t); - }, n.allocUnsafeSlow = function(t) { - if ("number" != typeof t) - throw new TypeError("Argument must be a number"); - return s.SlowBuffer(t); - }; - }, { buffer: 3 }], 26: [function(t, e, r) { - - function i() { - l.call(this); - }; - e.exports = i; - var l = t("events").EventEmitter; - t("inherits")(i, l), i.Readable = t("readable-stream/readable.js"), i.Writable = t("readable-stream/writable.js"), i.Duplex = t("readable-stream/duplex.js"), - i.Transform = t("readable-stream/transform.js"), i.PassThrough = t("readable-stream/passthrough.js"), (i.Stream = i).prototype.pipe = function(e, t) { - - function r(t) { - e.writable && !1 === e.write(t) && h.pause && h.pause(); - }; - - function i() { - h.readable && h.resume && h.resume(); - }; - - function n() { - u || (u = !0, e.end()); - }; - - function s() { - u || (u = !0, "function" == typeof e.destroy && e.destroy()); - }; - - function o(t) { - if (a(), 0 === l.listenerCount(this, "error")) - throw t; - }; - - function a() { - h.removeListener("data", r), e.removeListener("drain", i), h.removeListener("end", n), h.removeListener("close", s), h.removeListener("error", - o), e.removeListener("error", o), h.removeListener("end", a), h.removeListener("close", a), e.removeListener("close", a); - }; - var h = this; - h.on("data", r), e.on("drain", i), e._isStdio || t && !1 === t.end || (h.on("end", n), h.on("close", s)); - var u = !1; - return h.on("error", o), e.on("error", o), h.on("end", a), h.on("close", a), e.on("close", a), e.emit("pipe", h), e; - }; - }, { - events: 5, inherits: 7, "readable-stream/duplex.js": 12, "readable-stream/passthrough.js": 21, "readable-stream/readable.js": 22, - "readable-stream/transform.js": 23, "readable-stream/writable.js": 24 - }], 27: [function(t, e, r) { - - function i(t) { - var e = function(t) { - if (!t) - return "utf8"; - for (var e; ;) - switch (t) { - case "utf8": - case "utf-8": - return "utf8"; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return "utf16le"; - case "latin1": - case "binary": - return "latin1"; - case "base64": - case "ascii": - case "hex": - return t; - default: - if (e) - return; - t = ("" + t).toLowerCase(), e = !0; - } - }(t); - if ("string" != typeof e && (c.isEncoding === d || !d(t))) - throw Error("Unknown encoding: " + t); - switch (this.encoding = e || t, this.encoding) { - case "utf16le": - this.text = o, this.end = a, t = 4; - break; - case "utf8": - this.fillLast = n, t = 4; - break; - case "base64": - this.text = h, this.end = u, t = 3; - break; - default: - return this.write = l, void (this.end = f); - } - this.lastTotal = this.lastNeed = 0, this.lastChar = c.allocUnsafe(t); - }; - - function s(t) { - return t <= 127 ? 0 : 6 == t >> 5 ? 2 : 14 == t >> 4 ? 3 : 30 == t >> 3 ? 4 : 2 == t >> 6 ? - 1 : - 2; - }; - - function n(t) { - var e = this.lastTotal - this.lastNeed; - t: - if (128 != (192 & t[0])) { - this.lastNeed = 0; - var r = "�"; - } - else { - if (1 < this.lastNeed && 1 < t.length) { - if (128 != (192 & t[1])) { - this.lastNeed = 1, r = "�"; - break t; - } - if (2 < this.lastNeed && 2 < t.length && 128 != (192 & t[2])) { - this.lastNeed = 2, r = "�"; - break t; - } - } - r = void 0; - } - return void 0 !== r ? r : this.lastNeed <= t.length ? (t.copy(this.lastChar, e, 0, this.lastNeed), this.lastChar.toString(this.encoding, - 0, this.lastTotal)) : (t.copy(this.lastChar, e, 0, t.length), void (this.lastNeed -= t.length)); - }; - - function o(t, e) { - if (0 != (t.length - e) % 2) - return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = t[t.length - 1], t.toString("utf16le", e, t.length - 1); - var r = t.toString("utf16le", e); - if (r) { - var i = r.charCodeAt(r.length - 1); - if (55296 <= i && i <= 56319) - return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = t[t.length - 2], this.lastChar[1] = t[t.length - 1], r.slice(0, - - 1); - } - return r; - }; - - function a(t) { - return t = t && t.length ? this.write(t) : "", this.lastNeed ? t + this.lastChar.toString("utf16le", 0, this.lastTotal - this.lastNeed) : t; - }; - - function h(t, e) { - var r = (t.length - e) % 3; - return 0 == r ? t.toString("base64", e) : (this.lastNeed = 3 - r, this.lastTotal = 3, 1 == r ? this.lastChar[0] = t[t.length - 1] : (this.lastChar[0] = t[t.length - 2], - this.lastChar[1] = t[t.length - 1]), t.toString("base64", e, t.length - r)); - }; - - function u(t) { - return t = t && t.length ? this.write(t) : "", this.lastNeed ? t + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t; - }; - - function l(t) { - return t.toString(this.encoding); - }; - - function f(t) { - return t && t.length ? this.write(t) : ""; - }; - var c = t("safe-buffer").Buffer, d = c.isEncoding || function(t) { - switch ((t = "" + t) && t.toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - case "raw": - return !0; - default: - return !1; - } - }; - (r.StringDecoder = i).prototype.write = function(t) { - if (0 === t.length) - return ""; - if (this.lastNeed) { - var e = this.fillLast(t); - if (void 0 === e) - return ""; - var r = this.lastNeed; - this.lastNeed = 0; - } - else - r = 0; - return r < t.length ? e ? e + this.text(t, r) : this.text(t, r) : e || ""; - }, i.prototype.end = function(t) { - return t = t && t.length ? this.write(t) : "", this.lastNeed ? t + "�" : t; - }, i.prototype.text = function(t, e) { - var r = function(t, e, r) { - var i = e.length - 1; - if (i < r) - return 0; - var n = s(e[i]); - return 0 <= n ? (0 < n && (t.lastNeed = n - 1), n) : --i < r || - 2 === n ? 0 : 0 <= (n = s(e[i])) ? (0 < n && (t.lastNeed = n - 2), - n) : --i < r || - 2 === n ? 0 : 0 <= (n = s(e[i])) ? (0 < n && (2 === n ? n = 0 : t.lastNeed = n - 3), n) : 0; - }(this, t, e); - return this.lastNeed ? (this.lastTotal = r, r = t.length - (r - this.lastNeed), t.copy(this.lastChar, 0, r), t.toString("utf8", - e, r)) : t.toString("utf8", e); - }, i.prototype.fillLast = function(t) { - if (this.lastNeed <= t.length) - return t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); - t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length), this.lastNeed -= t.length; - }; - }, { "safe-buffer": 25 }], 28: [function(h, t, u) { - (function(t, e) { - - function r(t, e) { - this._id = t, this._clearFn = e; - }; - var i = h("process/browser.js").nextTick, n = Function.prototype.apply, s = Array.prototype.slice, o = {}, a = 0; - u.setTimeout = function() { - return new r(n.call(setTimeout, window, arguments), clearTimeout); - }, u.setInterval = function() { - return new r(n.call(setInterval, window, arguments), clearInterval); - }, u.clearTimeout = u.clearInterval = function(t) { - t.close(); - }, r.prototype.unref = r.prototype.ref = function() { - }, r.prototype.close = function() { - this._clearFn.call(window, this._id); - }, u.enroll = function(t, e) { - clearTimeout(t._idleTimeoutId), t._idleTimeout = e; - }, u.unenroll = function(t) { - clearTimeout(t._idleTimeoutId), t._idleTimeout = - 1; - }, u._unrefActive = u.active = function(t) { - clearTimeout(t._idleTimeoutId); - var e = t._idleTimeout; - 0 <= e && (t._idleTimeoutId = setTimeout(function() { - t._onTimeout && t._onTimeout(); - }, e)); - }, u.setImmediate = "function" == typeof t ? t : function(t) { - var e = a++, r = !(arguments.length < 2) && s.call(arguments, 1); - return o[e] = !0, i(function() { - o[e] && (r ? t.apply(null, r) : t.call(null), u.clearImmediate(e)); - }), e; - }, u.clearImmediate = "function" == typeof e ? e : function(t) { - delete o[t]; - }; - }).call(this, h("timers").setImmediate, h("timers").clearImmediate); - }, { "process/browser.js": 11, timers: 28 }], 29: [function(t, r, e) { - (function(e) { - - function i(t) { - try { - if (!e.localStorage) - return !1; - } - catch (t) { - return !1; - } - return null != (t = e.localStorage[t]) && "true" === String(t).toLowerCase(); - }; - r.exports = function(t, e) { - if (i("noDeprecation")) - return t; - var r = !1; - return function() { - if (!r) { - if (i("throwDeprecation")) - throw Error(e); - i("traceDeprecation") ? console.trace(e) : console.warn(e), r = !0; - } - return t.apply(this, arguments); - }; - }; - }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); - }, {}], 30: [function(t, e, r) { - window.SignLib = t("secp256k1/lib/js"), window.Buffer = t("safe-buffer").Buffer; - }, { "safe-buffer": 42, "secp256k1/lib/js": 48 }], 31: [function(t, e, r) { - - function i(t) { - s.call(this), (this.hashMode = "string" == typeof t) ? this[t] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, - this._final = null), this._encoding = this._decoder = null; - }; - var n = t("safe-buffer").Buffer, s = t("stream").Transform, o = t("string_decoder").StringDecoder; - t("inherits")(i, s), i.prototype.update = function(t, e, r) { - return "string" == typeof t && (t = n.from(t, e)), t = this._update(t), this.hashMode ? this : (r && (t = this._toString(t, - r)), t); - }, i.prototype.setAutoPadding = function() { - }, i.prototype.getAuthTag = function() { - throw Error("trying to get auth tag in unsupported state"); - }, i.prototype.setAuthTag = function() { - throw Error("trying to set auth tag in unsupported state"); - }, i.prototype.setAAD = function() { - throw Error("trying to set aad in unsupported state"); - }, i.prototype._transform = function(t, e, r) { - try { - this.hashMode ? this._update(t) : this.push(this._update(t)); - } - catch (t) { - var i = t; - } - finally { - r(i); - } - }, i.prototype._flush = function(t) { - try { - this.push(this.__final()); - } - catch (t) { - var e = t; - } - t(e); - }, i.prototype._finalOrDigest = function(t) { - var e = this.__final() || n.alloc(0); - return t && (e = this._toString(e, t, !0)), e; - }, i.prototype._toString = function(t, e, r) { - if (this._decoder || (this._decoder = new o(e), this._encoding = e), this._encoding !== e) - throw Error("can't switch encodings"); - return t = this._decoder.write(t), r && (t += this._decoder.end()), t; - }, e.exports = i; - }, { inherits: 39, "safe-buffer": 42, stream: 26, string_decoder: 27 }], 32: [function(t, e, r) { - - function i(t) { - a.call(this, "digest"), this._hash = t; - }; - r = t("inherits"); - var n = t("md5.js"), s = t("ripemd160"), o = t("sha.js"), a = t("cipher-base"); - r(i, a), i.prototype._update = function(t) { - this._hash.update(t); - }, i.prototype._final = function() { - return this._hash.digest(); - }, e.exports = function(t) { - return "md5" === (t = t.toLowerCase()) ? new n : "rmd160" === t || "ripemd160" === t ? new s : new i(o(t)); - }; - }, { "cipher-base": 31, inherits: 39, "md5.js": 40, ripemd160: 41, "sha.js": 51 }], 33: [function(t, e, r) { - var i = t("md5.js"); - e.exports = function(t) { - return (new i).update(t).digest(); - }; - }, { "md5.js": 40 }], 34: [function(t, e, r) { - - function i(t, e) { - o.call(this, "digest"), "string" == typeof e && (e = a.from(e)); - var r = "sha512" === t || "sha384" === t ? 128 : 64; - this._alg = t, (this._key = e).length > r ? e = ("rmd160" === t ? new h : u(t)).update(e).digest() : e.length < r && (e = a.concat([e, - l], r)); - for (var i = this._ipad = a.allocUnsafe(r), n = this._opad = a.allocUnsafe(r), s = 0; s < r; s++) - i[s] = 54 ^ e[s], n[s] = 92 ^ e[s]; - this._hash = "rmd160" === t ? new h : u(t), this._hash.update(i); - }; - r = t("inherits"); - var n = t("./legacy"), o = t("cipher-base"), a = t("safe-buffer").Buffer, s = t("create-hash/md5"), h = t("ripemd160"), u = t("sha.js"), - l = a.alloc(128); - r(i, o), i.prototype._update = function(t) { - this._hash.update(t); - }, i.prototype._final = function() { - var t = this._hash.digest(); - return ("rmd160" === this._alg ? new h : u(this._alg)).update(this._opad).update(t).digest(); - }, e.exports = function(t, e) { - return "rmd160" === (t = t.toLowerCase()) || "ripemd160" === t ? new i("rmd160", e) : "md5" === t ? new n(s, e) : new i(t, - e); - }; - }, { "./legacy": 35, "cipher-base": 31, "create-hash/md5": 33, inherits: 39, ripemd160: 41, "safe-buffer": 42, "sha.js": 51 }], 35: [function(t, e, r) { - - function i(t, e) { - o.call(this, "digest"), "string" == typeof e && (e = s.from(e)), this._alg = t, 64 < (this._key = e).length ? e = t(e) : e.length < 64 && (e = s.concat([e, - a], 64)); - for (var r = this._ipad = s.allocUnsafe(64), i = this._opad = s.allocUnsafe(64), n = 0; n < 64; n++) - r[n] = 54 ^ e[n], i[n] = 92 ^ e[n]; - this._hash = [r]; - }; - r = t("inherits"); - var s = t("safe-buffer").Buffer, o = t("cipher-base"), a = s.alloc(128); - r(i, o), i.prototype._update = function(t) { - this._hash.push(t); - }, i.prototype._final = function() { - var t = this._alg(s.concat(this._hash)); - return this._alg(s.concat([this._opad, t])); - }, e.exports = i; - }, { "cipher-base": 31, inherits: 39, "safe-buffer": 42 }], 36: [function(e, h, t) { - (function(n) { - - function t(t, e, r, i) { - var n = s[t]; - if (void 0 === n) - throw Error("hash " + t + " is not supported"); - this._algo = t, this._securityStrength = n.securityStrength / 8, this._outlen = n.outlen / 8, this._reseedInterval = 281474976710656, - this._init(e, r, i); - }; - var i = e("create-hmac"), s = e("./lib/hash-info.json"), o = new n(0), r = new n([0]), a = new n([1]); - t.prototype._update = function(t) { - var e = i(this._algo, this._K).update(this._V).update(r); - t && e.update(t), this._K = e.digest(), this._V = i(this._algo, this._K).update(this._V).digest(), t && (this._K = i(this._algo, - this._K).update(this._V).update(a).update(t).digest(), this._V = i(this._algo, this._K).update(this._V).digest()); - }, t.prototype._init = function(t, e, r) { - if (t.length < this._securityStrength) - throw Error("Not enough entropy"); - this._K = new n(this._outlen), this._V = new n(this._outlen); - for (var i = 0; i < this._K.length; ++i) - this._K[i] = 0, this._V[i] = 1; - this._update(n.concat([t, e, r || o])), this._reseed = 1; - }, t.prototype.reseed = function(t, e) { - if (t.length < this._securityStrength) - throw Error("Not enough entropy"); - this._update(n.concat([t, e || o])), this._reseed = 1; - }, t.prototype.generate = function(t, e) { - if (this._reseed > this._reseedInterval) - throw Error("Reseed is required"); - e && 0 === e.length && (e = void 0), e && this._update(e); - for (var r = new n(0); r.length < t;) - this._V = i(this._algo, this._K).update(this._V).digest(), r = n.concat([r, this._V]); - return this._update(e), this._reseed += 1, r.slice(0, t); - }, h.exports = t; - }).call(this, e("buffer").Buffer); - }, { "./lib/hash-info.json": 37, buffer: 3, "create-hmac": 34 }], 37: [function(t, e, r) { - e.exports = { - sha1: { securityStrength: 128, outlen: 160, seedlen: 440 }, sha224: { securityStrength: 192, outlen: 224, seedlen: 440 }, - sha256: { securityStrength: 256, outlen: 256, seedlen: 440 }, sha384: { securityStrength: 256, outlen: 384, seedlen: 888 }, sha512: { - securityStrength: 256, - outlen: 512, seedlen: 888 - } - }; - }, {}], 38: [function(t, e, r) { - - function i(t) { - n.call(this), this._block = s.allocUnsafe(t), this._blockSize = t, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1; - }; - var s = t("safe-buffer").Buffer, n = t("stream").Transform; - t("inherits")(i, n), i.prototype._transform = function(t, e, r) { - var i = null; - try { - this.update(t, e); - } - catch (t) { - i = t; - } - r(i); - }, i.prototype._flush = function(t) { - var e = null; - try { - this.push(this.digest()); - } - catch (t) { - e = t; - } - t(e); - }, i.prototype.update = function(t, e) { - var r = t; - if (!s.isBuffer(r) && "string" != typeof r) - throw new TypeError("Data must be a string or a buffer"); - if (this._finalized) - throw Error("Digest already called"); - s.isBuffer(t) || (t = s.from(t, e)), r = this._block; - for (var i = 0; this._blockOffset + t.length - i >= this._blockSize;) { - for (var n = this._blockOffset; n < this._blockSize;) - r[n++] = t[i++]; - this._update(), this._blockOffset = 0; - } - for (; i < t.length;) - r[this._blockOffset++] = t[i++]; - for (r = 0, i = 8 * t.length; 0 < i; ++r) - this._length[r] += i, 0 < (i = this._length[r] / 4294967296 | 0) && (this._length[r] -= 4294967296 * i); - return this; - }, i.prototype._update = function() { - throw Error("_update is not implemented"); - }, i.prototype.digest = function(t) { - if (this._finalized) - throw Error("Digest already called"); - this._finalized = !0; - var e = this._digest(); - for (void 0 !== t && (e = e.toString(t)), this._block.fill(0), t = this._blockOffset = 0; t < 4; ++t) - this._length[t] = 0; - return e; - }, i.prototype._digest = function() { - throw Error("_digest is not implemented"); - }, e.exports = i; - }, { inherits: 39, "safe-buffer": 42, stream: 26 }], 39: [function(t, e, r) { - arguments[4][7][0].apply(r, arguments); - }, { dup: 7 }], 40: [function(l, f, t) { - (function(e) { - - function t() { - i.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878; - }; - - function a(t, e) { - return t << e | t >>> 32 - e; - }; - - function n(t, e, r, i, n, s, o) { - return a(t + (e & r | ~e & i) + n + s | 0, o) + e | 0; - }; - - function s(t, e, r, i, n, s, o) { - return a(t + (e & i | r & ~i) + n + s | 0, o) + e | 0; - }; - - function o(t, e, r, i, n, s, o) { - return a(t + (e ^ r ^ i) + n + s | 0, o) + e | 0; - }; - - function h(t, e, r, i, n, s, o) { - return a(t + (r ^ (e | ~i)) + n + s | 0, o) + e | 0; - }; - var r = l("inherits"), i = l("hash-base"), u = Array(16); - r(t, i), t.prototype._update = function() { - for (var t = 0; t < 16; ++t) - u[t] = this._block.readInt32LE(4 * t); - t = this._a; - var e = this._b, r = this._c, i = this._d; - e = h(e = h(e = h(e = h(e = o(e = o(e = o(e = o(e = s(e = s(e = s(e = s(e = n(e = n(e = n(e = n(e, r = n(r, i = n(i, t = n(t, - e, r, i, u[0], 3614090360, 7), e, r, u[1], 3905402710, 12), t, e, u[2], 606105819, 17), i, t, u[3], 3250441966, 22), r = n(r, - i = n(i, t = n(t, e, r, i, u[4], 4118548399, 7), e, r, u[5], 1200080426, 12), t, e, u[6], 2821735955, 17), i, t, u[7], 4249261313, - 22), r = n(r, i = n(i, t = n(t, e, r, i, u[8], 1770035416, 7), e, r, u[9], 2336552879, 12), t, e, u[10], 4294925233, 17), i, - t, u[11], 2304563134, 22), r = n(r, i = n(i, t = n(t, e, r, i, u[12], 1804603682, 7), e, r, u[13], 4254626195, 12), t, e, u[14], - 2792965006, 17), i, t, u[15], 1236535329, 22), r = s(r, i = s(i, t = s(t, e, r, i, u[1], 4129170786, 5), e, r, u[6], 3225465664, - 9), t, e, u[11], 643717713, 14), i, t, u[0], 3921069994, 20), r = s(r, i = s(i, t = s(t, e, r, i, u[5], 3593408605, 5), e, - r, u[10], 38016083, 9), t, e, u[15], 3634488961, 14), i, t, u[4], 3889429448, 20), r = s(r, i = s(i, t = s(t, e, r, i, u[9], - 568446438, 5), e, r, u[14], 3275163606, 9), t, e, u[3], 4107603335, 14), i, t, u[8], 1163531501, 20), r = s(r, i = s(i, t = s(t, - e, r, i, u[13], 2850285829, 5), e, r, u[2], 4243563512, 9), t, e, u[7], 1735328473, 14), i, t, u[12], 2368359562, 20), r = o(r, - i = o(i, t = o(t, e, r, i, u[5], 4294588738, 4), e, r, u[8], 2272392833, 11), t, e, u[11], 1839030562, 16), i, t, u[14], 4259657740, - 23), r = o(r, i = o(i, t = o(t, e, r, i, u[1], 2763975236, 4), e, r, u[4], 1272893353, 11), t, e, u[7], 4139469664, 16), i, - t, u[10], 3200236656, 23), r = o(r, i = o(i, t = o(t, e, r, i, u[13], 681279174, 4), e, r, u[0], 3936430074, 11), t, e, u[3], - 3572445317, 16), i, t, u[6], 76029189, 23), r = o(r, i = o(i, t = o(t, e, r, i, u[9], 3654602809, 4), e, r, u[12], 3873151461, - 11), t, e, u[15], 530742520, 16), i, t, u[2], 3299628645, 23), r = h(r, i = h(i, t = h(t, e, r, i, u[0], 4096336452, 6), e, - r, u[7], 1126891415, 10), t, e, u[14], 2878612391, 15), i, t, u[5], 4237533241, 21), r = h(r, i = h(i, t = h(t, e, r, i, u[12], - 1700485571, 6), e, r, u[3], 2399980690, 10), t, e, u[10], 4293915773, 15), i, t, u[1], 2240044497, 21), r = h(r, i = h(i, t = h(t, - e, r, i, u[8], 1873313359, 6), e, r, u[15], 4264355552, 10), t, e, u[6], 2734768916, 15), i, t, u[13], 1309151649, 21), r = h(r, - i = h(i, t = h(t, e, r, i, u[4], 4149444226, 6), e, r, u[11], 3174756917, 10), t, e, u[2], 718787259, 15), i, t, u[9], 3951481745, - 21), this._a = this._a + t | 0, this._b = this._b + e | 0, this._c = this._c + r | 0, this._d = this._d + i | 0; - }, t.prototype._digest = function() { - this._block[this._blockOffset++] = 128, 56 < this._blockOffset && (this._block.fill(0, this._blockOffset, 64), this._update(), - this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], - 60), this._update(); - var t = new e(16); - return t.writeInt32LE(this._a, 0), t.writeInt32LE(this._b, 4), t.writeInt32LE(this._c, 8), t.writeInt32LE(this._d, 12), t; - }, f.exports = t; - }).call(this, l("buffer").Buffer); - }, { buffer: 3, "hash-base": 38, inherits: 39 }], 41: [function(t, e, r) { - - function i() { - s.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520; - }; - - function d(t, e) { - return t << e | t >>> 32 - e; - }; - var n = t("buffer").Buffer; - r = t("inherits"); - var s = t("hash-base"), p = Array(16), m = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, - 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, - 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13], _ = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, - 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11], g = [11, 14, 15, 12, 5, 8, 7, - 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, - 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, - 8, 5, 6], b = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, - 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, - 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11], y = [0, 1518500249, 1859775393, 2400959708, 2840853838], w = [1352829926, 1548603684, - 1836072691, 2053994217, 0]; - r(i, s), i.prototype._update = function() { - for (var t = 0; t < 16; ++t) - p[t] = this._block.readInt32LE(4 * t); - var e = 0 | this._a; - t = 0 | this._b; - for (var r = 0 | this._c, i = 0 | this._d, n = 0 | this._e, s = 0 | this._a, o = 0 | this._b, a = 0 | this._c, h = 0 | this._d, - u = 0 | this._e, l = 0; l < 80; l += 1) { - if (l < 16) { - var f = n; - f = d(e + (t ^ r ^ i) + p[m[l]] + y[0] | 0, g[l]) + f | 0, e = u; - var c = d(s + (o ^ (a | ~h)) + p[_[l]] + w[0] | 0, b[l]) + e | 0; - } - else - c = l < 32 ? (f = n, f = d(e + (t & r | ~t & i) + p[m[l]] + y[1] | 0, g[l]) + f | 0, e = u, d(s + (o & h | a & ~h) + p[_[l]] + w[1] | 0, - b[l]) + e | 0) : l < 48 ? (f = n, f = d(e + ((t | ~r) ^ i) + p[m[l]] + y[2] | 0, g[l]) + f | 0, e = u, d(s + ((o | ~a) ^ h) + p[_[l]] + w[2] | 0, - b[l]) + e | 0) : l < 64 ? (f = n, f = d(e + (t & i | r & ~i) + p[m[l]] + y[3] | 0, g[l]) + f | 0, e = u, d(s + (o & a | ~o & h) + p[_[l]] + w[3] | 0, - b[l]) + e | 0) : (f = n, f = d(e + (t ^ (r | ~i)) + p[m[l]] + y[4] | 0, g[l]) + f | 0, e = u, d(s + (o ^ a ^ h) + p[_[l]] + w[4] | 0, - b[l]) + e | 0); - e = n, n = i, i = d(r, 10), r = t, t = f, s = u, u = h, h = d(a, 10), a = o, o = c; - } - r = this._b + r + h | 0, this._b = this._c + i + u | 0, this._c = this._d + n + s | 0, this._d = this._e + e + o | 0, this._e = this._a + t + a | 0, - this._a = r; - }, i.prototype._digest = function() { - this._block[this._blockOffset++] = 128, 56 < this._blockOffset && (this._block.fill(0, this._blockOffset, 64), this._update(), - this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], - 60), this._update(); - var t = n.alloc ? n.alloc(20) : new n(20); - return t.writeInt32LE(this._a, 0), t.writeInt32LE(this._b, 4), t.writeInt32LE(this._c, 8), t.writeInt32LE(this._d, 12), t.writeInt32LE(this._e, - 16), t; - }, e.exports = i; - }, { buffer: 3, "hash-base": 38, inherits: 39 }], 42: [function(t, e, r) { - arguments[4][25][0].apply(r, arguments); - }, { buffer: 3, dup: 25 }], 43: [function(t, e, r) { - - function l() { - this.negative = 0, this.words = null, this.length = 0; - }; - var i = t("safe-buffer").Buffer; - t = t("./optimized"), l.fromNumber = function(t) { - var e = new l; - return e.words = [67108863 & t], e.length = 1, e; - }, l.fromBuffer = function(t) { - var e = new l; - return e.words = Array(10), e.words[0] = (3 & t[28]) << 24 | t[29] << 16 | t[30] << 8 | t[31], e.words[1] = (15 & t[25]) << 22 | t[26] << 14 | t[27] << 6 | t[28] >>> 2, - e.words[2] = (63 & t[22]) << 20 | t[23] << 12 | t[24] << 4 | t[25] >>> 4, e.words[3] = (255 & t[19]) << 18 | t[20] << 10 | t[21] << 2 | t[22] >>> 6, - e.words[4] = (3 & t[15]) << 24 | t[16] << 16 | t[17] << 8 | t[18], e.words[5] = (15 & t[12]) << 22 | t[13] << 14 | t[14] << 6 | t[15] >>> 2, - e.words[6] = (63 & t[9]) << 20 | t[10] << 12 | t[11] << 4 | t[12] >>> 4, e.words[7] = (255 & t[6]) << 18 | t[7] << 10 | t[8] << 2 | t[9] >>> 6, - e.words[8] = (3 & t[2]) << 24 | t[3] << 16 | t[4] << 8 | t[5], e.words[9] = t[0] << 14 | t[1] << 6 | t[2] >>> 2, e.length = 10, - e.strip(); - }, l.prototype.toBuffer = function() { - for (var t = this.words, e = this.length; e < 10; ++e) - t[e] = 0; - return i.from([t[9] >>> 14 & 255, t[9] >>> 6 & 255, (63 & t[9]) << 2 | t[8] >>> 24 & 3, t[8] >>> 16 & 255, t[8] >>> 8 & 255, - 255 & t[8], t[7] >>> 18 & 255, t[7] >>> 10 & 255, t[7] >>> 2 & 255, (3 & t[7]) << 6 | t[6] >>> 20 & 63, t[6] >>> 12 & 255, - t[6] >>> 4 & 255, (15 & t[6]) << 4 | t[5] >>> 22 & 15, t[5] >>> 14 & 255, t[5] >>> 6 & 255, (63 & t[5]) << 2 | t[4] >>> 24 & 3, - t[4] >>> 16 & 255, t[4] >>> 8 & 255, 255 & t[4], t[3] >>> 18 & 255, t[3] >>> 10 & 255, t[3] >>> 2 & 255, (3 & t[3]) << 6 | t[2] >>> 20 & 63, - t[2] >>> 12 & 255, t[2] >>> 4 & 255, (15 & t[2]) << 4 | t[1] >>> 22 & 15, t[1] >>> 14 & 255, t[1] >>> 6 & 255, (63 & t[1]) << 2 | t[0] >>> 24 & 3, - t[0] >>> 16 & 255, t[0] >>> 8 & 255, 255 & t[0]]); - }, l.prototype.clone = function() { - var t = new l; - t.words = Array(this.length); - for (var e = 0; e < this.length; e++) - t.words[e] = this.words[e]; - return t.length = this.length, t.negative = this.negative, t; - }, l.prototype.strip = function() { - for (; 1 < this.length && 0 == (0 | this.words[this.length - 1]);) - this.length--; - return this; - }, l.prototype.normSign = function() { - return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; - }, l.prototype.isEven = function() { - return 0 == (1 & this.words[0]); - }, l.prototype.isOdd = function() { - return 1 == (1 & this.words[0]); - }, l.prototype.isZero = function() { - return 1 === this.length && 0 === this.words[0]; - }, l.prototype.ucmp = function(t) { - if (this.length !== t.length) - return this.length > t.length ? 1 : - 1; - for (var e = this.length - 1; 0 <= e; --e) - if (this.words[e] !== t.words[e]) - return this.words[e] > t.words[e] ? 1 : - 1; - return 0; - }, l.prototype.gtOne = function() { - return 1 < this.length || 1 < this.words[0]; - }, l.prototype.isOverflow = function() { - return 0 <= this.ucmp(l.n); - }, l.prototype.isHigh = function() { - return 1 === this.ucmp(l.nh); - }, l.prototype.bitLengthGT256 = function() { - return 10 < this.length || 10 === this.length && 4194303 < this.words[9]; - }, l.prototype.iuaddn = function(t) { - for (this.words[0] += t, t = 0; 67108863 < this.words[t] && t < this.length; ++t) - this.words[t] -= 67108864, this.words[t + 1] += 1; - return t === this.length && (this.words[t] = 1, this.length += 1), this; - }, l.prototype.iadd = function(t) { - if (this.negative !== t.negative) - return 0 !== this.negative ? (this.negative = 0, this.isub(t), this.negative ^= 1) : (t.negative = 0, this.isub(t), t.negative = 1), - this.normSign(); - if (this.length > t.length) - var e = this; - else - e = t, t = this; - for (var r = 0, i = 0; r < t.length; ++r) - i = e.words[r] + t.words[r] + i, this.words[r] = 67108863 & i, i >>>= 26; - for (; 0 !== i && r < e.length; ++r) - i = e.words[r] + i, this.words[r] = 67108863 & i, i >>>= 26; - if (this.length = e.length, 0 !== i) - this.words[this.length++] = i; - else - if (e !== this) - for (; r < e.length; ++r) - this.words[r] = e.words[r]; - return this; - }, l.prototype.add = function(t) { - return this.clone().iadd(t); - }, l.prototype.isub = function(t) { - if (this.negative !== t.negative) - return 0 !== this.negative ? (this.negative = 0, this.iadd(t), this.negative = 1) : (t.negative = 0, this.iadd(t), t.negative = 1), - this.normSign(); - var e = this.ucmp(t); - if (0 === e) - return this.negative = 0, this.words[0] = 0, this.length = 1, this; - 0 < e ? e = this : (e = t, t = this); - for (var r = 0, i = 0; r < t.length; ++r) { - var n = e.words[r] - t.words[r] + i; - i = n >> 26, this.words[r] = 67108863 & n; - } - for (; 0 !== i && r < e.length; ++r) - i = (n = e.words[r] + i) >> 26, this.words[r] = 67108863 & n; - if (0 === i && r < e.length && e !== this) - for (; r < e.length; ++r) - this.words[r] = e.words[r]; - return this.length = Math.max(this.length, r), e !== this && (this.negative ^= 1), this.strip().normSign(); - }, l.prototype.sub = function(t) { - return this.clone().isub(t); - }, l.umulTo = function(t, e, r) { - r.length = t.length + e.length - 1; - var i = t.words[0] * e.words[0], n = i / 67108864 | 0; - r.words[0] = 67108863 & i, i = 1; - for (var s = r.length; i < s; i++) { - var o = n >>> 26, a = 67108863 & n; - n = Math.max(0, i - t.length + 1); - for (var h = Math.min(i, e.length - 1); n <= h; n++) - o += (a = t.words[i - n] * e.words[n] + a) / 67108864 | 0, a &= 67108863; - r.words[i] = a, n = o; - } - return 0 !== n && (r.words[r.length++] = n), r.strip(); - }, l.umulTo10x10 = Math.imul ? t.umulTo10x10 : l.umulTo, l.umulnTo = function(t, e, r) { - if (0 === e) - return r.words = [0], r.length = 1, r; - for (var i = 0, n = 0; i < t.length; ++i) - n = t.words[i] * e + n, r.words[i] = 67108863 & n, n = n / 67108864 | 0; - return 0 < n ? (r.words[i] = n, r.length = t.length + 1) : r.length = t.length, r; - }, l.prototype.umul = function(t) { - var e = new l; - return e.words = Array(this.length + t.length), 10 === this.length && 10 === t.length ? l.umulTo10x10(this, t, e) : 1 === this.length ? l.umulnTo(t, - this.words[0], e) : 1 === t.length ? l.umulnTo(this, t.words[0], e) : l.umulTo(this, t, e); - }, l.prototype.isplit = function(t) { - t.length = Math.min(this.length, 9); - for (var e = 0; e < t.length; ++e) - t.words[e] = this.words[e]; - if (this.length <= 9) - return this.words[0] = 0, this.length = 1, this; - var r = this.words[9]; - for (t.words[t.length++] = 4194303 & r, e = 10; e < this.length; ++e) - t = this.words[e], this.words[e - 10] = (4194303 & t) << 4 | r >>> 22, r = t; - return r >>>= 22, this.words[e - 10] = r, this.length = 0 === r && 10 < this.length ? this.length - 10 : this.length - 9, this; - }, l.prototype.fireduce = function() { - return this.isOverflow() && this.isub(l.n), this; - }, l.prototype.ureduce = function() { - var t = this.clone().isplit(l.tmp).umul(l.nc).iadd(l.tmp); - return t.bitLengthGT256() && ((t = t.isplit(l.tmp).umul(l.nc).iadd(l.tmp)).bitLengthGT256() && (t = t.isplit(l.tmp).umul(l.nc).iadd(l.tmp))), - t.fireduce(); - }, l.prototype.ishrn = function(t) { - for (var e = (1 << t) - 1, r = 26 - t, i = this.length - 1, n = 0; 0 <= i; --i) { - var s = this.words[i]; - this.words[i] = n << r | s >>> t, n = s & e; - } - return 1 < this.length && 0 === this.words[this.length - 1] && --this.length, this; - }, l.prototype.uinvm = function() { - for (var t = this.clone(), e = l.n.clone(), r = l.fromNumber(1), i = l.fromNumber(0), n = l.fromNumber(0), s = l.fromNumber(1); t.isEven() && e.isEven();) { - for (var o = 1, a = 1; 0 == (t.words[0] & a) && 0 == (e.words[0] & a) && o < 26; ++o, a <<= 1); - t.ishrn(o), e.ishrn(o); - } - for (o = e.clone(), a = t.clone(); !t.isZero();) { - for (var h = 0, u = 1; 0 == (t.words[0] & u) && h < 26; ++h, u <<= 1); - if (0 < h) - for (t.ishrn(h); 0 < h--;) - (r.isOdd() || i.isOdd()) && (r.iadd(o), i.isub(a)), r.ishrn(1), i.ishrn(1); - for (h = 0, u = 1; 0 == (e.words[0] & u) && h < 26; ++h, u <<= 1); - if (0 < h) - for (e.ishrn(h); 0 < h--;) - (n.isOdd() || s.isOdd()) && (n.iadd(o), s.isub(a)), n.ishrn(1), s.ishrn(1); - 0 <= t.ucmp(e) ? (t.isub(e), r.isub(n), i.isub(s)) : (e.isub(t), n.isub(r), s.isub(i)); - } - return 1 === n.negative ? (n.negative = 0, (t = n.ureduce()).negative ^= 1, t.normSign().iadd(l.n)) : n.ureduce(); - }, l.prototype.imulK = function() { - this.words[this.length] = 0, this.words[this.length + 1] = 0, this.length += 2; - for (var t = 0, e = 0; t < this.length; ++t) { - var r = 0 | this.words[t]; - e += 977 * r, this.words[t] = 67108863 & e, e = 64 * r + (e / 67108864 | 0); - } - return 0 === this.words[this.length - 1] && (--this.length, 0 === this.words[this.length - 1] && --this.length), this; - }, l.prototype.redIReduce = function() { - this.isplit(l.tmp).imulK().iadd(l.tmp), this.bitLengthGT256() && this.isplit(l.tmp).imulK().iadd(l.tmp); - var t = this.ucmp(l.p); - return 0 === t ? (this.words[0] = 0, this.length = 1) : 0 < t ? this.isub(l.p) : this.strip(), this; - }, l.prototype.redNeg = function() { - return this.isZero() ? l.fromNumber(0) : l.p.sub(this); - }, l.prototype.redAdd = function(t) { - return this.clone().redIAdd(t); - }, l.prototype.redIAdd = function(t) { - return this.iadd(t), 0 <= this.ucmp(l.p) && this.isub(l.p), this; - }, l.prototype.redIAdd7 = function() { - return this.iuaddn(7), 0 <= this.ucmp(l.p) && this.isub(l.p), this; - }, l.prototype.redSub = function(t) { - return this.clone().redISub(t); - }, l.prototype.redISub = function(t) { - return this.isub(t), 0 !== this.negative && this.iadd(l.p), this; - }, l.prototype.redMul = function(t) { - return this.umul(t).redIReduce(); - }, l.prototype.redSqr = function() { - return this.umul(this).redIReduce(); - }, l.prototype.redSqrt = function() { - if (this.isZero()) - return this.clone(); - for (var t = this.redSqr(), e = t.redSqr(), r = (t = (e = e.redSqr().redMul(e)).redMul(t)).redMul(this), i = r, n = 0; n < 54; ++n) - i = i.redSqr().redSqr().redSqr().redSqr().redMul(r); - for (i = i.redSqr().redSqr().redSqr().redSqr().redMul(t), n = 0; n < 5; ++n) - i = i.redSqr().redSqr().redSqr().redSqr().redMul(r); - return 0 === (i = (i = i.redSqr().redSqr().redSqr().redSqr().redMul(e)).redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(e)).redSqr().ucmp(this) ? i : null; - }, l.prototype.redInvm = function() { - for (var t = this.clone(), e = l.p.clone(), r = l.fromNumber(1), i = l.fromNumber(0); t.gtOne() && e.gtOne();) { - for (var n = 0, s = 1; 0 == (t.words[0] & s) && n < 26; ++n, s <<= 1); - if (0 < n) - for (t.ishrn(n); 0 < n--;) - r.isOdd() && r.iadd(l.p), r.ishrn(1); - for (n = 0, s = 1; 0 == (e.words[0] & s) && n < 26; ++n, s <<= 1); - if (0 < n) - for (e.ishrn(n); 0 < n--;) - i.isOdd() && i.iadd(l.p), i.ishrn(1); - 0 <= t.ucmp(e) ? (t.isub(e), r.isub(i)) : (e.isub(t), i.isub(r)); - } - return 0 !== (t = 1 === t.length && 1 === t.words[0] ? r : i).negative && t.iadd(l.p), 0 !== t.negative ? (t.negative = 0, - t.redIReduce().redNeg()) : t.redIReduce(); - }, l.prototype.getNAF = function(t) { - var e = [], r = 1 << t + 1, i = r - 1; - r >>= 1; - for (var n = this.clone(); !n.isZero();) { - for (var s = 0, o = 1; 0 == (n.words[0] & o) && s < 26; ++s, o <<= 1) - e.push(0); - if (0 !== s) - n.ishrn(s); - else - if (r <= (s = n.words[0] & i)) - e.push(r - s), n.iuaddn(s - r).ishrn(1); - else - if (e.push(s), n.words[0] -= s, !n.isZero()) { - for (s = t - 1; 0 < s; --s) - e.push(0); - n.ishrn(t); - } - } - return e; - }, l.prototype.inspect = function() { - if (this.isZero()) - return "0"; - for (var t = this.toBuffer().toString("hex"), e = 0; "0" === t[e]; ++e); - return t.slice(e); - }, l.n = l.fromBuffer(i.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", "hex")), l.nh = l.n.clone().ishrn(1), - l.nc = l.fromBuffer(i.from("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF", "hex")), l.p = l.fromBuffer(i.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", - "hex")), l.psn = l.p.sub(l.n), (l.tmp = new l).words = Array(10), l.fromNumber(1).words[3] = 0, e.exports = l; - }, { "./optimized": 44, "safe-buffer": 42 }], 44: [function(t, e, r) { - r.umulTo10x10 = function(t, e, r) { - var i = t.words, n = e.words; - e = r.words; - var s = (t = 0) | i[0], o = 8191 & s, a = s >>> 13, h = 0 | i[1]; - s = 8191 & h; - var u = h >>> 13, l = 0 | i[2]; - h = 8191 & l; - var f = l >>> 13, c = 0 | i[3]; - l = 8191 & c; - var d = c >>> 13, p = 0 | i[4]; - c = 8191 & p; - var m = p >>> 13, _ = 0 | i[5]; - p = 8191 & _; - var g = _ >>> 13, b = 0 | i[6]; - _ = 8191 & b; - var y = b >>> 13, w = 0 | i[7]; - b = 8191 & w; - var v = w >>> 13, M = 0 | i[8]; - w = 8191 & M, M >>>= 13; - var E = 0 | i[9]; - i = 8191 & E, E >>>= 13; - var S = 0 | n[0], I = 8191 & S, A = S >>> 13, B = 0 | n[1]; - S = 8191 & B; - var x = B >>> 13, L = 0 | n[2]; - B = 8191 & L; - var k = L >>> 13, T = 0 | n[3]; - L = 8191 & T; - var C = T >>> 13, F = 0 | n[4]; - T = 8191 & F; - var j = F >>> 13, O = 0 | n[5]; - F = 8191 & O; - var R = O >>> 13, N = 0 | n[6]; - O = 8191 & N; - var P = N >>> 13, U = 0 | n[7]; - N = 8191 & U; - var D = U >>> 13, q = 0 | n[8]; - U = 8191 & q; - var K = q >>> 13, V = 8191 & (n = 0 | n[9]), z = n >>> 13; - r.length = 19; - var Y = Math.imul(o, I); - n = Math.imul(o, A); - var $ = t + Y + ((8191 & (n += Math.imul(a, I))) << 13); - t = (q = Math.imul(a, A)) + (n >>> 13) + ($ >>> 26), $ &= 67108863, Y = Math.imul(s, I), n = Math.imul(s, A), n += Math.imul(u, - I), q = Math.imul(u, A), Y += Math.imul(o, S), n += Math.imul(o, x); - var W = t + Y + ((8191 & (n += Math.imul(a, S))) << 13); - t = (q += Math.imul(a, x)) + (n >>> 13) + (W >>> 26), W &= 67108863, Y = Math.imul(h, I), n = Math.imul(h, A), n += Math.imul(f, - I), q = Math.imul(f, A), Y += Math.imul(s, S), n += Math.imul(s, x), n += Math.imul(u, S), q += Math.imul(u, x), Y += Math.imul(o, - B), n += Math.imul(o, k); - var Z = t + Y + ((8191 & (n += Math.imul(a, B))) << 13); - t = (q += Math.imul(a, k)) + (n >>> 13) + (Z >>> 26), Z &= 67108863, Y = Math.imul(l, I), n = Math.imul(l, A), n += Math.imul(d, - I), q = Math.imul(d, A), Y += Math.imul(h, S), n += Math.imul(h, x), n += Math.imul(f, S), q += Math.imul(f, x), Y += Math.imul(s, - B), n += Math.imul(s, k), n += Math.imul(u, B), q += Math.imul(u, k), Y += Math.imul(o, L), n += Math.imul(o, C); - var G = t + Y + ((8191 & (n += Math.imul(a, L))) << 13); - t = (q += Math.imul(a, C)) + (n >>> 13) + (G >>> 26), G &= 67108863, Y = Math.imul(c, I), n = Math.imul(c, A), n += Math.imul(m, - I), q = Math.imul(m, A), Y += Math.imul(l, S), n += Math.imul(l, x), n += Math.imul(d, S), q += Math.imul(d, x), Y += Math.imul(h, - B), n += Math.imul(h, k), n += Math.imul(f, B), q += Math.imul(f, k), Y += Math.imul(s, L), n += Math.imul(s, C), n += Math.imul(u, - L), q += Math.imul(u, C), Y += Math.imul(o, T), n += Math.imul(o, j); - var H = t + Y + ((8191 & (n += Math.imul(a, T))) << 13); - t = (q += Math.imul(a, j)) + (n >>> 13) + (H >>> 26), H &= 67108863, Y = Math.imul(p, I), n = Math.imul(p, A), n += Math.imul(g, - I), q = Math.imul(g, A), Y += Math.imul(c, S), n += Math.imul(c, x), n += Math.imul(m, S), q += Math.imul(m, x), Y += Math.imul(l, - B), n += Math.imul(l, k), n += Math.imul(d, B), q += Math.imul(d, k), Y += Math.imul(h, L), n += Math.imul(h, C), n += Math.imul(f, - L), q += Math.imul(f, C), Y += Math.imul(s, T), n += Math.imul(s, j), n += Math.imul(u, T), q += Math.imul(u, j), Y += Math.imul(o, - F), n += Math.imul(o, R); - var J = t + Y + ((8191 & (n += Math.imul(a, F))) << 13); - t = (q += Math.imul(a, R)) + (n >>> 13) + (J >>> 26), J &= 67108863, Y = Math.imul(_, I), n = Math.imul(_, A), n += Math.imul(y, - I), q = Math.imul(y, A), Y += Math.imul(p, S), n += Math.imul(p, x), n += Math.imul(g, S), q += Math.imul(g, x), Y += Math.imul(c, - B), n += Math.imul(c, k), n += Math.imul(m, B), q += Math.imul(m, k), Y += Math.imul(l, L), n += Math.imul(l, C), n += Math.imul(d, - L), q += Math.imul(d, C), Y += Math.imul(h, T), n += Math.imul(h, j), n += Math.imul(f, T), q += Math.imul(f, j), Y += Math.imul(s, - F), n += Math.imul(s, R), n += Math.imul(u, F), q += Math.imul(u, R), Y += Math.imul(o, O), n += Math.imul(o, P); - var X = t + Y + ((8191 & (n += Math.imul(a, O))) << 13); - t = (q += Math.imul(a, P)) + (n >>> 13) + (X >>> 26), X &= 67108863, Y = Math.imul(b, I), n = Math.imul(b, A), n += Math.imul(v, - I), q = Math.imul(v, A), Y += Math.imul(_, S), n += Math.imul(_, x), n += Math.imul(y, S), q += Math.imul(y, x), Y += Math.imul(p, - B), n += Math.imul(p, k), n += Math.imul(g, B), q += Math.imul(g, k), Y += Math.imul(c, L), n += Math.imul(c, C), n += Math.imul(m, - L), q += Math.imul(m, C), Y += Math.imul(l, T), n += Math.imul(l, j), n += Math.imul(d, T), q += Math.imul(d, j), Y += Math.imul(h, - F), n += Math.imul(h, R), n += Math.imul(f, F), q += Math.imul(f, R), Y += Math.imul(s, O), n += Math.imul(s, P), n += Math.imul(u, - O), q += Math.imul(u, P), Y += Math.imul(o, N), n += Math.imul(o, D); - var Q = t + Y + ((8191 & (n += Math.imul(a, N))) << 13); - t = (q += Math.imul(a, D)) + (n >>> 13) + (Q >>> 26), Q &= 67108863, Y = Math.imul(w, I), n = Math.imul(w, A), n += Math.imul(M, - I), q = Math.imul(M, A), Y += Math.imul(b, S), n += Math.imul(b, x), n += Math.imul(v, S), q += Math.imul(v, x), Y += Math.imul(_, - B), n += Math.imul(_, k), n += Math.imul(y, B), q += Math.imul(y, k), Y += Math.imul(p, L), n += Math.imul(p, C), n += Math.imul(g, - L), q += Math.imul(g, C), Y += Math.imul(c, T), n += Math.imul(c, j), n += Math.imul(m, T), q += Math.imul(m, j), Y += Math.imul(l, - F), n += Math.imul(l, R), n += Math.imul(d, F), q += Math.imul(d, R), Y += Math.imul(h, O), n += Math.imul(h, P), n += Math.imul(f, - O), q += Math.imul(f, P), Y += Math.imul(s, N), n += Math.imul(s, D), n += Math.imul(u, N), q += Math.imul(u, D), Y += Math.imul(o, - U), n += Math.imul(o, K); - var tt = t + Y + ((8191 & (n += Math.imul(a, U))) << 13); - return t = (q += Math.imul(a, K)) + (n >>> 13) + (tt >>> 26), tt &= 67108863, Y = Math.imul(i, I), n = Math.imul(i, A), n += Math.imul(E, - I), q = Math.imul(E, A), Y += Math.imul(w, S), n += Math.imul(w, x), n += Math.imul(M, S), q += Math.imul(M, x), Y += Math.imul(b, - B), n += Math.imul(b, k), n += Math.imul(v, B), q += Math.imul(v, k), Y += Math.imul(_, L), n += Math.imul(_, C), n += Math.imul(y, - L), q += Math.imul(y, C), Y += Math.imul(p, T), n += Math.imul(p, j), n += Math.imul(g, T), q += Math.imul(g, j), Y += Math.imul(c, - F), n += Math.imul(c, R), n += Math.imul(m, F), q += Math.imul(m, R), Y += Math.imul(l, O), n += Math.imul(l, P), n += Math.imul(d, - O), q += Math.imul(d, P), Y += Math.imul(h, N), n += Math.imul(h, D), n += Math.imul(f, N), q += Math.imul(f, D), Y += Math.imul(s, - U), n += Math.imul(s, K), n += Math.imul(u, U), q += Math.imul(u, K), Y += Math.imul(o, V), n += Math.imul(o, z), n += Math.imul(a, - V), t = (q += Math.imul(a, z)) + (n >>> 13) + ((o = t + Y + ((8191 & n) << 13)) >>> 26), o &= 67108863, Y = Math.imul(i, S), - n = Math.imul(i, x), n += Math.imul(E, S), q = Math.imul(E, x), Y += Math.imul(w, B), n += Math.imul(w, k), n += Math.imul(M, - B), q += Math.imul(M, k), Y += Math.imul(b, L), n += Math.imul(b, C), n += Math.imul(v, L), q += Math.imul(v, C), Y += Math.imul(_, - T), n += Math.imul(_, j), n += Math.imul(y, T), q += Math.imul(y, j), Y += Math.imul(p, F), n += Math.imul(p, R), n += Math.imul(g, - F), q += Math.imul(g, R), Y += Math.imul(c, O), n += Math.imul(c, P), n += Math.imul(m, O), q += Math.imul(m, P), Y += Math.imul(l, - N), n += Math.imul(l, D), n += Math.imul(d, N), q += Math.imul(d, D), Y += Math.imul(h, U), n += Math.imul(h, K), n += Math.imul(f, - U), q += Math.imul(f, K), Y += Math.imul(s, V), n += Math.imul(s, z), n += Math.imul(u, V), t = (q += Math.imul(u, z)) + (n >>> 13) + ((s = t + Y + ((8191 & n) << 13)) >>> 26), - s &= 67108863, Y = Math.imul(i, B), n = Math.imul(i, k), n += Math.imul(E, B), q = Math.imul(E, k), Y += Math.imul(w, L), n += Math.imul(w, - C), n += Math.imul(M, L), q += Math.imul(M, C), Y += Math.imul(b, T), n += Math.imul(b, j), n += Math.imul(v, T), q += Math.imul(v, - j), Y += Math.imul(_, F), n += Math.imul(_, R), n += Math.imul(y, F), q += Math.imul(y, R), Y += Math.imul(p, O), n += Math.imul(p, - P), n += Math.imul(g, O), q += Math.imul(g, P), Y += Math.imul(c, N), n += Math.imul(c, D), n += Math.imul(m, N), q += Math.imul(m, - D), Y += Math.imul(l, U), n += Math.imul(l, K), n += Math.imul(d, U), q += Math.imul(d, K), Y += Math.imul(h, V), n += Math.imul(h, - z), n += Math.imul(f, V), t = (q += Math.imul(f, z)) + (n >>> 13) + ((h = t + Y + ((8191 & n) << 13)) >>> 26), h &= 67108863, - Y = Math.imul(i, L), n = Math.imul(i, C), n += Math.imul(E, L), q = Math.imul(E, C), Y += Math.imul(w, T), n += Math.imul(w, - j), n += Math.imul(M, T), q += Math.imul(M, j), Y += Math.imul(b, F), n += Math.imul(b, R), n += Math.imul(v, F), q += Math.imul(v, - R), Y += Math.imul(_, O), n += Math.imul(_, P), n += Math.imul(y, O), q += Math.imul(y, P), Y += Math.imul(p, N), n += Math.imul(p, - D), n += Math.imul(g, N), q += Math.imul(g, D), Y += Math.imul(c, U), n += Math.imul(c, K), n += Math.imul(m, U), q += Math.imul(m, - K), Y += Math.imul(l, V), n += Math.imul(l, z), n += Math.imul(d, V), t = (q += Math.imul(d, z)) + (n >>> 13) + ((l = t + Y + ((8191 & n) << 13)) >>> 26), - l &= 67108863, Y = Math.imul(i, T), n = Math.imul(i, j), n += Math.imul(E, T), q = Math.imul(E, j), Y += Math.imul(w, F), n += Math.imul(w, - R), n += Math.imul(M, F), q += Math.imul(M, R), Y += Math.imul(b, O), n += Math.imul(b, P), n += Math.imul(v, O), q += Math.imul(v, - P), Y += Math.imul(_, N), n += Math.imul(_, D), n += Math.imul(y, N), q += Math.imul(y, D), Y += Math.imul(p, U), n += Math.imul(p, - K), n += Math.imul(g, U), q += Math.imul(g, K), Y += Math.imul(c, V), n += Math.imul(c, z), n += Math.imul(m, V), t = (q += Math.imul(m, - z)) + (n >>> 13) + ((c = t + Y + ((8191 & n) << 13)) >>> 26), c &= 67108863, Y = Math.imul(i, F), n = Math.imul(i, R), n += Math.imul(E, - F), q = Math.imul(E, R), Y += Math.imul(w, O), n += Math.imul(w, P), n += Math.imul(M, O), q += Math.imul(M, P), Y += Math.imul(b, - N), n += Math.imul(b, D), n += Math.imul(v, N), q += Math.imul(v, D), Y += Math.imul(_, U), n += Math.imul(_, K), n += Math.imul(y, - U), q += Math.imul(y, K), Y += Math.imul(p, V), n += Math.imul(p, z), n += Math.imul(g, V), t = (q += Math.imul(g, z)) + (n >>> 13) + ((p = t + Y + ((8191 & n) << 13)) >>> 26), - p &= 67108863, Y = Math.imul(i, O), n = Math.imul(i, P), n += Math.imul(E, O), q = Math.imul(E, P), Y += Math.imul(w, N), n += Math.imul(w, - D), n += Math.imul(M, N), q += Math.imul(M, D), Y += Math.imul(b, U), n += Math.imul(b, K), n += Math.imul(v, U), q += Math.imul(v, - K), Y += Math.imul(_, V), n += Math.imul(_, z), n += Math.imul(y, V), t = (q += Math.imul(y, z)) + (n >>> 13) + ((_ = t + Y + ((8191 & n) << 13)) >>> 26), - _ &= 67108863, Y = Math.imul(i, N), n = Math.imul(i, D), n += Math.imul(E, N), q = Math.imul(E, D), Y += Math.imul(w, U), n += Math.imul(w, - K), n += Math.imul(M, U), q += Math.imul(M, K), Y += Math.imul(b, V), n += Math.imul(b, z), n += Math.imul(v, V), t = (q += Math.imul(v, - z)) + (n >>> 13) + ((b = t + Y + ((8191 & n) << 13)) >>> 26), b &= 67108863, Y = Math.imul(i, U), n = Math.imul(i, K), n += Math.imul(E, - U), q = Math.imul(E, K), Y += Math.imul(w, V), n += Math.imul(w, z), n += Math.imul(M, V), t = (q += Math.imul(M, z)) + (n >>> 13) + ((w = t + Y + ((8191 & n) << 13)) >>> 26), - w &= 67108863, Y = Math.imul(i, V), n = Math.imul(i, z), n += Math.imul(E, V), t = (q = Math.imul(E, z)) + (n >>> 13) + ((a = t + Y + ((8191 & n) << 13)) >>> 26), - e[0] = $, e[1] = W, e[2] = Z, e[3] = G, e[4] = H, e[5] = J, e[6] = X, e[7] = Q, e[8] = tt, e[9] = o, e[10] = s, e[11] = h, - e[12] = l, e[13] = c, e[14] = p, e[15] = _, e[16] = b, e[17] = w, e[18] = 67108863 & a, 0 !== t && (e[19] = t, r.length++), - r; - }; - }, {}], 45: [function(t, e, r) { - - function a(t, e, r) { - null === t && null === e && null === r ? (this.y = this.x = a.one, this.z = a.zero) : (this.x = t, this.y = e, this.z = r), - this.zOne = this.z === a.one; - }; - t = t("./bn"), a.zero = t.fromNumber(0), a.one = t.fromNumber(1), a.prototype.neg = function() { - return this.inf ? this : new a(this.x, this.y.redNeg(), this.z); - }, a.prototype.add = function(t) { - if (this.inf) - return t; - if (t.inf) - return this; - var e = t.z.redSqr(), r = this.z.redSqr(), i = this.x.redMul(e), n = t.x.redMul(r); - if (e = this.y.redMul(e).redMul(t.z), r = t.y.redMul(r).redMul(this.z), n = i.redSub(n), r = e.redSub(r), n.isZero()) - return r.isZero() ? this.dbl() : new a(null, null, null); - var s = n.redSqr(), o = i.redMul(s); - return s = s.redMul(n), new a(i = r.redSqr().redIAdd(s).redISub(o).redISub(o), e = r.redMul(o.redISub(i)).redISub(e.redMul(s)), - t = this.z.redMul(t.z).redMul(n)); - }, a.prototype.mixedAdd = function(t) { - if (this.inf) - return t.toECJPoint(); - if (t.inf) - return this; - var e = this.z.redSqr(), r = this.x, i = t.x.redMul(e), n = this.y; - if (t = t.y.redMul(e).redMul(this.z), i = r.redSub(i), t = n.redSub(t), i.isZero()) - return t.isZero() ? this.dbl() : new a(null, null, null); - var s = i.redSqr(); - return e = r.redMul(s), s = s.redMul(i), new a(r = t.redSqr().redIAdd(s).redISub(e).redISub(e), n = t.redMul(e.redISub(r)).redISub(n.redMul(s)), - i = this.z.redMul(i)); - }, a.prototype.dbl = function() { - if (this.inf) - return this; - if (this.zOne) { - var t = this.x.redSqr(), e = this.y.redSqr(), r = e.redSqr(); - e = (e = this.x.redAdd(e).redSqr().redISub(t).redISub(r)).redIAdd(e); - var i = (t = t.redAdd(t).redIAdd(t)).redSqr().redISub(e).redISub(e), n = r.redIAdd(r).redIAdd(r).redIAdd(r); - r = i, e = t.redMul(e.redISub(i)).redISub(n), t = this.y.redAdd(this.y); - } - else - t = this.x.redSqr(), r = (e = this.y.redSqr()).redSqr(), e = (e = this.x.redAdd(e).redSqr().redISub(t).redISub(r)).redIAdd(e), - i = (t = t.redAdd(t).redIAdd(t)).redSqr(), n = r.redIAdd(r).redIAdd(r).redIAdd(r), r = i.redISub(e).redISub(e), e = t.redMul(e.redISub(r)).redISub(n), - t = (t = this.y.redMul(this.z)).redIAdd(t); - return new a(r, e, t); - }, a.prototype.dblp = function(t) { - if (0 === t || this.inf) - return this; - for (var e = this, r = 0; r < t; r++) - e = e.dbl(); - return e; - }, Object.defineProperty(a.prototype, "inf", { - enumerable: !0, get: function() { - return this.z.isZero(); - } - }), e.exports = a; - }, { "./bn": 43 }], 46: [function(t, e, r) { - - function s(t, e) { - null === t && null === e ? (this.x = this.y = null, this.inf = !0) : (this.x = t, this.y = e, this.inf = !1); - }; - var i = t("safe-buffer").Buffer, n = t("./bn"), o = t("./ecjpoint"); - s.fromPublicKey = function(t) { - var e = t[0]; - if (33 !== t.length || 2 !== e && 3 !== e) - return 65 !== t.length || 4 !== e && 6 !== e && 7 !== e ? null : (r = n.fromBuffer(t.slice(1, 33)), t = n.fromBuffer(t.slice(33, - 65)), 0 <= r.ucmp(n.p) || 0 <= t.ucmp(n.p) || (6 === e || 7 === e) && t.isOdd() !== (7 === e) || 0 !== r.redSqr().redMul(r).redIAdd7().ucmp(t.redSqr()) ? null : new s(r, - t)); - var r = n.fromBuffer(t.slice(1, 33)); - return 0 <= r.ucmp(n.p) ? null : null === (t = r.redSqr().redMul(r).redIAdd7().redSqrt()) ? null : (3 === e !== t.isOdd() && (t = t.redNeg()), - new s(r, t)); - }, s.prototype.toPublicKey = function(t) { - var e = this.x, r = this.y; - return t ? ((t = i.alloc(33))[0] = r.isOdd() ? 3 : 2, e.toBuffer().copy(t, 1)) : ((t = i.alloc(65))[0] = 4, e.toBuffer().copy(t, - 1), r.toBuffer().copy(t, 33)), t; - }, s.fromECJPoint = function(t) { - if (t.inf) - return new s(null, null); - var e = t.z.redInvm(), r = e.redSqr(); - return new s(t.x.redMul(r), t = t.y.redMul(r).redMul(e)); - }, s.prototype.toECJPoint = function() { - return this.inf ? new o(null, null, null) : new o(this.x, this.y, o.one); - }, s.prototype.neg = function() { - return this.inf ? this : new s(this.x, this.y.redNeg()); - }, s.prototype.add = function(t) { - if (this.inf) - return t; - if (t.inf) - return this; - if (0 === this.x.ucmp(t.x)) - return 0 === this.y.ucmp(t.y) ? this.dbl() : new s(null, null); - var e = this.y.redSub(t.y); - return e.isZero() || (e = e.redMul(this.x.redSub(t.x).redInvm())), new s(t = e.redSqr().redISub(this.x).redISub(t.x), e = e.redMul(this.x.redSub(t)).redISub(this.y)); - }, s.prototype.dbl = function() { - if (this.inf) - return this; - var t = this.y.redAdd(this.y); - if (t.isZero()) - return new s(null, null); - var e = this.x.redSqr(); - return new s(t = (e = e.redAdd(e).redIAdd(e).redMul(t.redInvm())).redSqr().redISub(this.x.redAdd(this.x)), e = e.redMul(this.x.redSub(t)).redISub(this.y)); - }, s.prototype.mul = function(t) { - var e = this._getNAFPoints(4), r = e.points; - t = t.getNAF(e.wnd), e = new o(null, null, null); - for (var i = t.length - 1; 0 <= i; i--) { - for (var n = 0; 0 <= i && 0 === t[i]; i-- , ++n); - if (0 <= i && (n += 1), e = e.dblp(n), i < 0) - break; - e = 0 < (n = t[i]) ? e.mixedAdd(r[n - 1 >> 1]) : e.mixedAdd(r[- n - 1 >> 1].neg()); - } - return s.fromECJPoint(e); - }, s.prototype._getNAFPoints1 = function() { - return { wnd: 1, points: [this] }; - }, s.prototype._getNAFPoints = function(t) { - for (var e = Array((1 << t) - 1), r = (e[0] = this).dbl(), i = 1; i < e.length; ++i) - e[i] = e[i - 1].add(r); - return { wnd: t, points: e }; - }, e.exports = s; - }, { "./bn": 43, "./ecjpoint": 45, "safe-buffer": 42 }], 47: [function(t, e, r) { - - function i() { - this.x = s.fromBuffer(n.from("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", "hex")), this.y = s.fromBuffer(n.from("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", - "hex")), this.inf = !1, this._precompute(); - }; - var n = t("safe-buffer").Buffer, s = t("./bn"), u = t("./ecpoint"), l = t("./ecjpoint"); - i.prototype._precompute = function() { - for (var t = new u(this.x, this.y), e = Array(66), r = e[0] = t, i = 1; i < e.length; ++i) { - for (var n = 0; n < 4; n++) - r = r.dbl(); - e[i] = r; - } - this.precomputed = { - naf: t._getNAFPoints(7), doubles: { - step: 4, points: e, negpoints: e.map(function(t) { - return t.neg(); - }) - } - }; - }, i.prototype.mul = function(t) { - var e = this.precomputed.doubles.step, r = this.precomputed.doubles.points, i = this.precomputed.doubles.negpoints, n = t.getNAF(1), - s = ((1 << e + 1) - (0 == e % 2 ? 2 : 1)) / 3; - t = []; - for (var o = 0; o < n.length; o += e) { - for (var a = 0, h = o + e - 1; o <= h; h--) - a = (a << 1) + n[h]; - t.push(a); - } - for (e = new l(null, null, null), n = new l(null, null, null); 0 < s; s--) { - for (o = 0; o < t.length; o++) - t[o] === s ? n = n.mixedAdd(r[o]) : t[o] === - s && (n = n.mixedAdd(i[o])); - e = e.add(n); - } - return u.fromECJPoint(e); - }, i.prototype.mulAdd = function(t, e, r) { - var i = this.precomputed.naf, n = e._getNAFPoints1(); - for (e = [i.points, n.points], t = [t.getNAF(i.wnd), r.getNAF(n.wnd)], r = new l(null, null, null), i = [null, null], n = Math.max(t[0].length, - t[1].length); 0 <= n; n--) { - for (var s = 0; 0 <= n && (i[0] = 0 | t[0][n], i[1] = 0 | t[1][n], 0 === i[0] && 0 === i[1]); ++s, --n); - if (0 <= n && (s += 1), r = r.dblp(s), n < 0) - break; - for (s = 0; s < 2; s++) { - var o, a = i[s]; - 0 !== a && (0 < a ? o = e[s][a >> 1] : a < 0 && (o = e[s][- a >> 1].neg()), r = void 0 === o.z ? r.mixedAdd(o) : r.add(o)); - } - } - return r; - }, e.exports = new i; - }, { "./bn": 43, "./ecjpoint": 45, "./ecpoint": 46, "safe-buffer": 42 }], 48: [function(t, e, i) { - var f = t("safe-buffer").Buffer, n = t("create-hash"), c = t("drbg.js/hmac"), d = t("../messages.json"), p = t("./bn"), o = t("./ecpoint"), - m = t("./ecpointg"); - i.privateKeyVerify = function(t) { - return !((t = p.fromBuffer(t)).isOverflow() || t.isZero()); - }, i.privateKeyExport = function(t, e) { - var r = p.fromBuffer(t); - if (r.isOverflow() || r.isZero()) - throw Error(d.EC_PRIVATE_KEY_EXPORT_DER_FAIL); - return m.mul(r).toPublicKey(e); - }, i.privateKeyNegate = function(t) { - return (t = p.fromBuffer(t)).isZero() ? f.alloc(32) : (0 < t.ucmp(p.n) && t.isub(p.n), p.n.sub(t).toBuffer()); - }, i.privateKeyModInverse = function(t) { - if ((t = p.fromBuffer(t)).isOverflow() || t.isZero()) - throw Error(d.EC_PRIVATE_KEY_RANGE_INVALID); - return t.uinvm().toBuffer(); - }, i.privateKeyTweakAdd = function(t, e) { - var r = p.fromBuffer(e); - if (r.isOverflow()) - throw Error(d.EC_PRIVATE_KEY_TWEAK_ADD_FAIL); - if (r.iadd(p.fromBuffer(t)), r.isOverflow() && r.isub(p.n), r.isZero()) - throw Error(d.EC_PRIVATE_KEY_TWEAK_ADD_FAIL); - return r.toBuffer(); - }, i.privateKeyTweakMul = function(t, e) { - var r = p.fromBuffer(e); - if (r.isOverflow() || r.isZero()) - throw Error(d.EC_PRIVATE_KEY_TWEAK_MUL_FAIL); - var i = p.fromBuffer(t); - return r.umul(i).ureduce().toBuffer(); - }, i.publicKeyCreate = function(t, e) { - var r = p.fromBuffer(t); - if (r.isOverflow() || r.isZero()) - throw Error(d.EC_PUBLIC_KEY_CREATE_FAIL); - return m.mul(r).toPublicKey(e); - }, i.publicKeyConvert = function(t, e) { - var r = o.fromPublicKey(t); - if (null === r) - throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL); - return r.toPublicKey(e); - }, i.publicKeyVerify = function(t) { - return null !== o.fromPublicKey(t); - }, i.publicKeyTweakAdd = function(t, e, r) { - if (null === (t = o.fromPublicKey(t))) - throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL); - if ((e = p.fromBuffer(e)).isOverflow()) - throw Error(d.EC_PUBLIC_KEY_TWEAK_ADD_FAIL); - return m.mul(e).add(t).toPublicKey(r); - }, i.publicKeyTweakMul = function(t, e, r) { - if (null === (t = o.fromPublicKey(t))) - throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL); - if ((e = p.fromBuffer(e)).isOverflow() || e.isZero()) - throw Error(d.EC_PUBLIC_KEY_TWEAK_MUL_FAIL); - return t.mul(e).toPublicKey(r); - }, i.publicKeyCombine = function(t, e) { - for (var r = Array(t.length), i = 0; i < t.length; ++i) - if (r[i] = o.fromPublicKey(t[i]), null === r[i]) - throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL); - i = r[0]; - for (var n = 1; n < r.length; ++n) - i = i.add(r[n]); - if (i.inf) - throw Error(d.EC_PUBLIC_KEY_COMBINE_FAIL); - return i.toPublicKey(e); - }, i.signatureNormalize = function(t) { - var e = p.fromBuffer(t.slice(0, 32)), r = p.fromBuffer(t.slice(32, 64)); - if (e.isOverflow() || r.isOverflow()) - throw Error(d.ECDSA_SIGNATURE_PARSE_FAIL); - return t = f.from(t), r.isHigh() && p.n.sub(r).toBuffer().copy(t, 32), t; - }, i.signatureExport = function(t) { - var e = t.slice(0, 32); - if (t = t.slice(32, 64), p.fromBuffer(e).isOverflow() || p.fromBuffer(t).isOverflow()) - throw Error(d.ECDSA_SIGNATURE_PARSE_FAIL); - return { r: e, s: t }; - }, i.signatureImport = function(t) { - var e = p.fromBuffer(t.r); - return e.isOverflow() && (e = p.fromNumber(0)), (t = p.fromBuffer(t.s)).isOverflow() && (t = p.fromNumber(0)), f.concat([e.toBuffer(), - t.toBuffer()]); - }, i.sign = function(t, e, r, i) { - var n = p.fromBuffer(e); - if (n.isOverflow() || n.isZero()) - throw Error(d.ECDSA_SIGN_FAIL); - if (null === r) { - var s = new c("sha256", e, t, i); - r = function() { - return s.generate(32); - }; - } - for (var o = p.fromBuffer(t), a = 0; ; ++a) { - var h = r(t, e, null, i, a); - if (!f.isBuffer(h) || 32 !== h.length) - throw Error(d.ECDSA_SIGN_FAIL); - var u = p.fromBuffer(h); - if (!u.isOverflow() && !u.isZero()) { - var l = m.mul(u); - if (!(h = l.x.fireduce()).isZero() && !(u = u.uinvm().umul(h.umul(n).ureduce().iadd(o).fireduce()).ureduce()).isZero()) - return t = (0 !== l.x.ucmp(h) ? 2 : 0) | (l.y.isOdd() ? 1 : 0), u.isHigh() && (u = p.n.sub(u), t ^= 1), { - signature: f.concat([h.toBuffer(), - u.toBuffer()]), recovery: t - }; - } - } - }, i.verify = function(t, e, r) { - var i = p.fromBuffer(e.slice(0, 32)); - if (e = p.fromBuffer(e.slice(32, 64)), i.isOverflow() || e.isOverflow()) - throw Error(d.ECDSA_SIGNATURE_PARSE_FAIL); - if (e.isHigh() || i.isZero() || e.isZero()) - return !1; - if (null === (r = o.fromPublicKey(r))) - throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL); - return t = (e = e.uinvm()).umul(p.fromBuffer(t)).ureduce(), e = e.umul(i).ureduce(), !(t = m.mulAdd(t, r, e)).inf && (r = t.z.redSqr(), - 0 === i.redMul(r).ucmp(t.x) || !(0 <= i.ucmp(p.psn)) && 0 === i.iadd(p.psn).redMul(r).ucmp(t.x)); - }, i.recover = function(t, e, r, i) { - var n = p.fromBuffer(e.slice(0, 32)); - if (e = p.fromBuffer(e.slice(32, 64)), n.isOverflow() || e.isOverflow()) - throw Error(d.ECDSA_SIGNATURE_PARSE_FAIL); - do { - if (!n.isZero() && !e.isZero()) { - var s = n; - if (r >> 1) { - if (0 <= s.ucmp(p.psn)) - break; - s = n.add(p.n); - } - if (s = f.concat([f.from([2 + (1 & r)]), s.toBuffer()]), null !== (s = o.fromPublicKey(s))) - return r = n.uinvm(), t = p.n.sub(p.fromBuffer(t)).umul(r).ureduce(), e = e.umul(r).ureduce(), o.fromECJPoint(m.mulAdd(t, s, - e)).toPublicKey(i); - } - } - while (0); - throw Error(d.ECDSA_RECOVER_FAIL); - }, i.ecdh = function(t, e) { - var r = i.ecdhUnsafe(t, e, !0); - return n("sha256").update(r).digest(); - }, i.ecdhUnsafe = function(t, e, r) { - if (null === (t = o.fromPublicKey(t))) - throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL); - if ((e = p.fromBuffer(e)).isOverflow() || e.isZero()) - throw Error(d.ECDH_FAIL); - return t.mul(e).toPublicKey(r); - }; - }, { "../messages.json": 49, "./bn": 43, "./ecpoint": 46, "./ecpointg": 47, "create-hash": 32, "drbg.js/hmac": 36, "safe-buffer": 42 }], - 49: [function(t, e, r) { - e.exports = { - COMPRESSED_TYPE_INVALID: "compressed should be a boolean", EC_PRIVATE_KEY_TYPE_INVALID: "private key should be a Buffer", - EC_PRIVATE_KEY_LENGTH_INVALID: "private key length is invalid", EC_PRIVATE_KEY_RANGE_INVALID: "private key range is invalid", - EC_PRIVATE_KEY_TWEAK_ADD_FAIL: "tweak out of range or resulting private key is invalid", EC_PRIVATE_KEY_TWEAK_MUL_FAIL: "tweak out of range", - EC_PRIVATE_KEY_EXPORT_DER_FAIL: "couldn't export to DER format", EC_PRIVATE_KEY_IMPORT_DER_FAIL: "couldn't import from DER format", - EC_PUBLIC_KEYS_TYPE_INVALID: "public keys should be an Array", EC_PUBLIC_KEYS_LENGTH_INVALID: "public keys Array should have at least 1 element", - EC_PUBLIC_KEY_TYPE_INVALID: "public key should be a Buffer", EC_PUBLIC_KEY_LENGTH_INVALID: "public key length is invalid", EC_PUBLIC_KEY_PARSE_FAIL: "the public key could not be parsed or is invalid", - EC_PUBLIC_KEY_CREATE_FAIL: "private was invalid, try again", EC_PUBLIC_KEY_TWEAK_ADD_FAIL: "tweak out of range or resulting public key is invalid", - EC_PUBLIC_KEY_TWEAK_MUL_FAIL: "tweak out of range", EC_PUBLIC_KEY_COMBINE_FAIL: "the sum of the public keys is not valid", ECDH_FAIL: "scalar was invalid (zero or overflow)", - ECDSA_SIGNATURE_TYPE_INVALID: "signature should be a Buffer", ECDSA_SIGNATURE_LENGTH_INVALID: "signature length is invalid", - ECDSA_SIGNATURE_PARSE_FAIL: "couldn't parse signature", ECDSA_SIGNATURE_PARSE_DER_FAIL: "couldn't parse DER signature", ECDSA_SIGNATURE_SERIALIZE_DER_FAIL: "couldn't serialize signature to DER format", - ECDSA_SIGN_FAIL: "nonce generation function failed or private key is invalid", ECDSA_RECOVER_FAIL: "couldn't recover public key from signature", - MSG32_TYPE_INVALID: "message should be a Buffer", MSG32_LENGTH_INVALID: "message length is invalid", OPTIONS_TYPE_INVALID: "options should be an Object", - OPTIONS_DATA_TYPE_INVALID: "options.data should be a Buffer", OPTIONS_DATA_LENGTH_INVALID: "options.data length is invalid", - OPTIONS_NONCEFN_TYPE_INVALID: "options.noncefn should be a Function", RECOVERY_ID_TYPE_INVALID: "recovery should be a Number", - RECOVERY_ID_VALUE_INVALID: "recovery should have value between -1 and 4", TWEAK_TYPE_INVALID: "tweak should be a Buffer", TWEAK_LENGTH_INVALID: "tweak length is invalid" - }; - }, {}], 50: [function(t, e, r) { - - function i(t, e) { - this._block = l.alloc(t), this._finalSize = e, this._blockSize = t, this._len = 0; - }; - var l = t("safe-buffer").Buffer; - i.prototype.update = function(t, e) { - "string" == typeof t && (t = l.from(t, e || "utf8")); - for (var r = this._block, i = this._blockSize, n = t.length, s = this._len, o = 0; o < n;) { - for (var a = s % i, h = Math.min(n - o, i - a), u = 0; u < h; u++) - r[a + u] = t[o + u]; - o += h, 0 == (s += h) % i && this._update(r); - } - return this._len += n, this; - }, i.prototype.digest = function(t) { - var e = this._len % this._blockSize; - if (this._block[e] = 128, this._block.fill(0, e + 1), e >= this._finalSize && (this._update(this._block), this._block.fill(0)), - (e = 8 * this._len) <= 4294967295) - this._block.writeUInt32BE(e, this._blockSize - 4); - else { - var r = (4294967295 & e) >>> 0; - this._block.writeUInt32BE((e - r) / 4294967296, this._blockSize - 8), this._block.writeUInt32BE(r, this._blockSize - 4); - } - return this._update(this._block), e = this._hash(), t ? e.toString(t) : e; - }, i.prototype._update = function() { - throw Error("_update must be implemented by subclass"); - }, e.exports = i; - }, { "safe-buffer": 42 }], 51: [function(t, e, r) { - (r = e.exports = function(t) { - t = t.toLowerCase(); - var e = r[t]; - if (!e) - throw Error(t + " is not supported (we accept pull requests)"); - return new e; - }).sha = t("./sha"), r.sha1 = t("./sha1"), r.sha224 = t("./sha224"), r.sha256 = t("./sha256"), r.sha384 = t("./sha384"), r.sha512 = t("./sha512"); - }, { "./sha": 52, "./sha1": 53, "./sha224": 54, "./sha256": 55, "./sha384": 56, "./sha512": 57 }], 52: [function(t, e, r) { - - function i() { - this.init(), this._w = o, n.call(this, 64, 56); - }; - r = t("inherits"); - var n = t("./hash"), s = t("safe-buffer").Buffer, h = [1518500249, 1859775393, - 1894007588, - 899497514], o = Array(80); - r(i, n), i.prototype.init = function() { - return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this; - }, i.prototype._update = function(t) { - for (var e = this._w, r = 0 | this._a, i = 0 | this._b, n = 0 | this._c, s = 0 | this._d, o = 0 | this._e, a = 0; a < 16; ++a) - e[a] = t.readInt32BE(4 * a); - for (; a < 80; ++a) - e[a] = e[a - 3] ^ e[a - 8] ^ e[a - 14] ^ e[a - 16]; - for (t = 0; t < 80; ++t) { - a = (r << 5 | r >>> 27) + (0 === (a = ~~(t / 20)) ? i & n | ~i & s : 2 === a ? i & n | i & s | n & s : i ^ n ^ s) + o + e[t] + h[a] | 0, - o = s, s = n, n = i << 30 | i >>> 2, i = r, r = a; - } - this._a = r + this._a | 0, this._b = i + this._b | 0, this._c = n + this._c | 0, this._d = s + this._d | 0, this._e = o + this._e | 0; - }, i.prototype._hash = function() { - var t = s.allocUnsafe(20); - return t.writeInt32BE(0 | this._a, 0), t.writeInt32BE(0 | this._b, 4), t.writeInt32BE(0 | this._c, 8), t.writeInt32BE(0 | this._d, - 12), t.writeInt32BE(0 | this._e, 16), t; - }, e.exports = i; - }, { "./hash": 50, inherits: 39, "safe-buffer": 42 }], 53: [function(t, e, r) { - - function i() { - this.init(), this._w = o, n.call(this, 64, 56); - }; - r = t("inherits"); - var n = t("./hash"), s = t("safe-buffer").Buffer, h = [1518500249, 1859775393, - 1894007588, - 899497514], o = Array(80); - r(i, n), i.prototype.init = function() { - return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this; - }, i.prototype._update = function(t) { - for (var e = this._w, r = 0 | this._a, i = 0 | this._b, n = 0 | this._c, s = 0 | this._d, o = 0 | this._e, a = 0; a < 16; ++a) - e[a] = t.readInt32BE(4 * a); - for (; a < 80; ++a) - t = e[a - 3] ^ e[a - 8] ^ e[a - 14] ^ e[a - 16], e[a] = t << 1 | t >>> 31; - for (a = 0; a < 80; ++a) { - t = (r << 5 | r >>> 27) + (0 === (t = ~~(a / 20)) ? i & n | ~i & s : 2 === t ? i & n | i & s | n & s : i ^ n ^ s) + o + e[a] + h[t] | 0, - o = s, s = n, n = i << 30 | i >>> 2, i = r, r = t; - } - this._a = r + this._a | 0, this._b = i + this._b | 0, this._c = n + this._c | 0, this._d = s + this._d | 0, this._e = o + this._e | 0; - }, i.prototype._hash = function() { - var t = s.allocUnsafe(20); - return t.writeInt32BE(0 | this._a, 0), t.writeInt32BE(0 | this._b, 4), t.writeInt32BE(0 | this._c, 8), t.writeInt32BE(0 | this._d, - 12), t.writeInt32BE(0 | this._e, 16), t; - }, e.exports = i; - }, { "./hash": 50, inherits: 39, "safe-buffer": 42 }], 54: [function(t, e, r) { - - function i() { - this.init(), this._w = a, s.call(this, 64, 56); - }; - r = t("inherits"); - var n = t("./sha256"), s = t("./hash"), o = t("safe-buffer").Buffer, a = Array(64); - r(i, n), i.prototype.init = function() { - return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, - this._g = 1694076839, this._h = 3204075428, this; - }, i.prototype._hash = function() { - var t = o.allocUnsafe(28); - return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, - 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t; - }, e.exports = i; - }, { "./hash": 50, "./sha256": 55, inherits: 39, "safe-buffer": 42 }], 55: [function(t, e, r) { - - function i() { - this.init(), this._w = o, n.call(this, 64, 56); - }; - r = t("inherits"); - var n = t("./hash"), s = t("safe-buffer").Buffer, c = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, - 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, - 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, - 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, - 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, - 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, - 2756734187, 3204031479, 3329325298], o = Array(64); - r(i, n), i.prototype.init = function() { - return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, - this._g = 528734635, this._h = 1541459225, this; - }, i.prototype._update = function(t) { - for (var e = this._w, r = 0 | this._a, i = 0 | this._b, n = 0 | this._c, s = 0 | this._d, o = 0 | this._e, a = 0 | this._f, - h = 0 | this._g, u = 0 | this._h, l = 0; l < 16; ++l) - e[l] = t.readInt32BE(4 * l); - for (; l < 64; ++l) { - t = e[l - 2]; - var f = e[l - 15]; - e[l] = ((t >>> 17 | t << 15) ^ (t >>> 19 | t << 13) ^ t >>> 10) + e[l - 7] + ((f >>> 7 | f << 25) ^ (f >>> 18 | f << 14) ^ f >>> 3) + e[l - 16] | 0; - } - for (l = 0; l < 64; ++l) - t = u + ((o >>> 6 | o << 26) ^ (o >>> 11 | o << 21) ^ (o >>> 25 | o << 7)) + (h ^ o & (a ^ h)) + c[l] + e[l] | 0, f = ((r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10)) + (r & i | n & (r | i)) | 0, - u = h, h = a, a = o, o = s + t | 0, s = n, n = i, i = r, r = t + f | 0; - this._a = r + this._a | 0, this._b = i + this._b | 0, this._c = n + this._c | 0, this._d = s + this._d | 0, this._e = o + this._e | 0, - this._f = a + this._f | 0, this._g = h + this._g | 0, this._h = u + this._h | 0; - }, i.prototype._hash = function() { - var t = s.allocUnsafe(32); - return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, - 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t.writeInt32BE(this._h, 28), t; - }, e.exports = i; - }, { "./hash": 50, inherits: 39, "safe-buffer": 42 }], 56: [function(t, e, r) { - - function i() { - this.init(), this._w = a, s.call(this, 128, 112); - }; - r = t("inherits"); - var n = t("./sha512"), s = t("./hash"), o = t("safe-buffer").Buffer, a = Array(160); - r(i, n), i.prototype.init = function() { - return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, - this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, - this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this; - }, i.prototype._hash = function() { - - function t(t, e, r) { - i.writeInt32BE(t, r), i.writeInt32BE(e, r + 4); - }; - var i = o.allocUnsafe(48); - return t(this._ah, this._al, 0), t(this._bh, this._bl, 8), t(this._ch, this._cl, 16), t(this._dh, this._dl, 24), t(this._eh, - this._el, 32), t(this._fh, this._fl, 40), i; - }, e.exports = i; - }, { "./hash": 50, "./sha512": 57, inherits: 39, "safe-buffer": 42 }], 57: [function(t, e, r) { - - function i() { - this.init(), this._w = o, n.call(this, 128, 112); - }; - - function k(t, e) { - return t >>> 0 < e >>> 0 ? 1 : 0; - }; - r = t("inherits"); - var n = t("./hash"), s = t("safe-buffer").Buffer, T = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, - 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, - 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, - 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, - 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, - 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, - 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, - 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, - 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, - 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, - 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, - 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, - 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, - 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, - 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591], - o = Array(160); - r(i, n), i.prototype.init = function() { - return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, - this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, - this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this; - }, i.prototype._update = function(t) { - for (var e = this._w, r = 0 | this._ah, i = 0 | this._bh, n = 0 | this._ch, s = 0 | this._dh, o = 0 | this._eh, a = 0 | this._fh, - h = 0 | this._gh, u = 0 | this._hh, l = 0 | this._al, f = 0 | this._bl, c = 0 | this._cl, d = 0 | this._dl, p = 0 | this._el, - m = 0 | this._fl, _ = 0 | this._gl, g = 0 | this._hl, b = 0; b < 32; b += 2) - e[b] = t.readInt32BE(4 * b), e[b + 1] = t.readInt32BE(4 * b + 4); - for (; b < 160; b += 2) { - t = e[b - 30]; - var y = e[b - 30 + 1], w = (t >>> 1 | y << 31) ^ (t >>> 8 | y << 24) ^ t >>> 7, v = (y >>> 1 | t << 31) ^ (y >>> 8 | t << 24) ^ (y >>> 7 | t << 25), - M = ((t = e[b - 4]) >>> 19 | (y = e[b - 4 + 1]) << 13) ^ (y >>> 29 | t << 3) ^ t >>> 6; - y = (y >>> 19 | t << 13) ^ (t >>> 29 | y << 3) ^ (y >>> 6 | t << 26); - var E = e[b - 32], S = e[b - 32 + 1]; - t = v + e[b - 14 + 1] | 0, w = (w = (w = w + e[b - 14] + k(t, v) | 0) + M + k(t = t + y | 0, y) | 0) + E + k(t = t + S | 0, - S) | 0, e[b] = w, e[b + 1] = t; - } - for (b = 0; b < 160; b += 2) { - w = e[b], t = e[b + 1], y = r & i | n & (r | i); - var I = l & f | c & (l | f); - E = (r >>> 28 | l << 4) ^ (l >>> 2 | r << 30) ^ (l >>> 7 | r << 25), S = (l >>> 28 | r << 4) ^ (r >>> 2 | l << 30) ^ (r >>> 7 | l << 25); - var A = T[b], B = T[b + 1], x = h ^ o & (a ^ h), L = _ ^ p & (m ^ _); - v = (v = (v = (v = u + ((o >>> 14 | p << 18) ^ (o >>> 18 | p << 14) ^ (p >>> 9 | o << 23)) + k(M = g + ((p >>> 14 | o << 18) ^ (p >>> 18 | o << 14) ^ (o >>> 9 | p << 23)) | 0, - g) | 0) + x + k(M = M + L | 0, L) | 0) + A + k(M = M + B | 0, B) | 0) + w + k(M = M + t | 0, t) | 0, w = E + y + k(t = S + I | 0, - S) | 0, u = h, g = _, h = a, _ = m, a = o, m = p, o = s + v + k(p = d + M | 0, d) | 0, s = n, d = c, n = i, c = f, i = r, f = l, - r = v + w + k(l = M + t | 0, M) | 0; - } - this._al = this._al + l | 0, this._bl = this._bl + f | 0, this._cl = this._cl + c | 0, this._dl = this._dl + d | 0, this._el = this._el + p | 0, - this._fl = this._fl + m | 0, this._gl = this._gl + _ | 0, this._hl = this._hl + g | 0, this._ah = this._ah + r + k(this._al, - l) | 0, this._bh = this._bh + i + k(this._bl, f) | 0, this._ch = this._ch + n + k(this._cl, c) | 0, this._dh = this._dh + s + k(this._dl, - d) | 0, this._eh = this._eh + o + k(this._el, p) | 0, this._fh = this._fh + a + k(this._fl, m) | 0, this._gh = this._gh + h + k(this._gl, - _) | 0, this._hh = this._hh + u + k(this._hl, g) | 0; - }, i.prototype._hash = function() { - - function t(t, e, r) { - i.writeInt32BE(t, r), i.writeInt32BE(e, r + 4); - }; - var i = s.allocUnsafe(64); - return t(this._ah, this._al, 0), t(this._bh, this._bl, 8), t(this._ch, this._cl, 16), t(this._dh, this._dl, 24), t(this._eh, - this._el, 32), t(this._fh, this._fl, 40), t(this._gh, this._gl, 48), t(this._hh, this._hl, 56), i; - }, e.exports = i; - }, { "./hash": 50, inherits: 39, "safe-buffer": 42 }] -}, {}, [30]); +var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.arrayIteratorImpl=function(t){var e=0;return function(){return e>18&63]+h[e>>12&63]+h[e>>6&63]+h[63&e]);return i.join("")}r.byteLength=function(t){var e=(t=a(t))[1];return 3*(t[0]+e)/4-e},r.toByteArray=function(t){var e=a(t),r=e[0];e=e[1];for(var i=new l(3*(r+e)/4-e),n=0,s=0>16&255,i[n++]=r>>8&255,i[n++]=255&r;return 2===e&&(r=u[t.charCodeAt(o)]<<2|u[t.charCodeAt(o+1)]>>4,i[n++]=255&r),1===e&&(r=u[t.charCodeAt(o)]<<10|u[t.charCodeAt(o+1)]<<4|u[t.charCodeAt(o+2)]>>2,i[n++]=r>>8&255,i[n++]=255&r),i},r.fromByteArray=function(t){for(var e=t.length,r=e%3,i=[],n=0,s=e-r;n>2]+h[t<<4&63]+"==")):2==r&&(t=(t[e-2]<<8)+t[e-1],i.push(h[t>>10]+h[t>>4&63]+h[t<<2&63]+"=")),i.join("")};var h=[],u=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array;for(t=0;t<64;++t)h[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],u["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;u[45]=62,u[95]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){function n(t){if(B>>1;case"base64":return I.toByteArray(w(t)).length;default:if(i)return v(t).length;e=(""+e).toLowerCase(),i=!0}}function f(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function c(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:d(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):d(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function d(t,e,r,i,n){function s(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a/=o=2,h/=2,r/=2}if(n)for(i=-1;r>>10&1023|55296),s=56320|1023&s),i.push(s),e+=o}if((t=i.length)<=x)i=String.fromCharCode.apply(String,i);else{for(r="",e=0;et.length)throw new RangeError("Index out of range")}function g(t,e,r,i){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function b(t,e,r,i,n){return e=+e,r>>>=0,n||g(t,0,r,4),A.write(t,e,r,i,23,4),r+4}function y(t,e,r,i,n){return e=+e,r>>>=0,n||g(t,0,r,8),A.write(t,e,r,i,52,8),r+8}function w(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;0!=t.length%4;)t+="=";return t}function v(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function M(t){for(var e=[],r=0;r=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function S(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}var I=t("base64-js"),A=t("ieee754");r.Buffer=h,r.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},r.INSPECT_MAX_BYTES=50;var B=2147483647;r.kMaxLength=B,(h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{get:function(){if(this instanceof h)return this.buffer}}),Object.defineProperty(h.prototype,"offset",{get:function(){if(this instanceof h)return this.byteOffset}}),$jscomp.initSymbol(),$jscomp.initSymbol(),$jscomp.initSymbol(),"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&($jscomp.initSymbol(),Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),h.poolSize=8192,h.from=function(t,e,r){return i(t,e,r)},h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(t,e,r){return s(t),t=t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)},h.allocUnsafe=function(t){return o(t)},h.allocUnsafeSlow=function(t){return o(t)},h.isBuffer=function(t){return null!=t&&!0===t._isBuffer},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,s=Math.min(r,i);nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||t<0)&&(t=0),(!e||e<0||re&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=e)return 0;if(n<=i)return-1;if(r<=e)return 1;if(this===t)return 0;var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o);for(i=this.slice(i,n),t=t.slice(e,r),e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");for(i=i||"utf8",n=!1;;)switch(i){case"hex":t:{for(e=Number(e)||0,i=this.length-e,r?i<(r=Number(r))&&(r=i):r=i,(i=t.length)/2>8,a%=256,s.push(a),s.push(t)}return E(s,this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;h.prototype.slice=function(t,e){var r=this.length;return(t=~~t)<0?(t+=r)<0&&(t=0):r>>=0,e>>>=0,r||m(t,e,this.length),r=this[t];for(var i=1,n=0;++n>>=0,e>>>=0,r||m(t,e,this.length),r=this[t+--e];for(var i=1;0>>=0,e||m(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||m(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||m(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||m(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||m(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||m(t,e,this.length),r=this[t];for(var i=1,n=0;++n>>=0,e>>>=0,r||m(t,e,this.length),r=e;for(var i=1,n=this[t+--r];0>>=0,e||m(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||m(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){t>>>=0,e||m(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||m(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||m(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return t>>>=0,e||m(t,4,this.length),A.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||m(t,4,this.length),A.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||m(t,8,this.length),A.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||m(t,8,this.length),A.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||_(this,t,e,r,Math.pow(2,8*r)-1,0),i=1;var n=0;for(this[e]=255&t;++n>>=0,r>>>=0,i||_(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1;for(this[e+(i=r-1)]=255&t;0<=--i&&(n*=256);)this[e+i]=t/n&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,i){t=+t,e>>>=0,i||_(this,t,e,r,(i=Math.pow(2,8*r-1))-1,-i);var n=1,s=i=0;for(this[e]=255&t;++i>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){t=+t,e>>>=0,i||_(this,t,e,r,(i=Math.pow(2,8*r-1))-1,-i);var n=1,s=0;for(this[e+(i=r-1)]=255&t;0<=--i&&(n*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/n>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return b(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return b(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return y(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return y(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),e>=t.length&&(e=t.length),e=e||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(i=e;ir&&(s.warned=!0,(r=Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.')).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",r.name,r.message))):(n[e]=r,++t._eventsCount),t}function n(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=Array(arguments.length),e=0;e>1,h=-7,u=r?-1:1,l=t[e+(n=r?n-1:0)];for(n+=u,r=l&(1<<-h)-1,l>>=-h,h+=s;0>=-h,h+=i;0>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0;s=i?0:s-1;var f=i?1:-1,c=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,i=h):(i=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(e=1<=i+u?e+l/o:e+l*Math.pow(2,1-u))*o&&(i++,o/=2),h<=i+u?(e=0,i=h):1<=i+u?(e=(e*o-1)*Math.pow(2,n),i+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,n),i=0));8<=n;t[r+s]=255&e,s+=f,e/=256,n-=8);for(i=i<e.highWaterMark){var r=t;8388608<=r?r=8388608:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r}return t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0)}function u(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(I("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?g.nextTick(i,t):i(t))}function i(t){I("emit readable"),t.emit("readable"),m(t)}function l(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length)r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear();else{r=e.buffer;var i=e.decoder;if(ta.length?a.length:i;if(o=h===a.length?o+a:o+a.slice(0,i),0===(i-=h)){h===a.length?(++s,r.head=n.next?n.next:r.tail=null):(r.head=n).data=a.slice(h);break}++s}r.length-=s,r=o}else{for(i=t,n=v.allocUnsafe(i),o=1,(s=r.head).data.copy(n),i-=s.data.length;s=s.next;){if(h=i>(a=s.data).length?a.length:i,a.copy(n,n.length-i,0,h),0===(i-=h)){h===a.length?(++o,r.head=s.next?s.next:r.tail=null):(r.head=s).data=a.slice(h);break}++o}r.length-=o,r=n}i=r}r=i}return r}function c(t){var e=t._readableState;if(0=e.highWaterMark||e.ended))return I("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?c(this):u(this),null;if(0===(t=s(t,e))&&e.ended)return 0===e.length&&c(this),null;var i=e.needReadable;return I("need readable",i),(0===e.length||e.length-t>>0);for(var e=this.head,r=0;e;)e.data.copy(t,r),r+=e.data.length,e=e.next;return t},s),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":25,util:2}],19:[function(t,e,r){function n(t,e){t.emit("error",e)}var s=t("process-nextick-args");e.exports={destroy:function(t,e){var r=this,i=this._writableState&&this._writableState.destroyed;return this._readableState&&this._readableState.destroyed||i?e?e(t):!t||this._writableState&&this._writableState.errorEmitted||s.nextTick(n,this,t):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(s.nextTick(n,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":10}],20:[function(t,e,r){e.exports=t("events").EventEmitter},{events:5}],21:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":22}],22:[function(t,e,r){(((r=e.exports=t("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":13,"./lib/_stream_passthrough.js":14,"./lib/_stream_readable.js":15,"./lib/_stream_transform.js":16,"./lib/_stream_writable.js":17}],23:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":22}],24:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":17}],25:[function(t,e,r){function i(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return o(t,e,r)}var s=t("buffer"),o=s.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=s:(i(s,r),r.Buffer=n),i(o,n),n.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");return t=o(t),void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s.SlowBuffer(t)}},{buffer:3}],26:[function(t,e,r){function i(){l.call(this)}e.exports=i;var l=t("events").EventEmitter;t("inherits")(i,l),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&h.pause&&h.pause()}function i(){h.readable&&h.resume&&h.resume()}function n(){u||(u=!0,e.end())}function s(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function o(t){if(a(),0===l.listenerCount(this,"error"))throw t}function a(){h.removeListener("data",r),e.removeListener("drain",i),h.removeListener("end",n),h.removeListener("close",s),h.removeListener("error",o),e.removeListener("error",o),h.removeListener("end",a),h.removeListener("close",a),e.removeListener("close",a)}var h=this;h.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(h.on("end",n),h.on("close",s));var u=!1;return h.on("error",o),e.on("error",o),h.on("end",a),h.on("close",a),e.on("close",a),e.emit("pipe",h),e}},{events:5,inherits:7,"readable-stream/duplex.js":12,"readable-stream/passthrough.js":21,"readable-stream/readable.js":22,"readable-stream/transform.js":23,"readable-stream/writable.js":24}],27:[function(t,e,r){function i(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(c.isEncoding===d||!d(t)))throw Error("Unknown encoding: "+t);switch(this.encoding=e||t,this.encoding){case"utf16le":this.text=o,this.end=a,t=4;break;case"utf8":this.fillLast=n,t=4;break;case"base64":this.text=h,this.end=u,t=3;break;default:return this.write=l,void(this.end=f)}this.lastTotal=this.lastNeed=0,this.lastChar=c.allocUnsafe(t)}function s(t){return t<=127?0:6==t>>5?2:14==t>>4?3:30==t>>3?4:2==t>>6?-1:-2}function n(t){var e=this.lastTotal-this.lastNeed;t:if(128!=(192&t[0])){this.lastNeed=0;var r="�"}else{if(1r?e=("rmd160"===t?new h:u(t)).update(e).digest():e.lengththis._reseedInterval)throw Error("Reseed is required");e&&0===e.length&&(e=void 0),e&&this._update(e);for(var r=new n(0);r.length=this._blockSize;){for(var n=this._blockOffset;n>>32-e}function n(t,e,r,i,n,s,o){return a(t+(e&r|~e&i)+n+s|0,o)+e|0}function s(t,e,r,i,n,s,o){return a(t+(e&i|r&~i)+n+s|0,o)+e|0}function o(t,e,r,i,n,s,o){return a(t+(e^r^i)+n+s|0,o)+e|0}function h(t,e,r,i,n,s,o){return a(t+(r^(e|~i))+n+s|0,o)+e|0}var r=l("inherits"),i=l("hash-base"),u=Array(16);r(t,i),t.prototype._update=function(){for(var t=0;t<16;++t)u[t]=this._block.readInt32LE(4*t);t=this._a;var e=this._b,r=this._c,i=this._d;e=h(e=h(e=h(e=h(e=o(e=o(e=o(e=o(e=s(e=s(e=s(e=s(e=n(e=n(e=n(e=n(e,r=n(r,i=n(i,t=n(t,e,r,i,u[0],3614090360,7),e,r,u[1],3905402710,12),t,e,u[2],606105819,17),i,t,u[3],3250441966,22),r=n(r,i=n(i,t=n(t,e,r,i,u[4],4118548399,7),e,r,u[5],1200080426,12),t,e,u[6],2821735955,17),i,t,u[7],4249261313,22),r=n(r,i=n(i,t=n(t,e,r,i,u[8],1770035416,7),e,r,u[9],2336552879,12),t,e,u[10],4294925233,17),i,t,u[11],2304563134,22),r=n(r,i=n(i,t=n(t,e,r,i,u[12],1804603682,7),e,r,u[13],4254626195,12),t,e,u[14],2792965006,17),i,t,u[15],1236535329,22),r=s(r,i=s(i,t=s(t,e,r,i,u[1],4129170786,5),e,r,u[6],3225465664,9),t,e,u[11],643717713,14),i,t,u[0],3921069994,20),r=s(r,i=s(i,t=s(t,e,r,i,u[5],3593408605,5),e,r,u[10],38016083,9),t,e,u[15],3634488961,14),i,t,u[4],3889429448,20),r=s(r,i=s(i,t=s(t,e,r,i,u[9],568446438,5),e,r,u[14],3275163606,9),t,e,u[3],4107603335,14),i,t,u[8],1163531501,20),r=s(r,i=s(i,t=s(t,e,r,i,u[13],2850285829,5),e,r,u[2],4243563512,9),t,e,u[7],1735328473,14),i,t,u[12],2368359562,20),r=o(r,i=o(i,t=o(t,e,r,i,u[5],4294588738,4),e,r,u[8],2272392833,11),t,e,u[11],1839030562,16),i,t,u[14],4259657740,23),r=o(r,i=o(i,t=o(t,e,r,i,u[1],2763975236,4),e,r,u[4],1272893353,11),t,e,u[7],4139469664,16),i,t,u[10],3200236656,23),r=o(r,i=o(i,t=o(t,e,r,i,u[13],681279174,4),e,r,u[0],3936430074,11),t,e,u[3],3572445317,16),i,t,u[6],76029189,23),r=o(r,i=o(i,t=o(t,e,r,i,u[9],3654602809,4),e,r,u[12],3873151461,11),t,e,u[15],530742520,16),i,t,u[2],3299628645,23),r=h(r,i=h(i,t=h(t,e,r,i,u[0],4096336452,6),e,r,u[7],1126891415,10),t,e,u[14],2878612391,15),i,t,u[5],4237533241,21),r=h(r,i=h(i,t=h(t,e,r,i,u[12],1700485571,6),e,r,u[3],2399980690,10),t,e,u[10],4293915773,15),i,t,u[1],2240044497,21),r=h(r,i=h(i,t=h(t,e,r,i,u[8],1873313359,6),e,r,u[15],4264355552,10),t,e,u[6],2734768916,15),i,t,u[13],1309151649,21),r=h(r,i=h(i,t=h(t,e,r,i,u[4],4149444226,6),e,r,u[11],3174756917,10),t,e,u[2],718787259,15),i,t,u[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+e|0,this._c=this._c+r|0,this._d=this._d+i|0},t.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>32-e}var n=t("buffer").Buffer;r=t("inherits");var s=t("hash-base"),p=Array(16),m=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],y=[0,1518500249,1859775393,2400959708,2840853838],w=[1352829926,1548603684,1836072691,2053994217,0];r(i,s),i.prototype._update=function(){for(var t=0;t<16;++t)p[t]=this._block.readInt32LE(4*t);var e=0|this._a;t=0|this._b;for(var r=0|this._c,i=0|this._d,n=0|this._e,s=0|this._a,o=0|this._b,a=0|this._c,h=0|this._d,u=0|this._e,l=0;l<80;l+=1){if(l<16){var f=n;f=d(e+(t^r^i)+p[m[l]]+y[0]|0,g[l])+f|0,e=u;var c=d(s+(o^(a|~h))+p[_[l]]+w[0]|0,b[l])+e|0}else c=l<32?(f=n,f=d(e+(t&r|~t&i)+p[m[l]]+y[1]|0,g[l])+f|0,e=u,d(s+(o&h|a&~h)+p[_[l]]+w[1]|0,b[l])+e|0):l<48?(f=n,f=d(e+((t|~r)^i)+p[m[l]]+y[2]|0,g[l])+f|0,e=u,d(s+((o|~a)^h)+p[_[l]]+w[2]|0,b[l])+e|0):l<64?(f=n,f=d(e+(t&i|r&~i)+p[m[l]]+y[3]|0,g[l])+f|0,e=u,d(s+(o&a|~o&h)+p[_[l]]+w[3]|0,b[l])+e|0):(f=n,f=d(e+(t^(r|~i))+p[m[l]]+y[4]|0,g[l])+f|0,e=u,d(s+(o^a^h)+p[_[l]]+w[4]|0,b[l])+e|0);e=n,n=i,i=d(r,10),r=t,t=f,s=u,u=h,h=d(a,10),a=o,o=c}r=this._b+r+h|0,this._b=this._c+i+u|0,this._c=this._d+n+s|0,this._d=this._e+e+o|0,this._e=this._a+t+a|0,this._a=r},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>2,e.words[2]=(63&t[22])<<20|t[23]<<12|t[24]<<4|t[25]>>>4,e.words[3]=(255&t[19])<<18|t[20]<<10|t[21]<<2|t[22]>>>6,e.words[4]=(3&t[15])<<24|t[16]<<16|t[17]<<8|t[18],e.words[5]=(15&t[12])<<22|t[13]<<14|t[14]<<6|t[15]>>>2,e.words[6]=(63&t[9])<<20|t[10]<<12|t[11]<<4|t[12]>>>4,e.words[7]=(255&t[6])<<18|t[7]<<10|t[8]<<2|t[9]>>>6,e.words[8]=(3&t[2])<<24|t[3]<<16|t[4]<<8|t[5],e.words[9]=t[0]<<14|t[1]<<6|t[2]>>>2,e.length=10,e.strip()},l.prototype.toBuffer=function(){for(var t=this.words,e=this.length;e<10;++e)t[e]=0;return i.from([t[9]>>>14&255,t[9]>>>6&255,(63&t[9])<<2|t[8]>>>24&3,t[8]>>>16&255,t[8]>>>8&255,255&t[8],t[7]>>>18&255,t[7]>>>10&255,t[7]>>>2&255,(3&t[7])<<6|t[6]>>>20&63,t[6]>>>12&255,t[6]>>>4&255,(15&t[6])<<4|t[5]>>>22&15,t[5]>>>14&255,t[5]>>>6&255,(63&t[5])<<2|t[4]>>>24&3,t[4]>>>16&255,t[4]>>>8&255,255&t[4],t[3]>>>18&255,t[3]>>>10&255,t[3]>>>2&255,(3&t[3])<<6|t[2]>>>20&63,t[2]>>>12&255,t[2]>>>4&255,(15&t[2])<<4|t[1]>>>22&15,t[1]>>>14&255,t[1]>>>6&255,(63&t[1])<<2|t[0]>>>24&3,t[0]>>>16&255,t[0]>>>8&255,255&t[0]])},l.prototype.clone=function(){var t=new l;t.words=Array(this.length);for(var e=0;et.length?1:-1;for(var e=this.length-1;0<=e;--e)if(this.words[e]!==t.words[e])return this.words[e]>t.words[e]?1:-1;return 0},l.prototype.gtOne=function(){return 1t.length)var e=this;else e=t,t=this;for(var r=0,i=0;r>>=26;for(;0!==i&&r>>=26;if(this.length=e.length,0!==i)this.words[this.length++]=i;else if(e!==this)for(;r>26,this.words[r]=67108863&n}for(;0!==i&&r>26,this.words[r]=67108863&n;if(0===i&&r>>26,a=67108863&n;n=Math.max(0,i-t.length+1);for(var h=Math.min(i,e.length-1);n<=h;n++)o+=(a=t.words[i-n]*e.words[n]+a)/67108864|0,a&=67108863;r.words[i]=a,n=o}return 0!==n&&(r.words[r.length++]=n),r.strip()},l.umulTo10x10=Math.imul?t.umulTo10x10:l.umulTo,l.umulnTo=function(t,e,r){if(0===e)return r.words=[0],r.length=1,r;for(var i=0,n=0;i>>22,r=t;return r>>>=22,this.words[e-10]=r,this.length=0===r&&10>>t,n=s&e}return 1>=1;for(var n=this.clone();!n.isZero();){for(var s=0,o=1;0==(n.words[0]&o)&&s<26;++s,o<<=1)e.push(0);if(0!==s)n.ishrn(s);else if(r<=(s=n.words[0]&i))e.push(r-s),n.iuaddn(s-r).ishrn(1);else if(e.push(s),n.words[0]-=s,!n.isZero()){for(s=t-1;0>>13,h=0|i[1];s=8191&h;var u=h>>>13,l=0|i[2];h=8191&l;var f=l>>>13,c=0|i[3];l=8191&c;var d=c>>>13,p=0|i[4];c=8191&p;var m=p>>>13,_=0|i[5];p=8191&_;var g=_>>>13,b=0|i[6];_=8191&b;var y=b>>>13,w=0|i[7];b=8191&w;var v=w>>>13,M=0|i[8];w=8191&M,M>>>=13;var E=0|i[9];i=8191&E,E>>>=13;var S=0|n[0],I=8191&S,A=S>>>13,B=0|n[1];S=8191&B;var x=B>>>13,L=0|n[2];B=8191&L;var k=L>>>13,T=0|n[3];L=8191&T;var C=T>>>13,F=0|n[4];T=8191&F;var j=F>>>13,O=0|n[5];F=8191&O;var R=O>>>13,N=0|n[6];O=8191&N;var P=N>>>13,U=0|n[7];N=8191&U;var D=U>>>13,q=0|n[8];U=8191&q;var K=q>>>13,V=8191&(n=0|n[9]),z=n>>>13;r.length=19;var Y=Math.imul(o,I);n=Math.imul(o,A);var $=t+Y+((8191&(n+=Math.imul(a,I)))<<13);t=(q=Math.imul(a,A))+(n>>>13)+($>>>26),$&=67108863,Y=Math.imul(s,I),n=Math.imul(s,A),n+=Math.imul(u,I),q=Math.imul(u,A),Y+=Math.imul(o,S),n+=Math.imul(o,x);var W=t+Y+((8191&(n+=Math.imul(a,S)))<<13);t=(q+=Math.imul(a,x))+(n>>>13)+(W>>>26),W&=67108863,Y=Math.imul(h,I),n=Math.imul(h,A),n+=Math.imul(f,I),q=Math.imul(f,A),Y+=Math.imul(s,S),n+=Math.imul(s,x),n+=Math.imul(u,S),q+=Math.imul(u,x),Y+=Math.imul(o,B),n+=Math.imul(o,k);var Z=t+Y+((8191&(n+=Math.imul(a,B)))<<13);t=(q+=Math.imul(a,k))+(n>>>13)+(Z>>>26),Z&=67108863,Y=Math.imul(l,I),n=Math.imul(l,A),n+=Math.imul(d,I),q=Math.imul(d,A),Y+=Math.imul(h,S),n+=Math.imul(h,x),n+=Math.imul(f,S),q+=Math.imul(f,x),Y+=Math.imul(s,B),n+=Math.imul(s,k),n+=Math.imul(u,B),q+=Math.imul(u,k),Y+=Math.imul(o,L),n+=Math.imul(o,C);var G=t+Y+((8191&(n+=Math.imul(a,L)))<<13);t=(q+=Math.imul(a,C))+(n>>>13)+(G>>>26),G&=67108863,Y=Math.imul(c,I),n=Math.imul(c,A),n+=Math.imul(m,I),q=Math.imul(m,A),Y+=Math.imul(l,S),n+=Math.imul(l,x),n+=Math.imul(d,S),q+=Math.imul(d,x),Y+=Math.imul(h,B),n+=Math.imul(h,k),n+=Math.imul(f,B),q+=Math.imul(f,k),Y+=Math.imul(s,L),n+=Math.imul(s,C),n+=Math.imul(u,L),q+=Math.imul(u,C),Y+=Math.imul(o,T),n+=Math.imul(o,j);var H=t+Y+((8191&(n+=Math.imul(a,T)))<<13);t=(q+=Math.imul(a,j))+(n>>>13)+(H>>>26),H&=67108863,Y=Math.imul(p,I),n=Math.imul(p,A),n+=Math.imul(g,I),q=Math.imul(g,A),Y+=Math.imul(c,S),n+=Math.imul(c,x),n+=Math.imul(m,S),q+=Math.imul(m,x),Y+=Math.imul(l,B),n+=Math.imul(l,k),n+=Math.imul(d,B),q+=Math.imul(d,k),Y+=Math.imul(h,L),n+=Math.imul(h,C),n+=Math.imul(f,L),q+=Math.imul(f,C),Y+=Math.imul(s,T),n+=Math.imul(s,j),n+=Math.imul(u,T),q+=Math.imul(u,j),Y+=Math.imul(o,F),n+=Math.imul(o,R);var J=t+Y+((8191&(n+=Math.imul(a,F)))<<13);t=(q+=Math.imul(a,R))+(n>>>13)+(J>>>26),J&=67108863,Y=Math.imul(_,I),n=Math.imul(_,A),n+=Math.imul(y,I),q=Math.imul(y,A),Y+=Math.imul(p,S),n+=Math.imul(p,x),n+=Math.imul(g,S),q+=Math.imul(g,x),Y+=Math.imul(c,B),n+=Math.imul(c,k),n+=Math.imul(m,B),q+=Math.imul(m,k),Y+=Math.imul(l,L),n+=Math.imul(l,C),n+=Math.imul(d,L),q+=Math.imul(d,C),Y+=Math.imul(h,T),n+=Math.imul(h,j),n+=Math.imul(f,T),q+=Math.imul(f,j),Y+=Math.imul(s,F),n+=Math.imul(s,R),n+=Math.imul(u,F),q+=Math.imul(u,R),Y+=Math.imul(o,O),n+=Math.imul(o,P);var X=t+Y+((8191&(n+=Math.imul(a,O)))<<13);t=(q+=Math.imul(a,P))+(n>>>13)+(X>>>26),X&=67108863,Y=Math.imul(b,I),n=Math.imul(b,A),n+=Math.imul(v,I),q=Math.imul(v,A),Y+=Math.imul(_,S),n+=Math.imul(_,x),n+=Math.imul(y,S),q+=Math.imul(y,x),Y+=Math.imul(p,B),n+=Math.imul(p,k),n+=Math.imul(g,B),q+=Math.imul(g,k),Y+=Math.imul(c,L),n+=Math.imul(c,C),n+=Math.imul(m,L),q+=Math.imul(m,C),Y+=Math.imul(l,T),n+=Math.imul(l,j),n+=Math.imul(d,T),q+=Math.imul(d,j),Y+=Math.imul(h,F),n+=Math.imul(h,R),n+=Math.imul(f,F),q+=Math.imul(f,R),Y+=Math.imul(s,O),n+=Math.imul(s,P),n+=Math.imul(u,O),q+=Math.imul(u,P),Y+=Math.imul(o,N),n+=Math.imul(o,D);var Q=t+Y+((8191&(n+=Math.imul(a,N)))<<13);t=(q+=Math.imul(a,D))+(n>>>13)+(Q>>>26),Q&=67108863,Y=Math.imul(w,I),n=Math.imul(w,A),n+=Math.imul(M,I),q=Math.imul(M,A),Y+=Math.imul(b,S),n+=Math.imul(b,x),n+=Math.imul(v,S),q+=Math.imul(v,x),Y+=Math.imul(_,B),n+=Math.imul(_,k),n+=Math.imul(y,B),q+=Math.imul(y,k),Y+=Math.imul(p,L),n+=Math.imul(p,C),n+=Math.imul(g,L),q+=Math.imul(g,C),Y+=Math.imul(c,T),n+=Math.imul(c,j),n+=Math.imul(m,T),q+=Math.imul(m,j),Y+=Math.imul(l,F),n+=Math.imul(l,R),n+=Math.imul(d,F),q+=Math.imul(d,R),Y+=Math.imul(h,O),n+=Math.imul(h,P),n+=Math.imul(f,O),q+=Math.imul(f,P),Y+=Math.imul(s,N),n+=Math.imul(s,D),n+=Math.imul(u,N),q+=Math.imul(u,D),Y+=Math.imul(o,U),n+=Math.imul(o,K);var tt=t+Y+((8191&(n+=Math.imul(a,U)))<<13);return t=(q+=Math.imul(a,K))+(n>>>13)+(tt>>>26),tt&=67108863,Y=Math.imul(i,I),n=Math.imul(i,A),n+=Math.imul(E,I),q=Math.imul(E,A),Y+=Math.imul(w,S),n+=Math.imul(w,x),n+=Math.imul(M,S),q+=Math.imul(M,x),Y+=Math.imul(b,B),n+=Math.imul(b,k),n+=Math.imul(v,B),q+=Math.imul(v,k),Y+=Math.imul(_,L),n+=Math.imul(_,C),n+=Math.imul(y,L),q+=Math.imul(y,C),Y+=Math.imul(p,T),n+=Math.imul(p,j),n+=Math.imul(g,T),q+=Math.imul(g,j),Y+=Math.imul(c,F),n+=Math.imul(c,R),n+=Math.imul(m,F),q+=Math.imul(m,R),Y+=Math.imul(l,O),n+=Math.imul(l,P),n+=Math.imul(d,O),q+=Math.imul(d,P),Y+=Math.imul(h,N),n+=Math.imul(h,D),n+=Math.imul(f,N),q+=Math.imul(f,D),Y+=Math.imul(s,U),n+=Math.imul(s,K),n+=Math.imul(u,U),q+=Math.imul(u,K),Y+=Math.imul(o,V),n+=Math.imul(o,z),n+=Math.imul(a,V),t=(q+=Math.imul(a,z))+(n>>>13)+((o=t+Y+((8191&n)<<13))>>>26),o&=67108863,Y=Math.imul(i,S),n=Math.imul(i,x),n+=Math.imul(E,S),q=Math.imul(E,x),Y+=Math.imul(w,B),n+=Math.imul(w,k),n+=Math.imul(M,B),q+=Math.imul(M,k),Y+=Math.imul(b,L),n+=Math.imul(b,C),n+=Math.imul(v,L),q+=Math.imul(v,C),Y+=Math.imul(_,T),n+=Math.imul(_,j),n+=Math.imul(y,T),q+=Math.imul(y,j),Y+=Math.imul(p,F),n+=Math.imul(p,R),n+=Math.imul(g,F),q+=Math.imul(g,R),Y+=Math.imul(c,O),n+=Math.imul(c,P),n+=Math.imul(m,O),q+=Math.imul(m,P),Y+=Math.imul(l,N),n+=Math.imul(l,D),n+=Math.imul(d,N),q+=Math.imul(d,D),Y+=Math.imul(h,U),n+=Math.imul(h,K),n+=Math.imul(f,U),q+=Math.imul(f,K),Y+=Math.imul(s,V),n+=Math.imul(s,z),n+=Math.imul(u,V),t=(q+=Math.imul(u,z))+(n>>>13)+((s=t+Y+((8191&n)<<13))>>>26),s&=67108863,Y=Math.imul(i,B),n=Math.imul(i,k),n+=Math.imul(E,B),q=Math.imul(E,k),Y+=Math.imul(w,L),n+=Math.imul(w,C),n+=Math.imul(M,L),q+=Math.imul(M,C),Y+=Math.imul(b,T),n+=Math.imul(b,j),n+=Math.imul(v,T),q+=Math.imul(v,j),Y+=Math.imul(_,F),n+=Math.imul(_,R),n+=Math.imul(y,F),q+=Math.imul(y,R),Y+=Math.imul(p,O),n+=Math.imul(p,P),n+=Math.imul(g,O),q+=Math.imul(g,P),Y+=Math.imul(c,N),n+=Math.imul(c,D),n+=Math.imul(m,N),q+=Math.imul(m,D),Y+=Math.imul(l,U),n+=Math.imul(l,K),n+=Math.imul(d,U),q+=Math.imul(d,K),Y+=Math.imul(h,V),n+=Math.imul(h,z),n+=Math.imul(f,V),t=(q+=Math.imul(f,z))+(n>>>13)+((h=t+Y+((8191&n)<<13))>>>26),h&=67108863,Y=Math.imul(i,L),n=Math.imul(i,C),n+=Math.imul(E,L),q=Math.imul(E,C),Y+=Math.imul(w,T),n+=Math.imul(w,j),n+=Math.imul(M,T),q+=Math.imul(M,j),Y+=Math.imul(b,F),n+=Math.imul(b,R),n+=Math.imul(v,F),q+=Math.imul(v,R),Y+=Math.imul(_,O),n+=Math.imul(_,P),n+=Math.imul(y,O),q+=Math.imul(y,P),Y+=Math.imul(p,N),n+=Math.imul(p,D),n+=Math.imul(g,N),q+=Math.imul(g,D),Y+=Math.imul(c,U),n+=Math.imul(c,K),n+=Math.imul(m,U),q+=Math.imul(m,K),Y+=Math.imul(l,V),n+=Math.imul(l,z),n+=Math.imul(d,V),t=(q+=Math.imul(d,z))+(n>>>13)+((l=t+Y+((8191&n)<<13))>>>26),l&=67108863,Y=Math.imul(i,T),n=Math.imul(i,j),n+=Math.imul(E,T),q=Math.imul(E,j),Y+=Math.imul(w,F),n+=Math.imul(w,R),n+=Math.imul(M,F),q+=Math.imul(M,R),Y+=Math.imul(b,O),n+=Math.imul(b,P),n+=Math.imul(v,O),q+=Math.imul(v,P),Y+=Math.imul(_,N),n+=Math.imul(_,D),n+=Math.imul(y,N),q+=Math.imul(y,D),Y+=Math.imul(p,U),n+=Math.imul(p,K),n+=Math.imul(g,U),q+=Math.imul(g,K),Y+=Math.imul(c,V),n+=Math.imul(c,z),n+=Math.imul(m,V),t=(q+=Math.imul(m,z))+(n>>>13)+((c=t+Y+((8191&n)<<13))>>>26),c&=67108863,Y=Math.imul(i,F),n=Math.imul(i,R),n+=Math.imul(E,F),q=Math.imul(E,R),Y+=Math.imul(w,O),n+=Math.imul(w,P),n+=Math.imul(M,O),q+=Math.imul(M,P),Y+=Math.imul(b,N),n+=Math.imul(b,D),n+=Math.imul(v,N),q+=Math.imul(v,D),Y+=Math.imul(_,U),n+=Math.imul(_,K),n+=Math.imul(y,U),q+=Math.imul(y,K),Y+=Math.imul(p,V),n+=Math.imul(p,z),n+=Math.imul(g,V),t=(q+=Math.imul(g,z))+(n>>>13)+((p=t+Y+((8191&n)<<13))>>>26),p&=67108863,Y=Math.imul(i,O),n=Math.imul(i,P),n+=Math.imul(E,O),q=Math.imul(E,P),Y+=Math.imul(w,N),n+=Math.imul(w,D),n+=Math.imul(M,N),q+=Math.imul(M,D),Y+=Math.imul(b,U),n+=Math.imul(b,K),n+=Math.imul(v,U),q+=Math.imul(v,K),Y+=Math.imul(_,V),n+=Math.imul(_,z),n+=Math.imul(y,V),t=(q+=Math.imul(y,z))+(n>>>13)+((_=t+Y+((8191&n)<<13))>>>26),_&=67108863,Y=Math.imul(i,N),n=Math.imul(i,D),n+=Math.imul(E,N),q=Math.imul(E,D),Y+=Math.imul(w,U),n+=Math.imul(w,K),n+=Math.imul(M,U),q+=Math.imul(M,K),Y+=Math.imul(b,V),n+=Math.imul(b,z),n+=Math.imul(v,V),t=(q+=Math.imul(v,z))+(n>>>13)+((b=t+Y+((8191&n)<<13))>>>26),b&=67108863,Y=Math.imul(i,U),n=Math.imul(i,K),n+=Math.imul(E,U),q=Math.imul(E,K),Y+=Math.imul(w,V),n+=Math.imul(w,z),n+=Math.imul(M,V),t=(q+=Math.imul(M,z))+(n>>>13)+((w=t+Y+((8191&n)<<13))>>>26),w&=67108863,Y=Math.imul(i,V),n=Math.imul(i,z),n+=Math.imul(E,V),t=(q=Math.imul(E,z))+(n>>>13)+((a=t+Y+((8191&n)<<13))>>>26),e[0]=$,e[1]=W,e[2]=Z,e[3]=G,e[4]=H,e[5]=J,e[6]=X,e[7]=Q,e[8]=tt,e[9]=o,e[10]=s,e[11]=h,e[12]=l,e[13]=c,e[14]=p,e[15]=_,e[16]=b,e[17]=w,e[18]=67108863&a,0!==t&&(e[19]=t,r.length++),r}},{}],45:[function(t,e,r){function a(t,e,r){null===t&&null===e&&null===r?(this.y=this.x=a.one,this.z=a.zero):(this.x=t,this.y=e,this.z=r),this.zOne=this.z===a.one}t=t("./bn"),a.zero=t.fromNumber(0),a.one=t.fromNumber(1),a.prototype.neg=function(){return this.inf?this:new a(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r);if(e=this.y.redMul(e).redMul(t.z),r=t.y.redMul(r).redMul(this.z),n=i.redSub(n),r=e.redSub(r),n.isZero())return r.isZero()?this.dbl():new a(null,null,null);var s=n.redSqr(),o=i.redMul(s);return s=s.redMul(n),new a(i=r.redSqr().redIAdd(s).redISub(o).redISub(o),e=r.redMul(o.redISub(i)).redISub(e.redMul(s)),t=this.z.redMul(t.z).redMul(n))},a.prototype.mixedAdd=function(t){if(this.inf)return t.toECJPoint();if(t.inf)return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y;if(t=t.y.redMul(e).redMul(this.z),i=r.redSub(i),t=n.redSub(t),i.isZero())return t.isZero()?this.dbl():new a(null,null,null);var s=i.redSqr();return e=r.redMul(s),s=s.redMul(i),new a(r=t.redSqr().redIAdd(s).redISub(e).redISub(e),n=t.redMul(e.redISub(r)).redISub(n.redMul(s)),i=this.z.redMul(i))},a.prototype.dbl=function(){if(this.inf)return this;if(this.zOne){var t=this.x.redSqr(),e=this.y.redSqr(),r=e.redSqr();e=(e=this.x.redAdd(e).redSqr().redISub(t).redISub(r)).redIAdd(e);var i=(t=t.redAdd(t).redIAdd(t)).redSqr().redISub(e).redISub(e),n=r.redIAdd(r).redIAdd(r).redIAdd(r);r=i,e=t.redMul(e.redISub(i)).redISub(n),t=this.y.redAdd(this.y)}else t=this.x.redSqr(),r=(e=this.y.redSqr()).redSqr(),e=(e=this.x.redAdd(e).redSqr().redISub(t).redISub(r)).redIAdd(e),i=(t=t.redAdd(t).redIAdd(t)).redSqr(),n=r.redIAdd(r).redIAdd(r).redIAdd(r),r=i.redISub(e).redISub(e),e=t.redMul(e.redISub(r)).redISub(n),t=(t=this.y.redMul(this.z)).redIAdd(t);return new a(r,e,t)},a.prototype.dblp=function(t){if(0===t||this.inf)return this;for(var e=this,r=0;r>1]):e.mixedAdd(r[-n-1>>1].neg())}return s.fromECJPoint(e)},s.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},s.prototype._getNAFPoints=function(t){for(var e=Array((1<>1]:a<0&&(o=e[s][-a>>1].neg()),r=void 0===o.z?r.mixedAdd(o):r.add(o))}}return r},e.exports=new i},{"./bn":43,"./ecjpoint":45,"./ecpoint":46,"safe-buffer":42}],48:[function(t,e,i){var f=t("safe-buffer").Buffer,n=t("create-hash"),c=t("drbg.js/hmac"),d=t("../messages.json"),p=t("./bn"),o=t("./ecpoint"),m=t("./ecpointg");i.privateKeyVerify=function(t){return!((t=p.fromBuffer(t)).isOverflow()||t.isZero())},i.privateKeyExport=function(t,e){var r=p.fromBuffer(t);if(r.isOverflow()||r.isZero())throw Error(d.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return m.mul(r).toPublicKey(e)},i.privateKeyNegate=function(t){return(t=p.fromBuffer(t)).isZero()?f.alloc(32):(0>1){if(0<=s.ucmp(p.psn))break;s=n.add(p.n)}if(s=f.concat([f.from([2+(1&r)]),s.toBuffer()]),null!==(s=o.fromPublicKey(s)))return r=n.uinvm(),t=p.n.sub(p.fromBuffer(t)).umul(r).ureduce(),e=e.umul(r).ureduce(),o.fromECJPoint(m.mulAdd(t,s,e)).toPublicKey(i)}}while(0);throw Error(d.ECDSA_RECOVER_FAIL)},i.ecdh=function(t,e){var r=i.ecdhUnsafe(t,e,!0);return n("sha256").update(r).digest()},i.ecdhUnsafe=function(t,e,r){if(null===(t=o.fromPublicKey(t)))throw Error(d.EC_PUBLIC_KEY_PARSE_FAIL);if((e=p.fromBuffer(e)).isOverflow()||e.isZero())throw Error(d.ECDH_FAIL);return t.mul(e).toPublicKey(r)}},{"../messages.json":49,"./bn":43,"./ecpoint":46,"./ecpointg":47,"create-hash":32,"drbg.js/hmac":36,"safe-buffer":42}],49:[function(t,e,r){e.exports={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:"scalar was invalid (zero or overflow)",ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer",ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature",ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature",ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format",ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid",ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",MSG32_TYPE_INVALID:"message should be a Buffer",MSG32_LENGTH_INVALID:"message length is invalid",OPTIONS_TYPE_INVALID:"options should be an Object",OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer",OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function",RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4",TWEAK_TYPE_INVALID:"tweak should be a Buffer",TWEAK_LENGTH_INVALID:"tweak length is invalid"}},{}],50:[function(t,e,r){function i(t,e){this._block=l.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}var l=t("safe-buffer").Buffer;i.prototype.update=function(t,e){"string"==typeof t&&(t=l.from(t,e||"utf8"));for(var r=this._block,i=this._blockSize,n=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0)),(e=8*this._len)<=4294967295)this._block.writeUInt32BE(e,this._blockSize-4);else{var r=(4294967295&e)>>>0;this._block.writeUInt32BE((e-r)/4294967296,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}return this._update(this._block),e=this._hash(),t?e.toString(t):e},i.prototype._update=function(){throw Error("_update must be implemented by subclass")},e.exports=i},{"safe-buffer":42}],51:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":52,"./sha1":53,"./sha224":54,"./sha256":55,"./sha384":56,"./sha512":57}],52:[function(t,e,r){function i(){this.init(),this._w=o,n.call(this,64,56)}r=t("inherits");var n=t("./hash"),s=t("safe-buffer").Buffer,h=[1518500249,1859775393,-1894007588,-899497514],o=Array(80);r(i,n),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,n=0|this._c,s=0|this._d,o=0|this._e,a=0;a<16;++a)e[a]=t.readInt32BE(4*a);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(t=0;t<80;++t){a=(r<<5|r>>>27)+(0===(a=~~(t/20))?i&n|~i&s:2===a?i&n|i&s|n&s:i^n^s)+o+e[t]+h[a]|0,o=s,s=n,n=i<<30|i>>>2,i=r,r=a}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},i.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=i},{"./hash":50,inherits:39,"safe-buffer":42}],53:[function(t,e,r){function i(){this.init(),this._w=o,n.call(this,64,56)}r=t("inherits");var n=t("./hash"),s=t("safe-buffer").Buffer,h=[1518500249,1859775393,-1894007588,-899497514],o=Array(80);r(i,n),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,n=0|this._c,s=0|this._d,o=0|this._e,a=0;a<16;++a)e[a]=t.readInt32BE(4*a);for(;a<80;++a)t=e[a-3]^e[a-8]^e[a-14]^e[a-16],e[a]=t<<1|t>>>31;for(a=0;a<80;++a){t=(r<<5|r>>>27)+(0===(t=~~(a/20))?i&n|~i&s:2===t?i&n|i&s|n&s:i^n^s)+o+e[a]+h[t]|0,o=s,s=n,n=i<<30|i>>>2,i=r,r=t}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},i.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=i},{"./hash":50,inherits:39,"safe-buffer":42}],54:[function(t,e,r){function i(){this.init(),this._w=a,s.call(this,64,56)}r=t("inherits");var n=t("./sha256"),s=t("./hash"),o=t("safe-buffer").Buffer,a=Array(64);r(i,n),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=i},{"./hash":50,"./sha256":55,inherits:39,"safe-buffer":42}],55:[function(t,e,r){function i(){this.init(),this._w=o,n.call(this,64,56)}r=t("inherits");var n=t("./hash"),s=t("safe-buffer").Buffer,c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=Array(64);r(i,n),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,n=0|this._c,s=0|this._d,o=0|this._e,a=0|this._f,h=0|this._g,u=0|this._h,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<64;++l){t=e[l-2];var f=e[l-15];e[l]=((t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+e[l-7]+((f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3)+e[l-16]|0}for(l=0;l<64;++l)t=u+((o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7))+(h^o&(a^h))+c[l]+e[l]|0,f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i|n&(r|i))|0,u=h,h=a,a=o,o=s+t|0,s=n,n=i,i=r,r=t+f|0;this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=h+this._g|0,this._h=u+this._h|0},i.prototype._hash=function(){var t=s.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=i},{"./hash":50,inherits:39,"safe-buffer":42}],56:[function(t,e,r){function i(){this.init(),this._w=a,s.call(this,128,112)}r=t("inherits");var n=t("./sha512"),s=t("./hash"),o=t("safe-buffer").Buffer,a=Array(160);r(i,n),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){function t(t,e,r){i.writeInt32BE(t,r),i.writeInt32BE(e,r+4)}var i=o.allocUnsafe(48);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),i},e.exports=i},{"./hash":50,"./sha512":57,inherits:39,"safe-buffer":42}],57:[function(t,e,r){function i(){this.init(),this._w=o,n.call(this,128,112)}function k(t,e){return t>>>0>>0?1:0}r=t("inherits");var n=t("./hash"),s=t("safe-buffer").Buffer,T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=Array(160);r(i,n),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,s=0|this._dh,o=0|this._eh,a=0|this._fh,h=0|this._gh,u=0|this._hh,l=0|this._al,f=0|this._bl,c=0|this._cl,d=0|this._dl,p=0|this._el,m=0|this._fl,_=0|this._gl,g=0|this._hl,b=0;b<32;b+=2)e[b]=t.readInt32BE(4*b),e[b+1]=t.readInt32BE(4*b+4);for(;b<160;b+=2){t=e[b-30];var y=e[b-30+1],w=(t>>>1|y<<31)^(t>>>8|y<<24)^t>>>7,v=(y>>>1|t<<31)^(y>>>8|t<<24)^(y>>>7|t<<25),M=((t=e[b-4])>>>19|(y=e[b-4+1])<<13)^(y>>>29|t<<3)^t>>>6;y=(y>>>19|t<<13)^(t>>>29|y<<3)^(y>>>6|t<<26);var E=e[b-32],S=e[b-32+1];t=v+e[b-14+1]|0,w=(w=(w=w+e[b-14]+k(t,v)|0)+M+k(t=t+y|0,y)|0)+E+k(t=t+S|0,S)|0,e[b]=w,e[b+1]=t}for(b=0;b<160;b+=2){w=e[b],t=e[b+1],y=r&i|n&(r|i);var I=l&f|c&(l|f);E=(r>>>28|l<<4)^(l>>>2|r<<30)^(l>>>7|r<<25),S=(l>>>28|r<<4)^(r>>>2|l<<30)^(r>>>7|l<<25);var A=T[b],B=T[b+1],x=h^o&(a^h),L=_^p&(m^_);v=(v=(v=(v=u+((o>>>14|p<<18)^(o>>>18|p<<14)^(p>>>9|o<<23))+k(M=g+((p>>>14|o<<18)^(p>>>18|o<<14)^(o>>>9|p<<23))|0,g)|0)+x+k(M=M+L|0,L)|0)+A+k(M=M+B|0,B)|0)+w+k(M=M+t|0,t)|0,w=E+y+k(t=S+I|0,S)|0,u=h,g=_,h=a,_=m,a=o,m=p,o=s+v+k(p=d+M|0,d)|0,s=n,d=c,n=i,c=f,i=r,f=l,r=v+w+k(l=M+t|0,M)|0}this._al=this._al+l|0,this._bl=this._bl+f|0,this._cl=this._cl+c|0,this._dl=this._dl+d|0,this._el=this._el+p|0,this._fl=this._fl+m|0,this._gl=this._gl+_|0,this._hl=this._hl+g|0,this._ah=this._ah+r+k(this._al,l)|0,this._bh=this._bh+i+k(this._bl,f)|0,this._ch=this._ch+n+k(this._cl,c)|0,this._dh=this._dh+s+k(this._dl,d)|0,this._eh=this._eh+o+k(this._el,p)|0,this._fh=this._fh+a+k(this._fl,m)|0,this._gh=this._gh+h+k(this._gl,_)|0,this._hh=this._hh+u+k(this._hl,g)|0},i.prototype._hash=function(){function t(t,e,r){i.writeInt32BE(t,r),i.writeInt32BE(e,r+4)}var i=s.allocUnsafe(64);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),i},e.exports=i},{"./hash":50,inherits:39,"safe-buffer":42}]},{},[30]); \ No newline at end of file diff --git a/src/HTML/JS/terahashlib.js b/src/HTML/JS/terahashlib.js index e4f2c09..1904d1d 100644 --- a/src/HTML/JS/terahashlib.js +++ b/src/HTML/JS/terahashlib.js @@ -12,7 +12,8 @@ var DELTA_LONG_MINING = 5000; var BLOCKNUM_ALGO2 = 6560000; var BLOCKNUM_HASH_NEW = 10195000; var BLOCKNUM_TICKET_ALGO = 16070000; -if (typeof global === "object") { +if(typeof global === "object") +{ global.GetHashFromSeqAddr = GetHashFromSeqAddr; global.CalcHashBlockFromSeqAddr = CalcHashBlockFromSeqAddr; global.GetHashFromNum2 = GetHashFromNum2; @@ -20,23 +21,28 @@ if (typeof global === "object") { global.GetHashFromArrNum2 = GetHashFromArrNum2; global.XORArr = XORArr; global.GetHash = GetHash; - if (global.LOCAL_RUN || global.TEST_NETWORK) { + if(global.LOCAL_RUN || global.TEST_NETWORK) + { BLOCKNUM_ALGO2 = 0; - if (global.TEST_NETWORK) { + if(global.TEST_NETWORK) + { BLOCKNUM_HASH_NEW = 100; BLOCKNUM_TICKET_ALGO = 0; } - else { + else + { BLOCKNUM_HASH_NEW = 100; BLOCKNUM_TICKET_ALGO = 0; } } } -function GetHashFromSeqAddr(SeqHash, AddrHash, BlockNum, PrevHash, MiningVer) { - if (BlockNum < BLOCKNUM_ALGO2) { +function GetHashFromSeqAddr(SeqHash,AddrHash,BlockNum,PrevHash,MiningVer) +{ + if(BlockNum < BLOCKNUM_ALGO2) + { var Hash = shaarrblock2(SeqHash, AddrHash, BlockNum); - return { Hash: Hash, PowHash: Hash, Hash1: Hash, Hash2: Hash }; + return {Hash:Hash, PowHash:Hash, Hash1:Hash, Hash2:Hash}; } var MinerID = ReadUintFromArr(AddrHash, 0); var Nonce0 = ReadUintFromArr(AddrHash, 6); @@ -45,26 +51,31 @@ function GetHashFromSeqAddr(SeqHash, AddrHash, BlockNum, PrevHash, MiningVer) { var DeltaNum1 = ReadUint16FromArr(AddrHash, 24); var DeltaNum2 = ReadUint16FromArr(AddrHash, 26); var PrevHashNum; - if (PrevHash) { + if(PrevHash) + { PrevHashNum = ReadUint32FromArr(PrevHash, 28); } - else { + else + { PrevHashNum = ReadUint32FromArr(AddrHash, 28); } var Data = GetHash(SeqHash, PrevHashNum, BlockNum, MinerID, Nonce0, Nonce1, Nonce2, DeltaNum1, DeltaNum2); - if (MiningVer) { - if (AddrHash[17] !== MiningVer || AddrHash[23] !== MiningVer) { + if(MiningVer) + { + if(AddrHash[17] !== MiningVer || AddrHash[23] !== MiningVer) + { Data.PowHash = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]; + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]; } } return Data; }; -function GetHash(BlockHash, PrevHashNum, BlockNum, Miner, Nonce0, Nonce1, Nonce2, DeltaNum1, DeltaNum2) { - if (DeltaNum1 > DELTA_LONG_MINING) +function GetHash(BlockHash,PrevHashNum,BlockNum,Miner,Nonce0,Nonce1,Nonce2,DeltaNum1,DeltaNum2) +{ + if(DeltaNum1 > DELTA_LONG_MINING) DeltaNum1 = 0; - if (DeltaNum2 > DELTA_LONG_MINING) + if(DeltaNum2 > DELTA_LONG_MINING) DeltaNum2 = 0; var HashBase = GetHashFromNum2(BlockNum, PrevHashNum); var HashCurrent = GetHashFromArrNum2(BlockHash, Miner, Nonce0); @@ -72,15 +83,18 @@ function GetHash(BlockHash, PrevHashNum, BlockNum, Miner, Nonce0, Nonce1, Nonce2 var HashNonce2 = GetHashFromNum3(BlockNum - DeltaNum2, Miner, Nonce2); var Hash1 = XORArr(HashBase, HashNonce1); var Hash2 = XORArr(HashCurrent, HashNonce2); - var Ret = { Hash: Hash2, Hash1: Hash1, Hash2: Hash2 }; - if (CompareArr(Hash1, Hash2) > 0) { + var Ret = {Hash:Hash2, Hash1:Hash1, Hash2:Hash2}; + if(CompareArr(Hash1, Hash2) > 0) + { Ret.PowHash = Hash1; } - else { + else + { Ret.PowHash = Hash2; } - if (BlockNum >= BLOCKNUM_HASH_NEW) { - if (BlockNum >= BLOCKNUM_TICKET_ALGO) + if(BlockNum >= BLOCKNUM_HASH_NEW) + { + if(BlockNum >= BLOCKNUM_TICKET_ALGO) Ret.Hash = sha3arr2(Hash1, Hash2); else Ret.Hash = shaarr2(Hash1, Hash2); @@ -88,37 +102,43 @@ function GetHash(BlockHash, PrevHashNum, BlockNum, Miner, Nonce0, Nonce1, Nonce2 return Ret; }; -function CalcHashBlockFromSeqAddr(Block, PrevHash, MiningVer) { +function CalcHashBlockFromSeqAddr(Block,PrevHash,MiningVer) +{ var Value = GetHashFromSeqAddr(Block.SeqHash, Block.AddrHash, Block.BlockNum, PrevHash, MiningVer); Block.Hash = Value.Hash; Block.PowHash = Value.PowHash; }; -function XORArr(Arr1, Arr2) { +function XORArr(Arr1,Arr2) +{ var Ret = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - for (var i = 0; i < 32; i++) { + for(var i = 0; i < 32; i++) + { Ret[i] = Arr1[i] ^ Arr2[i]; } return Ret; }; -function GetHashFromNum2(Value1, Value2) { +function GetHashFromNum2(Value1,Value2) +{ var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; WriteUintToArrOnPos(MeshArr, Value1, 0); WriteUintToArrOnPos(MeshArr, Value2, 6); return sha3(MeshArr); }; -function GetHashFromArrNum2(Arr, Value1, Value2) { +function GetHashFromArrNum2(Arr,Value1,Value2) +{ var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0]; + 0, 0, 0, 0, 0, 0, 0, 0]; WriteArrToArrOnPos(MeshArr, Arr, 0, 32); WriteUintToArrOnPos(MeshArr, Value1, 32); WriteUintToArrOnPos(MeshArr, Value2, 38); return sha3(MeshArr); }; -function GetHashFromNum3(Value1, Value2, Value3) { +function GetHashFromNum3(Value1,Value2,Value3) +{ var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; WriteUintToArrOnPos(MeshArr, Value1, 0); WriteUintToArrOnPos(MeshArr, Value2, 6); @@ -126,8 +146,10 @@ function GetHashFromNum3(Value1, Value2, Value3) { return sha3(MeshArr); }; -function ReadUintFromArr(arr, len) { - if (len === undefined) { +function ReadUintFromArr(arr,len) +{ + if(len === undefined) + { len = arr.len; arr.len += 6; } @@ -137,8 +159,10 @@ function ReadUintFromArr(arr, len) { return value; }; -function ReadUint32FromArr(arr, len) { - if (len === undefined) { +function ReadUint32FromArr(arr,len) +{ + if(len === undefined) + { len = arr.len; arr.len += 4; } @@ -146,8 +170,10 @@ function ReadUint32FromArr(arr, len) { return value; }; -function ReadUint16FromArr(arr, len) { - if (len === undefined) { +function ReadUint16FromArr(arr,len) +{ + if(len === undefined) + { len = arr.len; arr.len += 2; } @@ -155,17 +181,20 @@ function ReadUint16FromArr(arr, len) { return value; }; -function ReadArrFromArr(arr, length) { +function ReadArrFromArr(arr,length) +{ var Ret = []; var len = arr.len; - for (var i = 0; i < length; i++) { + for(var i = 0; i < length; i++) + { Ret[i] = arr[len + i]; } arr.len += length; return Ret; }; -function WriteUintToArr(arr, Num) { +function WriteUintToArr(arr,Num) +{ var len = arr.length; arr[len] = Num & 0xFF; arr[len + 1] = (Num >>> 8) & 0xFF; @@ -176,7 +205,8 @@ function WriteUintToArr(arr, Num) { arr[len + 5] = (NumH >>> 8) & 0xFF; }; -function WriteUintToArrOnPos(arr, Num, Pos) { +function WriteUintToArrOnPos(arr,Num,Pos) +{ arr[Pos] = Num & 0xFF; arr[Pos + 1] = (Num >>> 8) & 0xFF; arr[Pos + 2] = (Num >>> 16) & 0xFF; @@ -186,7 +216,8 @@ function WriteUintToArrOnPos(arr, Num, Pos) { arr[Pos + 5] = (NumH >>> 8) & 0xFF; }; -function WriteUint32ToArr(arr, Num) { +function WriteUint32ToArr(arr,Num) +{ var len = arr.length; arr[len] = Num & 0xFF; arr[len + 1] = (Num >>> 8) & 0xFF; @@ -194,124 +225,148 @@ function WriteUint32ToArr(arr, Num) { arr[len + 3] = (Num >>> 24) & 0xFF; }; -function WriteUint32ToArrOnPos(arr, Num, Pos) { +function WriteUint32ToArrOnPos(arr,Num,Pos) +{ arr[Pos] = Num & 0xFF; arr[Pos + 1] = (Num >>> 8) & 0xFF; arr[Pos + 2] = (Num >>> 16) & 0xFF; arr[Pos + 3] = (Num >>> 24) & 0xFF; }; -function WriteUint16ToArrOnPos(arr, Num, Pos) { +function WriteUint16ToArrOnPos(arr,Num,Pos) +{ arr[Pos] = Num & 0xFF; arr[Pos + 1] = (Num >>> 8) & 0xFF; }; -function WriteArrToArr(arr, arr2, ConstLength) { +function WriteArrToArr(arr,arr2,ConstLength) +{ var len = arr.length; - for (var i = 0; i < ConstLength; i++) { + for(var i = 0; i < ConstLength; i++) + { arr[len + i] = arr2[i]; } }; -function WriteArrToArrOnPos(arr, arr2, Pos, ConstLength) { - for (var i = 0; i < ConstLength; i++) { +function WriteArrToArrOnPos(arr,arr2,Pos,ConstLength) +{ + for(var i = 0; i < ConstLength; i++) + { arr[Pos + i] = arr2[i]; } }; -function WriteArrToArrHOnPos(arr, arr2, Pos, ConstLength) { - for (var i = 0; i < ConstLength; i++) { +function WriteArrToArrHOnPos(arr,arr2,Pos,ConstLength) +{ + for(var i = 0; i < ConstLength; i++) + { arr[Pos + i] |= (arr2[i] << 8); } }; -function ConvertBufferToStr(Data) { - for (var key in Data) { +function ConvertBufferToStr(Data) +{ + for(var key in Data) + { var item = Data[key]; - if (item instanceof Buffer) { + if(item instanceof Buffer) + { Data[key] = GetHexFromArr(item); } else - if (typeof item === "object") + if(typeof item === "object") ConvertBufferToStr(item); } }; -function CopyObjValue(obj, num) { - if (num && num > 5) +function CopyObjValue(obj,num) +{ + if(num && num > 5) return obj; var ret = {}; - for (var key in obj) { + for(var key in obj) + { var val = obj[key]; - if ((typeof val === "object") && !(val instanceof Buffer) && !(val instanceof ArrayBuffer) && !(val instanceof Array)) + if((typeof val === "object") && !(val instanceof Buffer) && !(val instanceof ArrayBuffer) && !(val instanceof Array)) val = CopyObjValue(val, num + 1); ret[key] = val; } return ret; }; -function CopyArr(arr1) { +function CopyArr(arr1) +{ var arr2 = []; - if (arr1) - for (var i = 0; i < arr1.length; i++) + if(arr1) + for(var i = 0; i < arr1.length; i++) arr2[i] = arr1[i]; return arr2; }; -function ParseNum(a) { +function ParseNum(a) +{ var Num = parseInt(a); - if (!Num) + if(!Num) Num = 0; - if (isNaN(Num)) + if(isNaN(Num)) Num = 0; - if (Num < 0) + if(Num < 0) Num = 0; return Num; }; -function CompareArr(a, b) { - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) +function CompareArr(a,b) +{ + for(var i = 0; i < a.length; i++) + { + if(a[i] !== b[i]) return a[i] - b[i]; } return 0; }; -function CompareArrL(a, b) { - if (a.length !== b.length) +function CompareArrL(a,b) +{ + if(a.length !== b.length) return a.length - b.length; - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) + for(var i = 0; i < a.length; i++) + { + if(a[i] !== b[i]) return a[i] - b[i]; } return 0; }; -function GetSeqHash(BlockNum, PrevHash, TreeHash) { +function GetSeqHash(BlockNum,PrevHash,TreeHash) +{ var arr = [GetArrFromValue(BlockNum), PrevHash, TreeHash]; var SeqHash = CalcHashFromArray(arr, true); return SeqHash; }; -function arr2(Value1, Value2) { +function arr2(Value1,Value2) +{ var Buf = []; - for (var n = 0; n < Value1.length; n++) + for(var n = 0; n < Value1.length; n++) Buf.push(Value1[n]); - for (var n = 0; n < Value2.length; n++) + for(var n = 0; n < Value2.length; n++) Buf.push(Value2[n]); return Buf; }; -function shaarr2(Value1, Value2) { +function shaarr2(Value1,Value2) +{ return shaarr(arr2(Value1, Value2)); }; -function sha3arr2(Value1, Value2) { +function sha3arr2(Value1,Value2) +{ return sha3(arr2(Value1, Value2)); }; -function GetBlockArrFromBuffer(BufRead, Info) { - if (!BufRead || BufRead.length < 10) +function GetBlockArrFromBuffer(BufRead,Info) +{ + if(!BufRead || BufRead.length < 10) return []; var BLOCK_PROCESSING_LENGTH = 8; var BLOCK_PROCESSING_LENGTH2 = BLOCK_PROCESSING_LENGTH * 2; @@ -319,19 +374,24 @@ function GetBlockArrFromBuffer(BufRead, Info) { var StartNum = ReadUintFromArr(BufRead); var CountLoad = ReadUint32FromArr(BufRead); var BufSize = 6 + 4 + BLOCK_PROCESSING_LENGTH2 * 32 + 32 + 6 + CountLoad * 64; - if (CountLoad <= 0 || BufSize !== BufRead.length) { + if(CountLoad <= 0 || BufSize !== BufRead.length) + { return []; } var PrevBlock; var BlockArr = []; - for (var i = 0; i < CountLoad + BLOCK_PROCESSING_LENGTH2; i++) { + for(var i = 0; i < CountLoad + BLOCK_PROCESSING_LENGTH2; i++) + { var Block = {}; Block.BlockNum = StartNum + i; - if (i < BLOCK_PROCESSING_LENGTH2) { + if(i < BLOCK_PROCESSING_LENGTH2) + { Block.Hash = ReadArrFromArr(BufRead, 32); } - else { - if (i === BLOCK_PROCESSING_LENGTH2) { + else + { + if(i === BLOCK_PROCESSING_LENGTH2) + { Block.SumHash = ReadArrFromArr(BufRead, 32); Block.SumPow = ReadUintFromArr(BufRead); } @@ -339,7 +399,8 @@ function GetBlockArrFromBuffer(BufRead, Info) { Block.AddrHash = ReadArrFromArr(BufRead, 32); var arr = []; var start = i - BLOCK_PROCESSING_LENGTH2; - for (var n = 0; n < BLOCK_PROCESSING_LENGTH; n++) { + for(var n = 0; n < BLOCK_PROCESSING_LENGTH; n++) + { var Prev = BlockArr[start + n]; arr.push(Prev.Hash); } @@ -347,10 +408,12 @@ function GetBlockArrFromBuffer(BufRead, Info) { Block.SeqHash = GetSeqHash(Block.BlockNum, Block.PrevHash, Block.TreeHash); var PrevHashNum = ReadUint32FromArr(Block.PrevHash, 28); var PrevAddrNum = ReadUint32FromArr(Block.AddrHash, 28); - if (PrevHashNum !== PrevAddrNum && Block.BlockNum > 20000000) { - if (global.WATCHDOG_DEV) { + if(PrevHashNum !== PrevAddrNum && Block.BlockNum > 20000000) + { + if(global.WATCHDOG_DEV) + { var Str = ""; - if (Info && Info.Node) + if(Info && Info.Node) Str = " from " + NodeName(Info.Node); ToError("Error on block load: " + Block.BlockNum + Str); } @@ -358,7 +421,8 @@ function GetBlockArrFromBuffer(BufRead, Info) { } CalcHashBlockFromSeqAddr(Block, Block.PrevHash); Block.Power = GetPowPower(Block.PowHash); - if (PrevBlock) { + if(PrevBlock) + { Block.SumHash = shaarr2(PrevBlock.SumHash, Block.Hash); } PrevBlock = Block; @@ -368,9 +432,11 @@ function GetBlockArrFromBuffer(BufRead, Info) { Block.TrDataLen = 0; BlockArr.push(Block); } - for (var i = BlockArr.length - 1; i >= 0; i--) { + for(var i = BlockArr.length - 1; i >= 0; i--) + { var Block = BlockArr[i]; - if (!Block.SumHash) { + if(!Block.SumHash) + { BlockArr = BlockArr.slice(i + 1); break; } @@ -378,10 +444,12 @@ function GetBlockArrFromBuffer(BufRead, Info) { return BlockArr; }; -function shaarrblock2(Value1, Value2, BlockNum) { +function shaarrblock2(Value1,Value2,BlockNum) +{ return shaarrblock(arr2(Value1, Value2), BlockNum); }; -if (typeof global === "object") { +if(typeof global === "object") +{ global.ReadUint32FromArr = ReadUint32FromArr; global.ReadUintFromArr = ReadUintFromArr; global.ReadUint16FromArr = ReadUint16FromArr; @@ -406,6 +474,7 @@ if (typeof global === "object") { global.shaarrblock2 = shaarrblock2; } else - if (typeof window === "object") { + if(typeof window === "object") + { global = window; } diff --git a/src/HTML/JS/wallet-lib.js b/src/HTML/JS/wallet-lib.js index d870cd5..099dc74 100644 --- a/src/HTML/JS/wallet-lib.js +++ b/src/HTML/JS/wallet-lib.js @@ -19,56 +19,65 @@ var MaxBlockNum = 0; var DelList = {}; var WasAccountsDataStr; -function SetAccountsData(Data, AccountsDataStr) { - if (!Data || !Data.result) - return; - if ($("idBtRun")) +function SetAccountsData(Data,AccountsDataStr) +{ + if(!Data || !Data.result) + return ; + if($("idBtRun")) $("idBtRun").style.display = (Data.arr.length ? '' : 'none'); - if (AccountsDataStr === WasAccountsDataStr) - return; + if(AccountsDataStr === WasAccountsDataStr) + return ; WasAccountsDataStr = AccountsDataStr; var arr = Data.arr; var Select = $("idAccount"); - if (arr.length !== Select.options.length) { + if(arr.length !== Select.options.length) + { var options = Select.options; options.length = arr.length; } MaxBlockNum = GetCurrentBlockNumByTime(); SetGridData(arr, "grid_accounts", "idMyTotalSum"); - for (var i = 0; arr && i < arr.length; i++) { + for(var i = 0; arr && i < arr.length; i++) + { var Item = arr[i]; Item.MyAccount = true; var Num = ParseNum(Item.Num); - if (!MapAccounts[Num]) + if(!MapAccounts[Num]) MapAccounts[Num] = {}; CopyObjKeys(MapAccounts[Num], Item); var option = Select.options[i]; var StrText = GetAccountText(Item, Num, 1); - if (option.text !== StrText) + if(option.text !== StrText) CheckNameAccTo(); option.value = Num; option.text = StrText; } var CurentValue = LoadMapAfter["idAccount"]; - if (CurentValue) { + if(CurentValue) + { Select.value = CurentValue; delete LoadMapAfter["idAccount"]; } SetCurCurencyName(); }; -function CurTransactionToForm(bForce) { +function CurTransactionToForm(bForce) +{ var Item = $("idTransaction"); - if (Item && (Item.className === "" || bForce)) + if(Item && (Item.className === "" || bForce)) Item.value = GetJSONFromTransaction(CurrentTR); }; -function CheckNameAccTo() { +function CheckNameAccTo() +{ MaxBlockNum = GetCurrentBlockNumByTime(); var ToID = ParseNum($("idTo").value); - if (!MapAccounts[ToID] || (MapAccounts[ToID].MustUpdate && MapAccounts[ToID].MustUpdate >= MaxBlockNum)) { - GetData("GetAccountList", { StartNum: ToID }, function(Data) { - if (Data && Data.result === 1 && Data.arr.length) { + if(!MapAccounts[ToID] || (MapAccounts[ToID].MustUpdate && MapAccounts[ToID].MustUpdate >= MaxBlockNum)) + { + GetData("GetAccountList", {StartNum:ToID}, function (Data) + { + if(Data && Data.result === 1 && Data.arr.length) + { var Item = Data.arr[0]; Item.UpdateData = Date.now(); MapAccounts[Item.Num] = Item; @@ -79,173 +88,215 @@ function CheckNameAccTo() { SetNameAccTo(); }; -function SetNameAccTo() { +function SetNameAccTo() +{ var Str = ""; - var ToID = ParseNum($("idTo").value); + var ToID = $("idTo").value.trim(); var Item = MapAccounts[ToID]; - var element = $("idNameTo"); var StrTo = GetAccountText(Item, ToID, 1); - if (!element) { + var element = $("idNameTo"); + if(!element) + { element = $("idNameTo2"); } - else { + else + { StrTo = "To: " + StrTo; } - if (element.innerText !== StrTo) { + if(!ToID || ToID === "0") + { + element.innerText = ""; + return ; + } + if(element && element.innerText !== StrTo) + { element.innerText = StrTo; - if (Item && Item.MyAccount) + if(Item && Item.MyAccount) element.className = "smallbold"; else element.className = ""; } }; -function GetAccountText(Item, Num, bGetSum) { - if (Item) { +function GetAccountText(Item,Num,bGetSum) +{ + if(Item) + { var text = Item.Name; - if (!text || text.length === 0) + if(!text || text.length === 0) text = Num; else text = "" + Num + ". " + text; - if (bGetSum) { + if(bGetSum) + { var StrSum = SUM_TO_STRING(Item.Value, Item.Currency); text += " (" + StrSum + ")"; } return text; } - else { - return Num; + else + { + if(IsPublicAddr(Num)) + return Num; + else + return ""; } }; -function OnEditIdTo() { +function OnEditIdTo() +{ CheckNameAccTo(); OnEditTransactionFields(); }; -function OnEditTransactionFields() { - if (IsVisibleBlock("edit_transaction")) +function OnEditTransactionFields() +{ + if(IsVisibleBlock("edit_transaction")) CreateTransaction(); SetCurCurencyName(); SaveValues(); }; -function SetCurCurencyName() { +function SetCurCurencyName() +{ var idCoin = $("idCoinName"); - if (!idCoin) - return; + if(!idCoin) + return ; var Num = ParseNum($("idAccount").value); var Item = MapAccounts[Num]; - if (Item) { + if(Item) + { idCoin.innerText = CurrencyName(Item.Currency); } }; -function CreateTransaction(F, CheckErr, Run) { +function IsPublicAddr(StrTo) +{ + if(StrTo.length === 66 && (StrTo.substr(0, 2) === "02" || StrTo.substr(0, 2) === "03") && IsHexStr(StrTo)) + return 1; + else + return 0; +}; + +function CreateTransaction(F,CheckErr,Run) +{ CheckNameAccTo(); CheckSending(); var FromID = ParseNum($("idAccount").value); - if (CheckErr && FromID === 0) { + if(CheckErr && FromID === 0) + { SetError("Select valid 'From account'"); - return; + return ; } var StrTo = $("idTo").value.trim(); var bFindAcc = 0; var ToPubKey = ""; var ToID = ParseNum(StrTo); - if (StrTo !== "" + ToID) { - if (StrTo.length === 66 && (StrTo.substr(0, 2) === "02" || StrTo.substr(0, 2) === "03") && IsHexStr(StrTo)) { + if(StrTo !== "" + ToID) + { + if(IsPublicAddr(StrTo)) + { ToID = 0; ToPubKey = StrTo; - if (ToPubKey === PubKeyStr) + if(ToPubKey === window.PubKeyStr) bFindAcc = 1; } - else { - if (CheckErr) + else + { + if(CheckErr) SetError("Valid 'Pay to' - required!"); - return; + return ; } } - if (CheckErr && ToID <= 0 && ToPubKey === "" && !AttachItem) { + if(CheckErr && ToID <= 0 && ToPubKey === "" && !AttachItem) + { SetError("Valid 'Pay to' - required!"); - return; + return ; } var Description = $("idDescription").value.substr(0, 200); var StrSum = $("idSumSend").value; var indDot = StrSum.indexOf("."); - if (indDot >= 0) { + if(indDot >= 0) + { var StrTER = StrSum.substr(0, indDot); var StrCENT = StrSum.substr(indDot + 1); } - else { + else + { var StrTER = StrSum; var StrCENT = "0"; } StrCENT = StrCENT + "000000000"; - var Coin = { SumCOIN: ParseNum(StrTER), SumCENT: ParseNum(StrCENT.substr(0, 9)) }; + var Coin = {SumCOIN:ParseNum(StrTER), SumCENT:ParseNum(StrCENT.substr(0, 9))}; var OperationID = 0; var Item = MapAccounts[FromID]; - if (Item) { + if(Item) + { OperationID = Item.Value.OperationID; } var AttachBody = []; - if (AttachItem) { + if(AttachItem) + { AttachBody = AttachItem.Data.Body; - if (!AttachBody) + if(!AttachBody) AttachBody = []; } var ToPubKeyArr = []; - if (ToPubKey) + if(ToPubKey) ToPubKeyArr = GetArrFromHex(ToPubKey); - var TR = { - Type: 111, Version: 3, Reserve: 0, FromID: FromID, OperationID: OperationID, To: [{ - PubKey: ToPubKeyArr, ID: ToID, SumCOIN: Coin.SumCOIN, - SumCENT: Coin.SumCENT - }], Description: Description, Body: AttachBody, Sign: CurrentTR.Sign, - }; - Object.defineProperties(TR, { bFindAcc: { configurable: true, writable: true, enumerable: false, value: bFindAcc } }); - Object.defineProperties(TR, { Run: { configurable: true, writable: true, enumerable: false, value: Run } }); - if (JSON.stringify(TR) === JSON.stringify(CurrentTR)) { - if (F) + var TR = {Type:111, Version:3, Reserve:0, FromID:FromID, OperationID:OperationID, To:[{PubKey:ToPubKeyArr, ID:ToID, SumCOIN:Coin.SumCOIN, + SumCENT:Coin.SumCENT}], Description:Description, Body:AttachBody, Sign:CurrentTR.Sign, }; + Object.defineProperties(TR, {bFindAcc:{configurable:true, writable:true, enumerable:false, value:bFindAcc}}); + Object.defineProperties(TR, {Run:{configurable:true, writable:true, enumerable:false, value:Run}}); + if(JSON.stringify(TR) === JSON.stringify(CurrentTR)) + { + if(F) F(CurrentTR); - return; + return ; } CurrentTR = TR; - GetSignTransaction(TR, "", function(TR) { + GetSignTransaction(TR, "", function (TR) + { CurTransactionToForm(true); - if (F) + if(F) F(TR); }); }; -function SignJSON(F) { - if ($("idSignJSON").disabled) - return; +function SignJSON(F) +{ + if($("idSignJSON").disabled) + return ; var TR = GetTransactionFromJSON(); - if (!TR) - return; + if(!TR) + return ; CurrentTR = TR; - GetSignTransaction(TR, "", function(TR) { + GetSignTransaction(TR, "", function (TR) + { CurTransactionToForm(true); - if (F) + if(F) F(); }); }; -function CheckSending(bToStatus) { +function CheckSending(bToStatus) +{ MaxBlockNum = GetCurrentBlockNumByTime(); var CanSend = IsPrivateMode(); var StrButton = "Send"; var StrButtonSign = "Sign JSON"; - if (!CanSend) { + if(!CanSend) + { StrButton = " "; StrButtonSign = " "; } - if (CanSend) { + if(CanSend) + { var FromID = ParseNum($("idAccount").value); var Item = MapAccounts[FromID]; - if (Item && Item.NextSendTime && Item.NextSendTime > MaxBlockNum) { - if (bToStatus) + if(Item && Item.NextSendTime && Item.NextSendTime > MaxBlockNum) + { + if(bToStatus) SetStatus("Transaction was sending. Wait... (" + Item.LastTransactionText + ")"); CanSend = false; StrButton = "Wait..."; @@ -258,26 +309,31 @@ function CheckSending(bToStatus) { return CanSend; }; -function AddWhiteList() { +function AddWhiteList() +{ var ToID = ParseNum($("idTo").value); - if (ToID && $("idWhiteOnSend").checked) + if(ToID && $("idWhiteOnSend").checked) Storage.setItem("White:" + ToID, 1); }; -function SendMoneyBefore() { - if ($("idSendButton").disabled) - return; +function SendMoneyBefore() +{ + if($("idSendButton").disabled) + return ; var ToID = ParseNum($("idTo").value); var Item = MapAccounts[ToID]; - if (Storage.getItem("White:" + ToID) || !$("idSumSend").value || Item && Item.MyAccount) { + if(Storage.getItem("White:" + ToID) || !$("idSumSend").value || Item && Item.MyAccount) + { SendMoney(); } - else { + else + { var CoinAmount = COIN_FROM_FLOAT($("idSumSend").value); var StrTo = " to " + GetAccountText(Item, ToID); $("idWhiteOnSend").checked = 0; $("idOnSendText").innerHTML = "" + STRING_FROM_COIN(CoinAmount) + " " + $("idCoinName").innerText + StrTo; - if ($("idSumSend").value >= 100000) { + if($("idSumSend").value >= 100000) + { $("idOnSendText").innerHTML += "
    WARNING: You are about to send a very large amount!
    "; } SetVisibleBlock("idBlockOnSend", 1); @@ -285,26 +341,31 @@ function SendMoneyBefore() { } }; -function SendMoney2() { +function SendMoney2() +{ AddWhiteList(); SendMoney(); }; -function SendMoney() { - if (!CanSendTransaction) { +function SendMoney() +{ + if(!CanSendTransaction) + { SetError("Can't Send transaction"); - return; + return ; } CheckSending(true); - if ($("idSendButton").disabled) - return; + if($("idSendButton").disabled) + return ; SetVisibleBlock("idBlockOnSend", 0); CreateTransaction(SendMoneyTR, true, ClearAttach); }; -function GetJSONFromTransaction(TR) { +function GetJSONFromTransaction(TR) +{ var TR2 = JSON.parse(JSON.stringify(TR)); - for (var i = 0; i < TR2.To.length; i++) { + for(var i = 0; i < TR2.To.length; i++) + { var Item = TR2.To[i]; Item.PubKey = GetHexFromArr(Item.PubKey); } @@ -314,19 +375,24 @@ function GetJSONFromTransaction(TR) { return Str; }; -function GetTransactionFromJSON() { +function GetTransactionFromJSON() +{ var Str = $("idTransaction").value; - try { + try + { var TR = JSON.parse(Str); } - catch (e) { + catch(e) + { SetError(e); return undefined; } - for (var i = 0; i < TR.To.length; i++) { + for(var i = 0; i < TR.To.length; i++) + { var Item = TR.To[i]; Item.PubKey = GetArrFromHex(Item.PubKey); - if (Item.SumTER && Item.SumCOIN === undefined) { + if(Item.SumTER && Item.SumCOIN === undefined) + { Item.SumCOIN = Item.SumTER; delete Item.SumTER; } @@ -336,58 +402,68 @@ function GetTransactionFromJSON() { return TR; }; -function SendMoneyJSON() { - if (!CanSendTransaction) { +function SendMoneyJSON() +{ + if(!CanSendTransaction) + { SetError("Can't Send transaction"); - return; + return ; } var TR = GetTransactionFromJSON(); - if (!TR) - return; + if(!TR) + return ; SendMoneyTR(TR); }; -function SignAndSendFromJSON() { +function SignAndSendFromJSON() +{ SignJSON(SendMoneyJSON); }; -function GetTransactionText(TR, key) { +function GetTransactionText(TR,key) +{ var Str; - if (TR) { - if (TR.Type === TYPE_TRANSACTION_CREATE) { + if(TR) + { + if(TR.Type === TYPE_TRANSACTION_CREATE) + { Str = "New account " + TR.Name.substr(0, 20); } else - if (TR.Type === 111) { + if(TR.Type === 111) + { var MapItem = {}; - var ValueTotal = { SumCOIN: 0, SumCENT: 0 }; + var ValueTotal = {SumCOIN:0, SumCENT:0}; Str = "" + TR.FromID + "/" + TR.OperationID + " to "; - for (var i = 0; i < TR.To.length; i++) { + for(var i = 0; i < TR.To.length; i++) + { var Item = TR.To[i]; - if (Item.ID === TR.FromID || MapItem[Item.ID]) + if(Item.ID === TR.FromID || MapItem[Item.ID]) continue; MapItem[Item.ID] = 1; ADD(ValueTotal, Item); - if (i === 0) + if(i === 0) Str += "["; - if (Str.length < 16) { - if (i > 0) + if(Str.length < 16) + { + if(i > 0) Str += ","; - if (Item.ID || (Item.PubKey && Item.PubKey.length !== 66)) + if(Item.ID || (Item.PubKey && Item.PubKey.length !== 66)) Str += Item.ID; else Str += GetHexFromArr(Item.PubKey).substr(0, 8); } else - if (Str.substr(Str.length - 1) !== ".") + if(Str.substr(Str.length - 1) !== ".") Str += "..."; } Str += "] " + SUM_TO_STRING(ValueTotal); Str += " " + (TR.Description.substr(0, 20)).replace(/\n/g, ""); } } - else { - if (key) + else + { + if(key) Str = key; else Str = ""; @@ -395,15 +471,18 @@ function GetTransactionText(TR, key) { return Str; }; -function SendMoneyTR(TR) { +function SendMoneyTR(TR) +{ var Body = GetArrFromTR(TR); WriteArr(Body, TR.Sign, 64); Body.length += 12; - SendTransaction(Body, TR, undefined, function(Err, TR, Body) { - if (Err) - return; + SendTransaction(Body, TR, undefined, function (Err,TR,Body) + { + if(Err) + return ; var Item = MapAccounts[TR.FromID]; - if (Item) { + if(Item) + { var key = GetHexFromArr(sha3(Body)); var BlockNum = GetCurrentBlockNumByTime(); Item.LastTransactionText = GetTransactionText(TR); @@ -414,31 +493,37 @@ function SendMoneyTR(TR) { }); }; -function ClearTransaction() { +function ClearTransaction() +{ PayList = []; ClearAttach(); CheckSendList(1); var arr = ["idAccount", "idTo", "idSumSend", "idDescription"]; - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { $(arr[i]).value = ""; } SaveValues(); CreateTransaction(); }; -function StartEditTransactionJSON() { +function StartEditTransactionJSON() +{ var Item = $("idTransaction"); Item.className = "smallbold"; }; -function EditJSONTransaction() { +function EditJSONTransaction() +{ var name = "edit_transaction"; var Item = $("idTransaction"); - if (IsVisibleBlock(name)) { + if(IsVisibleBlock(name)) + { SetVisibleBlock(name, false); Item.className = ""; } - else { + else + { CreateTransaction(); SetVisibleBlock(name, true); Item.className = ""; @@ -446,14 +531,16 @@ function EditJSONTransaction() { }; var glNumPayCount = 0; -function GetInvoiceHTML(item, onclick, classstr) { - if (!item.num) { +function GetInvoiceHTML(item,onclick,classstr) +{ + if(!item.num) + { glNumPayCount++; item.num = glNumPayCount; } var idname = "idSendInvoice" + item.num; var value = ""; - if (item.Data.Amount) + if(item.Data.Amount) value += "" + item.Data.Amount + " Tera"; else value += "No pay"; @@ -461,46 +548,55 @@ function GetInvoiceHTML(item, onclick, classstr) { return ""; }; -function AddSendList(item) { - PayList.push({ Data: item }); +function AddSendList(item) +{ + PayList.push({Data:item}); }; -function CheckSendList(bRedraw) { +function CheckSendList(bRedraw) +{ TitleWarning = PayList.length; - if (AttachItem) + if(AttachItem) TitleWarning++; var Str = Storage.getItem("InvoiceList"); - if (!Str && !bRedraw) - return; - if (!bRedraw) { + if(!Str && !bRedraw) + return ; + if(!bRedraw) + { SelectTab("TabSend"); } - if (Str) { + if(Str) + { var arr = JSON.parse(Str); - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { AddSendList(arr[i]); } Storage.setItem("InvoiceList", ""); } var idList = $("idSendList"); - if (PayList.length) { + if(PayList.length) + { idList.innerHTML = "
    Select the item you want to sign (pay) and send to blockchain:
    "; - for (var i = 0; i < PayList.length; i++) { + for(var i = 0; i < PayList.length; i++) + { var item = PayList[i]; idList.innerHTML += GetInvoiceHTML(item, "UseInvoice(" + i + ")", "btinvoice"); } - if (AttachItem === undefined) + if(AttachItem === undefined) UseInvoice(0); } - else { + else + { idList.innerHTML = ""; } }; setInterval(CheckSendList, 200); -function UseInvoice(Num) { +function UseInvoice(Num) +{ var item = PayList[Num]; - if (item.Data.From) + if(item.Data.From) $("idAccount").value = item.Data.From; $("idTo").value = item.Data.To; $("idSumSend").value = item.Data.Amount; @@ -511,16 +607,19 @@ function UseInvoice(Num) { CheckSendList(1); }; -function ClearAttach() { +function ClearAttach() +{ AttachItem = undefined; - if ($("idAttach")) + if($("idAttach")) $("idAttach").innerHTML = ""; }; -function OpenAttach() { - if (AttachItem) { +function OpenAttach() +{ + if(AttachItem) + { var Data2 = JSON.parse(JSON.stringify(AttachItem.Data)); - if (Data2.Body) + if(Data2.Body) Data2.Body = GetHexFromArr(Data2.Body); delete Data2.TransferSecret; alert("DATA:\n" + JSON.stringify(Data2, "", 4)); @@ -528,65 +627,79 @@ function OpenAttach() { }; var CURRENCY, PUBKEY, NAME, SMART; -function SendTrCreateAccWait(Currency, PubKey, Name, Smart) { +function SendTrCreateAccWait(Currency,PubKey,Name,Smart) +{ CURRENCY = Currency; PUBKEY = PubKey; NAME = Name; SMART = Smart; - setTimeout(function() { + setTimeout(function () + { SendTrCreateAcc(CURRENCY, PUBKEY, NAME, 0, SMART, 0, 0); }, 50); }; -function SendTrCreateAcc(Currency, PubKey, Description, Adviser, Smart, bFindAcc, bAddToPay) { +function SendTrCreateAcc(Currency,PubKey,Description,Adviser,Smart,bFindAcc,bAddToPay) +{ var TR = GetTrCreateAcc(Currency, PubKey, Description, Adviser, Smart); var Body = GetBodyCreateAcc(TR); TR.bFindAcc = 1; - if (bAddToPay) { - var Item = { - name: Description, To: 0, Amount: CONFIG_DATA.PRICE_DAO.NewAccount, Description: "Create acc: " + Description, Body: Body, + if(bAddToPay) + { + var Item = {name:Description, To:0, Amount:CONFIG_DATA.PRICE_DAO.NewAccount, Description:"Create acc: " + Description, Body:Body, }; AddToInvoiceList(Item); } - else { + else + { SendTransaction(Body, TR); } $("idAccountName").value = ""; CancelCreateAccount(); }; -function ChangeSmart(NumAccount, WasSmart) { - if (!IsPrivateMode()) { +function ChangeSmart(NumAccount,WasSmart) +{ + if(!IsPrivateMode()) + { SetError("Pls, open wallet"); return 0; } var Result = prompt("Enter smart number:", WasSmart); - if (Result !== null && Result != WasSmart) { + if(Result !== null && Result != WasSmart) + { var Smart = parseInt(Result); - if (Smart) { - GetData("GetDappList", { StartNum: Smart, CountNum: 1 }, function(Data) { - if (Data && Data.result && Data.arr.length === 1) { + if(Smart) + { + GetData("GetDappList", {StartNum:Smart, CountNum:1}, function (Data) + { + if(Data && Data.result && Data.arr.length === 1) + { SetSmartToAccount(NumAccount, Smart); } - else { + else + { SetError("Error smart number"); } }); } - else { + else + { SetSmartToAccount(NumAccount, Smart); } } }; -function SetSmartToAccount(NumAccount, Smart) { +function SetSmartToAccount(NumAccount,Smart) +{ var OperationID = 0; var Item = MapAccounts[NumAccount]; - if (Item) { + if(Item) + { OperationID = Item.Value.OperationID; } OperationID++; - var TR = { Type: 140, Account: NumAccount, Smart: Smart, FromNum: NumAccount, Reserve: [], OperationID: OperationID, Sign: "", }; + var TR = {Type:140, Account:NumAccount, Smart:Smart, FromNum:NumAccount, Reserve:[], OperationID:OperationID, Sign:"", }; var Body = []; WriteByte(Body, TR.Type); WriteUint(Body, TR.Account); @@ -597,11 +710,12 @@ function SetSmartToAccount(NumAccount, Smart) { SendTrArrayWithSign(Body, TR.Account, TR); }; -function CheckLengthAccDesription(name, Length) { +function CheckLengthAccDesription(name,Length) +{ var Str = $(name).value.substr(0, Length + 1); var arr = toUTF8Array(Str); var Len = Length - arr.length; - if (Len < 0) + if(Len < 0) SetError("Bad length"); else SetStatus("Lost: " + Len + " bytes"); diff --git a/src/HTML/JS/wallet-node.js b/src/HTML/JS/wallet-node.js index 5433d5d..00d6a4b 100644 --- a/src/HTML/JS/wallet-node.js +++ b/src/HTML/JS/wallet-node.js @@ -9,34 +9,40 @@ */ -function SavePrivateKey() { +function SavePrivateKey() +{ var Select = document.getElementById("idTypeKey"); - if (Select.value === "brain") { + if(Select.value === "brain") + { ConvertToPrivateKey(); - return; + return ; } var Str = document.getElementById("idKeyNew").value; Str = Str.trim(); - if (Select.value === "private" && (Str.length !== 64 || !IsHexStr(Str))) { + if(Select.value === "private" && (Str.length !== 64 || !IsHexStr(Str))) + { SetError("Error: Length must 64 HEX chars. (Length=" + Str.length + ")"); - return; + return ; } else - if (Select.value !== "private" && (Str.length !== 66 || Str.substr(0, 1) !== "0" || !IsHexStr(Str))) { + if(Select.value !== "private" && (Str.length !== 66 || Str.substr(0, 1) !== "0" || !IsHexStr(Str))) + { SetError("Error: Length must 66 HEX chars. (Length=" + Str.length + ")"); - return; + return ; } - if (Select.value === "private" && PrivKeyStr !== Str) + if(Select.value === "private" && PrivKeyStr !== Str) SetStatus("Changed privat key"); else - if (Select.value === "public" && PubKeyStr !== Str) + if(Select.value === "public" && PubKeyStr !== Str) SetStatus("Changed public key"); - GetData("SetWalletKey", Str, function(Data) { - if (Data && Data.result === 1) { - if (Select.value === "private") + GetData("SetWalletKey", Str, function (Data) + { + if(Data && Data.result === 1) + { + if(Select.value === "private") SelectStyle("styleContrast1"); else - if (Select.value === "public") + if(Select.value === "public") SelectStyle("styleContrast2"); SetVisibleEditKeys(0); UpdatesData(); @@ -44,36 +50,46 @@ function SavePrivateKey() { }); }; -function CreateCheckPoint() { - if (!ServerBlockNumDB || ServerBlockNumDB < 16) { +function CreateCheckPoint() +{ + if(!ServerBlockNumDB || ServerBlockNumDB < 16) + { SetError("Not set ServerBlockNumDB"); - return; + return ; } var BlockNum = ServerBlockNumDB - 10; SetCheckPoint(BlockNum); }; -function UseAutoCheckPoint() { +function UseAutoCheckPoint() +{ var Set = $("idUseAutoCheckPoint").checked; var Period = ParseNum($("idPeriodAutoCheckPoint").value); - GetData("SetAutoCheckPoint", { Set: Set, Period: Period }, function(Data) { - if (Data) { + GetData("SetAutoCheckPoint", {Set:Set, Period:Period}, function (Data) + { + if(Data) + { SetStatus(Data.text, !Data.result); } }); }; -function UseAutoCorrTime() { - GetData("SetAutoCorrTime", document.getElementById("idUseAutoCorrTime").checked, function(Data) { - if (Data) { +function UseAutoCorrTime() +{ + GetData("SetAutoCorrTime", document.getElementById("idUseAutoCorrTime").checked, function (Data) + { + if(Data) + { SetStatus(Data.text, !Data.result); } }); }; -function SetCodeVersionJSON() { +function SetCodeVersionJSON() +{ var Data = JSON.parse(JSON.stringify(CONFIG_DATA.CODE_VERSION)); - if (!Data.BlockNum) { + if(!Data.BlockNum) + { Data.LevelUpdate = 160; } Data.BlockNum = CONFIG_DATA.CurBlockNum; @@ -87,11 +103,13 @@ function SetCodeVersionJSON() { document.getElementById("idDevService").value = Str; }; -function SetCorrTimeJSON() { +function SetCorrTimeJSON() +{ var AutoDelta = parseInt(document.getElementById("idDevValue").value); - var Data = { Num: CONFIG_DATA.CurBlockNum, bUse: 1, bAddTime: 1 }; - if (AutoDelta < 0) { - AutoDelta = - AutoDelta; + var Data = {Num:CONFIG_DATA.CurBlockNum, bUse:1, bAddTime:1}; + if(AutoDelta < 0) + { + AutoDelta = - AutoDelta; Data.bAddTime = 0; } Data.DeltaTime = 40; @@ -101,140 +119,180 @@ function SetCorrTimeJSON() { document.getElementById("idDevService").value = Str; }; -function SetNetConstJSON() { +function SetNetConstJSON() +{ var Str = JSON.stringify(Data, "", 2); document.getElementById("idDevService").value = Str; - var Data = { MaxTrasactionLimit: CONFIG_DATA.MAX_TRANSACTION_LIMIT }; + var Data = {MaxTrasactionLimit:CONFIG_DATA.MAX_TRANSACTION_LIMIT}; var Str = JSON.stringify(Data, "", 2); document.getElementById("idDevService").value = Str; }; -function SetNewCodeVersion() { - try { +function SetNewCodeVersion() +{ + try + { var Data = JSON.parse(document.getElementById("idDevService").value); } - catch (e) { + catch(e) + { SetError("Error format setting data"); - return; + return ; } Data.addrArr = GetArrFromHex(Data.addrArr); - GetData("SetNewCodeVersion", Data, function(Data) { - if (Data) { + GetData("SetNewCodeVersion", Data, function (Data) + { + if(Data) + { SetStatus(Data.text, !Data.result); } }); }; -function StartTimeCorrect() { - try { +function StartTimeCorrect() +{ + try + { var Data = JSON.parse(document.getElementById("idDevService").value); } - catch (e) { + catch(e) + { SetError("Error format setting data"); - return; + return ; } - GetData("SetCheckDeltaTime", Data, function(Data) { - if (Data) { + GetData("SetCheckDeltaTime", Data, function (Data) + { + if(Data) + { SetStatus(Data.text, !Data.result); } }); }; -function StartNetConst() { - try { +function StartNetConst() +{ + try + { var Data = JSON.parse(document.getElementById("idDevService").value); } - catch (e) { + catch(e) + { SetError("Error format setting data"); - return; + return ; } - GetData("SetCheckNetConstant", Data, function(Data) { - if (Data) { + GetData("SetCheckNetConstant", Data, function (Data) + { + if(Data) + { SetStatus(Data.text, !Data.result); } }); }; -function RestartNode() { +function RestartNode() +{ GetData("RestartNode", {}); DoRestartWallet(); }; -function UseAutoUpdate() { - var Data = { USE_AUTO_UPDATE: document.getElementById("idAutoUpdate").checked, DoMining: 1 }; - GetData("SaveConstant", Data, function(Data) { - if (Data && Data.result) { +function UseAutoUpdate() +{ + var Data = {USE_AUTO_UPDATE:document.getElementById("idAutoUpdate").checked, DoMining:1}; + GetData("SaveConstant", Data, function (Data) + { + if(Data && Data.result) + { SetStatus("Save AutoUpdate: " + document.getElementById("idAutoUpdate").checked); } }); }; -function UseMining() { - if (!MiningAccount) { +function UseMining() +{ + if(!MiningAccount) + { SetError("Not set mining account"); - return; + return ; } - var Data = { USE_MINING: document.getElementById("idUseMining").checked, DoMining: 1 }; - GetData("SaveConstant", Data, function(Data) { - if (Data && Data.result) { + var Data = {USE_MINING:document.getElementById("idUseMining").checked, DoMining:1}; + GetData("SaveConstant", Data, function (Data) + { + if(Data && Data.result) + { SetStatus("Save Mining: " + document.getElementById("idUseMining").checked); } }); }; -function SetPercentMining() { - var Data = { POW_MAX_PERCENT: document.getElementById("idPercentMining").value }; - GetData("SaveConstant", Data, function(Data) { - if (Data && Data.result) { +function SetPercentMining() +{ + var Data = {POW_MAX_PERCENT:document.getElementById("idPercentMining").value}; + GetData("SaveConstant", Data, function (Data) + { + if(Data && Data.result) + { SetStatus("Save Mining percent: " + document.getElementById("idPercentMining").value + " %"); } }); }; -function MiningSets() { +function MiningSets() +{ var name = "edit_mining_set"; - if (IsVisibleBlock(name)) { + if(IsVisibleBlock(name)) + { SetVisibleBlock(name, false); } - else { + else + { SetVisibleBlock(name, true); document.getElementById("idMiningAccount").value = MiningAccount; document.getElementById("idMiningAccount").focus(); } }; -function SaveMiningSet(Value) { +function SaveMiningSet(Value) +{ SetVisibleBlock("edit_mining_set", false); - if (Value) { + if(Value) + { MiningAccount = Value; } - else { + else + { MiningAccount = ParseNum(document.getElementById("idMiningAccount").value); } - GetData("SetMining", MiningAccount, function(Data) { + GetData("SetMining", MiningAccount, function (Data) + { }); }; -function CancalMiningSet() { +function CancalMiningSet() +{ var name = "edit_mining_set"; SetVisibleBlock(name, false); }; var WasHistoryMaxNum; var WasLastNumSound = 0; -function CheckNewMoney() { - return; - if (!$("idUseSoundHistory").checked) - return; - if (WasHistoryMaxNum === HistoryMaxNum || !ServerBlockNumDB) - return; +function CheckNewMoney() +{ + return ; + if(!$("idUseSoundHistory").checked) + return ; + if(WasHistoryMaxNum === HistoryMaxNum || !ServerBlockNumDB) + return ; WasHistoryMaxNum = HistoryMaxNum; - GetData("GetHistoryAct", { StartNum: HistoryMaxNum - 40, CountNum: 40 }, function(Data) { - if (Data && Data.result) { + GetData("GetHistoryAct", {StartNum:HistoryMaxNum - 40, CountNum:40}, function (Data) + { + if(Data && Data.result) + { var arr = Data.arr; - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { var Item = arr[i]; - if (Item.Direct === "+" && Item.BlockNum > ServerBlockNumDB - 60 && Item.BlockNum < ServerBlockNumDB - 20 && Item.BlockNum > WasLastNumSound) { + if(Item.Direct === "+" && Item.BlockNum > ServerBlockNumDB - 60 && Item.BlockNum < ServerBlockNumDB - 20 && Item.BlockNum > WasLastNumSound) + { WasLastNumSound = Item.BlockNum; $("sound_coin").play(); } @@ -243,41 +301,52 @@ function CheckNewMoney() { }); }; -function DoRestartWallet() { +function DoRestartWallet() +{ SetStatus("

    Restarting program...

    "); - if (!WasSetRestart) { + if(!WasSetRestart) + { WasSetRestart = 1; - setTimeout(function() { + setTimeout(function () + { window.location.reload(); }, 10 * 1000); } }; -function SetArrLog(arr) { +function SetArrLog(arr) +{ var Str = ""; var bFindAccount = 0; - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { var Item = arr[i]; var tr_text = GetTransactionText(MapSendTransaction[Item.key], Item.key.substr(0, 16)); var info = Item.text; - if (tr_text) + if(tr_text) info += " (" + tr_text + ")"; - if (Item.final) { + if(Item.final) + { var TR = MapSendTransaction[Item.key]; - if (TR) { - if (Item.text.indexOf("Add to blockchain") >= 0) { - if (TR.bFindAcc) { + if(TR) + { + if(Item.text.indexOf("Add to blockchain") >= 0) + { + if(TR.bFindAcc) + { bFindAccount = 1; TR.bFindAcc = 0; } - if (TR.Run) { + if(TR.Run) + { TR.Run(TR); TR.Run = undefined; } } } var Account = MapCheckTransaction[Item.key]; - if (Account) { + if(Account) + { delete MapCheckTransaction[Item.key]; Account.NextSendTime = 0; } @@ -286,31 +355,39 @@ function SetArrLog(arr) { } SetStatusFromServer(Str); CheckSending(); - if (bFindAccount) { + if(bFindAccount) + { FindMyAccounts(); } }; -function SetAutoMining() { - setTimeout(function() { +function SetAutoMining() +{ + setTimeout(function () + { var Select = $("idAccount"); - if (Select.options.length) { + if(Select.options.length) + { SaveMiningSet(Select.options[Select.options.length - 1].value); } }, 100); }; -function ViewNetworkMode() { - if (IsVisibleBlock('idNetworkView')) { +function ViewNetworkMode() +{ + if(IsVisibleBlock('idNetworkView')) + { SetVisibleBlock('idNetworkView', false); } - else { + else + { SetVisibleBlock('idNetworkView', true); var Mode = CONFIG_DATA.CONSTANTS.NET_WORK_MODE; - if (!Mode) { + if(!Mode) + { Mode = {}; Mode.UseDirectIP = true; - if (INTERNET_IP_FROM_STUN) + if(INTERNET_IP_FROM_STUN) Mode.ip = INTERNET_IP_FROM_STUN; else Mode.ip = SERVER_IP; @@ -319,120 +396,146 @@ function ViewNetworkMode() { document.getElementById("idUseDirectIP").checked = Mode.UseDirectIP; document.getElementById("idIP").value = Mode.ip; document.getElementById("idPort").value = Mode.port; - if (!Mode.NodeWhiteList) + if(!Mode.NodeWhiteList) Mode.NodeWhiteList = ""; document.getElementById("idNodeWhiteList").value = Mode.NodeWhiteList; } }; -function SetNetworkParams(bRestart) { +function SetNetworkParams(bRestart) +{ var Mode = {}; Mode.UseDirectIP = document.getElementById("idUseDirectIP").checked; Mode.ip = document.getElementById("idIP").value; Mode.port = ParseNum(document.getElementById("idPort").value); Mode.NodeWhiteList = document.getElementById("idNodeWhiteList").value; Mode.DoRestartNode = bRestart; - GetData("SetNetMode", Mode, function(Data) { - if (Data && Data.result) { + GetData("SetNetMode", Mode, function (Data) + { + if(Data && Data.result) + { SetStatus("Set net work params OK"); SetVisibleBlock('idNetworkView', false); } }); - if (bRestart) + if(bRestart) DoRestartWallet(); }; -function ViewConstant() { - if (IsVisibleBlock('idConstantView')) { +function ViewConstant() +{ + if(IsVisibleBlock('idConstantView')) + { SetVisibleBlock('idConstantView', false); } - else { + else + { SetVisibleBlock('idConstantView', true); document.getElementById("idConstant").value = JSON.stringify(CONFIG_DATA.CONSTANTS, "", 2); } }; -function SaveConstant(bRestart) { - try { +function SaveConstant(bRestart) +{ + try + { var Data = JSON.parse(document.getElementById("idConstant").value); } - catch (e) { + catch(e) + { SetError("Error JSON format setting constant"); - return; + return ; } Data.DoRestartNode = bRestart; - GetData("SaveConstant", Data, function(Data) { - if (Data && Data.result) { + GetData("SaveConstant", Data, function (Data) + { + if(Data && Data.result) + { SetStatus("Save Constant OK"); SetVisibleBlock('idConstantView', false); } }); - if (bRestart) + if(bRestart) DoRestartWallet(); }; -function ViewRemoteParams() { - if (IsVisibleBlock('idRemoteView')) { +function ViewRemoteParams() +{ + if(IsVisibleBlock('idRemoteView')) + { SetVisibleBlock('idRemoteView', false); } - else { + else + { SetVisibleBlock('idRemoteView', true); - if (CONFIG_DATA.HTTPPort) + if(CONFIG_DATA.HTTPPort) document.getElementById("idHTTPPort").value = CONFIG_DATA.HTTPPort; document.getElementById("idHTTPPassword").value = CONFIG_DATA.HTTPPassword; } }; -function SetRemoteParams(bRestart) { +function SetRemoteParams(bRestart) +{ var PrevHTTPPassword = HTTPPassword; var HTTPPort = ParseNum(document.getElementById("idHTTPPort").value); var HTTPPassword = document.getElementById("idHTTPPassword").value; - GetData("SetHTTPParams", { HTTPPort: HTTPPort, HTTPPassword: HTTPPassword, DoRestartNode: bRestart }, function(Data) { - if (!PrevHTTPPassword && HTTPPassword) + GetData("SetHTTPParams", {HTTPPort:HTTPPort, HTTPPassword:HTTPPassword, DoRestartNode:bRestart}, function (Data) + { + if(!PrevHTTPPassword && HTTPPassword) window.location.reload(); - else { + else + { SetVisibleBlock('idRemoteView', false); SetStatus("Set HTTP params OK"); } }); - if (bRestart) + if(bRestart) DoRestartWallet(); }; -function RewriteAllTransactions() { +function RewriteAllTransactions() +{ DoBlockChainProcess("RewriteAllTransactions", "Rewrite all transactions", 0); }; -function RewriteTransactions() { +function RewriteTransactions() +{ DoBlockChainProcess("RewriteTransactions", "Rewrite transactions on last %1 blocks", 1); }; -function TruncateBlockChain() { +function TruncateBlockChain() +{ DoBlockChainProcess("TruncateBlockChain", "Truncate last %1 blocks", 1); }; -function ClearDataBase() { +function ClearDataBase() +{ DoBlockChainProcess("ClearDataBase", "Clear DataBase", 0); }; -function CleanChain() { +function CleanChain() +{ DoBlockChainProcess("CleanChain", "Clean chain on last %1 blocks", 1); }; -function DoBlockChainProcess(FuncName, Text, LastBlock) { +function DoBlockChainProcess(FuncName,Text,LastBlock) +{ SaveValues(); var Params = {}; - if (LastBlock) { + if(LastBlock) + { Params.BlockCount = ParseNum(document.getElementById("idBlockCount").value); Text = Text.replace("%1", Params.BlockCount); } var result = confirm(Text + "?"); - if (!result) - return; + if(!result) + return ; SetVisibleBlock("idServerBlock", 1); SetStatus("START: " + Text); - GetData(FuncName, Params, function(Data) { - if (Data) { + GetData(FuncName, Params, function (Data) + { + if(Data) + { SetStatus("FINISH: " + Text, !Data.result); } }); diff --git a/src/HTML/JS/wallet-web.js b/src/HTML/JS/wallet-web.js index 7e31c96..0fb43fe 100644 --- a/src/HTML/JS/wallet-web.js +++ b/src/HTML/JS/wallet-web.js @@ -18,37 +18,23 @@ var StartTimeConnecting = 0; var ConnectedCount = 0; var NETWORK = "TERA-MAIN"; var ServerMap = {}; -var ServerMainMap = { - "127.0.0.1": { "ip": "127.0.0.1", "port": 80, "Name": "LOCAL" }, "terafoundation.org": { - "ip": "terafoundation.org", - "port": 443, "Name": "TERA", "System": 1 - }, "dappsgate.com": { "ip": "dappsgate.com", "port": 80, "Name": "SUPPORT2", "System": 1 }, "t1.teraexplorer.com": { - "ip": "t1.teraexplorer.com", - "port": 80, "Name": "t1.teraexplorer.com", "System": 1 - }, "t2.teraexplorer.com": { - "ip": "t2.teraexplorer.com", "port": 80, "Name": "t2.teraexplorer.com", - "System": 1 - }, "t3.teraexplorer.com": { "ip": "t3.teraexplorer.com", "port": 80, "Name": "t3.teraexplorer.com", "System": 1 }, "t4.teraexplorer.com": { - "ip": "t4.teraexplorer.com", - "port": 80, "Name": "t4.teraexplorer.com", "System": 1 - }, "t5.teraexplorer.com": { - "ip": "t5.teraexplorer.com", "port": 80, "Name": "t5.teraexplorer.com", - "System": 1 - }, -}; -var ServerTestMap = { - "127.0.0.1": { "ip": "127.0.0.1", "port": 80, "Name": "LOCAL" }, "dappsgate.com": { - "ip": "dappsgate.com", "port": 88, - "Name": "SUPPORT2", "System": 1 - }, -}; +var ServerMainMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "t2.teraexplorer.com":{"ip":"t2.teraexplorer.com", + "port":443, "Name":"t2.teraexplorer.com", "System":1}, "t3.teraexplorer.com":{"ip":"t3.teraexplorer.com", "port":443, "Name":"t3.teraexplorer.com", + "System":1}, "t4.teraexplorer.com":{"ip":"t4.teraexplorer.com", "port":443, "Name":"t4.teraexplorer.com", "System":1}, "t5.teraexplorer.com":{"ip":"t5.teraexplorer.com", + "port":443, "Name":"t5.teraexplorer.com", "System":1}, "dappsgate.com":{"ip":"dappsgate.com", "port":80, "Name":"SUPPORT2", + "System":1}, "t1.teraexplorer.com":{"ip":"t1.teraexplorer.com", "port":80, "Name":"t1.teraexplorer.com", "System":1}, }; +var ServerTestMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "dappsgate.com":{"ip":"dappsgate.com", "port":88, + "Name":"SUPPORT2", "System":1}, }; -function StartWebWallet() { - if (NETWORK === "TERA-TEST2") { +function StartWebWallet() +{ + if(NETWORK === "TERA-TEST2") + { MIN_SUM_POWER = 0; ServerMap = ServerTestMap; } - else { + else + { MIN_SUM_POWER = COUNT_BLOCK_PROOF * 35; ServerMap = ServerMainMap; } @@ -57,53 +43,64 @@ function StartWebWallet() { ConnectWebWallet(); }; -function OnInitWebWallet() { +function OnInitWebWallet() +{ var str = Storage.getItem(NETWORK + "NodesArrayList"); - if (str) { + if(str) + { var arr = JSON.parse(str); - for (var i = 0; i < arr.length; i++) { + for(var i = 0; i < arr.length; i++) + { var Item = ServerMap[arr[i].ip]; - if (Item && Item.System) + if(Item && Item.System) continue; ServerMap[arr[i].ip] = arr[i]; } } }; -function SaveServerMap() { +function SaveServerMap() +{ var arr = []; - for (var key in ServerMap) { + for(var key in ServerMap) + { var Item = ServerMap[key]; - if (Item.SumPower >= MIN_SUM_POWER) { - arr.push({ ip: Item.ip, port: Item.port }); + if(Item.SumPower >= MIN_SUM_POWER) + { + arr.push({ip:Item.ip, port:Item.port}); } } Storage.setItem(NETWORK + "NodesArrayList", JSON.stringify(arr)); }; -function SetStatus(Str) { +function SetStatus(Str) +{ var id = $("idStatus"); id.innerHTML = Str; - if (Str) + if(Str) console.log(id.innerText); }; -function SetError(Str, bNoSound) { +function SetError(Str,bNoSound) +{ SetStatus("
    " + Str + "
    "); }; var CountConnect = 0; var CountWallet = 0; -function ConnectWebWallet() { +function ConnectWebWallet() +{ StartTimeConnecting = Date.now(); ConnectedCount = 0; - for (var key in ServerMap) { + for(var key in ServerMap) + { var Item = ServerMap[key]; Item.SendHandShake = 0; } - if (window.BrowserIE && !IsLocalClient()) { + if(window.BrowserIE && !IsLocalClient()) + { MainServer = undefined; - return; + return ; } CountConnect = 0; CountWallet = 0; @@ -113,57 +110,68 @@ function ConnectWebWallet() { }; var Stage = 0; -function LoopHandShake() { +function LoopHandShake() +{ Stage++; SetStatus("Connecting: " + Stage + "..."); - for (var key in ServerMap) { + for(var key in ServerMap) + { var Item = ServerMap[key]; - if (Item.SendHandShake || !Item.port) + if(Item.SendHandShake || !Item.port) continue; CountConnect++; - if (window.BrowserIE && CountConnect > 4) + if(window.BrowserIE && CountConnect > 4) break; DoNodeList(Item); } }; -function DoNodeList(Item) { +function DoNodeList(Item) +{ console.log(GetProtocolServerPath(Item) + "/GetNodeList"); - if (window.location.protocol === "https:" && Item.port !== 443) - return; - if (Item.port === 443 && IsIPAddres(Item.ip)) - return; + if(window.location.protocol === "https:" && Item.port !== 443) + return ; + if(Item.port === 443 && IsIPAddres(Item.ip)) + return ; SetStatus("Try: " + Item.ip + ":" + Item.port); Item.SendHandShake = 1; - GetData(GetProtocolServerPath(Item) + "/GetNodeList", {}, function(Data) { - if (Data && Data.result && Data.NETWORK === NETWORK && Data.VersionNum >= MIN_VERSION) { + GetData(GetProtocolServerPath(Item) + "/GetNodeList", {}, function (Data) + { + if(Data && Data.result && Data.NETWORK === NETWORK && Data.VersionNum >= MIN_VERSION) + { ConnectedCount++; Item.GetHandShake = 1; Item.BlockChain = Data.BlockChain; SetStatus("Get: " + Item.ip + ":" + Item.port); var bWas = 0; - for (var i = 0; i < Data.arr.length; i++) { + for(var i = 0; i < Data.arr.length; i++) + { var Node = Data.arr[i]; - if (!ServerMap[Node.ip] && Node.port) { + if(!ServerMap[Node.ip] && Node.port) + { ServerMap[Node.ip] = Node; console.log("New: " + Node.ip + ":" + Node.port); bWas = 1; } } - if (bWas && ConnectedCount < MaxConnectedCount && new Date() - StartTimeConnecting < MaxTimeConnecting) { + if(bWas && ConnectedCount < MaxConnectedCount && new Date() - StartTimeConnecting < MaxTimeConnecting) + { setTimeout(LoopHandShake, 100); } } }); }; -function LoopWalletInfo() { +function LoopWalletInfo() +{ SetStatus("Get wallets info..."); - for (var key in ServerMap) { + for(var key in ServerMap) + { var Item = ServerMap[key]; - if (Item.port) { + if(Item.port) + { CountWallet++; - if (window.BrowserIE && CountWallet > 4) + if(window.BrowserIE && CountWallet > 4) break; DoWalletInfo(Item); } @@ -171,15 +179,18 @@ function LoopWalletInfo() { setTimeout(FindLider, 500); }; -function DoWalletInfo(Item) { - if (window.location.protocol === "https:" && Item.port !== 443) - return; - if (Item.port === 443 && IsIPAddres(Item.ip)) - return; +function DoWalletInfo(Item) +{ + if(window.location.protocol === "https:" && Item.port !== 443) + return ; + if(Item.port === 443 && IsIPAddres(Item.ip)) + return ; Item.StartTime = Date.now(); Item.SendWalletInfo = 1; - GetData(GetProtocolServerPath(Item) + "/GetCurrentInfo", { BlockChain: 1 }, function(Data) { - if (Data && Data.result && Data.BlockChain && Data.NETWORK === NETWORK) { + GetData(GetProtocolServerPath(Item) + "/GetCurrentInfo", {BlockChain:1}, function (Data) + { + if(Data && Data.result && Data.BlockChain && Data.NETWORK === NETWORK) + { Item.Name = Data.NODES_NAME; Item.GetWalletInfo = 1; Item.DeltaTime = new Date() - Item.StartTime; @@ -190,40 +201,49 @@ function DoWalletInfo(Item) { }); }; -function FindLider() { +function FindLider() +{ MainServer = undefined; var Arr = []; var MapSumPower = {}; - for (var key in ServerMap) { + for(var key in ServerMap) + { var Item = ServerMap[key]; - if (Item.GetWalletInfo && Item.BlockChain) { + if(Item.GetWalletInfo && Item.BlockChain) + { var arr = Item.BlockChain; - if (arr.data) + if(arr.data) arr = arr.data; Item.SumPower = CalcPowFromBlockChain(arr); - if (Item.SumPower < MIN_SUM_POWER) { + if(Item.SumPower < MIN_SUM_POWER) + { console.log("Skip: " + Item.ip + ":" + Item.port + " SumPower(" + Item.SumPower + ") < MIN_SUM_POWER(" + MIN_SUM_POWER + ")"); continue; } - if (!MapSumPower[Item.SumPower]) + if(!MapSumPower[Item.SumPower]) MapSumPower[Item.SumPower] = 0; MapSumPower[Item.SumPower]++; Arr.push(Item); } } var Max = 0, MaxKey; - for (var key in MapSumPower) { - if (MapSumPower[key] >= Max) { + for(var key in MapSumPower) + { + if(MapSumPower[key] >= Max) + { Max = MapSumPower[key]; MaxKey = parseInt(key); } } - Arr.sort(function(a, b) { + Arr.sort(function (a,b) + { return a.DeltaTime - b.DeltaTime; }); - for (var i = 0; i < Arr.length; i++) { + for(var i = 0; i < Arr.length; i++) + { var Item = Arr[i]; - if (Item.SumPower === MaxKey) { + if(Item.SumPower === MaxKey) + { SetStatus("Find " + Item.ip + ":" + Item.port + " with pow=" + Item.SumPower + "/" + MaxKey + " ping=" + Item.DeltaTime); MainServer = Item; SaveServerMap(); @@ -233,19 +253,23 @@ function FindLider() { OnFindServer(); }; -function CalcPowFromBlockChain(BufRead) { +function CalcPowFromBlockChain(BufRead) +{ var Sum = 0; var Arr = GetBlockArrFromBuffer(BufRead); - if (Arr.length === COUNT_BLOCK_PROOF) { - for (var i = 0; i < Arr.length; i++) { + if(Arr.length === COUNT_BLOCK_PROOF) + { + for(var i = 0; i < Arr.length; i++) + { Sum += Arr[i].Power; } } return Sum; }; -function SetAllSum() { +function SetAllSum() +{ var Item = MapAccounts[$("idAccount").value]; - if (Item) + if(Item) $("idSumSend").value = FLOAT_FROM_COIN(Item.Value).toStringF(); }; diff --git a/src/HTML/PIC/B.svg b/src/HTML/PIC/B.svg index 592a4ec..c0f3ed2 100644 --- a/src/HTML/PIC/B.svg +++ b/src/HTML/PIC/B.svg @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/src/HTML/PIC/TeraLogo.svg b/src/HTML/PIC/TeraLogo.svg index e3b819b..970575e 100644 --- a/src/HTML/PIC/TeraLogo.svg +++ b/src/HTML/PIC/TeraLogo.svg @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/HTML/PIC/Tera_logo.svg b/src/HTML/PIC/Tera_logo.svg index 15a5801..7490dcb 100644 --- a/src/HTML/PIC/Tera_logo.svg +++ b/src/HTML/PIC/Tera_logo.svg @@ -1,6 +1,6 @@ - - - Logo2 - - - + + + Logo2 + + + diff --git a/src/HTML/PIC/Tera_logo2.svg b/src/HTML/PIC/Tera_logo2.svg index c3edbad..c24c59e 100644 --- a/src/HTML/PIC/Tera_logo2.svg +++ b/src/HTML/PIC/Tera_logo2.svg @@ -1,6 +1,6 @@ - - - Logo2 - - - + + + Logo2 + + + diff --git a/src/HTML/PIC/blank.svg b/src/HTML/PIC/blank.svg index 1fc9496..30e32ec 100644 --- a/src/HTML/PIC/blank.svg +++ b/src/HTML/PIC/blank.svg @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/src/HTML/PIC/glass.svg b/src/HTML/PIC/glass.svg index 426d6b0..13b3909 100644 --- a/src/HTML/PIC/glass.svg +++ b/src/HTML/PIC/glass.svg @@ -1,3 +1,3 @@ - - - + + + diff --git a/src/HTML/blockviewer.html b/src/HTML/blockviewer.html index c67aa65..289eae2 100644 --- a/src/HTML/blockviewer.html +++ b/src/HTML/blockviewer.html @@ -1,131 +1,174 @@ - - - - - Block - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    -
    - - Transactions on block: -
    -
    -
    -
    -
    - - - -
    -
    - - - - - - - - - - - -
    TrNumTypeBodyJSONTxIDBytesPowerVerify
    -
    -
    -
    -
    - - - - - + + + + + Block + + + + + + + + + + + + + + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + Transactions on block: +
    +
    +
    +
    +
    + + + +
    +
    + + + + + + + + + + + +
    TrNumTypeBodyJSONTxIDBytesPowerVerify
    +
    +
    +
    +
    + + + + + diff --git a/src/HTML/chains.html b/src/HTML/chains.html index dd30074..c9217bc 100644 --- a/src/HTML/chains.html +++ b/src/HTML/chains.html @@ -1,1457 +1,1457 @@ - - - - Chains - - - - - - - - - - - - - - - -
    - - - - -
    -
    -
    -
    -
    - - -
    -
    - - - -Use sound alert
    -
    - - - - - - - - - - - - - - - - + + + + Chains + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    +
    + + +
    +
    + + + +Use sound alert
    +
    + + + + + + + + + + + + + + + + diff --git a/src/HTML/console.html b/src/HTML/console.html index 651ccf1..ffc0fcb 100644 --- a/src/HTML/console.html +++ b/src/HTML/console.html @@ -1,515 +1,523 @@ - - - - - Console - - - - - - - - - - - - - - - - - - - - - - -
    - CONSOLE - -

    -
    ...

    - - - Mode: - - - POW: Delta BlockNum: - -
    - -
    -
    - -
    - -
    -
    -
    - - Name: - -
    - -
    - - - - - - - sec - TX process: - - -
    - -
    - - -
    -
    - - -
    - - + + + + + Console + + + + + + + + + + + + + + + + + + + + + + +
    + CONSOLE + +

    +
    ...

    + + + Mode: + + + POW: Delta BlockNum: + +
    + +
    +
    + +
    + +
    +
    +
    + + Name: + +
    + +
    + + + + + + + sec + TX process: + WEB process: + + +
    + +
    + + +
    +
    + + +
    + + diff --git a/src/HTML/dapp-edit.html b/src/HTML/dapp-edit.html index 9f038d0..2dc9f0f 100644 --- a/src/HTML/dapp-edit.html +++ b/src/HTML/dapp-edit.html @@ -1,1048 +1,1048 @@ - - - - - Dapps IDE (simple) - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    -
    -----------------------
    - -
    - - - -
    -
    - Log from node: -

    -
    -
    -
    - - - - - + + + + + Dapps IDE (simple) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    -----------------------
    + +
    + + + +
    +
    + Log from node: +

    +
    +
    +
    + + + + + diff --git a/src/HTML/dapp-frame.html b/src/HTML/dapp-frame.html index e46d385..0b7a562 100644 --- a/src/HTML/dapp-frame.html +++ b/src/HTML/dapp-frame.html @@ -1,594 +1,595 @@ - - - - - - - - DAPP Loading... - - - - - - - - - - - - - - -
    - - - - + + + + + + + + DAPP Loading... + + + + + + + + + + + + + + +
    + + + + diff --git a/src/HTML/history.html b/src/HTML/history.html index f832703..9e0485f 100644 --- a/src/HTML/history.html +++ b/src/HTML/history.html @@ -1,253 +1,308 @@ - - - - - History account - - - - - - - - - - - - - - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    - - History of -
    -
    -
    Balance: 000
    -
    -
    -
    - - - - -
    - -
    - - - - - - - - - - - - - -
    ...FromToDateAmountCurDescriptionConfirmBlockTx
    -
    -
    -
    -
    -
    - - + + + + + History account + + + + + + + + + + + + + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + + History of +
    +
    +
    Balance: 000
    +
    +
    +
    + + + + +
    + +
    + + + + + + + + + + + + + +
    ...FromToDateAmountCurDescriptionConfirmBlockTx
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/HTML/mobile-wallet.html b/src/HTML/mobile-wallet.html index d903f57..891c4ed 100644 --- a/src/HTML/mobile-wallet.html +++ b/src/HTML/mobile-wallet.html @@ -1,716 +1,716 @@ - - - - - TERA Mobile - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - - -
    - -
    -
    - -
    -
    -
    - - - - -
    -

    Welcome to TERA Wallet

    -

    ATTENTION: Before using the wallet, save the private key.

    - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - - - - - - -
    - -
    - -
    -
    -
     
    - - - - - -
    -
    - - - - - -
    -
    - - -
    - -
    - - - - - - - - + + + + + TERA Mobile + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + +
    + +
    +
    + +
    +
    +
    + + + + +
    +

    Welcome to TERA Wallet

    +

    ATTENTION: Before using the wallet, save the private key.

    + + + + +
    + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    + + + + + + +
    + +
    + +
    +
    +
     
    + + + + + +
    +
    + + + + + +
    +
    + + +
    + +
    + + + + + + + + diff --git a/src/HTML/monitor.html b/src/HTML/monitor.html index 900c1f7..c9b0ecd 100644 --- a/src/HTML/monitor.html +++ b/src/HTML/monitor.html @@ -1,832 +1,832 @@ - - - - Monitor - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    -
    - - -
    -
    -
    -
    Blockchain Power
    - Adviser: - Miner: - <= - - Nonce: - - Block start: length: - - - - - -
    - - - - - -
    -
    -
    -
    - -
    -
    - New diagram - - - - -
    -
    -
    - - -
    - - - - - - + + + + Monitor + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    +
    + + +
    +
    +
    +
    Blockchain Power
    + Adviser: + Miner: + <= + + Nonce: + + Block start: length: + + + + + +
    + + + + + +
    +
    +
    +
    + +
    +
    + New diagram + + + + +
    +
    +
    + + +
    + + + + + + diff --git a/src/HTML/network.html b/src/HTML/network.html index d76edb6..1fdca61 100644 --- a/src/HTML/network.html +++ b/src/HTML/network.html @@ -1,530 +1,530 @@ - - - - - Network - - - - - - - - - - - - - - - - - - - - -
    - NETWORK
    - Max nodes on level: - - -

    - -
    - - - - - - - - - - - - - - -
    LNode1Node2Node3Node4Node5Node6Node7ConnectedNot connected
    - - -
    -
    -
    - - -
    -
    - - + + + + + Network + + + + + + + + + + + + + + + + + + + + +
    + NETWORK
    + Max nodes on level: + + +

    + +
    + + + + + + + + + + + + + + +
    LNode1Node2Node3Node4Node5Node6Node7ConnectedNot connected
    + + +
    +
    +
    + + +
    +
    + + \ No newline at end of file diff --git a/src/HTML/password.html b/src/HTML/password.html index 559babb..d31c236 100644 --- a/src/HTML/password.html +++ b/src/HTML/password.html @@ -1,339 +1,339 @@ - - - - - Password - - - - - - - - -
    - ENTER PASSWORD -
    - -
    -
    -
    - - + + + + + Password + + + + + + + + +
    + ENTER PASSWORD +
    + +
    +
    +
    + + diff --git a/src/HTML/stat.html b/src/HTML/stat.html index 76143a2..55f955e 100644 --- a/src/HTML/stat.html +++ b/src/HTML/stat.html @@ -1,382 +1,382 @@ - - - - Counters - - - - - - - - - - - - - - - - - - - -
    - -
    - -

    Performance counters

    - -
    - Filter: -
    - -
    - - - - - - - - - - - - - - - -
    Counters10 sec10 mintotalDiagr
    Total
    - -
    - - - - - - - - - - - - - - - -
    Errors10 sec10 mintotalDiagr
    Total
    - - - -
    - - -
    - - - -
    -
    - - - - - + + + + Counters + + + + + + + + + + + + + + + + + + + +
    + +
    + +

    Performance counters

    + +
    + Filter: +
    + +
    + + + + + + + + + + + + + + + +
    Counters10 sec10 mintotalDiagr
    Total
    + +
    + + + + + + + + + + + + + + + +
    Errors10 sec10 mintotalDiagr
    Total
    + + + +
    + + +
    + + + +
    +
    + + + + + diff --git a/src/HTML/wallet.html b/src/HTML/wallet.html index a50d472..c117dc7 100644 --- a/src/HTML/wallet.html +++ b/src/HTML/wallet.html @@ -1,2131 +1,2063 @@ - - - - - - - - TERA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    -
    配置
    -
    -
    发送
    -
    -
    分布式应用
    -
    -
    浏览器
    -
    - - - -
     
    -


    - -
    -
    -
    -
    - - -
    -
    - - -
    - -
    - - -

    -
    -
    - Block: - DB delta: - TX delta: - Time delta: - Wallet ver: - Max: tps -
    - - -
    - - - - - -
    - - -
    - - - - - - - - - - - - -
    IDAmountCurNameOP - AdvSmart
    - -
    - - - - - - - -
    - - - - - -
    - Style: - - 此版本由 MiaoWoo 使用 TypeScript 重构
    -
    - - - - - - - - - - -
    -
    -
    - Log from node: -

    -
    - - - - - - - - - - - - - - -
    - -
    - - - - -
    - Web - ANN - Twitter - Telegram - Discord - QQ - -
    \ No newline at end of file + + + + + + + TERA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + +
    CONFIG
    SEND
    DApps
    EXPLORER
    + + + +
     
    +


    + +
    +
    +
    +
    + + +
    +
    + + +
    + +
    + + +

    +
    + Block: + DB delta: + TX delta: + Time delta: + Wallet ver: + Max: tps +
    + + + + + + +
    + + + + + +
    + + +
    + + + + + + + + + + + + +
    IDAmountCurNameOPAdvSmart
    + +
    + + + + + + + +
    + + + + + +
    + + + Style: + + + + +
    + + + + + + + + + + + + + +
    +
    +
    + Log from node: +

    +
    + + + + + + + + + + + + + + +
    + +
    + + + +
    + Web + ANN + Twitter + Telegram + Discord + QQ + +
    + diff --git a/src/HTML/web-wallet.html b/src/HTML/web-wallet.html index a6c2fa7..105056b 100644 --- a/src/HTML/web-wallet.html +++ b/src/HTML/web-wallet.html @@ -1,669 +1,669 @@ - - - - - TERA WALLET - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - - -
    - -
    -
    - -
    -
    -
    - - - - -
    -

    Welcome to TERA Wallet

    -

    ATTENTION: Before using the wallet, save the private key.

    - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - - - - - - -
    - -
    - -
    -
    -
     
    - - - - - -
    -
    - - - - - -
    -
    - - -
    - -
    - - - - - - - - + + + + + TERA WALLET + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + +
    + +
    +
    + +
    +
    +
    + + + + +
    +

    Welcome to TERA Wallet

    +

    ATTENTION: Before using the wallet, save the private key.

    + + + + +
    + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    + + + + + + + + +
    +
    +
     
    + + + + + +
    +
    + + + + + +
    +
    + +
    +
    + + + + + + + + + + +