From aca9ee86848e221ac84cc0fe7b90d23c82f558c6 Mon Sep 17 00:00:00 2001 From: Benjamin Flores Date: Tue, 30 Jun 2015 12:10:02 -0300 Subject: [PATCH 1/2] stylus added and new html without plugins --- Gruntfile.js | 13 +- dist/css/app.css | 2 +- dist/js/app.js | 24 +- html/index.html | 1573 +++++++++++-------------- img/1.png | Bin 0 -> 4564 bytes img/1.svg | 158 +++ img/10.png | Bin 0 -> 8167 bytes img/10.svg | 21 + img/10@2x.png | Bin 0 -> 24681 bytes img/11.png | Bin 0 -> 4107 bytes img/11.svg | 28 + img/11@2x.png | Bin 0 -> 9199 bytes img/12.png | Bin 0 -> 3840 bytes img/12.svg | 43 + img/12@2x.png | Bin 0 -> 9709 bytes img/1@2x.png | Bin 0 -> 12760 bytes img/2.png | Bin 0 -> 4214 bytes img/2.svg | 26 + img/2@2x.png | Bin 0 -> 9771 bytes img/3.png | Bin 0 -> 3990 bytes img/3.svg | 32 + img/3@2x.png | Bin 0 -> 9968 bytes img/4.png | Bin 0 -> 3382 bytes img/4.svg | 33 + img/4@2x.png | Bin 0 -> 7656 bytes img/5.png | Bin 0 -> 5106 bytes img/5.svg | 42 + img/5@2x.png | Bin 0 -> 12654 bytes img/6.png | Bin 0 -> 3247 bytes img/6.svg | 31 + img/6@2x.png | Bin 0 -> 7158 bytes img/7.png | Bin 0 -> 6062 bytes img/7.svg | 155 +++ img/7@2x.png | Bin 0 -> 16573 bytes img/8.png | Bin 0 -> 4235 bytes img/8.svg | 56 + img/8@2x.png | Bin 0 -> 10081 bytes img/9.png | Bin 0 -> 3355 bytes img/9.svg | 36 + img/9@2x.png | Bin 0 -> 7485 bytes img/bg_arrow.svg | 16 + img/bg_arrow_select.svg | 14 + img/bg_steps.svg | 14 + img/ico_check.svg | 16 + img/ico_check2.svg | 16 + img/ico_close.svg | 17 + img/ico_edit.svg | 14 + img/ico_enlarge.svg | 18 + img/ico_github.svg | 16 + img/ico_logo.svg | 26 + img/ico_star.svg | 14 + img/ico_status.svg | 23 + img/ico_twitter.svg | 16 + img/logo.svg | 16 + img/pic_logo.svg | 23 + img/pic_logo2.svg | 35 + img/pic_logo3.svg | 31 + img/pic_logo4.svg | 42 + img/pic_logo_ft.svg | 15 + img/pic_tshirt.png | Bin 0 -> 45337 bytes img/pic_tshirt@2x.png | Bin 0 -> 157121 bytes img/pic_tshirt_b.png | Bin 0 -> 45337 bytes img/pic_tshirt_b@2x.png | Bin 0 -> 157121 bytes index.html | 1524 +++++++++++------------- less/app.less | 464 -------- package.json | 16 +- stylus/app.styl | 2418 +++++++++++++++++++++++++++++++++++++++ 67 files changed, 4815 insertions(+), 2262 deletions(-) create mode 100644 img/1.png create mode 100644 img/1.svg create mode 100644 img/10.png create mode 100644 img/10.svg create mode 100644 img/10@2x.png create mode 100644 img/11.png create mode 100644 img/11.svg create mode 100644 img/11@2x.png create mode 100644 img/12.png create mode 100644 img/12.svg create mode 100644 img/12@2x.png create mode 100644 img/1@2x.png create mode 100644 img/2.png create mode 100644 img/2.svg create mode 100644 img/2@2x.png create mode 100644 img/3.png create mode 100644 img/3.svg create mode 100644 img/3@2x.png create mode 100644 img/4.png create mode 100644 img/4.svg create mode 100644 img/4@2x.png create mode 100644 img/5.png create mode 100644 img/5.svg create mode 100644 img/5@2x.png create mode 100644 img/6.png create mode 100644 img/6.svg create mode 100644 img/6@2x.png create mode 100644 img/7.png create mode 100644 img/7.svg create mode 100644 img/7@2x.png create mode 100644 img/8.png create mode 100644 img/8.svg create mode 100644 img/8@2x.png create mode 100644 img/9.png create mode 100644 img/9.svg create mode 100644 img/9@2x.png create mode 100644 img/bg_arrow.svg create mode 100644 img/bg_arrow_select.svg create mode 100644 img/bg_steps.svg create mode 100644 img/ico_check.svg create mode 100644 img/ico_check2.svg create mode 100644 img/ico_close.svg create mode 100644 img/ico_edit.svg create mode 100644 img/ico_enlarge.svg create mode 100644 img/ico_github.svg create mode 100644 img/ico_logo.svg create mode 100644 img/ico_star.svg create mode 100644 img/ico_status.svg create mode 100644 img/ico_twitter.svg create mode 100644 img/logo.svg create mode 100644 img/pic_logo.svg create mode 100644 img/pic_logo2.svg create mode 100644 img/pic_logo3.svg create mode 100644 img/pic_logo4.svg create mode 100644 img/pic_logo_ft.svg create mode 100644 img/pic_tshirt.png create mode 100644 img/pic_tshirt@2x.png create mode 100644 img/pic_tshirt_b.png create mode 100644 img/pic_tshirt_b@2x.png delete mode 100644 less/app.less create mode 100644 stylus/app.styl diff --git a/Gruntfile.js b/Gruntfile.js index 6436ddd1..23ba2f93 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,7 +10,7 @@ module.exports = function (grunt) { options: { livereload: true }, - files: ['Gruntfile.js', 'js/**/*.js', 'less/**/*.less', 'html/index.html'], + files: ['Gruntfile.js', 'js/**/*.js', 'stylus/**/*.styl', 'html/index.html'], tasks: ['build'] } }, @@ -24,13 +24,10 @@ module.exports = function (grunt) { } }, }, - less: { - production: { - options: { - cleancss: true - }, + stylus: { + compile: { files: { - 'css/app.css': 'less/app.less' + 'css/app.css': 'stylus/app.styl' } } }, @@ -57,7 +54,7 @@ module.exports = function (grunt) { } }); - grunt.registerTask('build', ['clean', 'less', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'htmlmin', 'usemin']); + grunt.registerTask('build', ['clean', 'stylus', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'htmlmin', 'usemin']); grunt.registerTask('test', ['build', 'mocha_phantomjs']); grunt.registerTask('default', ['build', 'connect', 'watch']); }; diff --git a/dist/css/app.css b/dist/css/app.css index 1ce3b698..60216447 100644 --- a/dist/css/app.css +++ b/dist/css/app.css @@ -1 +1 @@ -.CodeMirror{height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-tab{display:inline-block}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-operator,.cm-s-default .cm-property{color:#000}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar,.cm-s-default .cm-error{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:1}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#000}.navbar-default .navbar-brand{font-weight:700;text-transform:uppercase;color:#000;font-size:14px;letter-spacing:.5px;margin-right:30px}.banner-jwt{position:relative;margin-top:50px;padding:20px;color:#000;overflow:hidden;background:linear-gradient(120deg,#848db4 0,#3cc8f4 100%);background-color:#24C6DC;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(10%,#24c6dc),color-stop(90%,#514a9d));background-image:-webkit-linear-gradient(-360deg,#24c6dc 10%,#514a9d 90%);background-image:linear-gradient(90deg,#24c6dc 10%,#514a9d 90%)}.banner-jwt p{color:#fff;font-size:28px;font-weight:100;line-height:52px;position:relative}.banner-jwt a{font-size:16px;font-weight:700;color:#fff;opacity:.8;display:inline-block;position:relative}.banner-jwt canvas{position:absolute;z-index:0;top:0;left:0;right:0;bottom:0;opacity:.3;height:1000px;width:100%}.CodeMirror{zoom:1;font-family:'Source Code Pro'}h1{margin-bottom:0}code,pre{padding:0;margin:0;font-family:Menlo!important}.navbar-default.navbar-fixed-top{background:rgba(255,255,255,.9);border:0;color:#fff}.vulnerable-badge{text-align:right;float:right;line-height:17px;text-transform:uppercase;color:red}.patched-badge{text-align:right;float:right;line-height:17px;text-transform:uppercase;color:orange}.panel{box-shadow:none;border:0;overflow:hidden}.panel.vulnerable{border:2px solid red}.panel.vulnerable .panel-body code,.panel.vulnerable .panel-heading{background:0 0}.panel.patched{border:2px solid orange}.panel .panel-heading,.panel.patched .panel-body code,.panel.patched .panel-heading{background:0 0}.panel .icon-budicon-333,.panel .icon-budicon-466{position:relative;top:2px;opacity:.5}.panel .author-info .maintainer>a,.panel .author-info>a{color:#4d4d4d}.panel .stars{display:none}.panel-footer{font-size:14px}.hn-button{margin-right:20px}.panel-title{font-weight:700}.panel-body{padding:0}.panel-body .row{padding:15px}.panel-body .row div{margin-bottom:4px}.panel-body .row div i{position:relative;top:2px}.icon-budicon-500{color:#65a52f}.panel-footer{padding:0}.panel-footer code{background:#222;display:block;padding:15px;border-radius:0;color:#fff;font-size:12px}.panel-footer code a{color:#fff}.author-info{border-top:1px solid #f1f1f1;padding:15px}.author-info .maintainer,.author-info .repository{display:inline-block}.author-info .repository{float:right}.author-info .repository-left{float:none}.banner{background:linear-gradient(120deg,#14204d 0,#3cc8f4 100%)}.banner img{width:140px}.banner a{color:#fff}.banner p{font-size:150%}.banner .btn{min-width:200px}.bg-grey{background:#f6f6f6;margin-top:60px;padding-bottom:40px}.jwt-playground{width:100%}.jwt-playground h4{font-size:14px;text-transform:uppercase}.jwt-playground .input{border:1px solid #44C7F4;padding:10px;margin-bottom:2px;border-radius:3px;background:#fff}.jwt-playground .input.error{background:pink}.jwt-playground .input:hover{-webkit-box-shadow:0 0 4px #54a1e9;-moz-box-shadow:0 0 4px #54a1e9;box-shadow:0 0 4px #54a1e9}.jwt-playground .input .CodeMirror{width:100%;background:0 0;font-size:20px;line-height:30px;min-height:460px;height:auto}.jwt-playground .input .CodeMirror .cm-jwt-dot{color:#000}.jwt-playground .input .CodeMirror .cm-jwt-header{color:#859900}.jwt-playground .input .CodeMirror .cm-jwt-payload{color:#268bd2}.jwt-playground .input .CodeMirror .cm-jwt-signature{color:#dc322f}.jwt-playground .algorithm-label{margin-right:20px}.jwt-playground .output{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.jwt-playground .output .jwt-explained{background:#fff;border:1px solid #ECECEC;padding:10px;margin-bottom:2px}.jwt-playground .output .jwt-explained pre{font-size:16px;line-height:26px}.jwt-playground .output .jwt-explained.error{background:rgba(100,0,0,.1)}.jwt-playground .output .jwt-explained:hover{-webkit-box-shadow:0 0 4px #54a1e9;-moz-box-shadow:0 0 4px #54a1e9;box-shadow:0 0 4px #54a1e9}.jwt-playground .output .jwt-explained .CodeMirror{width:100%;height:auto;background:0 0}.jwt-playground .output .jwt-header,.jwt-playground .output .jwt-header .CodeMirror,.jwt-playground .output .jwt-header .CodeMirror .cm-atom,.jwt-playground .output .jwt-header .CodeMirror .cm-number,.jwt-playground .output .jwt-header .CodeMirror .cm-property,.jwt-playground .output .jwt-header .CodeMirror .cm-string{color:#859900}.jwt-playground .output .jwt-payload,.jwt-playground .output .jwt-payload .CodeMirror,.jwt-playground .output .jwt-payload .CodeMirror .cm-atom,.jwt-playground .output .jwt-payload .CodeMirror .cm-number,.jwt-playground .output .jwt-payload .CodeMirror .cm-property,.jwt-playground .output .jwt-payload .CodeMirror .cm-string{color:#268bd2}.jwt-playground .output .jwt-signature{color:#dc322f;font-family:monospace}.jwt-playground .output .jwt-signature pre{background-color:transparent;border:0;color:#dc322f}.jwt-playground .output .jwt-signature span.is-base64-encoded-label{font-size:x-small}.jwt-playground .output .jwt-signature input[name=secret]{border-radius:4px;border:1px solid #dfdfdf}.jwt-playground .output .jwt-signature textarea{border:1px solid #dfdfdf;font-size:12px;line-height:18px;width:350px;max-width:100%;border-radius:4px}.jwt-playground .output .jwt-signature textarea.error{border:1px solid red}.jwt-playground .validation-status{background:#fff;padding:15px;margin-top:20px;clear:both;text-align:center;width:100%;font-size:20px;color:#fff;text-transform:uppercase;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.jwt-playground .validation-status.valid-token{background:#7ed321}.jwt-playground .validation-status.invalid-token{background:red}.library div i{padding-right:4px}html{position:relative;min-height:100%}body{margin-bottom:60px}#footer{position:absolute;bottom:0;width:100%;height:60px;background-color:#f5f5f5}.jwt-playground .input[data-alg=RS256] .CodeMirror{min-height:617px}h4 small{line-height:1.8}.container .text-muted{margin:20px 0}#footer>.container{padding-right:15px;padding-left:15px}code{font-size:80%}.navbar-right{height:20px} \ No newline at end of file +.CodeMirror{height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-tab{display:inline-block}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-operator,.cm-s-default .cm-property{color:#000}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar,.cm-s-default .cm-error{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:1}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.navbar-default .navbar-brand{font-weight:700;text-transform:uppercase;color:#000;font-size:14px;letter-spacing:.5px;margin-right:30px}.navbar-default.navbar-fixed-top{background:rgba(255,255,255,.9);border:0;color:#fff}@media (min-width:992px){.navbar-default.moved .navbar-brand{margin-right:-38px}}.banner-jwt{margin-top:50px;padding:20px;color:#000;overflow:hidden}.banner-jwt p{color:#fff;font-weight:100;position:relative}.banner-jwt a{font-size:16px;font-weight:700;color:#fff;opacity:.8;display:inline-block;position:relative}.banner-jwt canvas{position:absolute;z-index:0;top:0;left:0;right:0;bottom:0;opacity:.3;height:1000px;width:100%}.CodeMirror{zoom:1;font-family:'Source Code Pro';outline:0}.CodeMirror *{outline:0;box-shadow:none}h1{margin-bottom:0}code,pre{padding:0;margin:0;font-family:Menlo!important}.vulnerable-badge{text-align:right;float:right;line-height:17px;text-transform:uppercase;color:red}.patched-badge{text-align:right;float:right;line-height:17px;text-transform:uppercase;color:orange}.panel{box-shadow:none;border:0;overflow:hidden}.panel.vulnerable{border:2px solid red}.panel.vulnerable .panel-body code,.panel.vulnerable .panel-heading{background:0 0}.panel .panel-heading,.panel.patched .panel-body code,.panel.patched .panel-heading{background:0 0}.panel .stars{display:none}.panel .icon-budicon-333,.panel .icon-budicon-466{position:relative;top:2px}.panel .author-info .maintainer>a,.panel .author-info>a{color:#4d4d4d}.panel-footer{font-size:14px;padding:0}.panel-footer code{background:#222;display:block;border-radius:0;color:#fff;font-size:12px}.panel-footer code a{color:#fff}.hn-button{margin-right:20px}.panel-title{font-weight:700}.panel-body{padding:0}.panel-body .row{padding:15px}.panel-body .row div{margin-bottom:4px}.panel-body .row div i{position:relative;top:2px}.icon-budicon-500{color:#65a52f}.author-info:after{clear:both;display:block;content:""}.author-info .repository{float:right}.author-info .repository-left{float:none}.author-info .maintainer,.author-info .repository{display:inline-block}.banner a{color:#fff}.banner .btn{min-width:200px}.bg-grey{background:#f6f6f6;margin-top:60px}.jwt-playground .output .jwt-header .CodeMirror .cm-string,.jwt-playground .output .jwt-header .text-line a{color:#fb015b!important}.jwt-playground .output .jwt-payload .text-line a{color:#d63aff!important}.jwt-playground .output .jwt-signature .CodeMirror .cm-property,.jwt-playground .output .jwt-signature .text-line a,.jwt-playground .output .jwt-signature pre{color:#00b9f1!important}.jwt-playground h4{font-size:14px;text-transform:uppercase}.jwt-playground .input{border-radius:3px}.jwt-playground .input.error{background:pink}.jwt-playground .input .CodeMirror{width:100%;background:0 0;font-size:20px;line-height:30px;height:auto}.jwt-playground .input .CodeMirror .cm-jwt-dot{color:#000}.jwt-playground .output{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.jwt-playground .output .jwt-explained{padding:10px}.jwt-playground .output .jwt-explained.error{background:rgba(100,0,0,.1)}.jwt-playground .output .jwt-explained .CodeMirror{width:100%;height:auto;background:0 0}.jwt-playground .output .jwt-header{color:#859900}.jwt-playground .output .jwt-payload{color:#268bd2}.jwt-playground .output .jwt-signature{color:#dc322f;font-family:monospace}.jwt-playground .output .jwt-signature pre{background-color:transparent;border:0}.jwt-playground .output .jwt-signature span.is-base64-encoded-label{font-size:x-small}.jwt-playground .output .jwt-signature input[name=secret]{border-radius:4px;border:1px solid #dfdfdf}.jwt-playground .output .jwt-signature textarea{border:1px solid #dfdfdf;font-size:12px;line-height:18px;width:350px;max-width:100%;border-radius:4px}.jwt-playground .output .jwt-signature textarea.error{border:1px solid red}.jwt-playground .validation-status{background:#fff;padding:15px;margin-top:20px;clear:both;text-align:center;width:100%;font-size:20px;color:#fff;text-transform:uppercase;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.jwt-playground .validation-status.valid-token{background:#7ed321}.jwt-playground .validation-status.invalid-token{background:red}.jwt-playground .output .jwt-header .CodeMirror,.jwt-playground .output .jwt-header .CodeMirror .cm-atom,.jwt-playground .output .jwt-header .CodeMirror .cm-number,.jwt-playground .output .jwt-header .CodeMirror .cm-property,.jwt-playground .output .jwt-header .CodeMirror .cm-string{color:#859900}.jwt-playground .output .jwt-payload .CodeMirror,.jwt-playground .output .jwt-payload .CodeMirror .cm-atom,.jwt-playground .output .jwt-payload .CodeMirror .cm-number,.jwt-playground .output .jwt-payload .CodeMirror .cm-property,.jwt-playground .output .jwt-payload .CodeMirror .cm-string{color:#268bd2}.library div i{padding-right:4px}html{position:relative;min-height:100%}#footer{position:absolute;bottom:0;width:100%}#footer>.container{padding-right:15px;padding-left:15px}h4 small{line-height:1.8}.container .text-muted{margin:20px 0}code{font-size:80%}.navbar-right{height:20px}.bootstrap-select{width:220px 0}.bootstrap-select>.btn{width:100%;padding-right:25px}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select .btn:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.btn-group>.disabled{cursor:not-allowed}.bootstrap-select.btn-group>.disabled:focus{outline:0!important}.bootstrap-select.btn-group .btn .filter-option{display:inline-block;overflow:hidden;width:100%;text-align:left}.bootstrap-select.btn-group .btn .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;z-index:1035;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;border:0;padding:0;margin:0;border-radius:0;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu li{position:relative;margin:0}.bootstrap-select.btn-group .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select.btn-group .dropdown-menu li a{cursor:pointer}.bootstrap-select.btn-group .dropdown-menu li a.opt{position:relative;padding:5px}.bootstrap-select.btn-group .dropdown-menu li a span.check-mark{display:none}.bootstrap-select.btn-group .dropdown-menu li a span.text{display:inline-block}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;box-sizing:border-box}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px}.bootstrap-select.btn-group.fit-width .btn .filter-option{position:static}.bootstrap-select.btn-group.fit-width .btn .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{position:absolute;display:inline-block;right:15px;margin-top:5px}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.btn-group[class*=col-] .btn{width:100%}.bootstrap-select.show-menu-arrow.open>.btn{z-index:1036}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom-width:7px;border-bottom-style:solid;border-bottom-color:#ccc;border-bottom-color:rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-bottom:0;border-top-width:7px;border-top-style:solid;border-top-color:#ccc;border-top-color:rgba(204,204,204,.2)}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.error .bootstrap-select .btn{border:1px solid #b94a48}.control-group.error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.btn-group.dropdown-menu-right,.bootstrap-select.btn-group[class*=col-].dropdown-menu-right,.row-fluid .bootstrap-select.btn-group[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group,.form-search .bootstrap-select.btn-group{margin-bottom:0}.form-group-lg .bootstrap-select.btn-group.form-control,.form-group-sm .bootstrap-select.btn-group.form-control{padding:0}.form-inline .bootstrap-select.btn-group .form-control{width:100%}.input-append .bootstrap-select.btn-group{margin-left:-1px}.input-prepend .bootstrap-select.btn-group{margin-right:-1px}.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled) a small,.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) a:focus small,.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) a:hover small{color:#64b1d8;color:rgba(100,177,216,.4)}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before{display:block}.bs-actionsbox,.bs-searchbox{padding:4px 8px}.bs-actionsbox{float:left;width:100%;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox input.form-control{margin-bottom:0;width:100%}.mobile-device{position:absolute;top:0;left:0;display:block!important;width:100%;height:100%!important;opacity:0}@font-face{font-family:DINCondensedBold;src:url(../../fonts/DINCondensedBold.eot);src:url(../../fonts/DINCondensedBold.eot?#iefix) format('embedded-opentype'),url(../../fonts/DINCondensedBold.woff) format('woff'),url(../../fonts/DINCondensedBold.ttf) format('truetype'),url(../../fonts/DINCondensedBold.svg#DINCondensedBold) format('svg');font-weight:'normal';font-style:normal}@font-face{font-family:Menlo;src:url(../../fonts/Menlo-Regular.eot);src:url(../../fonts/Menlo-Regular.eot?#iefix) format('embedded-opentype'),url(../../fonts/Menlo-Regular.woff) format('woff'),url(../../fonts/Menlo-Regular.ttf) format('truetype'),url(../../fonts/Menlo-Regular.svg#Menlo) format('svg');font-weight:'normal';font-style:normal}body{margin:0}@media (min-width:992px){.container{width:100%;max-width:1220px;padding:0 35px;margin:auto}}.tabs{clear:both}@media (min-width:992px){.tabs{margin:0 -5px}}.jwt-playground{padding:0 24px;margin:0 -15px;position:relative;overflow:hidden;width:auto}.jwt-playground .output{float:right;margin:10px 0 0;height:auto;padding:0;width:100%;border:1px solid rgba(155,155,155,.5);border-radius:3px;overflow:hidden}@media (min-width:992px){.jwt-playground .output{float:right;display:block!important;margin:0 -3px;height:auto;padding:0;width:49%;border:1px solid rgba(155,155,155,.5);border-radius:3px;overflow:hidden}}.jwt-playground .output .text-line{font-size:12px;color:#979797;line-height:12px;border-top:1px solid rgba(155,155,155,.5);border-bottom:1px solid rgba(155,155,155,.5);margin:-12px -12px;padding:10px 13px 8px}.jwt-playground .output .text-line a{display:none}@media (min-width:992px){.jwt-playground .output .text-line a{display:block;float:right}}@media (min-width:992px){.jwt-playground .output .text-line{font-size:12px;color:#979797;line-height:12px;border-top:1px solid rgba(155,155,155,.5);border-bottom:1px solid rgba(155,155,155,.5);margin:-12px -12px;padding:10px 13px 8px}}.jwt-playground .output .text-line span{color:#000}.jwt-playground .output .jwt-signature pre{font-size:14px;line-height:19px;margin:28px 0 0 18px}.jwt-playground .output .jwt-explained{border:none;background:#fff;box-shadow:none;font-family:proxima-nova,"Helvetica Neue",sans-serif}.jwt-playground .CodeMirror-code{margin:30px 0 7px;padding:0}@media (min-width:992px){.jwt-playground .CodeMirror-wrap{padding:0 0 0 20px}}.jwt-playground .algorithm{text-align:center;position:relative;z-index:99}.jwt-playground .algorithm-label{margin:0 3px 0 0;display:inline-block;font-size:10px;line-height:18px;text-transform:uppercase;color:#000}@media (min-width:992px){.jwt-playground .algorithm-label{margin:0 4px 0 0;font-size:12px;line-height:18px}}.jwt-playground .tab-nav{position:relative;z-index:9}.jwt-playground .tab-nav ul{overflow:hidden;border-bottom:1px solid #979797;margin:0 -24px;padding:31px 24px 0}@media (min-width:992px){.jwt-playground .tab-nav ul{border-bottom:none;margin:0 -24px;padding:43px 24px 0}}.jwt-playground .tab-nav li{width:50%;float:left;padding:0;margin:0;list-style:none}@media (min-width:992px){.jwt-playground .tab-nav li{padding:0 5px 13px}}@media (min-width:992px){.jwt-playground .tab-nav li:nth-child(2){padding-left:26px}}.jwt-playground .tab-nav li a{font-size:26px;color:#000;line-height:32px;text-transform:none;font-weight:400;text-align:center;padding-bottom:6px;display:block;position:relative}@media (min-width:992px){.jwt-playground .tab-nav li a{text-align:left;font-size:30px;color:#000;line-height:36px}}.jwt-playground .tab-nav li a small{display:none}@media (min-width:992px){.jwt-playground .tab-nav li a small{display:inline-block;font-size:12px;color:#979797;line-height:12px;float:none!important;text-transform:uppercase;margin:0 10px;position:relative;top:-2px}}.jwt-playground .tab-nav li.current a{border-bottom:5px solid #fb015b}@media (min-width:992px){.jwt-playground .tab-nav li.current a{border-bottom:none}}@media (min-width:992px){.jwt-playground .CodeMirror-wrap{padding:0 0 0 20px}}.jwt-playground .input{border:none;padding:0;background:#fff;box-shadow:none;margin:0 -3px;font-family:proxima-nova,"Helvetica Neue",sans-serif;height:146px;padding-top:20px}@media (min-width:992px){.jwt-playground .input{margin:0 -3px;padding:0 10px;width:49%;border:1px solid rgba(155,155,155,.5);border-radius:3px;display:block!important;float:left}}@media (min-width:992px){.jwt-playground .input .CodeMirror-code{margin:22px 0 7px;padding:0}}.jwt-playground .input:hover{box-shadow:none}.jwt-playground .input .CodeMirror .cm-jwt-header{font-family:proxima-nova,"Helvetica Neue",sans-serif;font-size:15.5px;color:#fb015b;line-height:25px}@media (min-width:992px){.jwt-playground .input .CodeMirror .cm-jwt-header{font-size:18px;line-height:30px}}.jwt-playground .input .CodeMirror .cm-jwt-payload{font-family:proxima-nova,"Helvetica Neue",sans-serif;color:#e05eff;font-size:15.5px;line-height:25px}@media (min-width:992px){.jwt-playground .input .CodeMirror .cm-jwt-payload{font-size:18px;line-height:30px}}.jwt-playground .input .CodeMirror .cm-jwt-signature{font-family:proxima-nova,"Helvetica Neue",sans-serif;color:#00b9f1;font-size:15.5px;line-height:25px}@media (min-width:992px){.jwt-playground .input .CodeMirror .cm-jwt-signature{font-size:18px;line-height:30px}}.jwt-playground .tab-content,.jwt-playground .validation-status.invalid-token,.jwt-playground .validation-status.valid-token{display:none}@media (min-width:992px){.jwt-playground .validation-status.valid-token{display:block}}@media (min-width:992px){.jwt-playground .validation-status.invalid-token{display:block;margin:30px -27px;width:auto;background:#00b9f1;border-radius:3px;font-size:30px;color:#fff;line-height:86px;height:80px;padding:0;text-transform:none}}.jwt-playground .output .jwt-explained{margin-bottom:0}.jwt-playground .output .jwt-explained pre,.jwt-playground .output .jwt-header .CodeMirror .cm-property{color:#fb015b;font-size:14px;line-height:19px}.jwt-playground .output .jwt-payload .CodeMirror .cm-atom,.jwt-playground .output .jwt-payload .CodeMirror .cm-string,.jwt-playground .output .jwt-payload pre{color:#d63aff}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{height:65px;background:#000;border-top:1px solid #2d2d2d;max-height:none}@media (min-width:992px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{height:100px;background:0 0}}.navbar-brand{height:auto;padding:0;margin:23px 0 0 25px}@media (min-width:992px){.navbar{height:100px;background:#000}}.navbar-default .navbar-brand img{width:41px}@media (min-width:992px){.navbar-default.navbar-fixed-top{background:#000;border-bottom:1px solid #2c2c2c}}.navbar-default .navbar-toggle{border:none;margin-top:16px;background:url(../../img/ico_close.svg) no-repeat 50% 50%;background-size:22px 22px}.navbar-default .navbar-toggle .icon-bar{background-color:transparent}.navbar-default .navbar-toggle.collapsed{background:0 0}.navbar-default .navbar-toggle.collapsed .icon-bar{background-color:#fff}@media (min-width:992px){.navbar-default .navbar-brand img{width:auto;margin-top:19px}}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:transparent!important}.banner-jwt{background:#000;text-align:center;position:relative;z-index:9;padding-bottom:28px}@media (min-width:992px){.banner-jwt{padding-top:150px;padding-bottom:113px}}.banner-jwt p{font-size:22px;line-height:29px;margin:0 -10px}@media (min-width:992px){.banner-jwt p{font-size:40px;color:#fff;line-height:50px;padding:0 40px;font-weight:300}.banner-jwt p strong{font-weight:400}.banner-jwt p span{font-size:32px;font-weight:400}}.banner-jwt .logo{width:67px;display:block;margin:-7px auto 23px auto}@media (min-width:992px){.banner-jwt .logo{width:90px;margin:0 auto 45px}}.banner-jwt .logo img{width:100%;height:77px}@media (min-width:992px){.banner-jwt .logo img{height:auto}}h1{font-size:34px;color:#000;line-height:38px;font-weight:400;text-align:center}@media (min-width:992px){h1{font-size:40px;line-height:48px;padding-top:22px;padding-bottom:4px}}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:87px;display:inline-block;height:31px}@media (min-width:992px){.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:101px;height:37px}}.bootstrap-select>.btn{font-size:10px;height:33px;padding-left:10px;letter-spacing:0}@media (min-width:992px){.bootstrap-select>.btn{font-size:12px;height:37px}}.bg-grey{border:none;padding:0}@media (min-width:992px){.bg-grey{margin-top:52px;background:#eaeaea;padding-bottom:56px}}.bg-grey h1{font-size:31px;line-height:37px;letter-spacing:0;padding-bottom:10px}@media (min-width:992px){.bg-grey h1{font-size:36px;color:#000;line-height:37px;font-weight:400;letter-spacing:0;padding-bottom:20px}}.bg-grey .page-header{border:none;margin:45px 0 20px}@media (min-width:992px){.bg-grey .algorithm{float:right;margin:0;position:relative;top:22px;right:-18px}}@media (min-width:992px){.bg-grey .algorithm label{font-size:12px;padding-right:7px}}@media (min-width:992px){.bg-grey .row{margin:0 -20px}}@media (min-width:1280px){.bg-grey .row{margin:0}}@media (min-width:992px){.bg-grey .col-md-4{margin:0 1.666% 70px;width:30%}}@media (min-width:992px) and (min-width:1280px){.bg-grey .col-md-4{margin:0 15px 70px;width:375px}}.page-header{border-bottom:none;padding-bottom:4px}.jwt-playground .CodeMirror-hscrollbar,.jwt-playground .CodeMirror-measure,.jwt-playground .CodeMirror-vscrollbar{display:none!important}pre{background:0 0}.alert-danger{color:#4a4a4a;background-color:#fffcd3;border:none;margin:0 -15px;font-size:12px;line-height:18px;padding:20px 60px 20px 36px;position:relative}@media (min-width:992px){.alert-danger{background-color:#fffcd3;border:none;margin:0 -15px;padding:24px 350px 22px 255px;font-size:16px;color:#4a4a4a;line-height:14px;margin-bottom:90px}}@media (min-width:992px){.alert-danger em{font-style:normal}}.alert-danger .more{text-indent:-999em;display:block;position:absolute;top:50%;right:40px;background:url(../../img/bg_arrow.svg) no-repeat;background-size:8px 13px;width:8px;height:13px;margin-top:-6px}@media (min-width:992px){.alert-danger .more{position:absolute;top:50%;right:253px;background:0 0;width:auto;height:auto;text-indent:0;opacity:.5;font-weight:600;font-size:11px;color:#4a4a4a;letter-spacing:1.39px;line-height:13px;text-decoration:none;text-transform:uppercase;margin-top:-4px}}.panel{margin:0 -15px;background:#f9f9f9;border-radius:0}@media (min-width:992px){.panel{overflow:visible}}.panel h3{color:#fff;font-size:15px;line-height:36px}@media (min-width:992px){.panel h3{line-height:54px;font-size:18px;color:#fff;padding-left:8px}}.panel h3 img{width:28px;margin:-3px 12px 0 -2px}@media (min-width:992px){.panel h3 img{width:auto;position:absolute;top:-37px;left:50%;margin-left:-43px}}.panel .panel-heading{background:#2aa8e5;height:51px;border-radius:0;border:none}@media (min-width:992px){.panel .panel-heading{border-radius:3px 3px 0 0;height:60px;position:relative;font-size:18px;color:#fff;line-height:14px}}.panel .panel-heading.color-2{background:#8ac244}.panel .panel-heading.color-3{background:#e76f00}.panel .panel-heading.color-4{background:#377ef0}.panel .panel-heading.color-5{background:#777bb4}.panel .panel-heading.color-6{background:#efc825}.panel .panel-heading.color-7{background:#a10}.panel .panel-heading.color-8{background:#48b6c4}.panel .panel-heading.color-9{background:#666}.panel .panel-heading.color-10{background:#814626}.panel .panel-heading.color-11{background:#010080}.panel .panel-heading.color-12{background:#ea2e2f}.panel .star-ico{font-size:12px;float:right;line-height:18px;margin:0 15px 0 0;background-size:17px auto;padding:1px 0 0 20px}@media (min-width:992px){.panel .star-ico{font-size:14px;line-height:22px;margin:0 20px 0 0;background-size:auto auto;background-position:0 4px;padding:1px 0 0 22px}}.panel.patched{border:none}@media (min-width:992px){.panel .stars{display:block;font-size:14px;min-height:30px;min-width:1px;line-height:34px}}@media (min-width:992px){.panel .icon-budicon-333{font-size:20px!important;margin-left:8px;float:left;margin-top:2px}}@media (min-width:992px){.panel .icon-budicon-466{font-size:20px;margin-top:2px;margin-left:13px;line-height:28px;float:left}}@media (min-width:992px){.panel-body .row div{margin-bottom:6px}}.panel-body .row div .icon-check{background:url(../../img/ico_status.svg) no-repeat;height:17px;width:17px;background-size:17px 34px;display:block;float:left;position:relative;top:2px;margin-right:8px;font-size:15px;line-height:20px}@media (min-width:992px){.panel-body .row div .icon-check{height:20px;width:20px;background-size:20px 40px;top:1px;margin-right:8px;font-size:18px;line-height:20px}}.panel-body .row div .icon-cross{background:url(../../img/ico_status.svg) no-repeat 0 -17px;height:17px;width:17px;background-size:17px 34px;display:block;float:left;position:relative;top:2px;margin-right:8px;font-size:15px;line-height:20px}@media (min-width:992px){.panel-body .row div .icon-cross{background:url(../../img/ico_status.svg) no-repeat 0 -20px;height:20px;width:20px;background-size:20px 40px;top:1px;margin-right:8px;font-size:18px;line-height:20px}}.panel-body .row>div{padding:15px 0 0 36px}@media (min-width:992px){.panel-body .row>div{padding:29px 0 0 22px;font-size:18px;line-height:24px}}@media (min-width:1280px){.panel-body .row>div{padding:29px 0 0 27px;font-size:18px;line-height:24px}}.panel-body .row>div .grey{color:#9b9b9b}.panel-body .row>.right{padding:15px 0 5px 52px}@media (min-width:992px){.panel-body .row>.right{padding:29px 0 5px 23px}}@media (min-width:1280px){.panel-body .row>.right{padding:29px 0 5px 63px}}.author-info{border-top:1px solid #979797;padding:13px 15px 13px 34px}@media (min-width:992px){.author-info{margin-top:4px;border-top:2px solid #efefef;padding:13px 15px 9px 34px}}.author-info .repository{font-size:19px;color:#000;margin:-1px 20px 0 0}@media (min-width:992px){.author-info .repository{float:right;margin:-32px 25px 0 0}}@media (min-width:992px){.author-info .repository a{font-size:14px;line-height:14px;color:#000}}@media (min-width:992px){.author-info .repository .fa{font-size:22px;top:2px;position:relative}}@media (min-width:992px){.author-info .maintain{float:left}}@media (min-width:992px){.author-info.type-2 .repository{margin:3px 25px 0 0}}@media (min-width:992px){.author-info.type-2 .repository .fa{font-size:22px}}@media (min-width:992px){.author-info .maintainer{float:left}}@media (min-width:992px){.author-info .maintainer span{font-size:14px;line-height:25px;position:relative;top:4px;left:3px}}.hid-m{display:none}@media (min-width:992px){.hid-m{display:none!important}}@media (min-width:992px){.moved.navbar-default .navbar-brand img.hid-m{display:block!important;float:left;width:54px;height:54px;margin-right:14px;margin-top:-1px}}.navbar-toggle:not(.collapsed)+.navbar-brand .hid-m{display:block;float:left;width:26px;height:26px;margin-right:8px;margin-top:-4px}.panel .icon-budicon-333,.panel .icon-budicon-466{opacity:1;font-size:17px}.panel-footer code{padding:15px 15px 18px 35px}@media (min-width:992px){.panel-footer code{padding:20px 15px 23px 43px;background:#000;line-height:18px;border-radius:0 0 3px 3px}}.panel-wrap{display:none}.panel-wrap.active{display:block}@media (min-width:992px){.panel-wrap{height:auto!important;display:block!important}}.bt-con{background:#232228;text-align:center;padding:19px 0 0}.bt-con .container{padding:0}.bt-con .col-md-4{border-bottom:1px solid #2e2d33;padding-bottom:9px}@media (min-width:992px){.bt-con .col-md-4{border-bottom:none;padding-bottom:4px}}.bt-con h3{font-size:26px;color:#fff;line-height:30px;font-weight:400;padding-bottom:4px}@media (min-width:992px){.bt-con h3{font-size:30px;color:#fff;line-height:36px;padding-top:17px}}.bt-con .hold{padding-bottom:14px}@media (min-width:992px){.bt-con .hold{padding-bottom:14px;padding-top:2px}}.bt-con .hold a{background:#000;display:inline-block;font-size:10px;height:30px;line-height:30px;color:#fff;border-radius:183.6px;padding:0 10px}@media (min-width:992px){.bt-con .hold a{font-size:12px;height:35px;line-height:35px;padding:0 12px;margin-bottom:3px}}.bt-con .hold a img{width:15px;margin-right:6px}@media (min-width:992px){.bt-con .hold a img{width:auto;margin-right:8px}}.bt-con .hold.type-2 a{background:0 0;padding:0 10px;margin-bottom:3px}@media (min-width:992px){.bt-con .hold.type-2 a{margin-bottom:3px}}.bt-con .hold.type-2 a img{width:33px;margin-right:0}@media (min-width:992px){.bt-con .hold.type-2 a img{width:auto;position:relative;top:-3px}}.bt-con .hold.type-3 a{background:0 0;padding:0 10px;margin-bottom:-1px;margin-top:2px}.bt-con .hold.type-3 a img{width:73px;margin-right:0}@media (min-width:992px){.bt-con .hold.type-3 a img{width:auto;margin-right:0;margin-bottom:2px}}.bt-con .text-hold{height:33px;border-radius:4px;line-height:33px;cursor:pointer;background:#2e2d33;color:#fff;font-size:12px;margin:18px 32px;text-align:left;padding:0 13px}@media (min-width:992px){.bt-con .text-hold{height:40px;line-height:40px;font-size:14px;margin:18px 32px 20px;padding:0 15px;position:relative}}@media (min-width:992px){.bt-con .text-hold:after{position:absolute;content:"";background:url(../../img/ico_enlarge.svg) no-repeat;width:17px;height:20px;display:block;top:9px;right:13px}}.bt-con .text-hold p{line-height:35px;margin:0}@media (min-width:992px){.bt-con .text-hold p{line-height:44px}}.bt-con .col-2{padding-top:6px;padding-bottom:14px}@media (min-width:992px){.bt-con .col-2{padding-top:0}}.bt-con .tshirts{background:#222228;box-shadow:0 2px 14px 0 rgba(0,0,0,.5);border-radius:3px;margin:33px 30px 20px;padding:17px 12px 14px}@media (min-width:992px){.bt-con .tshirts{margin:8px 52px 20px 6px;padding:18px 12px 14px}}.bt-con .tshirts img{width:195px;margin:0 auto 18px;display:block}@media (min-width:992px){.bt-con .tshirts img{width:auto;margin:0 auto 24px}}.bt-con .tshirts .hover,.bt-con .tshirts:hover .normal{display:none}.bt-con .tshirts:hover .hover{display:block}.bt-con .tshirts .buy{background:#00b9f1;border:1px solid rgba(0,0,0,.5);border-radius:3px;font-size:14px;color:#fff;letter-spacing:.88px;display:block;height:52px;line-height:52px}@media (min-width:992px){.bt-con .tshirts .buy{font-size:16px;height:62px;line-height:62px}}.mobile-no{display:none}@media (min-width:992px){.mobile-no{display:block}}.banner{background:#000;padding:53px 0 128px;overflow:hidden;margin:0}@media (min-width:992px){.banner{padding:78px 0 252px}}.banner .container{padding:0}.banner img{width:125px;margin:0 auto 20px}@media (min-width:992px){.banner img{width:auto;margin:0 auto 30px}}.banner p{font-size:17px;line-height:26px;padding:0 20px}@media (min-width:992px){.banner p{font-size:26px;line-height:40px;padding:0;max-width:800px}}.banner .note{font-size:10px;display:block;text-align:center;letter-spacing:2px;max-width:none;line-height:14px;margin:5px 0 30px}@media (min-width:992px){.banner .note{font-size:14px;line-height:24px;margin:7px 0 40px;max-width:none}}.banner .counter{margin:39px 0 0}@media (min-width:992px){.banner .counter{margin:56px 0 0}}.btn.btn-lg,a.btn.btn-lg{line-height:55px;padding:0;height:51px;font-size:12px;width:236px;text-align:center}@media (min-width:992px){.btn.btn-lg,a.btn.btn-lg{line-height:62px;padding:0;height:62px;font-size:14px;width:276px}}.desktop-only{display:none}@media (min-width:992px){.desktop-only{display:inline-block}}.mobile-only{display:inline-block}@media (min-width:992px){.mobile-only{display:none!important}}.steps{margin:0 -15px;display:block}.steps .select{height:62px;background:#232228 url(../../img/bg_steps.svg) no-repeat 95% 50%;line-height:62px;display:block;padding:0 24px;font-size:12px;font-weight:600;color:#fff;text-transform:uppercase}.steps li,.steps ul{padding:0;margin:0}.steps ul{padding-bottom:15px;background:#232228}.steps li a{line-height:22px;display:block;padding:0 24px;font-size:12px;font-weight:600;color:#fff;text-transform:uppercase}.sidebar{display:none}@media (min-width:992px){.sidebar{display:block;margin-top:91px;float:right;width:283px;padding:17px 0 10px;border:1px solid #ddd;border-radius:4px}}@media (min-width:992px){.sidebar h4{font-size:13px;text-transform:uppercase;text-align:left;color:#333;margin:0;border-top:1px solid #ebebeb;padding:27px 28px 30px}}@media (min-width:992px){.sidebar .btn{display:block;color:#fff;border-color:transparent;margin:0 28px 27px;opacity:1;background:#d63aff;line-height:43px;padding:0;letter-spacing:1px;height:43px;font-size:14px}}@media (min-width:992px){.sidebar .btn:hover{background:#a829c9}}@media (min-width:992px){.sidebar p{text-align:center;font-size:13px;line-height:20px;padding:15px 28px 13px;margin:0}}@media (min-width:992px){.sidebar ul{font-size:14px;text-align:left;color:#333;line-height:normal;margin:0;padding:0 28px}}@media (min-width:992px){.sidebar ul li{list-style:none;margin:0;padding:0 0 11px}}@media (min-width:992px){.sidebar ul a{color:#333}}@media (min-width:992px){.sidebar ul a:hover{color:#bc0edf}}@media (min-width:992px){.sidebar ul .current a{color:#bc0edf;font-weight:600}}.entry{padding:23px 9px;font-size:14px;color:#000}@media (min-width:992px){.entry{float:left;width:55.49%;padding-top:73px}}.entry p{line-height:24px;margin:0;padding:0 0 23px}@media (min-width:992px){.entry p{line-height:28px;padding-bottom:0;display:inline}}.entry .label{font-size:12px;color:#fff;font-weight:400;font-family:Menlo;line-height:18px;padding:0 5px;display:inline-block;background:#d63aff}@media (min-width:992px){.entry .label{line-height:21px}}.entry pre{word-wrap:normal;word-break:normal;background:#f4f4f4;border:1px solid #d5d5d5;font-family:Menlo;font-size:12px;display:block;border-radius:3px;margin-top:-12px;margin-bottom:24px;padding:18px 22px}@media (min-width:992px){.entry pre{margin:40px 0 57px;font-size:12px;padding-top:21px;padding-bottom:19px;line-height:19px}}.entry code{display:block;white-space:nowrap;padding:0;margin:0;border:0}.entry code span{display:inline-block;min-width:13px}.entry h2{padding:0 0 16px;font-size:20px;line-height:20px;font-weight:400;margin:0}@media (min-width:992px){.entry h2{font-size:22px;padding-bottom:39px}}.btn.btn-purple.btn-lg,a.btn.btn-purple.btn-lg{display:none}.btn.btn-purple.btn-lg.hidden-lg,a.btn.btn-purple.btn-lg.hidden-lg{display:inline-block;color:#fff;border-color:transparent;margin:25px 0 16px;opacity:1;background:#d63aff;line-height:52px;padding:0;letter-spacing:1px;height:52px;font-size:14px;width:236px}.btn.btn-purple.btn-lg.hidden-lg:hover,a.btn.btn-purple.btn-lg.hidden-lg:hover{background:#a829c9}@media (min-width:992px){.btn.btn-purple.btn-lg.hidden-lg,a.btn.btn-purple.btn-lg.hidden-lg{display:none}}@media (min-width:992px){.btn.btn-purple.btn-lg,a.btn.btn-purple.btn-lg{display:inline-block;color:#fff;border-color:transparent;margin:42px 0 -58px;opacity:1;background:#d63aff;line-height:62px;padding:0;height:62px;font-size:14px;width:276px}.btn.btn-purple.btn-lg:hover,a.btn.btn-purple.btn-lg:hover{background:#a829c9}}#footer{height:82px;border-top:1px solid #313131;background:#000}#footer.static{position:relative}@media (min-width:992px){#footer{height:120px;border-top:2px solid #313131}}#footer .container{padding:0}#footer .design,#footer .twitter{display:none}@media (min-width:992px){#footer .design{display:block;float:left;font-size:14px;color:#fff;line-height:17px;margin:45px 0 0 34px}}@media (min-width:992px){#footer .design a{color:#fff}}@media (min-width:992px){#footer .design a img{position:relative;top:-2px;right:-7px}}@media (min-width:992px){#footer .twitter{display:block;float:right;background:url(../../img/ico_twitter.svg) no-repeat;height:25px;width:25px;margin:45px 0 0}}@media (min-width:1280px){#footer .twitter{margin:45px -18px 0 0}}@media (min-width:992px){#footer .twitter a{display:block;height:25px;width:25px}}#footer .ft-note{width:300px;position:absolute;top:33px;left:50%;text-align:center;margin-left:-150px;font-size:14px;line-height:14px;color:#fff}@media (min-width:992px){#footer .ft-note{width:320px;top:48px;margin-left:-160px;font-size:16px;line-height:16px}}@media (min-width:992px){#footer .container,.banner .container,.bt-con .container{padding:0 15px}}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#fff;background:0 0}.navbar-nav{padding-top:79px;padding-bottom:63px}@media (min-width:992px){.navbar-nav{padding-top:0;padding-bottom:0;float:left;margin:29px 0 0 325px}}.navbar-nav>li>a{text-align:center;font-size:34px;line-height:34px;color:#fff;margin-bottom:15px}@media (min-width:992px){.navbar-nav>li>a{font-size:14px;color:#fff;line-height:14px}}.navbar-collapse .design{color:#fff;font-size:12px;text-align:center;display:block;border-top:1px solid #2d2d2d;margin:0 -15px;padding:24px 0 29px}@media (min-width:992px){.navbar-collapse .design{display:none}}.navbar-collapse .design img{width:15px;margin-left:4px}@media (min-width:992px){.navbar-collapse .twitter{float:right;margin:36px -15px 0 0}}@media (max-width:994px){.jwt-playground .input,.jwt-playground .output{min-height:0!important}.jwt-playground .CodeMirror-code{padding-top:0;padding-bottom:0}.jwt-playground .input{height:auto}.filter-set{height:auto!important}.bg-grey .col-md-4{position:static!important}}@media (min-width:1280px){.filter-set{margin:0 -33px}}.flip-clock-wrapper{font-family:DINCondensedBold;-webkit-user-select:none;text-align:center;position:relative;width:100%;margin:0;-ms-transform:scale(.8);-webkit-transform:scale(.8);transform:scale(.8)}@media (min-width:992px){.flip-clock-wrapper{-ms-transform:none;-webkit-transform:none;transform:none}}.flip-clock-wrapper *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden}.flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}.flip-clock-wrapper a:hover{color:#fff}.flip-clock-wrapper ul{padding:0;list-style:none;position:relative;float:none;display:inline-block;margin:1px;width:31px;height:50px;font-size:80px;font-weight:700;line-height:87px;border-radius:2px;background:#000}.flip-clock-wrapper ul:nth-child(2),.flip-clock-wrapper ul:nth-child(5){margin-right:8px}@media (min-width:992px){.flip-clock-wrapper ul{width:40px;height:66px;line-height:66px}}.flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:64px;text-decoration:none!important}.pc .flip-clock-wrapper ul li{line-height:56px}@media (min-width:992px){.flip-clock-wrapper ul li{line-height:86px}.pc .flip-clock-wrapper ul li{line-height:70px}}.flip-clock-wrapper ul li:first-child{z-index:2}.flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;-moz-perspective:200px;perspective:200px;margin:0!important;overflow:visible!important;cursor:default!important}.flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;-moz-transform-origin:50% 100%;-ms-transform-origin:50% 100%;-o-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,.4)}.flip-clock-wrapper ul li a div.up div.inn{top:0}.flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-ms-transform-origin:50% 0;-o-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}.flip-clock-wrapper ul li a div.down div.inn{bottom:0}.flip-clock-wrapper ul li a div div.inn{font-family:DINCondensedBold;position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:46px}@media (min-width:992px){.flip-clock-wrapper ul li a div div.inn{font-size:60px}}.flip-clock-wrapper ul li.flip-clock-active,.flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}.flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 .5s linear both;-moz-animation:turn2 .5s linear both;animation:turn2 .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1)0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1)0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1)0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1)0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1)0,#000 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top,#000 0,rgba(0,0,0,.1)100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#000),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,#000 0,rgba(0,0,0,.1)100%;background:-o-linear-gradient(top,#000 0,rgba(0,0,0,.1)100%);background:-ms-linear-gradient(top,#000 0,rgba(0,0,0,.1)100%);background:linear,to bottom,#000 0,rgba(0,0,0,.1)100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd .5s .5s linear both;-moz-animation:asd .5s .5s linear both;animation:asd .5s .5s linear both;z-index:5}.flip-clock-wrapper ul.play li.flip-clock-active .down{z-index:2;-webkit-animation:turn .5s .5s linear both;-moz-animation:turn .5s .5s linear both;animation:turn .5s .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top,#000 0,rgba(0,0,0,.1)100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#000),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,#000 0,rgba(0,0,0,.1)100%;background:-o-linear-gradient(top,#000 0,rgba(0,0,0,.1)100%);background:-ms-linear-gradient(top,#000 0,rgba(0,0,0,.1)100%);background:linear,to bottom,#000 0,rgba(0,0,0,.1)100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .2s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1)0,#000 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(0,0,0,.1)),color-stop(100%,#000));background:linear,top,rgba(0,0,0,.1)0,#000 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1)0,#000 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1)0,#000 100%);background:linear,to bottom,rgba(0,0,0,.1)0,#000 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .3s linear both}.flip-clock-wrapper li{padding:0;margin:0;list-style:none}.flip-clock-wrapper.clearfix{*zoom:1}.flip-clock-wrapper.clearfix:after,.flip-clock-wrapper:after{clear:both}.flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,.7)}.flip-clock-wrapper.clearfix:after,.flip-clock-wrapper.clearfix:before{content:" ";display:table}.flip-clock-meridium{background:none!important;box-shadow:0 0 0!important;font-size:36px!important}.flip-clock-meridium a{color:#313333}.flip-clock-wrapper:after,.flip-clock-wrapper:before{content:" ";display:table}.flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}.flip-clock-divider:first-child{width:0}.flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-86px;color:#000;text-shadow:none}.flip-clock-divider.minutes .flip-clock-label{right:-88px}.flip-clock-divider.seconds .flip-clock-label{right:-91px}.flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.5);left:5px}.flip-clock-dot.top{top:30px}.flip-clock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@-moz-keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@-o-keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0)}}@-moz-keyframes turn{0%{-moz-transform:rotateX(90deg)}100%{-moz-transform:rotateX(0)}}@-o-keyframes turn{0%{-o-transform:rotateX(90deg)}100%{-o-transform:rotateX(0)}}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0)}100%{-webkit-transform:rotateX(-90deg)}}@-moz-keyframes turn2{0%{-moz-transform:rotateX(0)}100%{-moz-transform:rotateX(-90deg)}}@-o-keyframes turn2{0%{-o-transform:rotateX(0)}100%{-o-transform:rotateX(-90deg)}}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@-moz-keyframes show{0%{opacity:0}100%{opacity:1}}@-o-keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@-moz-keyframes hide{0%{opacity:1}100%{opacity:0}}@-o-keyframes hide{0%{opacity:1}100%{opacity:0}}@-moz-keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@-webkit-keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@-o-keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@keyframes asd{0%{z-index:2}100%,20%{z-index:4}}@-moz-keyframes turn{0%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}@-webkit-keyframes turn{0%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}@-o-keyframes turn{0%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}@keyframes turn{0%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}@-moz-keyframes turn2{0%{transform:rotateX(0)}100%{transform:rotateX(-90deg)}}@-webkit-keyframes turn2{0%{transform:rotateX(0)}100%{transform:rotateX(-90deg)}}@-o-keyframes turn2{0%{transform:rotateX(0)}100%{transform:rotateX(-90deg)}}@keyframes turn2{0%{transform:rotateX(0)}100%{transform:rotateX(-90deg)}}@-moz-keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@-o-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-moz-keyframes hide{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@-o-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}} \ No newline at end of file diff --git a/dist/js/app.js b/dist/js/app.js index 552e860d..b4fd9f87 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -1,12 +1,12 @@ -function hex2b64(a){var b,c,d="";for(b=0;b+3<=a.length;b+=3)c=parseInt(a.substring(b,b+3),16),d+=b64map.charAt(c>>6)+b64map.charAt(63&c);if(b+1==a.length?(c=parseInt(a.substring(b,b+1),16),d+=b64map.charAt(c<<2)):b+2==a.length&&(c=parseInt(a.substring(b,b+2),16),d+=b64map.charAt(c>>2)+b64map.charAt((3&c)<<4)),b64pad)for(;(3&d.length)>0;)d+=b64pad;return d}function b64tohex(a){var b,c,d,e="",f=0;for(b=0;bd||(0==f?(e+=int2char(d>>2),c=3&d,f=1):1==f?(e+=int2char(c<<2|d>>4),c=15&d,f=2):2==f?(e+=int2char(c),e+=int2char(d>>2),c=3&d,f=3):(e+=int2char(c<<2|d>>4),e+=int2char(15&d),f=0));return 1==f&&(e+=int2char(c<<2)),e}function b64toBA(a){var b,c=b64tohex(a),d=new Array;for(b=0;2*b=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpFromInt(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+this.DV:this.t=0}function nbv(a){var b=nbi();return b.fromInt(a),b}function bnpFromString(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void this.fromRadix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intAt(a,d);0>g?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<>this.DB-f):this[this.t-1]|=g<=this.DB&&(f-=this.DB))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<0)for(h>h)>0&&(e=!0,f=int2char(c));g>=0;)b>h?(c=(this[g]&(1<>(h+=this.DB-b)):(c=this[g]>>(h-=b)&d,0>=h&&(h+=this.DB,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnNegate(){var a=nbi();return BigInteger.ZERO.subTo(this,a),a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<>d;for(var g=c+1;g>d;d>0&&(b[this.t-c-1]|=(this.s&f)<c;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=0>d?-1:0,-1>d?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e=0;)a[c]=0;for(c=0;c=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t0?(d.lShiftTo(i,f),e.lShiftTo(i,c)):(d.copyTo(f),e.copyTo(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<1?f[j-2]>>this.F2:0),m=this.FV/l,n=(1<=0&&(c[c.t++]=1,c.subTo(r,c)),BigInteger.ONE.dlShiftTo(j,r),r.subTo(f,f);f.t=0;){var s=c[--p]==k?this.DM:Math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))0&&c.rShiftTo(i,c),0>g&&BigInteger.ZERO.subTo(c,c)}}}function bnMod(a){var b=nbi();return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b),b}function Classic(a){this.m=a}function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function cSqrTo(a,b){a.squareTo(b),this.reduce(b)}function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function Montgomery(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(b,b),b}function montRevert(a){var b=nbi();return a.copyTo(b),this.reduce(b),b}function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b),this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(a,b){if(a>4294967295||1>a)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);--f>=0;)if(b.sqrTo(c,d),(a&1<0)b.mulTo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnModPowInt(a,b){var c;return c=256>a||b.isEven()?new Classic(b):new Montgomery(b),this.exp(a,c)}function bnClone(){var a=nbi();return this.copyTo(a),a}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divRemTo(d,e,f);e.signum()>0;)g=(c+f.intValue()).toString(a).substr(1)+g,e.divRemTo(d,e,f);return f.intValue().toString(a)+g}function bnpFromRadix(a,b){this.fromInt(0),null==b&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,f=0,g=0,h=0;hi?"-"==a.charAt(h)&&0==this.signum()&&(e=!0):(g=b*g+i,++f>=c&&(this.dMultiply(d),this.dAddOffset(g,0),f=0,g=0))}f>0&&(this.dMultiply(Math.pow(b,f)),this.dAddOffset(g,0)),e&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var d=new Array,e=7&a;d.length=(a>>3)+1,b.nextBytes(d),e>0?d[0]&=(1<0)for(d>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<=0;)8>d?(c=(this[a]&(1<>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,0>=d&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;f>d;++d)c[d]=b(this[d],a[d]);if(a.ta?this.rShiftTo(-a,b):this.lShiftTo(a,b),b}function bnShiftRight(a){var b=nbi();return 0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b),b}function lbit(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bnGetLowestSetBit(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<c;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=0>d?-1:0,d>0?b[c++]=d:-1>d&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function bnAdd(a){var b=nbi();return this.addTo(a,b),b}function bnSubtract(a){var b=nbi();return this.subTo(a,b),b}function bnMultiply(a){var b=nbi();return this.multiplyTo(a,b),b}function bnSquare(){var a=nbi();return this.squareTo(a),a}function bnDivide(a){var b=nbi();return this.divRemTo(a,b,null),b}function bnRemainder(a){var b=nbi();return this.divRemTo(a,null,b),b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();return this.divRemTo(a,b,c),new Array(b,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}function bnPow(a){return this.exp(a,new NullExp)}function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpMultiplyUpperTo(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=nbi();return a.copyTo(b),this.reduce(b),b}function barrettRevert(a){return a}function barrettReduce(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b),this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnModPow(a,b){var c,d,e=a.bitLength(),f=nbv(1);if(0>=e)return f;c=18>e?1:48>e?3:144>e?4:768>e?5:6,d=8>e?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=new Array,h=3,i=c-1,j=(1<1){var k=nbi();for(d.sqrTo(g[1],k);j>=h;)g[h]=nbi(),d.mulTo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<0&&(l|=a[n-1]>>this.DB+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.DB,--n),o)g[l].copyTo(f),o=!1;else{for(;h>1;)d.sqrTo(f,p),d.sqrTo(p,f),h-=2;h>0?d.sqrTo(f,p):(m=f,f=p,p=m),d.mulTo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function bnpModInt(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&f.isEven()||(e.addTo(this,e),f.subTo(a,f)),e.rShiftTo(1,e)):f.isEven()||f.subTo(a,f),f.rShiftTo(1,f);for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&h.isEven()||(g.addTo(this,g),h.subTo(a,h)),g.rShiftTo(1,g)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(g,e),f.subTo(h,f)):(d.subTo(c,d),b&&g.subTo(e,g),h.subTo(f,h))}return 0!=d.compareTo(BigInteger.ONE)?BigInteger.ZERO:h.compareTo(a)>=0?h.subtract(a):h.signum()<0?(h.addTo(a,h),h.signum()<0?h.add(a):h):h}function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;bd;)d*=lowprimes[e++];for(d=c.modInt(d);e>b;)if(d%lowprimes[b++]==0)return!1}return c.millerRabin(a)}function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var d=b.shiftRight(c);a=a+1>>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;a>f;++f){e.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var g=e.modPow(d,this);if(0!=g.compareTo(BigInteger.ONE)&&0!=g.compareTo(b)){for(var h=1;h++b;++b)this.S[b]=b;for(c=0,b=0;256>b;++b)c=c+this.S[b]+a[b%a.length]&255,d=this.S[b],this.S[b]=this.S[c],this.S[c]=d;this.i=0,this.j=0}function ARC4next(){var a;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,a=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=a,this.S[a+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function rng_seed_int(a){rng_pool[rng_pptr++]^=255&a,rng_pool[rng_pptr++]^=a>>8&255,rng_pool[rng_pptr++]^=a>>16&255,rng_pool[rng_pptr++]^=a>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptra?"0"+a.toString(16):a.toString(16)}function pkcs1pad2(a,b){if(b=0&&b>0;){var e=a.charCodeAt(d--);128>e?c[--b]=e:e>127&&2048>e?(c[--b]=63&e|128,c[--b]=e>>6|192):(c[--b]=63&e|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;for(var f=new SecureRandom,g=new Array;b>2;){for(g[0]=0;0==g[0];)f.nextBytes(g);c[--b]=g[0]}return c[--b]=2,c[--b]=0,new BigInteger(c)}function oaep_mgf1_arr(a,b,c){for(var d="",e=0;d.length>24,(16711680&e)>>16,(65280&e)>>8,255&e]))),e+=1;return d}function oaep_pad(a,b,c){if(a.length+2*SHA1_SIZE+2>b)throw"Message too long for RSA";var d,e="";for(d=0;d0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16)):alert("Invalid RSA public key")}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){var b=pkcs1pad2(a,this.n.bitLength()+7>>3);if(null==b)return null;var c=this.doPublic(b);if(null==c)return null;var d=c.toString(16);return 0==(1&d.length)?d:"0"+d}function RSAEncryptOAEP(a,b){var c=oaep_pad(a,this.n.bitLength()+7>>3,b);if(null==c)return null;var d=this.doPublic(c);if(null==d)return null;var e=d.toString(16);return 0==(1&e.length)?e:"0"+e}function pkcs1unpad2(a,b){for(var c=a.toByteArray(),d=0;d=c.length)return null;for(var e="";++df?e+=String.fromCharCode(f):f>191&&224>f?(e+=String.fromCharCode((31&f)<<6|63&c[d+1]),++d):(e+=String.fromCharCode((15&f)<<12|(63&c[d+1])<<6|63&c[d+2]),d+=2)}return e}function oaep_mgf1_str(a,b,c){for(var d="",e=0;d.length>24,(16711680&e)>>16,(65280&e)>>8,255&e])),e+=1;return d}function oaep_unpad(a,b,c){a=a.toByteArray();var d;for(d=0;d0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16)):alert("Invalid RSA private key")}function RSASetPrivateEx(a,b,c,d,e,f,g,h){if(null==a)throw"RSASetPrivateEx N == null";if(null==b)throw"RSASetPrivateEx E == null";if(0==a.length)throw"RSASetPrivateEx N.length == 0";if(0==b.length)throw"RSASetPrivateEx E.length == 0";null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16),this.p=parseBigInt(d,16),this.q=parseBigInt(e,16),this.dmp1=parseBigInt(f,16),this.dmq1=parseBigInt(g,16),this.coeff=parseBigInt(h,16)):alert("Invalid RSA private key in RSASetPrivateEx")}function RSAGenerate(a,b){var c=new SecureRandom,d=a>>1;this.e=parseInt(b,16);for(var e=new BigInteger(b,16);;){for(;this.p=new BigInteger(a-d,1,c),0!=this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new BigInteger(d,1,c),0!=this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var f=this.p;this.p=this.q,this.q=f}var g=this.p.subtract(BigInteger.ONE),h=this.q.subtract(BigInteger.ONE),i=g.multiply(h);if(0==i.gcd(e).compareTo(BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=e.modInverse(i),this.dmp1=this.d.mod(g),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}}function RSADoPrivate(a){if(null==this.p||null==this.q)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),c=a.mod(this.q).modPow(this.dmq1,this.q);b.compareTo(c)<0;)b=b.add(this.p);return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c)}function RSADecrypt(a){var b=parseBigInt(a,16),c=this.doPrivate(b);return null==c?null:pkcs1unpad2(c,this.n.bitLength()+7>>3)}function RSADecryptOAEP(a,b){var c=parseBigInt(a,16),d=this.doPrivate(c);return null==d?null:oaep_unpad(d,this.n.bitLength()+7>>3,b)}function ECFieldElementFp(a,b){this.x=b,this.q=a}function feFpEquals(a){return a==this?!0:this.q.equals(a.q)&&this.x.equals(a.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(a){return new ECFieldElementFp(this.q,this.x.add(a.toBigInteger()).mod(this.q))}function feFpSubtract(a){return new ECFieldElementFp(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}function feFpMultiply(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(a,b,c,d){this.curve=a,this.x=b,this.y=c,this.z=null==d?BigInteger.ONE:d,this.zinv=null}function pointFpGetX(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(a){if(a==this)return!0;if(this.isInfinity())return a.isInfinity();if(a.isInfinity())return this.isInfinity();var b,c;return b=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q),b.equals(BigInteger.ZERO)?(c=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q),c.equals(BigInteger.ZERO)):!1}function pointFpIsInfinity(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q),c=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(c))return BigInteger.ZERO.equals(b)?this.twice():this.curve.getInfinity();var d=new BigInteger("3"),e=this.x.toBigInteger(),f=this.y.toBigInteger(),g=(a.x.toBigInteger(),a.y.toBigInteger(),c.square()),h=g.multiply(c),i=e.multiply(g),j=b.square().multiply(this.z),k=j.subtract(i.shiftLeft(1)).multiply(a.z).subtract(h).multiply(c).mod(this.curve.q),l=i.multiply(d).multiply(b).subtract(f.multiply(h)).subtract(j.multiply(b)).multiply(a.z).add(b.multiply(h)).mod(this.curve.q),m=h.multiply(this.z).multiply(a.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(k),this.curve.fromBigInteger(l),m)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var a=new BigInteger("3"),b=this.x.toBigInteger(),c=this.y.toBigInteger(),d=c.multiply(this.z),e=d.multiply(c).mod(this.curve.q),f=this.curve.a.toBigInteger(),g=b.square().multiply(a);BigInteger.ZERO.equals(f)||(g=g.add(this.z.square().multiply(f))),g=g.mod(this.curve.q);var h=g.square().subtract(b.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(d).mod(this.curve.q),i=g.multiply(a).multiply(b).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(g.square().multiply(g)).mod(this.curve.q),j=d.square().multiply(d).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(i),j)}function pointFpMultiply(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b,c=a,d=c.multiply(new BigInteger("3")),e=this.negate(),f=this;for(b=d.bitLength()-2;b>0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add(g?this:e))}return f}function pointFpMultiplyTwo(a,b,c){var d;d=a.bitLength()>c.bitLength()?a.bitLength()-1:c.bitLength()-1;for(var e=this.curve.getInfinity(),f=this.add(b);d>=0;)e=e.twice(),a.testBit(d)?e=e.add(c.testBit(d)?f:this):c.testBit(d)&&(e=e.add(b)),--d;return e}function ECCurveFp(a,b,c){this.q=a,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(c),this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(a){return a==this?!0:this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(a){return new ECFieldElementFp(this.q,a)}function curveFpDecodePointHex(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var b=(a.length-2)/2,c=a.substr(2,b),d=a.substr(b+2,b);return new ECPointFp(this,this.fromBigInteger(new BigInteger(c,16)),this.fromBigInteger(new BigInteger(d,16)));default:return null}}function Base64x(){}function stoBA(a){for(var b=new Array,c=0;ce;e++)c+="0";return c+a}function _rsasign_signString(a,b){var c=function(a){return KJUR.crypto.Util.hashString(a,b)},d=c(a);return this.signWithMessageHash(d,b)}function _rsasign_signWithMessageHash(a,b){var c=KJUR.crypto.Util.getPaddedDigestInfoHex(a,b,this.n.bitLength()),d=parseBigInt(c,16),e=this.doPrivate(d),f=e.toString(16); -return _zeroPaddingOfSignature(f,this.n.bitLength())}function _rsasign_signStringWithSHA1(a){return _rsasign_signString.call(this,a,"sha1")}function _rsasign_signStringWithSHA256(a){return _rsasign_signString.call(this,a,"sha256")}function pss_mgf1_str(a,b,c){for(var d="",e=0;d.length>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),e+=1;return d}function _rsasign_signStringPSS(a,b,c){var d=function(a){return KJUR.crypto.Util.hashHex(a,b)},e=d(rstrtohex(a));return void 0===c&&(c=-1),this.signWithMessageHashPSS(e,b,c)}function _rsasign_signWithMessageHashPSS(a,b,c){var d,e=hextorstr(a),f=e.length,g=this.n.bitLength()-1,h=Math.ceil(g/8),i=function(a){return KJUR.crypto.Util.hashHex(a,b)};if(-1===c||void 0===c)c=f;else if(-2===c)c=h-f-2;else if(-2>c)throw"invalid salt length";if(f+c+2>h)throw"data too long";var j="";c>0&&(j=new Array(c),(new SecureRandom).nextBytes(j),j=String.fromCharCode.apply(String,j));var k=hextorstr(i(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+e+j))),l=[];for(d=0;h-c-f-2>d;d+=1)l[d]=0;var m=String.fromCharCode.apply(String,l)+""+j,n=pss_mgf1_str(k,m.length,i),o=[];for(d=0;d>8*h-g&255;for(o[0]&=~p,d=0;f>d;d++)o.push(k.charCodeAt(d));return o.push(188),_zeroPaddingOfSignature(this.doPrivate(new BigInteger(o)).toString(16),this.n.bitLength())}function _rsasign_getDecryptSignatureBI(a,b,c){var d=new RSAKey;d.setPublic(b,c);var e=d.doPublic(a);return e}function _rsasign_getHexDigestInfoFromSig(a,b,c){var d=_rsasign_getDecryptSignatureBI(a,b,c),e=d.toString(16).replace(/^1f+00/,"");return e}function _rsasign_getAlgNameAndHashFromHexDisgestInfo(a){for(var b in KJUR.crypto.Util.DIGESTINFOHEAD){var c=KJUR.crypto.Util.DIGESTINFOHEAD[b],d=c.length;if(a.substring(0,d)==c){var e=[b,a.substring(d)];return e}}return[]}function _rsasign_verifySignatureWithArgs(a,b,c,d){var e=_rsasign_getHexDigestInfoFromSig(b,c,d),f=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(0==f.length)return!1;var g=f[0],h=f[1],i=function(a){return KJUR.crypto.Util.hashString(a,g)},j=i(a);return h==j}function _rsasign_verifyHexSignatureForMessage(a,b){var c=parseBigInt(a,16),d=_rsasign_verifySignatureWithArgs(b,c,this.n.toString(16),this.e.toString(16));return d}function _rsasign_verifyString(a,b){b=b.replace(_RE_HEXDECONLY,""),b=b.replace(/[ \n]+/g,"");var c=parseBigInt(b,16);if(c.bitLength()>this.n.bitLength())return 0;var d=this.doPublic(c),e=d.toString(16).replace(/^1f+00/,""),f=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(0==f.length)return!1;var g=f[0],h=f[1],i=function(a){return KJUR.crypto.Util.hashString(a,g)},j=i(a);return h==j}function _rsasign_verifyWithMessageHash(a,b){b=b.replace(_RE_HEXDECONLY,""),b=b.replace(/[ \n]+/g,"");var c=parseBigInt(b,16);if(c.bitLength()>this.n.bitLength())return 0;var d=this.doPublic(c),e=d.toString(16).replace(/^1f+00/,""),f=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(0==f.length)return!1;var g=(f[0],f[1]);return g==a}function _rsasign_verifyStringPSS(a,b,c,d){var e=function(a){return KJUR.crypto.Util.hashHex(a,c)},f=e(rstrtohex(a));return void 0===d&&(d=-1),this.verifyWithMessageHashPSS(f,b,c,d)}function _rsasign_verifyWithMessageHashPSS(a,b,c,d){var e=new BigInteger(b,16);if(e.bitLength()>this.n.bitLength())return!1;var f,g=function(a){return KJUR.crypto.Util.hashHex(a,c)},h=hextorstr(a),i=h.length,j=this.n.bitLength()-1,k=Math.ceil(j/8);if(-1===d||void 0===d)d=i;else if(-2===d)d=k-i-2;else if(-2>d)throw"invalid salt length";if(i+d+2>k)throw"data too long";var l=this.doPublic(e).toByteArray();for(f=0;f>8*k-j&255;if(0!==(m.charCodeAt(0)&o))throw"bits beyond keysize not zero";var p=pss_mgf1_str(n,m.length,g),q=[];for(f=0;ff;f+=1)if(0!==q[f])throw"leftmost octets not zero";if(1!==q[r])throw"0x01 marker not found";return n===hextorstr(g(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+h+String.fromCharCode.apply(String,q.slice(-d)))))}function X509(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return a=a.replace(/(..)/g,"%$1"),a=decodeURIComponent(a)},this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return a=a.replace(/(..)/g,"%$1"),a=decodeURIComponent(a)},this.readCertPEM=function(a){var b=X509.pemToHex(a),c=X509.getPublicKeyHexArrayFromCertHex(b),d=new RSAKey;d.setPublic(c[0],c[1]),this.subjectPublicKeyRSA=d,this.subjectPublicKeyRSA_hN=c[0],this.subjectPublicKeyRSA_hE=c[1],this.hex=b},this.readCertPEMWithoutRSAInit=function(a){var b=X509.pemToHex(a),c=X509.getPublicKeyHexArrayFromCertHex(b);this.subjectPublicKeyRSA.setPublic(c[0],c[1]),this.subjectPublicKeyRSA_hN=c[0],this.subjectPublicKeyRSA_hE=c[1],this.hex=b}}function url_base64_decode(a){var b=a.replace(/-/g,"+").replace(/_/g,"/");switch(b.length%4){case 0:break;case 2:b+="==";break;case 3:b+="=";break;default:throw"Illegal base64url string!"}var c=window.atob(b);try{return decodeURIComponent(escape(c))}catch(d){return c}}var Zepto=function(){function a(a){return null==a?String(a):U[V.call(a)]||"object"}function b(b){return"function"==a(b)}function c(a){return null!=a&&a==a.window}function d(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function e(b){return"object"==a(b)}function f(a){return e(a)&&!c(a)&&Object.getPrototypeOf(a)==Object.prototype}function g(a){return"number"==typeof a.length}function h(a){return D.call(a,function(a){return null!=a})}function i(a){return a.length>0?x.fn.concat.apply([],a):a}function j(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function k(a){return a in G?G[a]:G[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function l(a,b){return"number"!=typeof b||H[j(a)]?b:b+"px"}function m(a){var b,c;return F[a]||(b=E.createElement(a),E.body.appendChild(b),c=getComputedStyle(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),"none"==c&&(c="block"),F[a]=c),F[a]}function n(a){return"children"in a?C.call(a.children):x.map(a.childNodes,function(a){return 1==a.nodeType?a:void 0})}function o(a,b,c){for(w in b)c&&(f(b[w])||Z(b[w]))?(f(b[w])&&!f(a[w])&&(a[w]={}),Z(b[w])&&!Z(a[w])&&(a[w]=[]),o(a[w],b[w],c)):b[w]!==v&&(a[w]=b[w])}function p(a,b){return null==b?x(a):x(a).filter(b)}function q(a,c,d,e){return b(c)?c.call(a,d,e):c}function r(a,b,c){null==c?a.removeAttribute(b):a.setAttribute(b,c)}function s(a,b){var c=a.className,d=c&&c.baseVal!==v;return b===v?d?c.baseVal:c:void(d?c.baseVal=b:a.className=b)}function t(a){var b;try{return a?"true"==a||("false"==a?!1:"null"==a?null:/^0/.test(a)||isNaN(b=Number(a))?/^[\[\{]/.test(a)?x.parseJSON(a):a:b):a}catch(c){return a}}function u(a,b){b(a);for(var c in a.childNodes)u(a.childNodes[c],b)}var v,w,x,y,z,A,B=[],C=B.slice,D=B.filter,E=window.document,F={},G={},H={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},I=/^\s*<(\w+|!)[^>]*>/,J=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,K=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,L=/^(?:body|html)$/i,M=/([A-Z])/g,N=["val","css","html","text","data","width","height","offset"],O=["after","prepend","before","append"],P=E.createElement("table"),Q=E.createElement("tr"),R={tr:E.createElement("tbody"),tbody:P,thead:P,tfoot:P,td:Q,th:Q,"*":E.createElement("div")},S=/complete|loaded|interactive/,T=/^[\w-]*$/,U={},V=U.toString,W={},X=E.createElement("div"),Y={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Z=Array.isArray||function(a){return a instanceof Array};return W.matches=function(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=X).appendChild(a),d=~W.qsa(e,b).indexOf(a),f&&X.removeChild(a),d},z=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},A=function(a){return D.call(a,function(b,c){return a.indexOf(b)==c})},W.fragment=function(a,b,c){var d,e,g;return J.test(a)&&(d=x(E.createElement(RegExp.$1))),d||(a.replace&&(a=a.replace(K,"<$1>")),b===v&&(b=I.test(a)&&RegExp.$1),b in R||(b="*"),g=R[b],g.innerHTML=""+a,d=x.each(C.call(g.childNodes),function(){g.removeChild(this)})),f(c)&&(e=x(d),x.each(c,function(a,b){N.indexOf(a)>-1?e[a](b):e.attr(a,b)})),d},W.Z=function(a,b){return a=a||[],a.__proto__=x.fn,a.selector=b||"",a},W.isZ=function(a){return a instanceof W.Z},W.init=function(a,c){var d;if(!a)return W.Z();if("string"==typeof a)if(a=a.trim(),"<"==a[0]&&I.test(a))d=W.fragment(a,RegExp.$1,c),a=null;else{if(c!==v)return x(c).find(a);d=W.qsa(E,a)}else{if(b(a))return x(E).ready(a);if(W.isZ(a))return a;if(Z(a))d=h(a);else if(e(a))d=[a],a=null;else if(I.test(a))d=W.fragment(a.trim(),RegExp.$1,c),a=null;else{if(c!==v)return x(c).find(a);d=W.qsa(E,a)}}return W.Z(d,a)},x=function(a,b){return W.init(a,b)},x.extend=function(a){var b,c=C.call(arguments,1);return"boolean"==typeof a&&(b=a,a=c.shift()),c.forEach(function(c){o(a,c,b)}),a},W.qsa=function(a,b){var c,e="#"==b[0],f=!e&&"."==b[0],g=e||f?b.slice(1):b,h=T.test(g);return d(a)&&h&&e?(c=a.getElementById(g))?[c]:[]:1!==a.nodeType&&9!==a.nodeType?[]:C.call(h&&!e?f?a.getElementsByClassName(g):a.getElementsByTagName(b):a.querySelectorAll(b))},x.contains=function(a,b){return a!==b&&a.contains(b)},x.type=a,x.isFunction=b,x.isWindow=c,x.isArray=Z,x.isPlainObject=f,x.isEmptyObject=function(a){var b;for(b in a)return!1;return!0},x.inArray=function(a,b,c){return B.indexOf.call(b,a,c)},x.camelCase=z,x.trim=function(a){return null==a?"":String.prototype.trim.call(a)},x.uuid=0,x.support={},x.expr={},x.map=function(a,b){var c,d,e,f=[];if(g(a))for(d=0;d=0?a:a+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(a){return B.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return b(a)?this.not(this.not(a)):x(D.call(this,function(b){return W.matches(b,a)}))},add:function(a,b){return x(A(this.concat(x(a,b))))},is:function(a){return this.length>0&&W.matches(this[0],a)},not:function(a){var c=[];if(b(a)&&a.call!==v)this.each(function(b){a.call(this,b)||c.push(this)});else{var d="string"==typeof a?this.filter(a):g(a)&&b(a.item)?C.call(a):x(a);this.forEach(function(a){d.indexOf(a)<0&&c.push(a)})}return x(c)},has:function(a){return this.filter(function(){return e(a)?x.contains(this,a):x(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!e(a)?a:x(a)},last:function(){var a=this[this.length-1];return a&&!e(a)?a:x(a)},find:function(a){var b,c=this;return b="object"==typeof a?x(a).filter(function(){var a=this;return B.some.call(c,function(b){return x.contains(b,a)})}):1==this.length?x(W.qsa(this[0],a)):this.map(function(){return W.qsa(this,a)})},closest:function(a,b){var c=this[0],e=!1;for("object"==typeof a&&(e=x(a));c&&!(e?e.indexOf(c)>=0:W.matches(c,a));)c=c!==b&&!d(c)&&c.parentNode;return x(c)},parents:function(a){for(var b=[],c=this;c.length>0;)c=x.map(c,function(a){return(a=a.parentNode)&&!d(a)&&b.indexOf(a)<0?(b.push(a),a):void 0});return p(b,a)},parent:function(a){return p(A(this.pluck("parentNode")),a)},children:function(a){return p(this.map(function(){return n(this)}),a)},contents:function(){return this.map(function(){return C.call(this.childNodes)})},siblings:function(a){return p(this.map(function(a,b){return D.call(n(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return x.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=m(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var c=b(a);if(this[0]&&!c)var d=x(a).get(0),e=d.parentNode||this.length>1;return this.each(function(b){x(this).wrapAll(c?a.call(this,b):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){x(this[0]).before(a=x(a));for(var b;(b=a.children()).length;)a=b.first();x(a).append(this)}return this},wrapInner:function(a){var c=b(a);return this.each(function(b){var d=x(this),e=d.contents(),f=c?a.call(this,b):a;e.length?e.wrapAll(f):d.append(f)})},unwrap:function(){return this.parent().each(function(){x(this).replaceWith(x(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(a){return this.each(function(){var b=x(this);(a===v?"none"==b.css("display"):a)?b.show():b.hide()})},prev:function(a){return x(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return x(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return 0===arguments.length?this.length>0?this[0].innerHTML:null:this.each(function(b){var c=this.innerHTML;x(this).empty().append(q(this,a,b,c))})},text:function(a){return 0===arguments.length?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=a===v?"":""+a})},attr:function(a,b){var c;return"string"==typeof a&&b===v?0==this.length||1!==this[0].nodeType?v:"value"==a&&"INPUT"==this[0].nodeName?this.val():!(c=this[0].getAttribute(a))&&a in this[0]?this[0][a]:c:this.each(function(c){if(1===this.nodeType)if(e(a))for(w in a)r(this,w,a[w]);else r(this,a,q(this,b,c,this.getAttribute(a)))})},removeAttr:function(a){return this.each(function(){1===this.nodeType&&r(this,a)})},prop:function(a,b){return a=Y[a]||a,b===v?this[0]&&this[0][a]:this.each(function(c){this[a]=q(this,b,c,this[a])})},data:function(a,b){var c=this.attr("data-"+a.replace(M,"-$1").toLowerCase(),b);return null!==c?t(c):v},val:function(a){return 0===arguments.length?this[0]&&(this[0].multiple?x(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(b){this.value=q(this,a,b,this.value)})},offset:function(a){if(a)return this.each(function(b){var c=x(this),d=q(this,a,b,c.offset()),e=c.offsetParent().offset(),f={top:d.top-e.top,left:d.left-e.left};"static"==c.css("position")&&(f.position="relative"),c.css(f)});if(0==this.length)return null;var b=this[0].getBoundingClientRect();return{left:b.left+window.pageXOffset,top:b.top+window.pageYOffset,width:Math.round(b.width),height:Math.round(b.height)}},css:function(b,c){if(arguments.length<2){var d=this[0],e=getComputedStyle(d,"");if(!d)return;if("string"==typeof b)return d.style[z(b)]||e.getPropertyValue(b);if(Z(b)){var f={};return x.each(Z(b)?b:[b],function(a,b){f[b]=d.style[z(b)]||e.getPropertyValue(b)}),f}}var g="";if("string"==a(b))c||0===c?g=j(b)+":"+l(b,c):this.each(function(){this.style.removeProperty(j(b))});else for(w in b)b[w]||0===b[w]?g+=j(w)+":"+l(w,b[w])+";":this.each(function(){this.style.removeProperty(j(w))});return this.each(function(){this.style.cssText+=";"+g})},index:function(a){return a?this.indexOf(x(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return a?B.some.call(this,function(a){return this.test(s(a))},k(a)):!1},addClass:function(a){return a?this.each(function(b){y=[];var c=s(this),d=q(this,a,b,c);d.split(/\s+/g).forEach(function(a){x(this).hasClass(a)||y.push(a)},this),y.length&&s(this,c+(c?" ":"")+y.join(" "))}):this},removeClass:function(a){return this.each(function(b){return a===v?s(this,""):(y=s(this),q(this,a,b,y).split(/\s+/g).forEach(function(a){y=y.replace(k(a)," ")}),void s(this,y.trim()))})},toggleClass:function(a,b){return a?this.each(function(c){var d=x(this),e=q(this,a,c,s(this));e.split(/\s+/g).forEach(function(a){(b===v?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})}):this},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===v?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a===v?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=L.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(x(a).css("margin-top"))||0,c.left-=parseFloat(x(a).css("margin-left"))||0,d.top+=parseFloat(x(b[0]).css("border-top-width"))||0,d.left+=parseFloat(x(b[0]).css("border-left-width"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||E.body;a&&!L.test(a.nodeName)&&"static"==x(a).css("position");)a=a.offsetParent;return a})}},x.fn.detach=x.fn.remove,["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});x.fn[a]=function(e){var f,g=this[0];return e===v?c(g)?g["inner"+b]:d(g)?g.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){g=x(this),g.css(a,q(this,e,b,g[a]()))})}}),O.forEach(function(b,c){var d=c%2;x.fn[b]=function(){var b,e,f=x.map(arguments,function(c){return b=a(c),"object"==b||"array"==b||null==c?c:W.fragment(c)}),g=this.length>1;return f.length<1?this:this.each(function(a,b){e=d?b:b.parentNode,b=0==c?b.nextSibling:1==c?b.firstChild:2==c?b:null,f.forEach(function(a){if(g)a=a.cloneNode(!0);else if(!e)return x(a).remove();u(e.insertBefore(a,b),function(a){null==a.nodeName||"SCRIPT"!==a.nodeName.toUpperCase()||a.type&&"text/javascript"!==a.type||a.src||window.eval.call(window,a.innerHTML)})})})},x.fn[d?b+"To":"insert"+(c?"Before":"After")]=function(a){return x(a)[b](this),this}}),W.Z.prototype=x.fn,W.uniq=A,W.deserializeValue=t,x.zepto=W,x}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(a){function b(a){return a._zid||(a._zid=m++)}function c(a,c,f,g){if(c=d(c),c.ns)var h=e(c.ns);return(q[b(a)]||[]).filter(function(a){return!(!a||c.e&&a.e!=c.e||c.ns&&!h.test(a.ns)||f&&b(a.fn)!==b(f)||g&&a.sel!=g)})}function d(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function e(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function f(a,b){return a.del&&!s&&a.e in t||!!b}function g(a){return u[a]||s&&t[a]||a}function h(c,e,h,i,k,m,n){var o=b(c),p=q[o]||(q[o]=[]);e.split(/\s/).forEach(function(b){if("ready"==b)return a(document).ready(h);var e=d(b);e.fn=h,e.sel=k,e.e in u&&(h=function(b){var c=b.relatedTarget;return!c||c!==this&&!a.contains(this,c)?e.fn.apply(this,arguments):void 0}),e.del=m;var o=m||h;e.proxy=function(a){if(a=j(a),!a.isImmediatePropagationStopped()){a.data=i;var b=o.apply(c,a._args==l?[a]:[a].concat(a._args));return b===!1&&(a.preventDefault(),a.stopPropagation()),b}},e.i=p.length,p.push(e),"addEventListener"in c&&c.addEventListener(g(e.e),e.proxy,f(e,n))})}function i(a,d,e,h,i){var j=b(a);(d||"").split(/\s/).forEach(function(b){c(a,b,e,h).forEach(function(b){delete q[j][b.i],"removeEventListener"in a&&a.removeEventListener(g(b.e),b.proxy,f(b,i))})})}function j(b,c){return(c||!b.isDefaultPrevented)&&(c||(c=b),a.each(y,function(a,d){var e=c[a];b[a]=function(){return this[d]=v,e&&e.apply(c,arguments)},b[d]=w}),(c.defaultPrevented!==l?c.defaultPrevented:"returnValue"in c?c.returnValue===!1:c.getPreventDefault&&c.getPreventDefault())&&(b.isDefaultPrevented=v)),b}function k(a){var b,c={originalEvent:a};for(b in a)x.test(b)||a[b]===l||(c[b]=a[b]);return j(c,a)}var l,m=1,n=Array.prototype.slice,o=a.isFunction,p=function(a){return"string"==typeof a},q={},r={},s="onfocusin"in window,t={focus:"focusin",blur:"focusout"},u={mouseenter:"mouseover",mouseleave:"mouseout"};r.click=r.mousedown=r.mouseup=r.mousemove="MouseEvents",a.event={add:h,remove:i},a.proxy=function(c,d){if(o(c)){var e=function(){return c.apply(d,arguments)};return e._zid=b(c),e}if(p(d))return a.proxy(c[d],c);throw new TypeError("expected function")},a.fn.bind=function(a,b,c){return this.on(a,b,c)},a.fn.unbind=function(a,b){return this.off(a,b)},a.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var v=function(){return!0},w=function(){return!1},x=/^([A-Z]|returnValue$|layer[XY]$)/,y={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};a.fn.delegate=function(a,b,c){return this.on(b,a,c)},a.fn.undelegate=function(a,b,c){return this.off(b,a,c)},a.fn.live=function(b,c){return a(document.body).delegate(this.selector,b,c),this},a.fn.die=function(b,c){return a(document.body).undelegate(this.selector,b,c),this},a.fn.on=function(b,c,d,e,f){var g,j,m=this;return b&&!p(b)?(a.each(b,function(a,b){m.on(a,c,d,b,f)}),m):(p(c)||o(e)||e===!1||(e=d,d=c,c=l),(o(d)||d===!1)&&(e=d,d=l),e===!1&&(e=w),m.each(function(l,m){f&&(g=function(a){return i(m,a.type,e),e.apply(this,arguments)}),c&&(j=function(b){var d,f=a(b.target).closest(c,m).get(0);return f&&f!==m?(d=a.extend(k(b),{currentTarget:f,liveFired:m}),(g||e).apply(f,[d].concat(n.call(arguments,1)))):void 0}),h(m,b,e,d,c,j||g)}))},a.fn.off=function(b,c,d){var e=this;return b&&!p(b)?(a.each(b,function(a,b){e.off(a,c,b)}),e):(p(c)||o(d)||d===!1||(d=c,c=l),d===!1&&(d=w),e.each(function(){i(this,b,d,c)}))},a.fn.trigger=function(b,c){return b=p(b)||a.isPlainObject(b)?a.Event(b):j(b),b._args=c,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(b):a(this).triggerHandler(b,c)})},a.fn.triggerHandler=function(b,d){var e,f;return this.each(function(g,h){e=k(p(b)?a.Event(b):b),e._args=d,e.target=h,a.each(c(h,b.type||b),function(a,b){return f=b.proxy(e),e.isImmediatePropagationStopped()?!1:void 0})}),f},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)}}),["focus","blur"].forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.each(function(){try{this[b]()}catch(a){}}),this}}),a.Event=function(a,b){p(a)||(b=a,a=b.type);var c=document.createEvent(r[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),j(c)}}(Zepto),function(a){function b(b,c,d){var e=a.Event(c);return a(b).trigger(e,d),!e.isDefaultPrevented()}function c(a,c,d,e){return a.global?b(c||s,d,e):void 0}function d(b){b.global&&0===a.active++&&c(b,null,"ajaxStart")}function e(b){b.global&&!--a.active&&c(b,null,"ajaxStop")}function f(a,b){var d=b.context;return b.beforeSend.call(d,a,b)===!1||c(b,d,"ajaxBeforeSend",[a,b])===!1?!1:void c(b,d,"ajaxSend",[a,b])}function g(a,b,d,e){var f=d.context,g="success";d.success.call(f,a,g,b),e&&e.resolveWith(f,[a,g,b]),c(d,f,"ajaxSuccess",[b,d,a]),i(g,b,d)}function h(a,b,d,e,f){var g=e.context;e.error.call(g,d,b,a),f&&f.rejectWith(g,[d,b,a]),c(e,g,"ajaxError",[d,e,a||b]),i(b,d,e)}function i(a,b,d){var f=d.context;d.complete.call(f,b,a),c(d,f,"ajaxComplete",[b,d]),e(d)}function j(){}function k(a){return a&&(a=a.split(";",2)[0]),a&&(a==x?"html":a==w?"json":u.test(a)?"script":v.test(a)&&"xml")||"text"}function l(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function m(b){b.processData&&b.data&&"string"!=a.type(b.data)&&(b.data=a.param(b.data,b.traditional)),!b.data||b.type&&"GET"!=b.type.toUpperCase()||(b.url=l(b.url,b.data),b.data=void 0)}function n(b,c,d,e){return a.isFunction(c)&&(e=d,d=c,c=void 0),a.isFunction(d)||(e=d,d=void 0),{url:b,data:c,success:d,dataType:e}}function o(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,i){f=a.type(i),e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]"),!e&&g?b.add(i.name,i.value):"array"==f||!d&&"object"==f?o(b,i,d,c):b.add(c,i)})}var p,q,r=0,s=window.document,t=/)<[^<]*)*<\/script>/gi,u=/^(?:text|application)\/javascript/i,v=/^(?:text|application)\/xml/i,w="application/json",x="text/html",y=/^\s*$/;a.active=0,a.ajaxJSONP=function(b,c){if(!("type"in b))return a.ajax(b);var d,e,i=b.jsonpCallback,j=(a.isFunction(i)?i():i)||"jsonp"+ ++r,k=s.createElement("script"),l=window[j],m=function(b){a(k).triggerHandler("error",b||"abort")},n={abort:m};return c&&c.promise(n),a(k).on("load error",function(f,i){clearTimeout(e),a(k).off().remove(),"error"!=f.type&&d?g(d[0],n,b,c):h(null,i||"error",n,b,c),window[j]=l,d&&a.isFunction(l)&&l(d[0]),l=d=void 0}),f(n,b)===!1?(m("abort"),n):(window[j]=function(){d=arguments},k.src=b.url.replace(/\?(.+)=\?/,"?$1="+j),s.head.appendChild(k),b.timeout>0&&(e=setTimeout(function(){m("timeout")},b.timeout)),n)},a.ajaxSettings={type:"GET",beforeSend:j,success:j,error:j,complete:j,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:w,xml:"application/xml, text/xml",html:x,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},a.ajax=function(b){var c=a.extend({},b||{}),e=a.Deferred&&a.Deferred();for(p in a.ajaxSettings)void 0===c[p]&&(c[p]=a.ajaxSettings[p]);d(c),c.crossDomain||(c.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(c.url)&&RegExp.$2!=window.location.host),c.url||(c.url=window.location.toString()),m(c),c.cache===!1&&(c.url=l(c.url,"_="+Date.now()));var i=c.dataType,n=/\?.+=\?/.test(c.url);if("jsonp"==i||n)return n||(c.url=l(c.url,c.jsonp?c.jsonp+"=?":c.jsonp===!1?"":"callback=?")),a.ajaxJSONP(c,e);var o,r=c.accepts[i],s={},t=function(a,b){s[a.toLowerCase()]=[a,b]},u=/^([\w-]+:)\/\//.test(c.url)?RegExp.$1:window.location.protocol,v=c.xhr(),w=v.setRequestHeader;if(e&&e.promise(v),c.crossDomain||t("X-Requested-With","XMLHttpRequest"),t("Accept",r||"*/*"),(r=c.mimeType||r)&&(r.indexOf(",")>-1&&(r=r.split(",",2)[0]),v.overrideMimeType&&v.overrideMimeType(r)),(c.contentType||c.contentType!==!1&&c.data&&"GET"!=c.type.toUpperCase())&&t("Content-Type",c.contentType||"application/x-www-form-urlencoded"),c.headers)for(q in c.headers)t(q,c.headers[q]);if(v.setRequestHeader=t,v.onreadystatechange=function(){if(4==v.readyState){v.onreadystatechange=j,clearTimeout(o);var b,d=!1;if(v.status>=200&&v.status<300||304==v.status||0==v.status&&"file:"==u){i=i||k(c.mimeType||v.getResponseHeader("content-type")),b=v.responseText;try{"script"==i?(1,eval)(b):"xml"==i?b=v.responseXML:"json"==i&&(b=y.test(b)?null:a.parseJSON(b))}catch(f){d=f}d?h(d,"parsererror",v,c,e):g(b,v,c,e)}else h(v.statusText||null,v.status?"error":"abort",v,c,e)}},f(v,c)===!1)return v.abort(),h(null,"abort",v,c,e),v;if(c.xhrFields)for(q in c.xhrFields)v[q]=c.xhrFields[q];var x="async"in c?c.async:!0;v.open(c.type,c.url,x,c.username,c.password);for(q in s)w.apply(v,s[q]);return c.timeout>0&&(o=setTimeout(function(){v.onreadystatechange=j,v.abort(),h(null,"timeout",v,c,e)},c.timeout)),v.send(c.data?c.data:null),v},a.get=function(){return a.ajax(n.apply(null,arguments))},a.post=function(){var b=n.apply(null,arguments);return b.type="POST",a.ajax(b)},a.getJSON=function(){var b=n.apply(null,arguments);return b.dataType="json",a.ajax(b)},a.fn.load=function(b,c,d){if(!this.length)return this;var e,f=this,g=b.split(/\s/),h=n(b,c,d),i=h.success;return g.length>1&&(h.url=g[0],e=g[1]),h.success=function(b){f.html(e?a("
").html(b.replace(t,"")).find(e):b),i&&i.apply(f,arguments)},a.ajax(h),this};var z=encodeURIComponent;a.param=function(a,b){var c=[];return c.add=function(a,b){this.push(z(a)+"="+z(b))},o(c,a,b),c.join("&").replace(/%20/g,"+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b,c=[];return a([].slice.call(this.get(0).elements)).each(function(){b=a(this);var d=b.attr("type");"fieldset"!=this.nodeName.toLowerCase()&&!this.disabled&&"submit"!=d&&"reset"!=d&&"button"!=d&&("radio"!=d&&"checkbox"!=d||this.checked)&&c.push({name:b.attr("name"),value:b.val()})}),c},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),function(a){"__proto__"in{}||a.extend(a.zepto,{Z:function(b,c){return b=b||[],a.extend(b,a.fn),b.selector=c||"",b.__Z=!0,b},isZ:function(b){return"array"===a.type(b)&&"__Z"in b}});try{getComputedStyle(void 0)}catch(b){var c=getComputedStyle;window.getComputedStyle=function(a){try{return c(a)}catch(b){return null}}}}(Zepto);var jsonlint=function(){var a={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:this.$=a.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\v/g," ").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(a);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=f[g-1];case 13:this.$={};break;case 14:this.$=f[g-1];break;case 15:this.$=[f[g-2],f[g]];break;case 16:this.$={},this.$[f[g][0]]=f[g][1];break;case 17:this.$=f[g-2],f[g-2][f[g][0]]=f[g][1];break;case 18:this.$=[];break;case 19:this.$=f[g-1];break;case 20:this.$=[f[g]];break;case 21:this.$=f[g-2],f[g-2].push(f[g])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(a){throw new Error(a) -},parse:function(a){function b(a){e.length=e.length-2*a,f.length=f.length-a,g.length=g.length-a}function c(){var a;return a=d.lexer.lex()||1,"number"!=typeof a&&(a=d.symbols_[a]||a),a}var d=this,e=[0],f=[null],g=[],h=this.table,i="",j=0,k=0,l=0,m=2,n=1;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;g.push(o),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var p,q,r,s,t,u,v,w,x,y={};;){if(r=e[e.length-1],this.defaultActions[r]?s=this.defaultActions[r]:(null==p&&(p=c()),s=h[r]&&h[r][p]),"undefined"==typeof s||!s.length||!s[0]){if(!l){x=[];for(u in h[r])this.terminals_[u]&&u>2&&x.push("'"+this.terminals_[u]+"'");var z="";z=this.lexer.showPosition?"Parse error on line "+(j+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[p]+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(z,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:o,expected:x})}if(3==l){if(p==n)throw new Error(z||"Parsing halted.");k=this.lexer.yyleng,i=this.lexer.yytext,j=this.lexer.yylineno,o=this.lexer.yylloc,p=c()}for(;;){if(m.toString()in h[r])break;if(0==r)throw new Error(z||"Parsing halted.");b(1),r=e[e.length-1]}q=p,p=m,r=e[e.length-1],s=h[r]&&h[r][m],l=3}if(s[0]instanceof Array&&s.length>1)throw new Error("Parse Error: multiple actions possible at state: "+r+", token: "+p);switch(s[0]){case 1:e.push(p),f.push(this.lexer.yytext),g.push(this.lexer.yylloc),e.push(s[1]),p=null,q?(p=q,q=null):(k=this.lexer.yyleng,i=this.lexer.yytext,j=this.lexer.yylineno,o=this.lexer.yylloc,l>0&&l--);break;case 2:if(v=this.productions_[s[1]][1],y.$=f[f.length-v],y._$={first_line:g[g.length-(v||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(v||1)].first_column,last_column:g[g.length-1].last_column},t=this.performAction.call(y,i,k,j,this.yy,s[1],f,g),"undefined"!=typeof t)return t;v&&(e=e.slice(0,-1*v*2),f=f.slice(0,-1*v),g=g.slice(0,-1*v)),e.push(this.productions_[s[1]][0]),f.push(y.$),g.push(y._$),w=h[e[e.length-2]][e[e.length-1]],e.push(w);break;case 3:return!0}}return!0}},b=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parseError)throw new Error(a);this.yy.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.match+=a,this.matched+=a;var b=a.match(/\n/);return b&&this.yylineno++,this._input=this._input.slice(1),a},unput:function(a){return this._input=a+this._input,this},more:function(){return this._more=!0,this},less:function(a){this._input=this.match.slice(a)+this._input},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/\n.*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-1:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){switch(c){case 0:break;case 1:return 6;case 2:return b.yytext=b.yytext.substr(1,b.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},a.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],a.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}},a}();return a.lexer=b,a}();"undefined"!=typeof require&&"undefined"!=typeof exports&&(exports.parser=jsonlint,exports.parse=function(){return jsonlint.parse.apply(jsonlint,arguments)},exports.main=function(a){if(!a[1])throw new Error("Usage: "+a[0]+" FILE");if("undefined"!=typeof process)var b=require("fs").readFileSync(require("path").join(process.cwd(),a[1]),"utf8");else var c=require("file").path(require("file").cwd()),b=c.join(a[1]).read({charset:"utf-8"});return exports.parser.parse(b)},"undefined"!=typeof module&&require.main===module&&exports.main("undefined"!=typeof process?process.argv.slice(1):require("system").args));var jsonParse=function(){function a(a,b,c){return b?g[b]:String.fromCharCode(parseInt(c,16))}var b="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",c='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',d='(?:"'+c+'*")',e=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+b+"|"+d+")","g"),f=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),g={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},h=new String(""),i="\\",j=Object.hasOwnProperty;return function(b,c){var d,g=b.match(e),k=g[0],l=!1;"{"===k?d={}:"["===k?d=[]:(d=[],l=!0);for(var m,n=[d],o=1-l,p=g.length;p>o;++o){k=g[o];var q;switch(k.charCodeAt(0)){default:q=n[0],q[m||q.length]=+k,m=void 0;break;case 34:if(k=k.substring(1,k.length-1),-1!==k.indexOf(i)&&(k=k.replace(f,a)),q=n[0],!m){if(!(q instanceof Array)){m=k||h;break}m=q.length}q[m]=k,m=void 0;break;case 91:q=n[0],n.unshift(q[m||q.length]=[]),m=void 0;break;case 93:n.shift();break;case 102:q=n[0],q[m||q.length]=!1,m=void 0;break;case 110:q=n[0],q[m||q.length]=null,m=void 0;break;case 116:q=n[0],q[m||q.length]=!0,m=void 0;break;case 123:q=n[0],n.unshift(q[m||q.length]={}),m=void 0;break;case 125:n.shift()}}if(l){if(1!==n.length)throw new Error;d=d[0]}else if(n.length)throw new Error;if(c){var r=function(a,b){var d=a[b];if(d&&"object"==typeof d){var e=null;for(var f in d)if(j.call(d,f)&&d!==a){var g=r(d,f);void 0!==g?d[f]=g:(e||(e=[]),e.push(f))}if(e)for(var h=e.length;--h>=0;)delete d[e[h]]}return c.call(a,b,d)};d=r({"":d},"")}return d}}();if(function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d||{};for(var e in ag)d.hasOwnProperty(e)||(d[e]=ag[e]);n(d);var f=d.value;"string"==typeof f&&(f=new yg(f,d.mode));var g=this.display=new b(c,f);g.wrapper.CodeMirror=this,k(this),i(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Gf&&lc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Me},qf&&setTimeout(Ue(kc,this,!0),20),oc(this);var h=this;Wb(this,function(){h.curOp.forceUpdate=!0,ge(h,f),d.autofocus&&!Gf||$e()==g.input?setTimeout(Ue(Jc,h),20):Kc(h);for(var a in bg)bg.hasOwnProperty(a)&&bg[a](h,d[a],cg);for(var b=0;bb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Qe(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display.scroller;return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,barWidth:a.display.scrollbarH.clientWidth,docHeight:a.doc.height+vb(a.display)}}function p(a,b){b||(b=o(a));var c=a.display,d=b.docHeight+Jg,e=b.scrollWidth>b.clientWidth,f=d>b.clientHeight;if(f?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=e?_e(c.measure)+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,d-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0"),e?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=f?_e(c.measure)+"px":"0",c.scrollbarH.firstChild.style.width=b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0"),e&&f?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=_e(c.measure)+"px"):c.scrollbarFiller.style.display="",e&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=_e(c.measure)+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="",Cf&&0===_e(c.measure)){c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=Df?"18px":"12px";var g=function(b){Fe(b)!=c.scrollbarV&&Fe(b)!=c.scrollbarH&&Xb(a,rc)(b)};Fg(c.scrollbarV,"mousedown",g),Fg(c.scrollbarH,"mousedown",g)}}function q(a,b,c){var d=c&&null!=c.top?c.top:a.scroller.scrollTop;d=Math.floor(d-ub(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=me(b,d),g=me(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;if(f>h)return{from:h,to:me(b,ne(he(b,h))+a.wrapper.clientHeight)};if(Math.min(i,b.lastLine())>=g)return{from:me(b,ne(he(b,i))-a.wrapper.clientHeight),to:i}}return{from:f,to:g}}function r(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=u(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=a.display.viewFrom&&g.to<=a.display.viewTo)break}return a.display.updateLineNumbers=null,d&&(He(a,"update",a),(a.display.viewFrom!=e||a.display.viewTo!=f)&&He(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)),d}function w(a,b,c){var d=a.display,e=a.doc;if(!d.wrapper.offsetWidth)return void cc(a);if(!(!c&&b.from>=d.viewFrom&&b.to<=d.viewTo&&0==gc(a))){s(a)&&cc(a);var f=B(a),g=e.first+e.size,h=Math.max(b.from-a.options.viewportMargin,e.first),i=Math.min(g,b.to+a.options.viewportMargin);d.viewFromi&&d.viewTo-i<20&&(i=Math.min(g,d.viewTo)),Nf&&(h=Jd(a.doc,h),i=Kd(a.doc,i));var j=h!=d.viewFrom||i!=d.viewTo||d.lastSizeC!=d.wrapper.clientHeight;fc(a,h,i),d.viewOffset=ne(he(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var k=gc(a);if(j||0!=k||c){var l=$e();return k>4&&(d.lineDiv.style.display="none"),C(a,d.updateLineNumbers,f),k>4&&(d.lineDiv.style.display=""),l&&$e()!=l&&l.offsetHeight&&l.focus(),Ye(d.cursorDiv),Ye(d.selectionDiv),j&&(d.lastSizeC=d.wrapper.clientHeight,qb(a,400)),z(a),!0}}}function x(a){var b=a.display,c=Ab(a,b.maxLine,b.maxLine.text.length).left;b.maxLineChanged=!1;var d=Math.max(0,c+3),e=Math.max(0,b.sizer.offsetLeft+d+Jg-b.scroller.clientWidth);b.sizer.style.minWidth=d+"px",ee&&(e=Sb(b)),(i>.001||-.001>i)&&(ke(f.line,e),A(f.line),f.rest))for(var j=0;j=b&&l.lineNumber;l.changes&&(Qe(l.changes,"gutter")>-1&&(m=!1),D(a,l,j,c)),m&&(Ye(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(t(a.options,j)))),h=l.node.nextSibling}else{var n=L(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function D(a,b,c,d){for(var e=0;e=0){var g=R(f.from(),e.from()),h=Q(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new T(i?h:g,i?g:h))}}return new S(a,b)}function V(a,b){return new S([new T(a,b||a)],0)}function W(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function X(a,b){if(b.linec?Of(c,he(a,c).text.length):Y(b,he(a,b.line).text.length)}function Y(a,b){var c=a.ch;return null==c||c>b?Of(a.line,b):0>c?Of(a.line,0):a}function Z(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(Hg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==Pf(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?X(a,Of(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),h.appendChild(Xe("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return Mb(a,Of(b,c),"div",l,d)}var h,i,l=he(g,b),m=l.text.length;return cf(oe(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottomi.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=wb(a.display),j=i.left,k=f.lineSpace.offsetWidth-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=he(g,l.line),o=he(g,m.line),p=Hd(n)==Hd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top0&&(b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function qb(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ig(b.mode,tb(a,b.frontier));Wb(a,function(){b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(e){if(b.frontier>=a.display.viewFrom){var f=e.styles;e.styles=Sd(a,e,d,!0);for(var g=!f||f.length!=e.styles.length,h=0;!g&&hc?(qb(a,a.options.workDelay),!0):void 0})})}}function sb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=he(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Og(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function tb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=sb(a,b,c),g=f>d.first&&he(d,f-1).stateAfter;return g=g?ig(d.mode,g):jg(d.mode),d.iter(f,b,function(c){Ud(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function yb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function zb(a,b){b=Hd(b);var c=le(b),d=a.display.externalMeasured=new $b(a.doc,b,c);d.lineN=c;var e=d.built=Wd(a,d);return d.text=e.pre,Ze(a.display.lineMeasure,e.pre),d}function Ab(a,b,c,d){return Db(a,Cb(a,b),c,d)}function Bb(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bc?(f=0,g=1,h="left"):l>c?(f=c-k,g=f+1):(j==i.length-3||c==l&&i[j+3]>c)&&(g=l-k,f=g-1,c>=l&&(h="right")),null!=f){if(e=i[j+2],k==l&&d==(e.insertLeft?"left":"right")&&(h=d),"left"==d&&0==f)for(;j&&i[j-2]==i[j-3]&&i[j-1].insertLeft;)e=i[(j-=3)+2],h="left";if("right"==d&&f==l-k)for(;jk+g&&We(b.line.text.charAt(k+g));)++g;if(sf&&0==f&&g==l-k)m=e.parentNode.getBoundingClientRect();else if(vf&&a.options.lineWrapping){var n=Rg(e,f,g).getClientRects();m=n.length?n["right"==d?n.length-1:0]:Tf}else m=Rg(e,f,g).getBoundingClientRect()}else{f>0&&(h=d="right");var n;m=a.options.lineWrapping&&(n=e.getClientRects()).length>1?n["right"==d?n.length-1:0]:e.getBoundingClientRect()}if(sf&&!f&&(!m||!m.left&&!m.right)){var o=e.parentNode.getClientRects()[0];m=o?{left:o.left,right:o.left+Tb(a.display),top:o.top,bottom:o.bottom}:Tf}for(var p,q=(m.bottom+m.top)/2-b.rect.top,r=b.view.measure.heights,j=0;jc.from?f(a-1):f(a,d)}d=d||he(a.doc,b.line),e||(e=Cb(a,d));var h=oe(d),i=b.ch;if(!h)return f(i);var j=lf(h,i),k=g(i,j);return null!=bh&&(k.other=g(i,bh)),k}function Ob(a,b){var c=0,b=X(a.doc,b);a.options.lineWrapping||(c=Tb(a.display)*b.ch);var d=he(a.doc,b.line),e=ne(d)+ub(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function Pb(a,b,c,d){var e=Of(a,b);return e.xRel=d,c&&(e.outside=!0),e}function Qb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return Pb(d.first,0,!0,-1);var e=me(d,c),f=d.first+d.size-1;if(e>f)return Pb(d.first+d.size-1,he(d,f).text.length,!0,1);0>b&&(b=0);for(var g=he(d,e);;){var h=Rb(a,g,e,b,c),i=Fd(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=le(g=j.to.line)}}function Rb(a,b,c,d,e){function f(d){var e=Nb(a,Of(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:gq)return Pb(c,n,r,1);for(;;){if(k?n==m||n==nf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);We(b.text.charAt(s));)++s;var u=Pb(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=nf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function Sb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Qf){Qf=Xe("pre");for(var b=0;49>b;++b)Qf.appendChild(document.createTextNode("x")),Qf.appendChild(Xe("br"));Qf.appendChild(document.createTextNode("x"))}Ze(a.measure,Qf);var c=Qf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Ye(a.measure),c||1}function Tb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Xe("span","xxxxxxxxxx"),c=Xe("pre",[b]);Ze(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function Ub(a){a.curOp={viewChanged:!1,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivity:!1,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Uf},Ig++||(Bg=[])}function Vb(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&m(a),b.viewChanged||b.forceUpdate||null!=b.scrollTop||b.scrollToPos&&(b.scrollToPos.from.line=d.viewTo)||d.maxLineChanged&&a.options.lineWrapping){var e=v(a,{top:b.scrollTop,ensure:b.scrollToPos},b.forceUpdate);a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)}if(!e&&b.selectionChanged&&mb(a),null!=b.scrollTop&&d.scroller.scrollTop!=b.scrollTop){var f=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,b.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f}if(null!=b.scrollLeft&&d.scroller.scrollLeft!=b.scrollLeft){var g=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,b.scrollLeft));d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g,r(a)}if(b.scrollToPos){var h=$c(a,X(a.doc,b.scrollToPos.from),X(a.doc,b.scrollToPos.to),b.scrollToPos.margin);b.scrollToPos.isCursor&&a.state.focused&&Zc(a,h)}b.selectionChanged&&pb(a),a.state.focused&&b.updateInput&&kc(a,b.typing);var i=b.maybeHiddenMarkers,j=b.maybeUnhiddenMarkers;if(i)for(var k=0;kf;f=d){var g=new $b(a.doc,he(a.doc,f),f);d=f+g.size,e.push(g)}return e}function ac(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Nf&&Jd(a.doc,b)e.viewFrom?cc(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)cc(a);else if(b<=e.viewFrom){var f=ec(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):cc(a)}else if(c>=e.viewTo){var f=ec(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):cc(a)}else{var g=ec(a,b,b,-1),h=ec(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(_b(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):cc(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[dc(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Qe(g,c)&&g.push(c)}}}function cc(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function dc(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function ec(a,b,c,d){var e,f=dc(a,b),g=a.display.view;if(!Nf)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;Jd(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function fc(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=_b(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=_b(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,dc(a,c)))),d.viewTo=c}function gc(a){for(var b=a.display.view,c=0,d=0;dg&&c.charCodeAt(g)==e.charCodeAt(g);)++g;for(var i=e.slice(g),j=Zg(i),k=a.state.pasteIncoming&&j.length>1&&d.sel.ranges.length==j.length,l=d.sel.ranges.length-1;l>=0;l--){var m=d.sel.ranges[l],n=m.from(),o=m.to();g-1){ed(a,m.head.line,"smart");break}}}return cd(a),a.curOp.updateInput=p,a.curOp.typing=!0,e.length>1e3||e.indexOf("\n")>-1?b.value=a.display.prevInput="":a.display.prevInput=e,f&&Vb(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function kc(a,b){var c,d,e=a.doc;if(a.somethingSelected()){a.display.prevInput="";var f=e.sel.primary();c=_g&&(f.to().line-f.from().line>100||(d=a.getSelection()).length>1e3);var g=c?"-":d||a.getSelection();a.display.input.value=g,a.state.focused&&Qg(a.display.input),vf&&!sf&&(a.display.inputHasSelection=g)}else b||(a.display.prevInput=a.display.input.value="",vf&&!sf&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function lc(a){"nocursor"==a.options.readOnly||Gf&&$e()==a.display.input||a.display.input.focus()}function mc(a){a.state.focused||(lc(a),Jc(a))}function nc(a){return a.options.readOnly||a.doc.cantEdit}function oc(a){function b(){a.state.focused&&setTimeout(Ue(lc,a),0)}function c(){null==h&&(h=setTimeout(function(){h=null,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=Vg=null,a.setSize()},100))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5e3):Gg(window,"resize",c)}function e(b){Je(a,b)||Eg(b)}function f(b){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),Qg(g.input)),"cut"==b.type&&(a.state.cutIncoming=!0)}var g=a.display;Fg(g.scroller,"mousedown",Xb(a,rc)),qf?Fg(g.scroller,"dblclick",Xb(a,function(b){if(!Je(a,b)){var c=qc(a,b);if(c&&!wc(a,b)&&!pc(a.display,b)){Cg(b);var d=jd(a.doc,c);ab(a.doc,d.anchor,d.head)}}})):Fg(g.scroller,"dblclick",function(b){Je(a,b)||Cg(b)}),Fg(g.lineSpace,"selectstart",function(a){pc(g,a)||Cg(a)}),Lf||Fg(g.scroller,"contextmenu",function(b){Lc(a,b)}),Fg(g.scroller,"scroll",function(){g.scroller.clientHeight&&(zc(a,g.scroller.scrollTop),Ac(a,g.scroller.scrollLeft,!0),Hg(a,"scroll",a))}),Fg(g.scrollbarV,"scroll",function(){g.scroller.clientHeight&&zc(a,g.scrollbarV.scrollTop)}),Fg(g.scrollbarH,"scroll",function(){g.scroller.clientHeight&&Ac(a,g.scrollbarH.scrollLeft)}),Fg(g.scroller,"mousewheel",function(b){Bc(a,b)}),Fg(g.scroller,"DOMMouseScroll",function(b){Bc(a,b)}),Fg(g.scrollbarH,"mousedown",b),Fg(g.scrollbarV,"mousedown",b),Fg(g.wrapper,"scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});var h;Fg(window,"resize",c),setTimeout(d,5e3),Fg(g.input,"keyup",Xb(a,Hc)),Fg(g.input,"input",function(){vf&&!sf&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),ic(a)}),Fg(g.input,"keydown",Xb(a,Gc)),Fg(g.input,"keypress",Xb(a,Ic)),Fg(g.input,"focus",Ue(Jc,a)),Fg(g.input,"blur",Ue(Kc,a)),a.options.dragDrop&&(Fg(g.scroller,"dragstart",function(b){yc(a,b)}),Fg(g.scroller,"dragenter",e),Fg(g.scroller,"dragover",e),Fg(g.scroller,"drop",Xb(a,xc))),Fg(g.scroller,"paste",function(b){pc(g,b)||(a.state.pasteIncoming=!0,lc(a),ic(a))}),Fg(g.input,"paste",function(){if(wf&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var b=g.input.selectionStart,c=g.input.selectionEnd;g.input.value+="$",g.input.selectionStart=b,g.input.selectionEnd=c,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,ic(a)}),Fg(g.input,"cut",f),Fg(g.input,"copy",f),Bf&&Fg(g.sizer,"mouseup",function(){$e()==g.input&&g.input.blur(),lc(a)})}function pc(a,b){for(var c=Fe(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function qc(a,b,c,d){var e=a.display;if(!c){var f=Fe(b);if(f==e.scrollbarH||f==e.scrollbarV||f==e.scrollbarFiller||f==e.gutterFiller)return null}var g,h,i=e.lineSpace.getBoundingClientRect();try{g=b.clientX-i.left,h=b.clientY-i.top}catch(b){return null}var j,k=Qb(a,g,h);if(d&&1==k.xRel&&(j=he(a.doc,k.line).text).length==k.ch){var l=Og(j,j.length,a.options.tabSize)-j.length;k=Of(k.line,Math.round((g-wb(a.display).left)/Tb(a.display))-l)}return k}function rc(a){if(!Je(this,a)){var b=this,c=b.display;if(c.shift=a.shiftKey,pc(c,a))return void(wf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!wc(b,a)){var d=qc(b,a);switch(window.focus(),Ge(a)){case 1:d?sc(b,a,d):Fe(a)==c.scroller&&Cg(a);break;case 2:wf&&(b.state.lastMiddleDown=+new Date),d&&ab(b.doc,d),setTimeout(Ue(lc,b),20),Cg(a);break;case 3:Lf&&Lc(b,a)}}}}function sc(a,b,c){setTimeout(Ue(mc,a),0);var d,e=+new Date;Sf&&Sf.time>e-400&&0==Pf(Sf.pos,c)?d="triple":Rf&&Rf.time>e-400&&0==Pf(Rf.pos,c)?(d="double",Sf={time:e,pos:c}):(d="single",Rf={time:e,pos:c});var f=a.doc.sel,g=Hf?b.metaKey:b.ctrlKey;a.options.dragDrop&&Yg&&!g&&!nc(a)&&"single"==d&&f.contains(c)>-1&&f.somethingSelected()?tc(a,b,c):uc(a,b,c,d,g)}function tc(a,b,c){var d=a.display,e=Xb(a,function(f){wf&&(d.scroller.draggable=!1),a.state.draggingText=!1,Gg(document,"mouseup",e),Gg(d.scroller,"drop",e),Math.abs(b.clientX-f.clientX)+Math.abs(b.clientY-f.clientY)<10&&(Cg(f),ab(a.doc,c),lc(a),qf&&!sf&&setTimeout(function(){document.body.focus(),lc(a)},20))});wf&&(d.scroller.draggable=!0),a.state.draggingText=e,d.scroller.dragDrop&&d.scroller.dragDrop(),Fg(document,"mouseup",e),Fg(d.scroller,"drop",e)}function uc(a,b,c,d,e){function f(b){if(0!=Pf(p,b))if(p=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=Og(he(j,c.line).text,c.ch,f),h=Og(he(j,b.line).text,b.ch,f),i=Math.min(g,h),n=Math.max(g,h),o=Math.min(c.line,b.line),q=Math.min(a.lastLine(),Math.max(c.line,b.line));q>=o;o++){var r=he(j,o).text,s=Ne(r,i,f);i==n?e.push(new T(Of(o,s),Of(o,s))):r.length>s&&e.push(new T(Of(o,s),Of(o,Ne(r,n,f))))}e.length||e.push(new T(c,c)),gb(j,U(m.ranges.slice(0,l).concat(e),l),Mg)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=jd(j,b);else var w=new T(Of(b.line,0),X(j,Of(b.line+1,0)));Pf(w.anchor,u)>0?(v=w.head,u=R(t.from(),w.anchor)):(v=w.anchor,u=Q(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new T(X(j,u),v),gb(j,U(e,l),Mg)}}function g(b){var c=++s,e=qc(a,b,!0,"rect"==d);if(e)if(0!=Pf(e,p)){mc(a),f(e);var h=q(i,j);(e.line>=h.to||e.liner.bottom?20:0;k&&setTimeout(Xb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){s=1/0,Cg(b),lc(a),Gg(document,"mousemove",t),Gg(document,"mouseup",u),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Cg(b);var k,l,m=j.sel;if(e?(l=j.sel.contains(c),k=l>-1?j.sel.ranges[l]:new T(c,c)):k=j.sel.primary(),b.altKey)d="rect",e||(k=new T(c,c)),c=qc(a,b,!0,!0),l=-1;else if("double"==d){var n=jd(j,c);k=a.display.shift||j.extend?_(j,k,n.anchor,n.head):n}else if("triple"==d){var o=new T(Of(c.line,0),X(j,Of(c.line+1,0)));k=a.display.shift||j.extend?_(j,k,o.anchor,o.head):o}else k=_(j,k,c);e?l>-1?cb(j,l,k,Mg):(l=j.sel.ranges.length,gb(j,U(j.sel.ranges.concat([k]),l),{scroll:!1,origin:"*mouse"})):(l=0,gb(j,new S([k],0),Mg));var p=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Xb(a,function(a){(vf&&!tf?a.buttons:Ge(a))?g(a):h(a)}),u=Xb(a,h);Fg(document,"mousemove",t),Fg(document,"mouseup",u)}function vc(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Cg(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!Ke(a,c))return Ee(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=me(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Ee(b)}}}function wc(a,b){return vc(a,b,"gutterClick",!0,He)}function xc(a){var b=this;if(!Je(b,a)&&!pc(b.display,a)){Cg(a),qf&&(Vf=+new Date);var c=qc(b,a,!0),d=a.dataTransfer.files;if(c&&!nc(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=function(){if(f[d]=h.result,++g==e){c=X(b.doc,c);var a={from:c,to:c,text:Zg(f.join("\n")),origin:"paste"};Sc(b.doc,a),fb(b.doc,V(c,_f(a)))}},h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(Ue(lc,b),20);try{var f=a.dataTransfer.getData("Text");if(f){var j=b.state.draggingText&&b.listSelections();if(hb(b.doc,V(c,c)),j)for(var i=0;if.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&Hf&&wf)a:for(var g=b.target,h=e.view;g!=f;g=g.parentNode)for(var i=0;ij?k=Math.max(0,k+j-50):l=Math.min(a.doc.height,l+j+50),v(a,{top:k,bottom:l})}20>Wf&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,c=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null,c&&(Xf=(Xf*Wf+c)/(Wf+1),++Wf)}},200)):(e.wheelDX+=c,e.wheelDY+=d))}}function Cc(a,b,c){if("string"==typeof b&&(b=kg[b],!b))return!1;a.display.pollingFast&&jc(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{nc(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Kg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function Dc(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function Ec(a,b){var c=ld(a.options.keyMap),d=c.auto;clearTimeout(Yf),d&&!ng(b)&&(Yf=setTimeout(function(){ld(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,h(a))},50));var e=og(b,!0),f=!1;if(!e)return!1;var g=Dc(a);return f=b.shiftKey?mg("Shift-"+e,g,function(b){return Cc(a,b,!0)})||mg(e,g,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?Cc(a,b):void 0}):mg(e,g,function(b){return Cc(a,b)}),f&&(Cg(b),pb(a),He(a,"keyHandled",a,e,b)),f}function Fc(a,b,c){var d=mg("'"+c+"'",Dc(a),function(b){return Cc(a,b,!0)});return d&&(Cg(b),pb(a),He(a,"keyHandled",a,"'"+c+"'",b)),d}function Gc(a){var b=this;if(mc(b),!Je(b,a)){qf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=Ec(b,a);zf&&($f=d?c:null,!d&&88==c&&!_g&&(Hf?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut"))}}function Hc(a){Je(this,a)||16==a.keyCode&&(this.doc.sel.shift=!1)}function Ic(a){var b=this;if(!Je(b,a)){var c=a.keyCode,d=a.charCode;if(zf&&c==$f)return $f=null,void Cg(a);if(!(zf&&(!a.which||a.which<10)||Bf)||!Ec(b,a)){var e=String.fromCharCode(null==d?c:d);Fc(b,a,e)||(vf&&!sf&&(b.display.inputHasSelection=null),ic(b))}}}function Jc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(Hg(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(kc(a),wf&&setTimeout(Ue(kc,a,!0),0))),hc(a),pb(a))}function Kc(a){a.state.focused&&(Hg(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150)}function Lc(a,b){function c(){if(null!=e.input.selectionStart){var a=e.input.value="​"+(j?e.input.value:"");e.prevInput="​",e.input.selectionStart=1,e.input.selectionEnd=a.length}}function d(){if(e.inputDiv.style.position="relative",e.input.style.cssText=i,sf&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=g),hc(a),null!=e.input.selectionStart){(!vf||sf)&&c(),clearTimeout(Zf);var b=0,d=function(){"​"==e.prevInput&&0==e.input.selectionStart?Xb(a,kg.selectAll)(a):b++<10?Zf=setTimeout(d,500):kc(a)};Zf=setTimeout(d,200)}}if(!Je(a,b,"contextmenu")){var e=a.display;if(!pc(e,b)&&!Mc(a,b)){var f=qc(a,b),g=e.scroller.scrollTop;if(f&&!zf){var h=a.options.resetSelectionOnContextMenu;h&&-1==a.doc.sel.contains(f)&&Xb(a,gb)(a.doc,V(f),Lg);var i=e.input.style.cssText;e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: transparent; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",lc(a),kc(a);var j=a.somethingSelected();if(j||(e.input.value=e.prevInput=" "),vf&&!sf&&c(),Lf){Eg(b);var k=function(){Gg(window,"mouseup",k),setTimeout(d,20)};Fg(window,"mouseup",k)}else setTimeout(d,50)}}}}function Mc(a,b){return Ke(a,"gutterContextMenu")?vc(a,b,"gutterContextMenu",!1,Hg):!1}function Nc(a,b){if(Pf(a,b.from)<0)return a;if(Pf(a,b.to)<=0)return _f(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=_f(b).ch-b.to.ch),Of(c,d)}function Oc(a,b){for(var c=[],d=0;d=0;--e)Tc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Tc(a,b)}}function Tc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Pf(b.from,b.to)){var c=Oc(a,b);te(a,b,c,a.cm?a.cm.curOp.id:0/0),Wc(a,b,c,ud(a,b));var d=[];fe(a,function(a,c){c||-1!=Qe(d,a.history)||(De(a.history,b),d.push(a.history)),Wc(a,b,null,ud(a,b))})}}function Uc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i=0;--i){var l=d.changes[i];if(l.origin=b,k&&!Rc(a,l,!1))return void(g.length=0);j.push(qe(a,l));var m=i?Oc(a,l,null):Pe(g);Wc(a,l,m,wd(a,l)),a.cm&&cd(a.cm);var n=[];fe(a,function(a,b){b||-1!=Qe(n,a.history)||(De(a.history,l),n.push(a.history)),Wc(a,l,null,wd(a,l))})}}}}function Vc(a,b){a.first+=b,a.sel=new S(Re(a.sel.ranges,function(a){return new T(Of(a.anchor.line+b,a.anchor.ch),Of(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm&&ac(a.cm,a.first,a.first-b,b)}function Wc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Xb(a.cm,Wc)(a,b,c,d);if(b.to.linea.lastLine())){if(b.from.linef&&(b={from:b.from,to:Of(f,he(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=ie(a,b.from,b.to),c||(c=Oc(a,b,null)),a.cm?Xc(a.cm,b,d):ce(a,b,d),hb(a,c,Lg)}}function Xc(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=le(Hd(he(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&(a.curOp.cursorActivity=!0),ce(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),qb(a,400);var k=b.text.length-(h.line-g.line)-1;g.line!=h.line||1!=b.text.length||be(a.doc,b)?ac(a,g.line,h.line+1,k):bc(a,g.line,"text"),(Ke(a,"change")||Ke(a,"changes"))&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push({from:g,to:h,text:b.text,removed:b.removed,origin:b.origin})}function Yc(a,b,c,d,e){if(d||(d=c),Pf(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Zg(b)),Sc(a,{from:c,to:d,text:b,origin:e})}function Zc(a,b){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!Ef){var f=Xe("div","​",null,"position: absolute; top: "+(b.top-c.viewOffset-ub(a.display))+"px; height: "+(b.bottom-b.top+Jg)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}function $c(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=Nb(a,b),g=c&&c!=b?Nb(a,c):f,h=ad(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&(zc(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(Ac(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function _c(a,b,c,d,e){var f=ad(a,b,c,d,e);null!=f.scrollTop&&zc(a,f.scrollTop),null!=f.scrollLeft&&Ac(a,f.scrollLeft)}function ad(a,b,c,d,e){var f=a.display,g=Sb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=f.scroller.clientHeight-Jg,j={},k=a.doc.height+vb(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=f.scroller.clientWidth-Jg;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return o+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>p+o-3&&(j.scrollLeft=d+10-p),j}function bd(a,b,c){(null!=b||null!=c)&&dd(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function cd(a){dd(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Of(b.line,b.ch-1):b,d=Of(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function dd(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=Ob(a,b.from),d=Ob(a,b.to),e=ad(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function ed(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(a.doc.mode.indent?e=tb(a,b):c="prev");var g=a.options.tabSize,h=he(f,b),i=Og(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=a.doc.mode.indent(e,h.text.slice(k.length),h.text),j==Kg)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Og(he(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Oe(j-m)),l!=k)Yc(a.doc,l,Of(b,0),Of(b,k.length),"+input"); -else for(var n=0;n=0;b--)Yc(a.doc,"",d[b].from,d[b].to,"+delete");cd(a)})}function hd(a,b,c,d,e){function f(){var b=h+c;return b=a.first+a.size?l=!1:(h=b,k=he(a,b))}function g(a){var b=(e?nf:of)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?gf:ff)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=he(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||g(!o);o=!1){var p=k.text.charAt(i)||"\n",q=Tg(p)?"w":n&&"\n"==p?"n":!n||/\s/.test(p)?null:"p";if(!n||o||q||(q="s"),m&&m!=q){0>c&&(c=1,g());break}if(q&&(m=q),c>0&&!g(!o))break}var r=lb(a,Of(h,i),j,!0);return l||(r.hitSide=!0),r}function id(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*Sb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=Qb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function jd(a,b){var c=he(a,b.line).text,d=b.ch,e=b.ch;if(c){(b.xRel<0||e==c.length)&&d?--d:++e;for(var f=c.charAt(d),g=Tg(f)?Tg:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Tg(a)};d>0&&g(c.charAt(d-1));)--d;for(;e0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Xe("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(Gd(a,b.line,b,c,f)||b.line!=c.line&&Gd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Nf=!0}f.addToHistory&&te(a,{from:b,to:c,origin:"markText"},a.sel,0/0);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&Hd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&ke(a,0),rd(a,new od(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Ld(a,b)&&ke(b,0)}),f.clearOnEnter&&Fg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Mf=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++rg,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)ac(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(var k=b.line;k<=c.line;k++)bc(j,k,"text");f.atomic&&jb(j.doc)}return He(j,"markerAdded",j,f),f}function nd(a,b,c,d,e){d=Te(d),d.shared=!1;var f=[md(a,b,c,d,e)],g=f[0],h=d.widgetNode;return fe(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(md(a,X(a,b),X(a,c),d,e));for(var i=0;i=b:f.to>b);(d||(d=[])).push(new od(g,f.from,i?null:f.to))}}return d}function td(a,b,c){if(a)for(var d,e=0;e=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(p);o.push(i)}return o}function vd(a){for(var b=0;b0)){var k=[i,1],l=Pf(j.from,h.from),m=Pf(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function yd(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Pf(j.to,c)||Bd(i.marker)-Ad(e))>0||k>=0&&(Pf(j.from,d)||Ad(i.marker)-Bd(e))<0))return!0}}}function Hd(a){for(var b;b=Ed(a);)a=b.find(-1,!0).line;return a}function Id(a){for(var b,c;b=Fd(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function Jd(a,b){var c=he(a,b),d=Hd(c);return c==d?b:le(d)}function Kd(a,b){if(b>a.lastLine())return b;var c,d=he(a,b);if(!Ld(a,d))return b;for(;c=Fd(d);)d=c.find(1,!0).line;return le(d)+1}function Ld(a,b){var c=Nf&&b.markedSpans;if(c)for(var d,e=0;eb.options.maxHighlightLength?(h=!1,g&&Ud(b,c,e,l.pos),l.pos=c.length,i=null):i=d.token(l,e),b.options.addModeClass){var m=a.innerMode(d,e).mode.name;m&&(i="m-"+(i?m+" "+i:m))}h&&k==i||(ji;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d),h+=2,i=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,b),h=c+2;else for(;h>c;c+=2){var f=e[c+1];e[c+1]=f?f+" "+b:b}})}return e}function Td(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Sd(a,b,b.stateAfter=tb(a,le(b)))),b.styles}function Ud(a,b,c,d){var e=a.doc.mode,f=new pg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&e.blankLine&&e.blankLine(c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)e.token(f,c),f.start=f.pos}function Vd(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}if(/^\s*$/.test(a))return null;var e=b.cm.options.addModeClass?wg:vg;return e[a]||(e[a]=a.replace(/\S+/g,"cm-$&"))}function Wd(a,b){var c=Xe("span",null,null,wf?"padding-right: .1px":null),d={pre:Xe("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Yd,(vf||wf)&&a.getOption("lineWrapping")&&(d.addToken=Zd(d.addToken)),bf(a.display.measure)&&(f=oe(g))&&(d.addToken=$d(d.addToken,f)),d.map=[],ae(g,d,Td(a,g)),0==d.map.length&&d.map.push(0,0,d.content.appendChild(af(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return Hg(a,"renderLine",a,b.line,d.pre),d}function Xd(a){var b=Xe("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b}function Yd(a,b,c,d,e,f){if(b){var g=a.cm.options.specialChars,h=!1;if(g.test(b))for(var i=document.createDocumentFragment(),j=0;;){g.lastIndex=j;var k=g.exec(b),l=k?k.index-j:b.length-j;if(l){var m=document.createTextNode(b.slice(j,j+l));i.appendChild(sf?Xe("span",[m]):m),a.map.push(a.pos,a.pos+l,m),a.col+=l,a.pos+=l}if(!k)break;if(j+=l+1," "==k[0]){var n=a.cm.options.tabSize,o=n-a.col%n,m=i.appendChild(Xe("span",Oe(o),"cm-tab"));a.col+=o}else{var m=a.cm.options.specialCharPlaceholder(k[0]);i.appendChild(sf?Xe("span",[m]):m),a.col+=1}a.map.push(a.pos,a.pos+1,m),a.pos++}else{a.col+=b.length;var i=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,i),sf&&(h=!0),a.pos+=b.length}if(c||d||e||h){var p=c||"";d&&(p+=d),e&&(p+=e);var q=Xe("span",[i],p);return f&&(q.title=f),a.content.appendChild(q)}a.content.appendChild(i)}}function Zd(a){function b(a){for(var b=" ",c=0;ci&&l.from<=i)break}if(l.to>=j)return a(c,d,e,f,g,h);a(c,d.slice(0,l.to-i),e,f,null,h),f=null,d=d.slice(l.to-i),i=l.to}}}function _d(a,b,c,d){var e=!d&&c.widgetNode;e&&(a.map.push(a.pos,a.pos+b,e),a.content.appendChild(e)),a.pos+=b}function ae(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m=e.length,n=0,o=1,p="",q=0;;){if(q==n){h=i=j=k="",l=null,q=1/0;for(var r=[],s=0;sn)?(null!=t.to&&q>t.to&&(q=t.to,i=""),u.className&&(h+=" "+u.className),u.startStyle&&t.from==n&&(j+=" "+u.startStyle),u.endStyle&&t.to==q&&(i+=" "+u.endStyle),u.title&&!k&&(k=u.title),u.collapsed&&(!l||Cd(l.marker,u)<0)&&(l=t)):t.from>n&&q>t.from&&(q=t.from),"bookmark"==u.type&&t.from==n&&u.widgetNode&&r.push(u)}if(l&&(l.from||0)==n&&(_d(b,(null==l.to?m+1:l.to)-n,l.marker,null==l.from),null==l.to))return;if(!l&&r.length)for(var s=0;s=m)break;for(var v=Math.min(m,q);;){if(p){var w=n+p.length;if(!l){var x=w>v?p.slice(0,v-n):p;b.addToken(b,x,g?g+h:h,j,n+x.length==q?i:"",k)}if(w>=v){p=p.slice(v-n),n=v;break}n=w,j=""}p=e.slice(f,f=c[o++]),g=Vd(c[o++],b)}}else for(var o=1;o1&&a.remove(g.line+1,n-1),a.insert(g.line+1,p)}He(a,"change",a,b)}function de(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function ie(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function je(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function ke(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function le(a){if(null==a.parent)return null;for(var b=a.parent,c=Qe(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function me(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function ne(a){a=Hd(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Pe(a.done)):void 0}function te(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=se(e,e.lastOp==d))){var h=Pe(f.changes);0==Pf(b.from,b.to)&&0==Pf(b.from,h.to)?h.to=_f(b):f.changes.push(qe(a,b))}else{var i=Pe(e.done);for(i&&i.ranges||we(a.sel,e.done),f={changes:[qe(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=g,e.lastOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Hg(a,"historyAdded")}function ue(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function ve(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastOp||f&&e.lastSelOrigin==f&&ue(a,f,Pe(e.done),b)?e.done[e.done.length-1]=b:we(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastOp=c,d&&d.clearRedo!==!1&&re(e.undone)}function we(a,b){var c=Pe(b);c&&c.ranges&&c.equals(a)||b.push(a)}function xe(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ye(a){if(!a)return null;for(var b,c=0;c-1&&(Pe(h)[l]=k[l],delete k[l])}}}return e}function Be(a,b,c,d){c0}function Le(a){a.prototype.on=function(a,b){Fg(this,a,b)},a.prototype.off=function(a,b){Gg(this,a,b)}}function Me(){this.id=null}function Ne(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function Oe(a){for(;Pg.length<=a;)Pg.push(Pe(Pg)+" ");return Pg[a]}function Pe(a){return a[a.length-1]}function Qe(a,b){for(var c=0;c=768&&Ug.test(a)}function Xe(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function Ze(a,b){return Ye(a).appendChild(b)}function $e(){return document.activeElement}function _e(a){if(null!=Vg)return Vg;var b=Xe("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Ze(a,b),b.offsetWidth&&(Vg=b.offsetHeight-b.clientHeight),Vg||0}function af(a){if(null==Wg){var b=Xe("span","​");Ze(a,Xe("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Wg=b.offsetWidth<=1&&b.offsetHeight>2&&!rf)}return Wg?Xe("span","​"):Xe("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function bf(a){if(null!=Xg)return Xg;var b=Ze(a,document.createTextNode("AخA")),c=Rg(b,0,1).getBoundingClientRect();if(c.left==c.right)return!1;var d=Rg(b,1,2).getBoundingClientRect();return Xg=d.right-c.right<3}function cf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function df(a){return a.level%2?a.to:a.from}function ef(a){return a.level%2?a.from:a.to}function ff(a){var b=oe(a);return b?df(b[0]):0}function gf(a){var b=oe(a);return b?ef(Pe(b)):a.text.length}function hf(a,b){var c=he(a.doc,b),d=Hd(c);d!=c&&(b=le(d));var e=oe(d),f=e?e[0].level%2?gf(d):ff(d):0;return Of(b,f)}function jf(a,b){for(var c,d=he(a.doc,b);c=Fd(d);)d=c.find(1,!0).line,b=null;var e=oe(d),f=e?e[0].level%2?ff(d):gf(d):d.text.length;return Of(null==b?le(d):b,f)}function kf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function lf(a,b){bh=null;for(var c,d=0;db)return d;if(e.from==b||e.to==b){if(null!=c)return kf(a,e.level,a[c].level)?(e.from!=e.to&&(bh=c),d):(e.from!=e.to&&(bh=d),c);c=d}}return c}function mf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&We(a.text.charAt(b)));return b}function nf(a,b,c,d){var e=oe(a);if(!e)return of(a,b,c,d);for(var f=lf(e,b),g=e[f],h=mf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?mf(a,g.to,-1,d):mf(a,g.from,1,d)}}function of(a,b,c,d){var e=b+c;if(d)for(;e>0&&We(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var pf=/gecko\/\d/i.test(navigator.userAgent),qf=/MSIE \d/.test(navigator.userAgent),rf=qf&&(null==document.documentMode||document.documentMode<8),sf=qf&&(null==document.documentMode||document.documentMode<9),tf=qf&&(null==document.documentMode||document.documentMode<10),uf=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),vf=qf||uf,wf=/WebKit\//.test(navigator.userAgent),xf=wf&&/Qt\/\d+\.\d+/.test(navigator.userAgent),yf=/Chrome\//.test(navigator.userAgent),zf=/Opera\//.test(navigator.userAgent),Af=/Apple Computer/.test(navigator.vendor),Bf=/KHTML\//.test(navigator.userAgent),Cf=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Df=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),Ef=/PhantomJS/.test(navigator.userAgent),Ff=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Gf=Ff||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Hf=Ff||/Mac/.test(navigator.platform),If=/win/i.test(navigator.platform),Jf=zf&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Jf&&(Jf=Number(Jf[1])),Jf&&Jf>=15&&(zf=!1,wf=!0);var Kf=Hf&&(xf||zf&&(null==Jf||12.11>Jf)),Lf=pf||vf&&!sf,Mf=!1,Nf=!1,Of=a.Pos=function(a,b){return this instanceof Of?(this.line=a,void(this.ch=b)):new Of(a,b)},Pf=a.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};S.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&Pf(a,d.to())<=0)return c}return-1}},T.prototype={from:function(){return R(this.anchor,this.head)},to:function(){return Q(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Qf,Rf,Sf,Tf={left:0,right:0,top:0,bottom:0},Uf=0,Vf=0,Wf=0,Xf=null;vf?Xf=-.53:pf?Xf=15:yf?Xf=-.7:Af&&(Xf=-1/3);var Yf,Zf,$f=null,_f=a.changeEnd=function(a){return a.text?Of(a.from.line+a.text.length-1,Pe(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),lc(this),ic(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,bg.hasOwnProperty(a)&&Xb(this,bg[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(ed(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&cd(this));else{var f=Math.max(c,e.from().line),g=e.to();c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var h=f;c>h;++h)ed(this,h,a)}}}),getTokenAt:function(a,b){var c=this.doc;a=X(c,a);for(var d=tb(this,a.line,b),e=this.doc.mode,f=he(c,a.line),g=new pg(f.text,this.options.tabSize);g.pos>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]d&&(a=d,c=!0);var e=he(this.doc,a);return Kb(this,he(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return Sb(this.display)},defaultCharWidth:function(){return Tb(this.display)},setGutterMarker:Yb(function(a,b,c){return fd(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Ve(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Yb(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,bc(b,d,"gutter"),Ve(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Yb(function(a,b,c){return fd(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Yb(function(a,b,c){return fd(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Yb(function(a,b,c){return Od(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!Z(this.doc,a))return null;var b=a;if(a=he(this.doc,a),!a)return null}else{var b=le(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=Nb(this,X(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth) -}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&_c(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Yb(Gc),triggerOnKeyPress:Yb(Ic),triggerOnKeyUp:Yb(Hc),execCommand:function(a){return kg.hasOwnProperty(a)?kg[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=X(this.doc,a);b>f&&(g=hd(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Yb(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?hd(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Ng)}),deleteH:Yb(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):gd(this,function(c){var e=hd(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=X(this.doc,a);b>g;++g){var i=Nb(this,h,"div");if(null==f?f=i.left:i.left=f,h=id(this,i,e,c),h.hitSide)break}return h},moveV:Yb(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.sel.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=Nb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=id(c,h,a,b);return"page"==b&&g==d.sel.primary()&&bd(c,null,Mb(c,i,"div").top-h.top),i},Ng),e.length)for(var g=0;g.5)&&g(this),Hg(this,"refresh",this)}),swapDoc:Yb(function(a){var b=this.doc;return b.cm=null,ge(this,a),Hb(this),kc(this),this.scrollTo(a.scrollLeft,a.scrollTop),He(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Le(a);var ag=a.defaults={},bg=a.optionHandlers={},cg=a.Init={toString:function(){return"CodeMirror.Init"}};kd("value","",function(a,b){a.setValue(b)},!0),kd("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),kd("indentUnit",2,c,!0),kd("indentWithTabs",!1),kd("smartIndent",!0),kd("tabSize",4,function(a){d(a),Hb(a),ac(a)},!0),kd("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),a.refresh()},!0),kd("specialCharPlaceholder",Xd,function(a){a.refresh()},!0),kd("electricChars",!0),kd("rtlMoveVisually",!If),kd("wholeLineUpdateBefore",!0),kd("theme","default",function(a){i(a),j(a)},!0),kd("keyMap","default",h),kd("extraKeys",null),kd("lineWrapping",!1,e,!0),kd("gutters",[],function(a){n(a.options),j(a)},!0),kd("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?u(a.display)+"px":"0",a.refresh()},!0),kd("coverGutterNextToScrollbar",!1,p,!0),kd("lineNumbers",!1,function(a){n(a.options),j(a)},!0),kd("firstLineNumber",1,j,!0),kd("lineNumberFormatter",function(a){return a},j,!0),kd("showCursorWhenSelecting",!1,mb,!0),kd("resetSelectionOnContextMenu",!0),kd("readOnly",!1,function(a,b){"nocursor"==b?(Kc(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||kc(a))}),kd("disableInput",!1,function(a,b){b||kc(a)},!0),kd("dragDrop",!0),kd("cursorBlinkRate",530),kd("cursorScrollMargin",0),kd("cursorHeight",1),kd("workTime",100),kd("workDelay",100),kd("flattenSpans",!0,d,!0),kd("addModeClass",!1,d,!0),kd("pollInterval",100),kd("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),kd("historyEventDelay",1250),kd("viewportMargin",10,function(a){a.refresh()},!0),kd("maxHighlightLength",1e4,d,!0),kd("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),kd("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),kd("autofocus",null);var dg=a.modes={},eg=a.mimeModes={};a.defineMode=function(b,c){if(a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2){c.dependencies=[];for(var d=2;d0&&d.chc;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),cd(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},lg=a.keyMap={};lg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},lg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},lg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]},lg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},lg["default"]=Hf?lg.macDefault:lg.pcDefault;var mg=a.lookupKey=function(a,b,c){function d(b){b=ld(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0;g=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var qg=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a};Le(qg),qg.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&Ub(a),Ke(this,"clear")){var c=this.find();c&&He(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&ac(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&jb(a.doc)),He(a,"markerCleared",a,this),b&&Vb(a)}},qg.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e=b.display.viewFrom&&dc;++c){var e=this.lines[c];this.height-=e.height,Qd(e),He(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},ee.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof de))){var h=[];this.collapse(h),this.children=[new de(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new de(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new ee(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Qe(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new ee(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var xg=0,yg=a.Doc=function(a,b,c){if(!(this instanceof yg))return new yg(a,b,c);null==c&&(c=0),ee.call(this,[new de([new ug("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=Of(c,0);this.sel=V(d),this.history=new pe(null),this.id=++xg,this.modeOption=b,"string"==typeof a&&(a=Zg(a)),ce(this,{from:d,to:d,text:a}),gb(this,V(d),Lg)};yg.prototype=Se(ee.prototype,{constructor:yg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)Sc(this,d[f]);h?fb(this,h):this.cm&&cd(this.cm)},undo:Zb(function(){Uc(this,"undo")}),redo:Zb(function(){Uc(this,"redo")}),undoSelection:Zb(function(){Uc(this,"undo",!0)}),redoSelection:Zb(function(){Uc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b){a=X(this,a),b=X(this,b);var c=[],d=a.line;return this.iter(a.line,b.line+1,function(e){var f=e.markedSpans;if(f)for(var g=0;gh.to||null==h.from&&d!=a.line||d==b.line&&h.from>b.ch||c.push(h.marker.parent||h.marker)}++d}),c},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=e,void++c)}),X(this,Of(c,b))},indexFromPos:function(a){a=X(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Pg=[""],Qg=function(a){a.select()};Ff?Qg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:vf&&(Qg=function(a){try{a.select()}catch(b){}}),[].indexOf&&(Qe=function(a,b){return a.indexOf(b)}),[].map&&(Re=function(a,b){return a.map(b)});var Rg,Sg=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Tg=a.isWordChar=function(a){return/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||Sg.test(a))},Ug=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Rg=document.createRange?function(a,b,c){var d=document.createRange(); -return d.setEnd(a,c),d.setStart(a,b),d}:function(a,b,c){var d=document.body.createTextRange();return d.moveToElementText(a.parentNode),d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d},qf&&($e=function(){try{return document.activeElement}catch(a){return document.body}});var Vg,Wg,Xg,Yg=function(){if(sf)return!1;var a=Xe("div");return"draggable"in a||"dragDrop"in a}(),Zg=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},$g=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},_g=function(){var a=Xe("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),ah={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};a.keyNames=ah,function(){for(var a=0;10>a;a++)ah[a+48]=ah[a+96]=String(a);for(var a=65;90>=a;a++)ah[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)ah[a+111]=ah[a+63235]="F"+a}();var bh,ch=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Pe(v).level&&(u=c.match(/\s+$/))&&(Pe(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),v[0].level!=Pe(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="4.0.1",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("javascript",function(b,c){function d(a){for(var b,c=!1,d=!1;null!=(b=a.next());){if(!c){if("/"==b&&!d)return;"["==b?d=!0:d&&"]"==b&&(d=!1)}c=!c&&"\\"==b}}function e(a,b,c){return nb=a,ob=c,b}function f(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=g(c),b.tokenize(a,b);if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return e("number","number");if("."==c&&a.match(".."))return e("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return e(c);if("="==c&&a.eat(">"))return e("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),e("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),e("number","number");if("/"==c)return a.eat("*")?(b.tokenize=h,h(a,b)):a.eat("/")?(a.skipToEnd(),e("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(d(a),a.eatWhile(/[gimy]/),e("regexp","string-2")):(a.eatWhile(vb),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c)return a.skipToEnd(),e("error","error");if(vb.test(c))return a.eatWhile(vb),e("operator","operator",a.current());a.eatWhile(/[\w\$_]/);var f=a.current(),j=ub.propertyIsEnumerable(f)&&ub[f];return j&&"."!=b.lastType?e(j.type,j.style,f):e("variable","variable",f)}function g(a){return function(b,c){var d,g=!1;if(rb&&"@"==b.peek()&&b.match(wb))return c.tokenize=f,e("jsonld-keyword","meta");for(;null!=(d=b.next())&&(d!=a||g);)g=!g&&"\\"==d;return g||(c.tokenize=f),e("string","string")}}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=f;break}d="*"==c}return e("comment","comment")}function i(a,b){for(var c,d=!1;null!=(c=a.next());){if(!d&&("`"==c||"$"==c&&a.eat("{"))){b.tokenize=f;break}d=!d&&"\\"==c}return e("quasi","string-2",a.current())}function j(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=xb.indexOf(g);if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(/[$\w]/.test(g))e=!0;else if(e&&!d){++f;break}}e&&!d&&(b.fatArrowAt=f)}}function k(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function l(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function m(a,b,c,d,e){var f=a.cc;for(zb.state=a,zb.stream=e,zb.marked=null,zb.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():sb?w:v;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return zb.marked?zb.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)zb.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=zb.state;if(d.context){if(zb.marked="def",b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function q(){zb.state.context={prev:zb.state.context,vars:zb.state.localVars},zb.state.localVars=Ab}function r(){zb.state.localVars=zb.state.context.vars,zb.state.context=zb.state.context.prev}function s(a,b){var c=function(){var c=zb.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new k(d,zb.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function t(){var a=zb.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function u(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function v(a,b){return"var"==a?o(s("vardef",b.length),R,u(";"),t):"keyword a"==a?o(s("form"),w,v,t):"keyword b"==a?o(s("form"),v,t):"{"==a?o(s("}"),O,t):";"==a?o():"if"==a?o(s("form"),w,v,t,W):"function"==a?o(ab):"for"==a?o(s("form"),X,v,t):"variable"==a?o(s("stat"),H):"switch"==a?o(s("form"),w,s("}","switch"),u("{"),O,t,t):"case"==a?o(w,u(":")):"default"==a?o(u(":")):"catch"==a?o(s("form"),q,u("("),bb,u(")"),v,t,r):"module"==a?o(s("form"),q,fb,r,t):"class"==a?o(s("form"),cb,eb,t):"export"==a?o(s("form"),gb,t):"import"==a?o(s("form"),hb,t):n(s("stat"),w,u(";"),t)}function w(a){return y(a,!1)}function x(a){return y(a,!0)}function y(a,b){if(zb.state.fatArrowAt==zb.stream.start){var c=b?G:F;if("("==a)return o(q,s(")"),M(S,")"),t,u("=>"),c,r);if("variable"==a)return n(q,S,u("=>"),c,r)}var d=b?C:B;return yb.hasOwnProperty(a)?o(d):"function"==a?o(ab):"keyword c"==a?o(b?A:z):"("==a?o(s(")"),z,mb,u(")"),t,d):"operator"==a||"spread"==a?o(b?x:w):"["==a?o(s("]"),kb,t,d):"{"==a?N(J,"}",null,d):o()}function z(a){return a.match(/[;\}\)\],]/)?n():n(w)}function A(a){return a.match(/[;\}\)\],]/)?n():n(x)}function B(a,b){return","==a?o(w):C(a,b,!1)}function C(a,b,c){var d=0==c?B:C,e=0==c?w:x;return"=>"==b?o(q,c?G:F,r):"operator"==a?/\+\+|--/.test(b)?o(d):"?"==b?o(w,u(":"),e):o(e):"quasi"==a?(zb.cc.push(d),D(b)):";"!=a?"("==a?N(x,")","call",d):"."==a?o(I,d):"["==a?o(s("]"),z,u("]"),t,d):void 0:void 0}function D(a){return"${"!=a.slice(a.length-2)?o():o(w,E)}function E(a){return"}"==a?(zb.marked="string-2",zb.state.tokenize=i,o()):void 0}function F(a){return j(zb.stream,zb.state),n("{"==a?v:w)}function G(a){return j(zb.stream,zb.state),n("{"==a?v:x)}function H(a){return":"==a?o(t,v):n(B,u(";"),t)}function I(a){return"variable"==a?(zb.marked="property",o()):void 0}function J(a,b){if("variable"==a){if(zb.marked="property","get"==b||"set"==b)return o(K)}else if("number"==a||"string"==a)zb.marked=rb?"property":a+" property";else if("["==a)return o(w,u("]"),L);return yb.hasOwnProperty(a)?o(L):void 0}function K(a){return"variable"!=a?n(L):(zb.marked="property",o(ab))}function L(a){return":"==a?o(x):"("==a?n(ab):void 0}function M(a,b){function c(d){if(","==d){var e=zb.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),o(a,c)}return d==b?o():o(u(b))}return function(d){return d==b?o():n(a,c)}}function N(a,b,c){for(var d=3;d!?|~^]/,wb=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,xb="([{}])",yb={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},zb={state:null,column:null,marked:null,cc:null},Ab={name:"this",next:{name:"arguments"}};return t.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-pb,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),j(a,b)),b.tokenize!=h&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==nb?c:(b.lastType="operator"!=nb||"++"!=ob&&"--"!=ob?nb:"incdec",m(b,c,nb,ob,a))},indent:function(b,d){if(b.tokenize==h)return a.Pass;if(b.tokenize!=f)return 0;for(var e=d&&d.charAt(0),g=b.lexical,i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==t)g=g.prev;else if(j!=W)break}"stat"==g.type&&"}"==e&&(g=g.prev),qb&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var k=g.type,l=e==k;return"vardef"==k?g.indented+("operator"==b.lastType||","==b.lastType?g.info+1:0):"form"==k&&"{"==e?g.indented:"form"==k?g.indented+pb:"stat"==k?g.indented+("operator"==b.lastType||","==b.lastType?qb||pb:0):"switch"!=g.info||l||0==c.doubleIndentSwitch?g.align?g.column+(l?0:1):g.indented+(l?0:pb):g.indented+(/^(?:case|default)\b/.test(d)?pb:2*pb)},electricChars:":{}",blockCommentStart:sb?null:"/*",blockCommentEnd:sb?null:"*/",lineComment:sb?null:"//",fold:"brace",helperType:sb?"json":"javascript",jsonldMode:rb,jsonMode:sb}}),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(b,c){function d(b){return e.parentNode?(e.style.top=Math.max(0,b.clientY-e.offsetHeight-5)+"px",void(e.style.left=b.clientX+5+"px")):a.off(document,"mousemove",d)}var e=document.createElement("div");return e.className="CodeMirror-lint-tooltip",e.appendChild(c.cloneNode(!0)),document.body.appendChild(e),a.on(document,"mousemove",d),d(b),null!=e.style.opacity&&(e.style.opacity=1),e}function c(a){a.parentNode&&a.parentNode.removeChild(a)}function d(a){a.parentNode&&(null==a.style.opacity&&c(a),a.style.opacity=0,setTimeout(function(){c(a)},600))}function e(c,e,f){function g(){a.off(f,"mouseout",g),h&&(d(h),h=null)}var h=b(c,e),i=setInterval(function(){if(h)for(var a=f;;a=a.parentNode){if(a==document.body)return;if(!a){g();break}}return h?void 0:clearInterval(i)},400);a.on(f,"mouseout",g)}function f(a,b,c){this.marked=[],this.options=b,this.timeout=null,this.hasGutter=c,this.onMouseOver=function(b){q(a,b)}}function g(b,c){if(c instanceof Function)return{getAnnotations:c};if(c&&c!==!0||(c={}),c.getAnnotations||(c.getAnnotations=b.getHelper(a.Pos(0,0),"lint")),!c.getAnnotations)throw new Error("Required option 'getAnnotations' missing (lint addon)");return c}function h(a){var b=a.state.lint;b.hasGutter&&a.clearGutter(r);for(var c=0;c1,c.options.tooltips))}}d.onUpdateLinting&&d.onUpdateLinting(b,e,a)}function o(a){var b=a.state.lint;clearTimeout(b.timeout),b.timeout=setTimeout(function(){m(a)},b.options.delay||500)}function p(a,b){var c=b.target||b.srcElement;e(b,l(a),c)}function q(a,b){if(/\bCodeMirror-lint-mark-/.test((b.target||b.srcElement).className))for(var c=0;c0){var k=f.character;i.forEach(function(a){k>a&&(k-=1)}),f.character=k}}var l=f.character-1,m=l+1;f.evidence&&(h=f.evidence.substring(l).search(/.\b/),h>-1&&(m+=h)),f.description=f.reason,f.start=f.character,f.end=m,f=c(f),f&&d.push({message:f.description,severity:f.severity,from:a.Pos(f.line-1,l),to:a.Pos(f.line-1,m)})}}}var g=["Dangerous comment"],h=[["Expected '{'","Statement body should be inside '{ }' braces."]],i=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];a.registerHelper("lint","javascript",b)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.registerHelper("lint","json",function(b){var c=[];jsonlint.parseError=function(b,d){var e=d.loc;c.push({from:a.Pos(e.first_line-1,e.first_column),to:a.Pos(e.last_line-1,e.last_column),message:b})};try{jsonlint.parse(b)}catch(d){}return c})}),"undefined"==typeof YAHOO||!YAHOO)var YAHOO={};YAHOO.namespace=function(){var a,b,c,d=arguments,e=null;for(a=0;a":">",'"':""","'":"'","/":"/","`":"`"},h=["toString","valueOf"],i={isArray:function(a){return b.toString.apply(a)===c},isBoolean:function(a){return"boolean"==typeof a},isFunction:function(a){return"function"==typeof a||b.toString.apply(a)===d},isNull:function(a){return null===a},isNumber:function(a){return"number"==typeof a&&isFinite(a)},isObject:function(b){return b&&("object"==typeof b||a.isFunction(b))||!1},isString:function(a){return"string"==typeof a},isUndefined:function(a){return"undefined"==typeof a},_IEEnumFix:YAHOO.env.ua.ie?function(c,d){var e,f,g;for(e=0;e"'\/`]/g,function(a){return g[a]})},extend:function(c,d,e){if(!d||!c)throw new Error("extend failed, please check that all dependencies are included.");var f,g=function(){};if(g.prototype=d.prototype,c.prototype=new g,c.prototype.constructor=c,c.superclass=d.prototype,d.prototype.constructor==b.constructor&&(d.prototype.constructor=d),e){for(f in e)a.hasOwnProperty(e,f)&&(c.prototype[f]=e[f]);a._IEEnumFix(c.prototype,e)}},augmentObject:function(b,c){if(!c||!b)throw new Error("Absorb failed, verify dependencies.");var d,e,f=arguments,g=f[2];if(g&&g!==!0)for(d=2;dd;d+=1)f.push(a.isObject(b[d])?c>0?a.dump(b[d],c-1):g:b[d]),f.push(i);f.length>1&&f.pop(),f.push("]")}else{f.push("{");for(d in b)a.hasOwnProperty(b,d)&&(f.push(d+j),f.push(a.isObject(b[d])?c>0?a.dump(b[d],c-1):g:b[d]),f.push(i));f.length>1&&f.pop(),f.push("}")}return f.join("")},substitute:function(b,c,d,f){for(var g,h,i,j,k,l,m,n,o,p=[],q=b.length,r="dump",s=" ",t="{",u="}";(g=b.lastIndexOf(t,q),!(0>g))&&(h=b.indexOf(u,g),!(g+1>h));)m=b.substring(g+1,h),j=m,l=null,i=j.indexOf(s),i>-1&&(l=j.substring(i+1),j=j.substring(0,i)),k=c[j],d&&(k=d(j,k,l)),a.isObject(k)?a.isArray(k)?k=a.dump(k,parseInt(l,10)):(l=l||"",n=l.indexOf(r),n>-1&&(l=l.substring(4)),o=k.toString(),k=o===e||n>-1?a.dump(k,parseInt(l,10)):o):a.isString(k)||a.isNumber(k)||(k="~-"+p.length+"-~",p[p.length]=m),b=b.substring(0,g)+k+b.substring(h+1),f===!1&&(q=g-1);for(g=p.length-1;g>=0;g-=1)b=b.replace(new RegExp("~-"+g+"-~"),"{"+p[g]+"}","g");return b},trim:function(a){try{return a.replace(/^\s+|\s+$/g,"")}catch(b){return a}},merge:function(){var b,c={},d=arguments,e=d.length;for(b=0;e>b;b+=1)a.augmentObject(c,d[b],!0);return c},later:function(b,c,d,e,g){b=b||0,c=c||{};var h,i,j=d,k=e;if(a.isString(d)&&(j=c[d]),!j)throw new TypeError("method undefined");return a.isUndefined(e)||a.isArray(k)||(k=[e]),h=function(){j.apply(c,k||f)},i=g?setInterval(h,b):setTimeout(h,b),{interval:g,cancel:function(){this.interval?clearInterval(i):clearTimeout(i)}}},isValue:function(b){return a.isObject(b)||a.isString(b)||a.isNumber(b)||a.isBoolean(b)}};a.hasOwnProperty=b.hasOwnProperty?function(a,b){return a&&a.hasOwnProperty&&a.hasOwnProperty(b)}:function(b,c){return!a.isUndefined(b[c])&&b.constructor.prototype[c]!==b[c]},i.augmentObject(a,i,!0),YAHOO.util.Lang=a,a.augment=a.augmentProto,YAHOO.augment=a.augmentProto,YAHOO.extend=a.extend}(),YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});var CryptoJS=CryptoJS||function(a,b){var c={},d=c.lib={},e=d.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;return b&&c.mixIn(b),c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)}),c.init.prototype=c,c.$super=this,c},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=d.WordArray=e.extend({init:function(a,c){a=this.words=a||[],this.sigBytes=c!=b?c:4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;e>f;f++){var g=c[f>>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;e>f;f+=4)b[d+f>>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=e.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c=[],d=0;b>d;d+=4)c.push(4294967296*a.random()|0);return new f.init(c,b)}}),g=c.enc={},h=g.Hex={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new f.init(c,b/2)}},i=g.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new f.init(c,b)}},j=g.Utf8={stringify:function(a){try{return decodeURIComponent(escape(i.stringify(a)))}catch(b){throw new Error("Malformed UTF-8 data")}},parse:function(a){return i.parse(unescape(encodeURIComponent(a)))}},k=d.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,g=this.blockSize,h=4*g,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*g,k=a.min(4*j,e);if(j){for(var l=0;j>l;l+=g)this._doProcessBlock(d,l);var m=d.splice(0,j);c.sigBytes-=k}return new f.init(m,k)},clone:function(){var a=e.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),l=(d.Hasher=k.extend({cfg:e.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){k.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new l.HMAC.init(a,c).finalize(b)}}}),c.algo={});return c}(Math);!function(a){var b=CryptoJS,c=b.lib,d=c.Base,e=c.WordArray,b=b.x64={};b.Word=d.extend({init:function(a,b){this.high=a,this.low=b}}),b.WordArray=d.extend({init:function(b,c){b=this.words=b||[],this.sigBytes=c!=a?c:8*b.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;b>d;d++){var f=a[d];c.push(f.high),c.push(f.low)}return e.create(c,this.sigBytes)},clone:function(){for(var a=d.clone.call(this),b=a.words=this.words.slice(0),c=b.length,e=0;c>e;e++)b[e]=b[e].clone();return a}})}(),function(){var a=CryptoJS,b=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,c){a=this._hasher=new a.init,"string"==typeof c&&(c=b.parse(c));var d=a.blockSize,e=4*d;c.sigBytes>e&&(c=a.finalize(c)),c.clamp();for(var f=this._oKey=c.clone(),g=this._iKey=c.clone(),h=f.words,i=g.words,j=0;d>j;j++)h[j]^=1549556828,i[j]^=909522486;f.sigBytes=g.sigBytes=e,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher;return a=b.finalize(a),b.reset(),b.finalize(this._oKey.clone().concat(a))}})}(),function(a){for(var b=CryptoJS,c=b.lib,d=c.WordArray,e=c.Hasher,c=b.algo,f=[],g=[],h=function(a){return 4294967296*(a-(0|a))|0},i=2,j=0;64>j;){var k;a:{k=i;for(var l=a.sqrt(k),m=2;l>=m;m++)if(!(k%m)){k=!1;break a}k=!0}k&&(8>j&&(f[j]=h(a.pow(i,.5))),g[j]=h(a.pow(i,1/3)),j++),i++}var n=[],c=c.SHA256=e.extend({_doReset:function(){this._hash=new d.init(f.slice(0)) -},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=c[5],k=c[6],l=c[7],m=0;64>m;m++){if(16>m)n[m]=0|a[b+m];else{var o=n[m-15],p=n[m-2];n[m]=((o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3)+n[m-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[m-16]}o=l+((i<<26|i>>>6)^(i<<21|i>>>11)^(i<<7|i>>>25))+(i&j^~i&k)+g[m]+n[m],p=((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+(d&e^d&f^e&f),l=k,k=j,j=i,i=h+o|0,h=f,f=e,e=d,d=o+p|0}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0,c[5]=c[5]+j|0,c[6]=c[6]+k|0,c[7]=c[7]+l|0},_doFinalize:function(){var b=this._data,c=b.words,d=8*this._nDataBytes,e=8*b.sigBytes;return c[e>>>5]|=128<<24-e%32,c[(e+64>>>9<<4)+14]=a.floor(d/4294967296),c[(e+64>>>9<<4)+15]=d,b.sigBytes=4*c.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA256=e._createHelper(c),b.HmacSHA256=e._createHmacHelper(c)}(Math),function(){var a=CryptoJS,b=a.lib.WordArray,c=a.algo,d=c.SHA256,c=c.SHA224=d.extend({_doReset:function(){this._hash=new b.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=d._doFinalize.call(this);return a.sigBytes-=4,a}});a.SHA224=d._createHelper(c),a.HmacSHA224=d._createHmacHelper(c)}(),function(){function a(){return e.create.apply(e,arguments)}for(var b=CryptoJS,c=b.lib.Hasher,d=b.x64,e=d.Word,f=d.WordArray,d=b.algo,g=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],h=[],i=0;80>i;i++)h[i]=a();d=d.SHA512=c.extend({_doReset:function(){this._hash=new f.init([new e.init(1779033703,4089235720),new e.init(3144134277,2227873595),new e.init(1013904242,4271175723),new e.init(2773480762,1595750129),new e.init(1359893119,2917565137),new e.init(2600822924,725511199),new e.init(528734635,4215389547),new e.init(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],i=c[3],j=c[4],k=c[5],l=c[6],c=c[7],m=d.high,n=d.low,o=e.high,p=e.low,q=f.high,r=f.low,s=i.high,t=i.low,u=j.high,v=j.low,w=k.high,x=k.low,y=l.high,z=l.low,A=c.high,B=c.low,C=m,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v,M=w,N=x,O=y,P=z,Q=A,R=B,S=0;80>S;S++){var T=h[S];if(16>S)var U=T.high=0|a[b+2*S],V=T.low=0|a[b+2*S+1];else{var U=h[S-15],V=U.high,W=U.low,U=(V>>>1|W<<31)^(V>>>8|W<<24)^V>>>7,W=(W>>>1|V<<31)^(W>>>8|V<<24)^(W>>>7|V<<25),X=h[S-2],V=X.high,Y=X.low,X=(V>>>19|Y<<13)^(V<<3|Y>>>29)^V>>>6,Y=(Y>>>19|V<<13)^(Y<<3|V>>>29)^(Y>>>6|V<<26),V=h[S-7],Z=V.high,$=h[S-16],_=$.high,$=$.low,V=W+V.low,U=U+Z+(W>>>0>V>>>0?1:0),V=V+Y,U=U+X+(Y>>>0>V>>>0?1:0),V=V+$,U=U+_+($>>>0>V>>>0?1:0);T.high=U,T.low=V}var Z=K&M^~K&O,$=L&N^~L&P,T=C&E^C&G^E&G,ab=D&F^D&H^F&H,W=(C>>>28|D<<4)^(C<<30|D>>>2)^(C<<25|D>>>7),X=(D>>>28|C<<4)^(D<<30|C>>>2)^(D<<25|C>>>7),Y=g[S],bb=Y.high,cb=Y.low,Y=R+((L>>>14|K<<18)^(L>>>18|K<<14)^(L<<23|K>>>9)),_=Q+((K>>>14|L<<18)^(K>>>18|L<<14)^(K<<23|L>>>9))+(R>>>0>Y>>>0?1:0),Y=Y+$,_=_+Z+($>>>0>Y>>>0?1:0),Y=Y+cb,_=_+bb+(cb>>>0>Y>>>0?1:0),Y=Y+V,_=_+U+(V>>>0>Y>>>0?1:0),V=X+ab,T=W+T+(X>>>0>V>>>0?1:0),Q=O,R=P,O=M,P=N,M=K,N=L,L=J+Y|0,K=I+_+(J>>>0>L>>>0?1:0)|0,I=G,J=H,G=E,H=F,E=C,F=D,D=Y+V|0,C=_+T+(Y>>>0>D>>>0?1:0)|0}n=d.low=n+D,d.high=m+C+(D>>>0>n>>>0?1:0),p=e.low=p+F,e.high=o+E+(F>>>0>p>>>0?1:0),r=f.low=r+H,f.high=q+G+(H>>>0>r>>>0?1:0),t=i.low=t+J,i.high=s+I+(J>>>0>t>>>0?1:0),v=j.low=v+L,j.high=u+K+(L>>>0>v>>>0?1:0),x=k.low=x+N,k.high=w+M+(N>>>0>x>>>0?1:0),z=l.low=z+P,l.high=y+O+(P>>>0>z>>>0?1:0),B=c.low=B+R,c.high=A+Q+(R>>>0>B>>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+128>>>10<<5)+30]=Math.floor(c/4294967296),b[(d+128>>>10<<5)+31]=c,a.sigBytes=4*b.length,this._process(),this._hash.toX32()},clone:function(){var a=c.clone.call(this);return a._hash=this._hash.clone(),a},blockSize:32}),b.SHA512=c._createHelper(d),b.HmacSHA512=c._createHmacHelper(d)}(),function(){var a=CryptoJS,b=a.x64,c=b.Word,d=b.WordArray,b=a.algo,e=b.SHA512,b=b.SHA384=e.extend({_doReset:function(){this._hash=new d.init([new c.init(3418070365,3238371032),new c.init(1654270250,914150663),new c.init(2438529370,812702999),new c.init(355462360,4144912697),new c.init(1731405415,4290775857),new c.init(2394180231,1750603025),new c.init(3675008525,1694076839),new c.init(1203062813,3204075428)])},_doFinalize:function(){var a=e._doFinalize.call(this);return a.sigBytes-=16,a}});a.SHA384=e._createHelper(b),a.HmacSHA384=e._createHmacHelper(b)}(),function(a){function b(a,b,c,d,e,f,g){return a=a+(b&c|~b&d)+e+g,(a<>>32-f)+b}function c(a,b,c,d,e,f,g){return a=a+(b&d|c&~d)+e+g,(a<>>32-f)+b}function d(a,b,c,d,e,f,g){return a=a+(b^c^d)+e+g,(a<>>32-f)+b}function e(a,b,c,d,e,f,g){return a=a+(c^(b|~d))+e+g,(a<>>32-f)+b}for(var f=CryptoJS,g=f.lib,h=g.WordArray,i=g.Hasher,g=f.algo,j=[],k=0;64>k;k++)j[k]=4294967296*a.abs(a.sin(k+1))|0;g=g.MD5=i.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(a,f){for(var g=0;16>g;g++){var h=f+g,i=a[h];a[h]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var g=this._hash.words,h=a[f+0],i=a[f+1],k=a[f+2],l=a[f+3],m=a[f+4],n=a[f+5],o=a[f+6],p=a[f+7],q=a[f+8],r=a[f+9],s=a[f+10],t=a[f+11],u=a[f+12],v=a[f+13],w=a[f+14],x=a[f+15],y=g[0],z=g[1],A=g[2],B=g[3],y=b(y,z,A,B,h,7,j[0]),B=b(B,y,z,A,i,12,j[1]),A=b(A,B,y,z,k,17,j[2]),z=b(z,A,B,y,l,22,j[3]),y=b(y,z,A,B,m,7,j[4]),B=b(B,y,z,A,n,12,j[5]),A=b(A,B,y,z,o,17,j[6]),z=b(z,A,B,y,p,22,j[7]),y=b(y,z,A,B,q,7,j[8]),B=b(B,y,z,A,r,12,j[9]),A=b(A,B,y,z,s,17,j[10]),z=b(z,A,B,y,t,22,j[11]),y=b(y,z,A,B,u,7,j[12]),B=b(B,y,z,A,v,12,j[13]),A=b(A,B,y,z,w,17,j[14]),z=b(z,A,B,y,x,22,j[15]),y=c(y,z,A,B,i,5,j[16]),B=c(B,y,z,A,o,9,j[17]),A=c(A,B,y,z,t,14,j[18]),z=c(z,A,B,y,h,20,j[19]),y=c(y,z,A,B,n,5,j[20]),B=c(B,y,z,A,s,9,j[21]),A=c(A,B,y,z,x,14,j[22]),z=c(z,A,B,y,m,20,j[23]),y=c(y,z,A,B,r,5,j[24]),B=c(B,y,z,A,w,9,j[25]),A=c(A,B,y,z,l,14,j[26]),z=c(z,A,B,y,q,20,j[27]),y=c(y,z,A,B,v,5,j[28]),B=c(B,y,z,A,k,9,j[29]),A=c(A,B,y,z,p,14,j[30]),z=c(z,A,B,y,u,20,j[31]),y=d(y,z,A,B,n,4,j[32]),B=d(B,y,z,A,q,11,j[33]),A=d(A,B,y,z,t,16,j[34]),z=d(z,A,B,y,w,23,j[35]),y=d(y,z,A,B,i,4,j[36]),B=d(B,y,z,A,m,11,j[37]),A=d(A,B,y,z,p,16,j[38]),z=d(z,A,B,y,s,23,j[39]),y=d(y,z,A,B,v,4,j[40]),B=d(B,y,z,A,h,11,j[41]),A=d(A,B,y,z,l,16,j[42]),z=d(z,A,B,y,o,23,j[43]),y=d(y,z,A,B,r,4,j[44]),B=d(B,y,z,A,u,11,j[45]),A=d(A,B,y,z,x,16,j[46]),z=d(z,A,B,y,k,23,j[47]),y=e(y,z,A,B,h,6,j[48]),B=e(B,y,z,A,p,10,j[49]),A=e(A,B,y,z,w,15,j[50]),z=e(z,A,B,y,n,21,j[51]),y=e(y,z,A,B,u,6,j[52]),B=e(B,y,z,A,l,10,j[53]),A=e(A,B,y,z,s,15,j[54]),z=e(z,A,B,y,i,21,j[55]),y=e(y,z,A,B,q,6,j[56]),B=e(B,y,z,A,x,10,j[57]),A=e(A,B,y,z,o,15,j[58]),z=e(z,A,B,y,v,21,j[59]),y=e(y,z,A,B,m,6,j[60]),B=e(B,y,z,A,t,10,j[61]),A=e(A,B,y,z,k,15,j[62]),z=e(z,A,B,y,r,21,j[63]);g[0]=g[0]+y|0,g[1]=g[1]+z|0,g[2]=g[2]+A|0,g[3]=g[3]+B|0},_doFinalize:function(){var b=this._data,c=b.words,d=8*this._nDataBytes,e=8*b.sigBytes;c[e>>>5]|=128<<24-e%32;var f=a.floor(d/4294967296);for(c[(e+64>>>9<<4)+15]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c[(e+64>>>9<<4)+14]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),b.sigBytes=4*(c.length+1),this._process(),b=this._hash,c=b.words,d=0;4>d;d++)e=c[d],c[d]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8);return b},clone:function(){var a=i.clone.call(this);return a._hash=this._hash.clone(),a}}),f.MD5=i._createHelper(g),f.HmacMD5=i._createHmacHelper(g)}(Math),function(){var a=CryptoJS,b=a.lib.WordArray;a.enc.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp(),a=[];for(var e=0;c>e;e+=3)for(var f=(b[e>>>2]>>>24-8*(e%4)&255)<<16|(b[e+1>>>2]>>>24-8*((e+1)%4)&255)<<8|b[e+2>>>2]>>>24-8*((e+2)%4)&255,g=0;4>g&&c>e+.75*g;g++)a.push(d.charAt(f>>>6*(3-g)&63));if(b=d.charAt(64))for(;a.length%4;)a.push(b);return a.join("")},parse:function(a){var c=a.length,d=this._map,e=d.charAt(64);e&&(e=a.indexOf(e),-1!=e&&(c=e));for(var e=[],f=0,g=0;c>g;g++)if(g%4){var h=d.indexOf(a.charAt(g-1))<<2*(g%4),i=d.indexOf(a.charAt(g))>>>6-2*(g%4);e[f>>>2]|=(h|i)<<24-8*(f%4),f++}return b.create(e,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),CryptoJS.lib.Cipher||function(a){var b=CryptoJS,c=b.lib,d=c.Base,e=c.WordArray,f=c.BufferedBlockAlgorithm,g=b.enc.Base64,h=b.algo.EvpKDF,i=c.Cipher=f.extend({cfg:d.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c),this._xformMode=a,this._key=b,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(a){return this._append(a),this._process()},finalize:function(a){return a&&this._append(a),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(b,c,d){return("string"==typeof c?o:n).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?o:n).decrypt(a,b,c,d)}}}});c.StreamCipher=i.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var j=b.mode={},k=function(b,c,d){var e=this._iv;e?this._iv=a:e=this._prevBlock;for(var f=0;d>f;f++)b[c+f]^=e[f]},l=(c.BlockCipherMode=d.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a,this._iv=b}})).extend();l.Encryptor=l.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize;k.call(this,a,b,d),c.encryptBlock(a,b),this._prevBlock=a.slice(b,b+d)}}),l.Decryptor=l.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=a.slice(b,b+d);c.decryptBlock(a,b),k.call(this,a,b,d),this._prevBlock=e}}),j=j.CBC=l,l=(b.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,f=[],g=0;c>g;g+=4)f.push(d);c=e.create(f,c),a.concat(c)},unpad:function(a){a.sigBytes-=255&a.words[a.sigBytes-1>>>2]}},c.BlockCipher=i.extend({cfg:i.cfg.extend({mode:j,padding:l}),reset:function(){i.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var m=c.CipherParams=d.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),j=(b.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;return a=a.salt,(a?e.create([1398893684,1701076831]).concat(a).concat(b):b).toString(g)},parse:function(a){a=g.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=e.create(b.slice(2,4));b.splice(0,4),a.sigBytes-=16}return m.create({ciphertext:a,salt:c})}},n=c.SerializableCipher=d.extend({cfg:d.extend({format:j}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d);return b=e.finalize(b),e=e.cfg,m.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){return d=this.cfg.extend(d),b=this._parse(b,d.format),a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),b=(b.kdf={}).OpenSSL={execute:function(a,b,c,d){return d||(d=e.random(8)),a=h.create({keySize:b+c}).compute(a,d),c=e.create(a.words.slice(b),4*c),a.sigBytes=4*b,m.create({key:a,iv:c,salt:d})}},o=c.PasswordBasedCipher=n.extend({cfg:n.cfg.extend({kdf:b}),encrypt:function(a,b,c,d){return d=this.cfg.extend(d),c=d.kdf.execute(c,a.keySize,a.ivSize),d.iv=c.iv,a=n.encrypt.call(this,a,b,c.key,d),a.mixIn(c),a},decrypt:function(a,b,c,d){return d=this.cfg.extend(d),b=this._parse(b,d.format),c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt),d.iv=c.iv,n.decrypt.call(this,a,b,c.key,d)}})}(),function(){for(var a=CryptoJS,b=a.lib.BlockCipher,c=a.algo,d=[],e=[],f=[],g=[],h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=0;256>o;o++)n[o]=128>o?o<<1:o<<1^283;for(var p=0,q=0,o=0;256>o;o++){var r=q^q<<1^q<<2^q<<3^q<<4,r=r>>>8^255&r^99;d[p]=r,e[r]=p;var s=n[p],t=n[s],u=n[t],v=257*n[r]^16843008*r;f[p]=v<<24|v>>>8,g[p]=v<<16|v>>>16,h[p]=v<<8|v>>>24,i[p]=v,v=16843009*u^65537*t^257*s^16843008*p,j[r]=v<<24|v>>>8,k[r]=v<<16|v>>>16,l[r]=v<<8|v>>>24,m[r]=v,p?(p=s^n[n[n[u^s]]],q^=n[n[q]]):p=q=1}var w=[0,1,2,4,8,16,32,64,128,27,54],c=c.AES=b.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes/4,a=4*((this._nRounds=c+6)+1),e=this._keySchedule=[],f=0;a>f;f++)if(c>f)e[f]=b[f];else{var g=e[f-1];f%c?c>6&&4==f%c&&(g=d[g>>>24]<<24|d[g>>>16&255]<<16|d[g>>>8&255]<<8|d[255&g]):(g=g<<8|g>>>24,g=d[g>>>24]<<24|d[g>>>16&255]<<16|d[g>>>8&255]<<8|d[255&g],g^=w[f/c|0]<<24),e[f]=e[f-c]^g}for(b=this._invKeySchedule=[],c=0;a>c;c++)f=a-c,g=c%4?e[f]:e[f-4],b[c]=4>c||4>=f?g:j[d[g>>>24]]^k[d[g>>>16&255]]^l[d[g>>>8&255]]^m[d[255&g]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,f,g,h,i,d)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c,this._doCryptBlock(a,b,this._invKeySchedule,j,k,l,m,e),c=a[b+1],a[b+1]=a[b+3],a[b+3]=c},_doCryptBlock:function(a,b,c,d,e,f,g,h){for(var i=this._nRounds,j=a[b]^c[0],k=a[b+1]^c[1],l=a[b+2]^c[2],m=a[b+3]^c[3],n=4,o=1;i>o;o++)var p=d[j>>>24]^e[k>>>16&255]^f[l>>>8&255]^g[255&m]^c[n++],q=d[k>>>24]^e[l>>>16&255]^f[m>>>8&255]^g[255&j]^c[n++],r=d[l>>>24]^e[m>>>16&255]^f[j>>>8&255]^g[255&k]^c[n++],m=d[m>>>24]^e[j>>>16&255]^f[k>>>8&255]^g[255&l]^c[n++],j=p,k=q,l=r;p=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[255&m])^c[n++],q=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[255&j])^c[n++],r=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[255&k])^c[n++],m=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[255&l])^c[n++],a[b]=p,a[b+1]=q,a[b+2]=r,a[b+3]=m},keySize:8});a.AES=b._createHelper(c)}(),function(){function a(a,b){var c=(this._lBlock>>>a^this._rBlock)&b;this._rBlock^=c,this._lBlock^=c<>>a^this._lBlock)&b;this._lBlock^=c,this._rBlock^=c<c;c++){var d=g[c]-1;b[c]=a[d>>>5]>>>31-d%32&1}for(a=this._subKeys=[],d=0;16>d;d++){for(var e=a[d]=[],f=i[d],c=0;24>c;c++)e[c/6|0]|=b[(h[c]-1+f)%28]<<31-c%6,e[4+(c/6|0)]|=b[28+(h[c+24]-1+f)%28]<<31-c%6;for(e[0]=e[0]<<1|e[0]>>>31,c=1;7>c;c++)e[c]>>>=4*(c-1)+3;e[7]=e[7]<<5|e[7]>>>27}for(b=this._invSubKeys=[],c=0;16>c;c++)b[c]=a[15-c]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._subKeys)},decryptBlock:function(a,b){this._doCryptBlock(a,b,this._invSubKeys)},_doCryptBlock:function(c,d,e){this._lBlock=c[d],this._rBlock=c[d+1],a.call(this,4,252645135),a.call(this,16,65535),b.call(this,2,858993459),b.call(this,8,16711935),a.call(this,1,1431655765);for(var f=0;16>f;f++){for(var g=e[f],h=this._lBlock,i=this._rBlock,l=0,m=0;8>m;m++)l|=j[m][((i^g[m])&k[m])>>>0];this._lBlock=i,this._rBlock=h^l}e=this._lBlock,this._lBlock=this._rBlock,this._rBlock=e,a.call(this,1,1431655765),b.call(this,8,16711935),b.call(this,2,858993459),a.call(this,16,65535),a.call(this,4,252645135),c[d]=this._lBlock,c[d+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});c.DES=d._createHelper(l),f=f.TripleDES=d.extend({_doReset:function(){var a=this._key.words;this._des1=l.createEncryptor(e.create(a.slice(0,2))),this._des2=l.createEncryptor(e.create(a.slice(2,4))),this._des3=l.createEncryptor(e.create(a.slice(4,6)))},encryptBlock:function(a,b){this._des1.encryptBlock(a,b),this._des2.decryptBlock(a,b),this._des3.encryptBlock(a,b)},decryptBlock:function(a,b){this._des3.decryptBlock(a,b),this._des2.encryptBlock(a,b),this._des1.decryptBlock(a,b)},keySize:6,ivSize:2,blockSize:2}),c.TripleDES=d._createHelper(f)}(),function(){var a=CryptoJS,b=a.lib,c=b.WordArray,d=b.Hasher,e=[],b=a.algo.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],f=c[1],g=c[2],h=c[3],i=c[4],j=0;80>j;j++){if(16>j)e[j]=0|a[b+j];else{var k=e[j-3]^e[j-8]^e[j-14]^e[j-16];e[j]=k<<1|k>>>31}k=(d<<5|d>>>27)+i+e[j],k=20>j?k+((f&g|~f&h)+1518500249):40>j?k+((f^g^h)+1859775393):60>j?k+((f&g|f&h|g&h)-1894007588):k+((f^g^h)-899497514),i=h,h=g,g=f<<30|f>>>2,f=d,d=k}c[0]=c[0]+d|0,c[1]=c[1]+f|0,c[2]=c[2]+g|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.SHA1=d._createHelper(b),a.HmacSHA1=d._createHmacHelper(b)}(),function(){var a=CryptoJS,b=a.lib,c=b.WordArray,d=b.Hasher,b=a.algo,e=c.create([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]),f=c.create([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=c.create([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]),h=c.create([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]),i=c.create([0,1518500249,1859775393,2400959708,2840853838]),j=c.create([1352829926,1548603684,1836072691,2053994217,0]),b=b.RIPEMD160=d.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=0;16>c;c++){var d=b+c,k=a[d];a[d]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l,m,n,o,p,q,r,s,t,u,d=this._hash.words,k=i.words,v=j.words,w=e.words,x=f.words,y=g.words,z=h.words;q=l=d[0],r=m=d[1],s=n=d[2],t=o=d[3],u=p=d[4];for(var A,c=0;80>c;c+=1)A=l+a[b+w[c]]|0,A=16>c?A+((m^n^o)+k[0]):32>c?A+((m&n|~m&o)+k[1]):48>c?A+(((m|~n)^o)+k[2]):64>c?A+((m&o|n&~o)+k[3]):A+((m^(n|~o))+k[4]),A|=0,A=A<>>32-y[c],A=A+p|0,l=p,p=o,o=n<<10|n>>>22,n=m,m=A,A=q+a[b+x[c]]|0,A=16>c?A+((r^(s|~t))+v[0]):32>c?A+((r&t|s&~t)+v[1]):48>c?A+(((r|~s)^t)+v[2]):64>c?A+((r&s|~r&t)+v[3]):A+((r^s^t)+v[4]),A|=0,A=A<>>32-z[c],A=A+u|0,q=u,u=t,t=s<<10|s>>>22,s=r,r=A;A=d[1]+n+t|0,d[1]=d[2]+o+u|0,d[2]=d[3]+p+q|0,d[3]=d[4]+l+r|0,d[4]=d[0]+m+s|0,d[0]=A},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;for(b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),a.sigBytes=4*(b.length+1),this._process(),a=this._hash,b=a.words,c=0;5>c;c++)d=b[c],b[c]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8);return a},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.RIPEMD160=d._createHelper(b),a.HmacRIPEMD160=d._createHmacHelper(b)}(Math),function(){var a=CryptoJS,b=a.lib,c=b.Base,d=b.WordArray,b=a.algo,e=b.HMAC,f=b.PBKDF2=c.extend({cfg:c.extend({keySize:4,hasher:b.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=e.create(c.hasher,a),g=d.create(),h=d.create([1]),i=g.words,j=h.words,k=c.keySize,c=c.iterations;i.lengthp;p++){o=f.finalize(o),f.reset();for(var q=o.words,r=0;n>r;r++)m[r]^=q[r]}g.concat(l),j[0]++}return g.sigBytes=4*k,g}});a.PBKDF2=function(a,b,c){return f.create(c).compute(a,b)}}();var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64pad="=",dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo; -var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256,rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if("Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;trng_pptr;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes;var SHA1_SIZE=20;RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,RSAKey.prototype.encryptOAEP=RSAEncryptOAEP,RSAKey.prototype.type="RSA";var SHA1_SIZE=20;RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.generate=RSAGenerate,RSAKey.prototype.decrypt=RSADecrypt,RSAKey.prototype.decryptOAEP=RSADecryptOAEP,ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex,ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ECPointFp.prototype.getEncoded=function(a){var b=function(a,b){var c=a.toByteArrayUnsigned();if(bc.length;)c.unshift(0);return c},c=this.getX().toBigInteger(),d=this.getY().toBigInteger(),e=b(c,32);return a?e.unshift(d.isEven()?2:3):(e.unshift(4),e=e.concat(b(d,32))),e},ECPointFp.decodeFrom=function(a,b){var c=(b[0],b.length-1),d=b.slice(1,1+c/2),e=b.slice(1+c/2,1+c);d.unshift(0),e.unshift(0);var f=new BigInteger(d),g=new BigInteger(e);return new ECPointFp(a,a.fromBigInteger(f),a.fromBigInteger(g))},ECPointFp.decodeFromHex=function(a,b){var c=(b.substr(0,2),b.length-2),d=b.substr(2,c/2),e=b.substr(2+c/2,c/2),f=new BigInteger(d,16),g=new BigInteger(e,16);return new ECPointFp(a,a.fromBigInteger(f),a.fromBigInteger(g))},ECPointFp.prototype.add2D=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;if(this.x.equals(a.x))return this.y.equals(a.y)?this.twice():this.curve.getInfinity();var b=a.x.subtract(this.x),c=a.y.subtract(this.y),d=c.divide(b),e=d.square().subtract(this.x).subtract(a.x),f=d.multiply(this.x.subtract(e)).subtract(this.y);return new ECPointFp(this.curve,e,f)},ECPointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var a=this.curve.fromBigInteger(BigInteger.valueOf(2)),b=this.curve.fromBigInteger(BigInteger.valueOf(3)),c=this.x.square().multiply(b).add(this.curve.a).divide(this.y.multiply(a)),d=c.square().subtract(this.x.multiply(a)),e=c.multiply(this.x.subtract(d)).subtract(this.y);return new ECPointFp(this.curve,d,e)},ECPointFp.prototype.multiply2D=function(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b,c=a,d=c.multiply(new BigInteger("3")),e=this.negate(),f=this;for(b=d.bitLength()-2;b>0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add2D(g?this:e))}return f},ECPointFp.prototype.isOnCurve=function(){var a=this.getX().toBigInteger(),b=this.getY().toBigInteger(),c=this.curve.getA().toBigInteger(),d=this.curve.getB().toBigInteger(),e=this.curve.getQ(),f=b.multiply(b).mod(e),g=a.multiply(a).multiply(a).add(c.multiply(a)).add(d).mod(e);return f.equals(g)},ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ECPointFp.prototype.validate=function(){var a=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var b=this.getX().toBigInteger(),c=this.getY().toBigInteger();if(b.compareTo(BigInteger.ONE)<0||b.compareTo(a.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(c.compareTo(BigInteger.ONE)<0||c.compareTo(a.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(a).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);return b.length%2==1&&(b="0"+b),b},this.bigIntToMinTwosComplementsHex=function(a){var b=a.toString(16);if("-"!=b.substr(0,1))b.length%2==1?b="0"+b:b.match(/^[0-7]/)||(b="00"+b);else{var c=b.substr(1),d=c.length;d%2==1?d+=1:b.match(/^[0-7]/)||(d+=2);for(var e="",f=0;d>f;f++)e+="f";var g=new BigInteger(e,16),h=g.xor(a).add(BigInteger.ONE);b=h.toString(16).replace(/^-/,"")}return b},this.getPEMStringFromHex=function(a,b){var c=(KJUR.asn1,CryptoJS.enc.Hex.parse(a)),d=CryptoJS.enc.Base64.stringify(c),e=d.replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,""),"-----BEGIN "+b+"-----\r\n"+e+"\r\n-----END "+b+"-----\r\n"},this.newObject=function(a){var b=KJUR.asn1,c=Object.keys(a);if(1!=c.length)throw"key of param shall be only one.";var d=c[0];if(-1==":bool:int:bitstr:octstr:null:oid:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+d+":"))throw"undefined key: "+d;if("bool"==d)return new b.DERBoolean(a[d]);if("int"==d)return new b.DERInteger(a[d]);if("bitstr"==d)return new b.DERBitString(a[d]);if("octstr"==d)return new b.DEROctetString(a[d]);if("null"==d)return new b.DERNull(a[d]);if("oid"==d)return new b.DERObjectIdentifier(a[d]);if("utf8str"==d)return new b.DERUTF8String(a[d]);if("numstr"==d)return new b.DERNumericString(a[d]);if("prnstr"==d)return new b.DERPrintableString(a[d]);if("telstr"==d)return new b.DERTeletexString(a[d]);if("ia5str"==d)return new b.DERIA5String(a[d]);if("utctime"==d)return new b.DERUTCTime(a[d]);if("gentime"==d)return new b.DERGeneralizedTime(a[d]);if("seq"==d){for(var e=a[d],f=[],g=0;gb)return c;var d=c.length/2;if(d>15)throw"ASN.1 length too long to represent by 8x: n = "+b.toString(16);var e=128+d;return e.toString(16)+c},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(a){this.hTLV=null,this.isModified=!0,this.s=a,this.hV=stohex(this.s)},this.setStringHex=function(a){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=a},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("string"==typeof a?this.setString(a):"undefined"!=typeof a.str?this.setString(a.str):"undefined"!=typeof a.hex&&this.setStringHex(a.hex))},YAHOO.lang.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(a){utc=a.getTime()+6e4*a.getTimezoneOffset();var b=new Date(utc);return b},this.formatDate=function(a,b){var c=this.zeroPadding,d=this.localDateToUTC(a),e=String(d.getFullYear());"utc"==b&&(e=e.substr(2,2));var f=c(String(d.getMonth()+1),2),g=c(String(d.getDate()),2),h=c(String(d.getHours()),2),i=c(String(d.getMinutes()),2),j=c(String(d.getSeconds()),2);return e+f+g+h+i+j+"Z"},this.zeroPadding=function(a,b){return a.length>=b?a:new Array(b-a.length+1).join("0")+a},this.getString=function(){return this.s},this.setString=function(a){this.hTLV=null,this.isModified=!0,this.s=a,this.hV=stohex(a)},this.setByDateValue=function(a,b,c,d,e,f){var g=new Date(Date.UTC(a,b-1,c,d,e,f,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},YAHOO.lang.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(a){this.hTLV=null,this.isModified=!0,this.asn1Array=a},this.appendASN1Object=function(a){this.hTLV=null,this.isModified=!0,this.asn1Array.push(a)},this.asn1Array=new Array,"undefined"!=typeof a&&"undefined"!=typeof a.array&&(this.asn1Array=a.array)},YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(a){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a)},this.setByInteger=function(a){var b=new BigInteger(String(a),10);this.setByBigInteger(b)},this.setValueHex=function(a){this.hV=a},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.bigint?this.setByBigInteger(a.bigint):"undefined"!=typeof a["int"]?this.setByInteger(a["int"]):"number"==typeof a?this.setByInteger(a):"undefined"!=typeof a.hex&&this.setValueHex(a.hex))},YAHOO.lang.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(a){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(a){this.hTLV=null,this.isModified=!0,this.hV=a},this.setUnusedBitsAndHexValue=function(a,b){if(0>a||a>7)throw"unused bits shall be from 0 to 7: u = "+a;var c="0"+a;this.hTLV=null,this.isModified=!0,this.hV=c+b},this.setByBinaryString=function(a){a=a.replace(/0+$/,"");var b=8-a.length%8;8==b&&(b=0);for(var c=0;b>=c;c++)a+="0";for(var d="",c=0;cc;c++)b[c]=!1;return b},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("string"==typeof a&&a.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(a):"undefined"!=typeof a.hex?this.setHexValueIncludingUnusedBits(a.hex):"undefined"!=typeof a.bin?this.setByBinaryString(a.bin):"undefined"!=typeof a.array&&this.setByBooleanArray(a.array))},YAHOO.lang.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(a){KJUR.asn1.DEROctetString.superclass.constructor.call(this,a),this.hT="04"},YAHOO.lang.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},YAHOO.lang.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(a){var b=function(a){var b=a.toString(16);return 1==b.length&&(b="0"+b),b},c=function(a){var c="",d=new BigInteger(a,10),e=d.toString(2),f=7-e.length%7;7==f&&(f=0);for(var g="",h=0;f>h;h++)g+="0";e=g+e;for(var h=0;h0&&10>c?c+1:-2},this.getHexOfL_AtObj=function(a,b){var c=this.getByteLengthOfL_AtObj(a,b);return 1>c?"":a.substring(b+2,b+2+2*c)},this.getIntOfL_AtObj=function(a,b){var c=this.getHexOfL_AtObj(a,b);if(""==c)return-1;var d;return d=parseInt(c.substring(0,1))<8?new BigInteger(c,16):new BigInteger(c.substring(2),16),d.intValue()},this.getStartPosOfV_AtObj=function(a,b){var c=this.getByteLengthOfL_AtObj(a,b);return 0>c?c:b+2*(c+1)},this.getHexOfV_AtObj=function(a,b){var c=this.getStartPosOfV_AtObj(a,b),d=this.getIntOfL_AtObj(a,b);return a.substring(c,c+2*d)},this.getHexOfTLV_AtObj=function(a,b){var c=a.substr(b,2),d=this.getHexOfL_AtObj(a,b),e=this.getHexOfV_AtObj(a,b);return c+d+e},this.getPosOfNextSibling_AtObj=function(a,b){var c=this.getStartPosOfV_AtObj(a,b),d=this.getIntOfL_AtObj(a,b);return c+2*d},this.getPosArrayOfChildren_AtObj=function(a,b){var c=new Array,d=this.getStartPosOfV_AtObj(a,b);c.push(d);for(var e=this.getIntOfL_AtObj(a,b),f=d,g=0;;){var h=this.getPosOfNextSibling_AtObj(a,f);if(null==h||h-d>=2*e)break;if(g>=200)break;c.push(h),f=h,g++}return c},this.getNthChildIndex_AtObj=function(a,b,c){var d=this.getPosArrayOfChildren_AtObj(a,b);return d[c]},this.getDecendantIndexByNthList=function(a,b,c){if(0==c.length)return b;var d=c.shift(),e=this.getPosArrayOfChildren_AtObj(a,b);return this.getDecendantIndexByNthList(a,e[d],c)},this.getDecendantHexTLVByNthList=function(a,b,c){var d=this.getDecendantIndexByNthList(a,b,c);return this.getHexOfTLV_AtObj(a,d)},this.getDecendantHexVByNthList=function(a,b,c){var d=this.getDecendantIndexByNthList(a,b,c);return this.getHexOfV_AtObj(a,d)}};"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),"undefined"!=typeof KJUR.asn1.x509&&KJUR.asn1.x509||(KJUR.asn1.x509={}),KJUR.asn1.x509.Certificate=function(a){KJUR.asn1.x509.Certificate.superclass.constructor.call(this);this.setRsaPrvKeyByPEMandPass=function(a,b){var c=PKCS5PKEY.getDecryptedKeyHex(a,b),d=new RSAKey;d.readPrivateKeyFromASN1HexString(c),this.rsaPrvKey=d},this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg,sig=new KJUR.crypto.Signature({alg:"SHA1withRSA",prov:"cryptojs/jsrsa"}),sig.initSign(this.rsaPrvKey),sig.updateHex(this.asn1TBSCert.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var a=new KJUR.asn1.DERSequence({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=a.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){var a=this.getEncodedHex(),b=CryptoJS.enc.Hex.parse(a),c=CryptoJS.enc.Base64.stringify(b),d=c.replace(/(.{64})/g,"$1\r\n");return"-----BEGIN CERTIFICATE-----\r\n"+d+"\r\n-----END CERTIFICATE-----\r\n"},"undefined"!=typeof a&&("undefined"!=typeof a.tbscertobj&&(this.asn1TBSCert=a.tbscertobj),"undefined"!=typeof a.rsaprvkey&&(this.rsaPrvKey=a.rsaprvkey),"undefined"!=typeof a.rsaprvpem&&"undefined"!=typeof a.rsaprvpas&&this.setRsaPrvKeyByPEMandPass(a.rsaprvpem,a.rsaprvpas))},YAHOO.lang.extend(KJUR.asn1.x509.Certificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.TBSCertificate=function(){KJUR.asn1.x509.TBSCertificate.superclass.constructor.call(this),this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new KJUR.asn1.DERTaggedObject({obj:new KJUR.asn1.DERInteger({"int":2})}),this.asn1SerialNumber=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1NotBefore=null,this.asn1NotAfter=null,this.asn1Subject=null,this.asn1SubjPKey=null,this.extensionsArray=new Array},this.setSerialNumberByParam=function(a){this.asn1SerialNumber=new KJUR.asn1.DERInteger(a)},this.setSignatureAlgByParam=function(a){this.asn1SignatureAlg=new KJUR.asn1.x509.AlgorithmIdentifier(a)},this.setIssuerByParam=function(a){this.asn1Issuer=new KJUR.asn1.x509.X500Name(a)},this.setNotBeforeByParam=function(a){this.asn1NotBefore=new KJUR.asn1.x509.Time(a)},this.setNotAfterByParam=function(a){this.asn1NotAfter=new KJUR.asn1.x509.Time(a)},this.setSubjectByParam=function(a){this.asn1Subject=new KJUR.asn1.x509.X500Name(a)},this.setSubjectPublicKeyByParam=function(a){this.asn1SubjPKey=new KJUR.asn1.x509.SubjectPublicKeyInfo(a)},this.appendExtension=function(a){this.extensionsArray.push(a)},this.getEncodedHex=function(){if(null==this.asn1NotBefore||null==this.asn1NotAfter)throw"notBefore and/or notAfter not set";var a=new KJUR.asn1.DERSequence({array:[this.asn1NotBefore,this.asn1NotAfter]});if(this.asn1Array=new Array,this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1SerialNumber),this.asn1Array.push(this.asn1SignatureAlg),this.asn1Array.push(this.asn1Issuer),this.asn1Array.push(a),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey),this.extensionsArray.length>0){var b=new KJUR.asn1.DERSequence({array:this.extensionsArray}),c=new KJUR.asn1.DERTaggedObject({explicit:!0,tag:"a3",obj:b});this.asn1Array.push(c)}var d=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=d.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Extension=function(a){KJUR.asn1.x509.Extension.superclass.constructor.call(this);this.getEncodedHex=function(){var a=new KJUR.asn1.DERObjectIdentifier({oid:this.oid}),b=new KJUR.asn1.DEROctetString({hex:this.getExtnValueHex()}),c=new Array;c.push(a),this.critical&&c.push(new KJUR.asn1.DERBoolean),c.push(b);var d=new KJUR.asn1.DERSequence({array:c});return d.getEncodedHex()},this.critical=!1,"undefined"!=typeof a&&"undefined"!=typeof a.critical&&(this.critical=a.critical)},YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object),KJUR.asn1.x509.KeyUsage=function(a){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,a),this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15","undefined"!=typeof a&&"undefined"!=typeof a.bin&&(this.asn1ExtnValue=new KJUR.asn1.DERBitString(a))},YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage,KJUR.asn1.x509.Extension),KJUR.asn1.x509.BasicConstraints=function(a){KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this,a);this.getExtnValueHex=function(){var a=new Array;this.cA&&a.push(new KJUR.asn1.DERBoolean),this.pathLen>-1&&a.push(new KJUR.asn1.DERInteger({"int":this.pathLen}));var b=new KJUR.asn1.DERSequence({array:a});return this.asn1ExtnValue=b,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,"undefined"!=typeof a&&("undefined"!=typeof a.cA&&(this.cA=a.cA),"undefined"!=typeof a.pathLen&&(this.pathLen=a.pathLen))},YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.CRLDistributionPoints=function(a){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,a),this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(a){this.asn1ExtnValue=new KJUR.asn1.DERSequence({array:a})},this.setByOneURI=function(a){var b=new KJUR.asn1.x509.GeneralNames([{uri:a}]),c=new KJUR.asn1.x509.DistributionPointName(b),d=new KJUR.asn1.x509.DistributionPoint({dpobj:c});this.setByDPArray([d])},this.oid="2.5.29.31","undefined"!=typeof a&&("undefined"!=typeof a.array?this.setByDPArray(a.array):"undefined"!=typeof a.uri&&this.setByOneURI(a.uri))},YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.ExtKeyUsage=function(a){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,a),this.setPurposeArray=function(a){this.asn1ExtnValue=new KJUR.asn1.DERSequence;for(var b=0;b0){var a=new KJUR.asn1.DERSequence({array:this.aRevokedCert});this.asn1Array.push(a)}var b=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=b.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize=function(){this.asn1Version=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1ThisUpdate=null,this.asn1NextUpdate=null,this.aRevokedCert=new Array},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object),KJUR.asn1.x509.CRLEntry=function(a){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);this.setCertSerial=function(a){this.sn=new KJUR.asn1.DERInteger(a)},this.setRevocationDate=function(a){this.time=new KJUR.asn1.x509.Time(a)},this.getEncodedHex=function(){var a=new KJUR.asn1.DERSequence({array:[this.sn,this.time]});return this.TLV=a.getEncodedHex(),this.TLV},"undefined"!=typeof a&&("undefined"!=typeof a.time&&this.setRevocationDate(a.time),"undefined"!=typeof a.sn&&this.setCertSerial(a.sn))},YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object),KJUR.asn1.x509.X500Name=function(a){KJUR.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=new Array,this.setByString=function(a){var b=a.split("/");b.shift();for(var c=0;ce)throw"key is too short for SigAlg: keylen="+c+","+b;for(var f="0001",g="00"+d,h="",i=e-f.length-g.length,j=0;i>j;j+=2)h+="ff";var k=f+h+g;return k},this.hashString=function(a,b){var c=new KJUR.crypto.MessageDigest({alg:b});return c.digestString(a)},this.hashHex=function(a,b){var c=new KJUR.crypto.MessageDigest({alg:b});return c.digestHex(a)},this.sha1=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha1",prov:"cryptojs"});return b.digestString(a)},this.sha256=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return b.digestString(a)},this.sha256Hex=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return b.digestHex(a)},this.sha512=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return b.digestString(a)},this.sha512Hex=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return b.digestHex(a)},this.md5=function(a){var b=new KJUR.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return b.digestString(a)},this.ripemd160=function(a){var b=new KJUR.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return b.digestString(a)},this.getCryptoJSMDByName=function(){}},KJUR.crypto.MessageDigest=function(params){var md=null,algName=null,provName=null;this.setAlgAndProvider=function(alg,prov){if(null!=alg&&void 0===prov&&(prov=KJUR.crypto.Util.DEFAULTPROVIDER[alg]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(alg)&&"cryptojs"==prov){try{this.md=eval(KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[alg]).create()}catch(ex){throw"setAlgAndProvider hash alg set fail alg="+alg+"/"+ex}this.updateString=function(a){this.md.update(a)},this.updateHex=function(a){var b=CryptoJS.enc.Hex.parse(a);this.md.update(b)},this.digest=function(){var a=this.md.finalize();return a.toString(CryptoJS.enc.Hex)},this.digestString=function(a){return this.updateString(a),this.digest()},this.digestHex=function(a){return this.updateHex(a),this.digest()}}if(-1!=":sha256:".indexOf(alg)&&"sjcl"==prov){try{this.md=new sjcl.hash.sha256}catch(ex){throw"setAlgAndProvider hash alg set fail alg="+alg+"/"+ex}this.updateString=function(a){this.md.update(a)},this.updateHex=function(a){var b=sjcl.codec.hex.toBits(a);this.md.update(b)},this.digest=function(){var a=this.md.finalize();return sjcl.codec.hex.fromBits(a)},this.digestString=function(a){return this.updateString(a),this.digest()},this.digestHex=function(a){return this.updateHex(a),this.digest()}}},this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==params&&void 0!==params.alg&&(this.algName=params.alg,void 0===params.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},KJUR.crypto.Mac=function(params){var mac=null,pass=null,algName=null,provName=null,algProv=null;this.setAlgAndProvider=function(alg,prov){if(null==alg&&(alg="hmacsha1"),alg=alg.toLowerCase(),"hmac"!=alg.substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+alg;void 0===prov&&(prov=KJUR.crypto.Util.DEFAULTPROVIDER[alg]),this.algProv=alg+"/"+prov;var hashAlg=alg.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(hashAlg)&&"cryptojs"==prov){try{var mdObj=eval(KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[hashAlg]);this.mac=CryptoJS.algo.HMAC.create(mdObj,this.pass)}catch(ex){throw"setAlgAndProvider hash alg set fail hashAlg="+hashAlg+"/"+ex}this.updateString=function(a){this.mac.update(a)},this.updateHex=function(a){var b=CryptoJS.enc.Hex.parse(a);this.mac.update(b)},this.doFinal=function(){var a=this.mac.finalize();return a.toString(CryptoJS.enc.Hex)},this.doFinalString=function(a){return this.updateString(a),this.doFinal()},this.doFinalHex=function(a){return this.updateHex(a),this.doFinal()}}},this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},void 0!==params&&(void 0!==params.pass&&(this.pass=params.pass),void 0!==params.alg&&(this.algName=params.alg,void 0===params.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},KJUR.crypto.Signature=function(a){var b=null;if(this._setAlgNames=function(){this.algName.match(/^(.+)with(.+)$/)&&(this.mdAlgName=RegExp.$1.toLowerCase(),this.pubkeyAlgName=RegExp.$2.toLowerCase())},this._zeroPaddingOfSignature=function(a,b){for(var c="",d=b/4-a.length,e=0;d>e;e++)c+="0";return c+a},this.setAlgAndProvider=function(a,b){if(this._setAlgNames(),"cryptojs/jsrsa"!=b)throw"provider not supported: "+b;if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new KJUR.crypto.MessageDigest({alg:this.mdAlgName})}catch(c){throw"setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+c}this.init=function(a,b){if("string"==typeof a)if(-1!=a.indexOf("-END ENCRYPTED PRIVATE KEY-",0)&&void 0!==b)this.prvKey=PKCS5PKEY.getKeyFromEncryptedPKCS8PEM(a,b),this.state="SIGN";else if(-1!=a.indexOf("-END RSA PRIVATE KEY-",0)&&-1!=a.indexOf(",ENCRYPTED",0)&&void 0!==b)this.prvKey=PKCS5PKEY.getRSAKeyFromEncryptedPKCS5PEM(a,b),this.state="SIGN";else if(-1!=a.indexOf("-END RSA PRIVATE KEY-",0)&&-1==a.indexOf(",ENCRYPTED",0)&&void 0===b)this.prvKey=new RSAKey,this.prvKey.readPrivateKeyFromPEMString(a),this.state="SIGN";else if(-1!=a.indexOf("-END PRIVATE KEY-",0)&&void 0===b)this.prvKey=PKCS5PKEY.getKeyFromPlainPrivatePKCS8PEM(a),this.state="SIGN";else if(-1!=a.indexOf("-END PUBLIC KEY-",0)&&void 0===b)this.pubKey=PKCS5PKEY.getKeyFromPublicPKCS8PEM(a),this.state="VERIFY";else{if(-1==a.indexOf("-END CERTIFICATE-",0)&&-1==a.indexOf("-END X509 CERTIFICATE-",0)&&-1==a.indexOf("-END TRUSTED CERTIFICATE-",0)||void 0!==b)throw"unsupported arguments";this.pubKey=X509.getPublicKeyFromCertPEM(a),this.state="VERIFY"}else if(a instanceof RSAKey)if(null!=a.d)this.prvKey=a,this.state="SIGN";else{if(null==a.n)throw"RSAKey object is not private and public key";this.pubKey=a,this.state="VERIFY"}else if(a instanceof KJUR.crypto.ECDSA)if(null!=a.prvKeyHex)this.prvKey=a,this.state="SIGN";else{if(null==a.pubKeyHex)throw"ECDSA object is not private and public key";this.pubKey=a,this.state="VERIFY"}},this.initSign=function(a){"string"==typeof a.ecprvhex&&"string"==typeof a.eccurvename?(this.ecprvhex=a.ecprvhex,this.eccurvename=a.eccurvename):this.prvKey=a,this.state="SIGN"},this.initVerifyByPublicKey=function(a){"string"==typeof a.ecpubhex&&"string"==typeof a.eccurvename?(this.ecpubhex=a.ecpubhex,this.eccurvename=a.eccurvename):a instanceof KJUR.crypto.ECDSA?this.pubKey=a:a instanceof RSAKey&&(this.pubKey=a),this.state="VERIFY"},this.initVerifyByCertificatePEM=function(a){var b=new X509;b.readCertPEM(a),this.pubKey=b.subjectPublicKeyRSA,this.state="VERIFY"},this.updateString=function(a){this.md.updateString(a)},this.updateHex=function(a){this.md.updateHex(a)},this.sign=function(){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecprvhex&&"undefined"!=typeof this.eccurvename){var a=new KJUR.crypto.ECDSA({curve:this.eccurvename});this.hSign=a.signHex(this.sHashHex,this.ecprvhex)}else if("rsaandmgf1"==this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if("rsa"==this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else{if(!(this.prvKey instanceof KJUR.crypto.ECDSA))throw"Signature: unsupported public key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(a){this.updateString(a),this.sign()},this.signHex=function(a){this.updateHex(a),this.sign()},this.verify=function(a){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecpubhex&&"undefined"!=typeof this.eccurvename){var b=new KJUR.crypto.ECDSA({curve:this.eccurvename});return b.verifyHex(this.sHashHex,a,this.ecpubhex)}if("rsaandmgf1"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,a,this.mdAlgName,this.pssSaltLen);if("rsa"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);if(this.pubKey instanceof KJUR.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.initVerifyByPublicKey=function(){throw"initVerifyByPublicKey(rsaPubKeyy) not supported for this alg:prov="+this.algProvName},this.initVerifyByCertificatePEM=function(){throw"initVerifyByCertificatePEM(certPEM) not supported for this alg:prov="+this.algProvName},this.initSign=function(){throw"initSign(prvKey) not supported for this alg:prov="+this.algProvName},this.updateString=function(){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=a,void 0!==a&&(void 0!==a.alg&&(this.algName=a.alg,this.provName=void 0===a.prov?KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]:a.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==a.psssaltlen&&(this.pssSaltLen=a.psssaltlen),void 0!==a.prvkeypem)){if(void 0!==a.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{var b=new RSAKey;b.readPrivateKeyFromPEMString(a.prvkeypem),this.initSign(b)}catch(c){throw"fatal error to load pem private key: "+c}}},KJUR.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1"}},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECDSA=function(a){var b="secp256r1",c=new SecureRandom;this.type="EC",this.getBigRandom=function(a){return new BigInteger(a.bitLength(),c).mod(a.subtract(BigInteger.ONE)).add(BigInteger.ONE)},this.setNamedCurve=function(a){this.ecparams=KJUR.crypto.ECParameterDB.getByName(a),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=a},this.setPrivateKeyHex=function(a){this.prvKeyHex=a},this.setPublicKeyHex=function(a){this.pubKeyHex=a},this.generateKeyPairHex=function(){var a=this.ecparams.n,b=this.getBigRandom(a),c=this.ecparams.G.multiply(b),d=c.getX().toBigInteger(),e=c.getY().toBigInteger(),f=this.ecparams.keylen/4,g=("0000000000"+b.toString(16)).slice(-f),h=("0000000000"+d.toString(16)).slice(-f),i=("0000000000"+e.toString(16)).slice(-f),j="04"+h+i;return this.prvKeyHex=g,this.pubKeyHex=j,{ecprvhex:g,ecpubhex:j}},this.signWithMessageHash=function(a){return this.signHex(a,this.prvKeyHex)},this.signHex=function(a,b){var c=new BigInteger(b,16),d=this.ecparams.n,e=new BigInteger(a,16);do var f=this.getBigRandom(d),g=this.ecparams.G,h=g.multiply(f),i=h.getX().toBigInteger().mod(d);while(i.compareTo(BigInteger.ZERO)<=0);var j=f.modInverse(d).multiply(e.add(c.multiply(i))).mod(d);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(i,j)},this.sign=function(a,b){var c=b,d=this.ecparams.n,e=BigInteger.fromByteArrayUnsigned(a);do var f=this.getBigRandom(d),g=this.ecparams.G,h=g.multiply(f),i=h.getX().toBigInteger().mod(d);while(i.compareTo(BigInteger.ZERO)<=0);var j=f.modInverse(d).multiply(e.add(c.multiply(i))).mod(d);return this.serializeSig(i,j)},this.verifyWithMessageHash=function(a,b){return this.verifyHex(a,b,this.pubKeyHex)},this.verifyHex=function(a,b,c){var d,e,f=KJUR.crypto.ECDSA.parseSigHex(b);d=f.r,e=f.s;var g;g=ECPointFp.decodeFromHex(this.ecparams.curve,c);var h=new BigInteger(a,16);return this.verifyRaw(h,d,e,g)},this.verify=function(a,b,c){var d,e;if(Bitcoin.Util.isArray(b)){var f=this.parseSig(b);d=f.r,e=f.s}else{if("object"!=typeof b||!b.r||!b.s)throw"Invalid value for signature";d=b.r,e=b.s}var g;if(c instanceof ECPointFp)g=c;else{if(!Bitcoin.Util.isArray(c))throw"Invalid format for pubkey value, must be byte array or ECPointFp";g=ECPointFp.decodeFrom(this.ecparams.curve,c)}var h=BigInteger.fromByteArrayUnsigned(a);return this.verifyRaw(h,d,e,g)},this.verifyRaw=function(a,b,c,d){var e=this.ecparams.n,f=this.ecparams.G;if(b.compareTo(BigInteger.ONE)<0||b.compareTo(e)>=0)return!1;if(c.compareTo(BigInteger.ONE)<0||c.compareTo(e)>=0)return!1;var g=c.modInverse(e),h=a.multiply(g).mod(e),i=b.multiply(g).mod(e),j=f.multiply(h).add(d.multiply(i)),k=j.getX().toBigInteger().mod(e);return k.equals(b)},this.serializeSig=function(a,b){var c=a.toByteArraySigned(),d=b.toByteArraySigned(),e=[];return e.push(2),e.push(c.length),e=e.concat(c),e.push(2),e.push(d.length),e=e.concat(d),e.unshift(e.length),e.unshift(48),e},this.parseSig=function(a){var b;if(48!=a[0])throw new Error("Signature not a valid DERSequence");if(b=2,2!=a[b])throw new Error("First element in signature must be a DERInteger");var c=a.slice(b+2,b+2+a[b+1]);if(b+=2+a[b+1],2!=a[b])throw new Error("Second element in signature must be a DERInteger");var d=a.slice(b+2,b+2+a[b+1]);b+=2+a[b+1];var e=BigInteger.fromByteArrayUnsigned(c),f=BigInteger.fromByteArrayUnsigned(d);return{r:e,s:f}},this.parseSigCompact=function(a){if(65!==a.length)throw"Signature has the wrong length";var b=a[0]-27;if(0>b||b>7)throw"Invalid signature type";var c=this.ecparams.n,d=BigInteger.fromByteArrayUnsigned(a.slice(1,33)).mod(c),e=BigInteger.fromByteArrayUnsigned(a.slice(33,65)).mod(c);return{r:d,s:e,i:b}},void 0!==a&&void 0!==a.curve&&(this.curveName=a.curve),void 0===this.curveName&&(this.curveName=b),this.setNamedCurve(this.curveName),void 0!==a&&(void 0!==a.prv&&(this.prvKeyHex=a.prv),void 0!==a.pub&&(this.pubKeyHex=a.pub))},KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a),c=new BigInteger(b.r,16),d=new BigInteger(b.s,16);return{r:c,s:d}},KJUR.crypto.ECDSA.parseSigHexInHexRS=function(a){if("30"!=a.substr(0,2))throw"signature is not a ASN.1 sequence";var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=b.length)throw"number of signature ASN.1 sequence elements seem wrong";var c=b[0],d=b[1];if("02"!=a.substr(c,2))throw"1st item of sequene of signature is not ASN.1 integer";if("02"!=a.substr(d,2))throw"2nd item of sequene of signature is not ASN.1 integer";var e=ASN1HEX.getHexOfV_AtObj(a,c),f=ASN1HEX.getHexOfV_AtObj(a,d);return{r:e,s:f}},KJUR.crypto.ECDSA.asn1SigToConcatSig=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a),c=b.r,d=b.s;if("00"==c.substr(0,2)&&c.length/2*8%128==8&&(c=c.substr(2)),"00"==d.substr(0,2)&&d.length/2*8%128==8&&(d=d.substr(2)),c.length/2*8%128!=0)throw"unknown ECDSA sig r length error";if(d.length/2*8%128!=0)throw"unknown ECDSA sig s length error";return c+d},KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if(a.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var b=a.substr(0,a.length/2),c=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(b,c)},KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(a,b){var c=new BigInteger(a,16),d=new BigInteger(b,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(c,d)},KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(a,b){var c=new KJUR.asn1.DERInteger({bigint:a}),d=new KJUR.asn1.DERInteger({bigint:b}),e=new KJUR.asn1.DERSequence({array:[c,d]});return e.getEncodedHex()},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECParameterDB=new function(){function a(a){return new BigInteger(a,16)}var b={},c={};this.getByName=function(a){var d=a;if("undefined"!=typeof c[d]&&(d=c[a]),"undefined"!=typeof b[d])return b[d];throw"unregistered EC curve name: "+d},this.regist=function(d,e,f,g,h,i,j,k,l,m,n,o){b[d]={};var p=a(f),q=a(g),r=a(h),s=a(i),t=a(j),u=new ECCurveFp(p,q,r),v=u.decodePointHex("04"+k+l);b[d].name=d,b[d].keylen=e,b[d].curve=u,b[d].G=v,b[d].n=s,b[d].h=t,b[d].oid=n,b[d].info=o;for(var w=0;w=2*h)break}var l={};return l.keyhex=i.substr(0,2*g[a].keylen),l.ivhex=i.substr(2*g[a].keylen,2*g[a].ivlen),l},l=function(a,b,c,d){var e=CryptoJS.enc.Base64.parse(a),f=CryptoJS.enc.Hex.stringify(e),h=g[b].proc,i=h(f,c,d);return i},m=function(a,b,c,d){var e=g[b].eproc,f=e(a,c,d);return f};return{version:"1.0.5",getHexFromPEM:function(a,b){var c=a;if(-1==c.indexOf("BEGIN "+b))throw"can't find PEM header: "+b;c=c.replace("-----BEGIN "+b+"-----",""),c=c.replace("-----END "+b+"-----","");var d=c.replace(/\s+/g,""),e=b64tohex(d);return e},getDecryptedKeyHexByKeyIV:function(a,b,c,d){var e=h(b);return e(a,c,d)},parsePKCS5PEM:function(a){return j(a)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(a,b,c){return k(a,b,c)},decryptKeyB64:function(a,b,c,d){return l(a,b,c,d)},getDecryptedKeyHex:function(a,b){var c=j(a),d=(c.type,c.cipher),e=c.ivsalt,f=c.data,g=k(d,b,e),h=g.keyhex,i=l(f,d,h,e);return i},getRSAKeyFromEncryptedPKCS5PEM:function(a,b){var c=this.getDecryptedKeyHex(a,b),d=new RSAKey;return d.readPrivateKeyFromASN1HexString(c),d},getEryptedPKCS5PEMFromPrvKeyHex:function(a,b,c,d){var e="";if(("undefined"==typeof c||null==c)&&(c="AES-256-CBC"),"undefined"==typeof g[c])throw"PKCS5PKEY unsupported algorithm: "+c;if("undefined"==typeof d||null==d){var f=g[c].ivlen,h=i(f);d=h.toUpperCase()}var j=k(c,b,d),l=j.keyhex,n=m(a,c,l,d),o=n.replace(/(.{64})/g,"$1\r\n"),e="-----BEGIN RSA PRIVATE KEY-----\r\n";return e+="Proc-Type: 4,ENCRYPTED\r\n",e+="DEK-Info: "+c+","+d+"\r\n",e+="\r\n",e+=o,e+="\r\n-----END RSA PRIVATE KEY-----\r\n"},getEryptedPKCS5PEMFromRSAKey:function(a,b,c,d){var e=new KJUR.asn1.DERInteger({"int":0}),f=new KJUR.asn1.DERInteger({bigint:a.n}),g=new KJUR.asn1.DERInteger({"int":a.e}),h=new KJUR.asn1.DERInteger({bigint:a.d}),i=new KJUR.asn1.DERInteger({bigint:a.p}),j=new KJUR.asn1.DERInteger({bigint:a.q}),k=new KJUR.asn1.DERInteger({bigint:a.dmp1}),l=new KJUR.asn1.DERInteger({bigint:a.dmq1}),m=new KJUR.asn1.DERInteger({bigint:a.coeff}),n=new KJUR.asn1.DERSequence({array:[e,f,g,h,i,j,k,l,m]}),o=n.getEncodedHex();return this.getEryptedPKCS5PEMFromPrvKeyHex(o,b,c,d)},newEncryptedPKCS5PEM:function(a,b,c,d){("undefined"==typeof b||null==b)&&(b=1024),("undefined"==typeof c||null==c)&&(c="10001");var e=new RSAKey;e.generate(b,c);var f=null;return f="undefined"==typeof d||null==d?this.getEncryptedPKCS5PEMFromRSAKey(pkey,a):this.getEncryptedPKCS5PEMFromRSAKey(pkey,a,d)},getRSAKeyFromPlainPKCS8PEM:function(a){if(a.match(/ENCRYPTED/))throw"pem shall be not ENCRYPTED";var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getRSAKeyFromPlainPKCS8Hex(b);return c},getRSAKeyFromPlainPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=b.length)throw"outer DERSequence shall have 3 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmIdentifier is not rsaEnc: "+c;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]),d=ASN1HEX.getHexOfTLV_AtObj(a,b[2]),e=ASN1HEX.getHexOfV_AtObj(d,0),f=new RSAKey;return f.readPrivateKeyFromASN1HexString(e),f},parseHexOfEncryptedPKCS8:function(a){var b={},c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed format: SEQUENCE(0).items != 2: "+c.length;b.ciphertext=ASN1HEX.getHexOfV_AtObj(a,c[1]);var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[0]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+d.length;if("2a864886f70d01050d"!=ASN1HEX.getHexOfV_AtObj(a,d[0]))throw"this only supports pkcs5PBES2";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d[1]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+e.length;var f=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[1]);if(2!=f.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+f.length;if("2a864886f70d0307"!=ASN1HEX.getHexOfV_AtObj(a,f[0]))throw"this only supports TripleDES";b.encryptionSchemeAlg="TripleDES",b.encryptionSchemeIV=ASN1HEX.getHexOfV_AtObj(a,f[1]);var g=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[0]);if(2!=g.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+g.length;if("2a864886f70d01050c"!=ASN1HEX.getHexOfV_AtObj(a,g[0]))throw"this only supports pkcs5PBKDF2";var h=ASN1HEX.getPosArrayOfChildren_AtObj(a,g[1]);if(h.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length;b.pbkdf2Salt=ASN1HEX.getHexOfV_AtObj(a,h[0]);var i=ASN1HEX.getHexOfV_AtObj(a,h[1]);try{b.pbkdf2Iter=parseInt(i,16)}catch(j){throw"malformed format pbkdf2Iter: "+i}return b},getPBKDF2KeyHexFromParam:function(a,b){var c=CryptoJS.enc.Hex.parse(a.pbkdf2Salt),d=a.pbkdf2Iter,e=CryptoJS.PBKDF2(b,c,{keySize:6,iterations:d}),f=CryptoJS.enc.Hex.stringify(e);return f},getPlainPKCS8HexFromEncryptedPKCS8PEM:function(a,b){var c=this.getHexFromPEM(a,"ENCRYPTED PRIVATE KEY"),d=this.parseHexOfEncryptedPKCS8(c),e=PKCS5PKEY.getPBKDF2KeyHexFromParam(d,b),f={};f.ciphertext=CryptoJS.enc.Hex.parse(d.ciphertext);var g=CryptoJS.enc.Hex.parse(e),h=CryptoJS.enc.Hex.parse(d.encryptionSchemeIV),i=CryptoJS.TripleDES.decrypt(f,g,{iv:h}),j=CryptoJS.enc.Hex.stringify(i);return j},getRSAKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getRSAKeyFromPlainPKCS8Hex(c);return d},getKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getKeyFromPlainPrivatePKCS8Hex(c);return d},parsePlainPrivatePKCS8Hex:function(a){var b={};if(b.algparam=null,"30"!=a.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=c.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=a.substr(c[1],2))throw"malformed PKCS8 private key(code:003)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[1]);if(2!=d.length)throw"malformed PKCS8 private key(code:004)";if("06"!=a.substr(d[0],2))throw"malformed PKCS8 private key(code:005)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,d[0]),"06"==a.substr(d[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,d[1])),"04"!=a.substr(c[2],2))throw"malformed PKCS8 private key(code:006)";return b.keyidx=ASN1HEX.getStartPosOfV_AtObj(a,c[2]),b},getKeyFromPlainPrivatePKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getKeyFromPlainPrivatePKCS8Hex(b);return c},getKeyFromPlainPrivatePKCS8Hex:function(a){var b=this.parsePlainPrivatePKCS8Hex(a);if("2a864886f70d010101"==b.algoid){this.parsePrivateRawRSAKeyHexAtObj(a,b);var c=b.key,d=new RSAKey;return d.setPrivateEx(c.n,c.e,c.d,c.p,c.q,c.dp,c.dq,c.co),d}if("2a8648ce3d0201"==b.algoid){if(this.parsePrivateRawECKeyHexAtObj(a,b),void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,prv:b.key});return d}throw"unsupported private key algorithm"},getRSAKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getRSAKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8Hex:function(a){var b=this.parsePublicPKCS8Hex(a);if("2a864886f70d010101"==b.algoid){var c=this.parsePublicRawRSAKeyHex(b.key),d=new RSAKey;return d.setPublic(c.n,c.e),d}if("2a8648ce3d0201"==b.algoid){if(void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,pub:b.key});return d}throw"unsupported public key algorithm"},parsePublicRawRSAKeyHex:function(a){var b={};if("30"!=a.substr(0,2))throw"malformed RSA key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed RSA key(code:002)";if("02"!=a.substr(c[0],2))throw"malformed RSA key(code:003)";if(b.n=ASN1HEX.getHexOfV_AtObj(a,c[0]),"02"!=a.substr(c[1],2))throw"malformed RSA key(code:004)";return b.e=ASN1HEX.getHexOfV_AtObj(a,c[1]),b},parsePrivateRawRSAKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed RSA private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(9!=d.length)throw"malformed RSA private key(code:002)";b.key={},b.key.n=ASN1HEX.getHexOfV_AtObj(a,d[1]),b.key.e=ASN1HEX.getHexOfV_AtObj(a,d[2]),b.key.d=ASN1HEX.getHexOfV_AtObj(a,d[3]),b.key.p=ASN1HEX.getHexOfV_AtObj(a,d[4]),b.key.q=ASN1HEX.getHexOfV_AtObj(a,d[5]),b.key.dp=ASN1HEX.getHexOfV_AtObj(a,d[6]),b.key.dq=ASN1HEX.getHexOfV_AtObj(a,d[7]),b.key.co=ASN1HEX.getHexOfV_AtObj(a,d[8])},parsePrivateRawECKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed ECC private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(3!=d.length)throw"malformed ECC private key(code:002)";if("04"!=a.substr(d[1],2))throw"malformed ECC private key(code:003)";b.key=ASN1HEX.getHexOfV_AtObj(a,d[1])},parsePublicPKCS8Hex:function(a){var b={};b.algparam=null;var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"outer DERSequence shall have 2 elements: "+c.length;var d=c[0];if("30"!=a.substr(d,2))throw"malformed PKCS8 public key(code:001)";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"malformed PKCS8 public key(code:002)";if("06"!=a.substr(e[0],2))throw"malformed PKCS8 public key(code:003)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,e[0]),"06"==a.substr(e[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,e[1])),"03"!=a.substr(c[1],2))throw"malformed PKCS8 public key(code:004)";return b.key=ASN1HEX.getHexOfV_AtObj(a,c[1]).substr(2),b},getRSAKeyFromPublicPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=b.length)throw"outer DERSequence shall have 2 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[0]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmId is not rsaEncryption";if("03"!=a.substr(b[1],2))throw"PKCS8 Public Key is not BITSTRING encapslated.";var d=ASN1HEX.getStartPosOfV_AtObj(a,b[1])+2;if("30"!=a.substr(d,2))throw"PKCS8 Public Key is not SEQUENCE.";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"inner DERSequence shall have 2 elements: "+e.length;if("02"!=a.substr(e[0],2))throw"N is not ASN.1 INTEGER";if("02"!=a.substr(e[1],2))throw"E is not ASN.1 INTEGER";var f=ASN1HEX.getHexOfV_AtObj(a,e[0]),g=ASN1HEX.getHexOfV_AtObj(a,e[1]),h=new RSAKey;return h.setPublic(f,g),h}}}(),KEYUTIL=function(){var a=function(a,b,d){return c(CryptoJS.AES,a,b,d)},b=function(a,b,d){return c(CryptoJS.TripleDES,a,b,d)},c=function(a,b,c,d){var e=CryptoJS.enc.Hex.parse(b),f=CryptoJS.enc.Hex.parse(c),g=CryptoJS.enc.Hex.parse(d),h={};h.key=f,h.iv=g,h.ciphertext=e;var i=a.decrypt(h,f,{iv:g});return CryptoJS.enc.Hex.stringify(i)},d=function(a,b,c){return f(CryptoJS.AES,a,b,c)},e=function(a,b,c){return f(CryptoJS.TripleDES,a,b,c)},f=function(a,b,c,d){var e=CryptoJS.enc.Hex.parse(b),f=CryptoJS.enc.Hex.parse(c),g=CryptoJS.enc.Hex.parse(d),h=a.encrypt(e,f,{iv:g}),i=CryptoJS.enc.Hex.parse(h.toString()),j=CryptoJS.enc.Base64.stringify(i);return j},g={"AES-256-CBC":{proc:a,eproc:d,keylen:32,ivlen:16},"AES-192-CBC":{proc:a,eproc:d,keylen:24,ivlen:16},"AES-128-CBC":{proc:a,eproc:d,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:b,eproc:e,keylen:24,ivlen:8}},h=function(a){return g[a].proc},i=function(a){var b=CryptoJS.lib.WordArray.random(a),c=CryptoJS.enc.Hex.stringify(b);return c},j=function(a){var b={};a.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"))&&(b.cipher=RegExp.$1,b.ivsalt=RegExp.$2),a.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"))&&(b.type=RegExp.$1);var c=-1,d=0;-1!=a.indexOf("\r\n\r\n")&&(c=a.indexOf("\r\n\r\n"),d=2),-1!=a.indexOf("\n\n")&&(c=a.indexOf("\n\n"),d=1);var e=a.indexOf("-----END");if(-1!=c&&-1!=e){var f=a.substring(c+2*d,e-d);f=f.replace(/\s+/g,""),b.data=f}return b},k=function(a,b,c){for(var d=c.substring(0,16),e=CryptoJS.enc.Hex.parse(d),f=CryptoJS.enc.Utf8.parse(b),h=g[a].keylen+g[a].ivlen,i="",j=null;;){var k=CryptoJS.algo.MD5.create();if(null!=j&&k.update(j),k.update(f),k.update(e),j=k.finalize(),i+=CryptoJS.enc.Hex.stringify(j),i.length>=2*h)break}var l={};return l.keyhex=i.substr(0,2*g[a].keylen),l.ivhex=i.substr(2*g[a].keylen,2*g[a].ivlen),l},l=function(a,b,c,d){var e=CryptoJS.enc.Base64.parse(a),f=CryptoJS.enc.Hex.stringify(e),h=g[b].proc,i=h(f,c,d);return i},m=function(a,b,c,d){var e=g[b].eproc,f=e(a,c,d);return f};return{version:"1.0.0",getHexFromPEM:function(a,b){var c=a;if(-1==c.indexOf("BEGIN "+b))throw"can't find PEM header: "+b;c=c.replace("-----BEGIN "+b+"-----",""),c=c.replace("-----END "+b+"-----","");var d=c.replace(/\s+/g,""),e=b64tohex(d);return e},getDecryptedKeyHexByKeyIV:function(a,b,c,d){var e=h(b);return e(a,c,d)},parsePKCS5PEM:function(a){return j(a)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(a,b,c){return k(a,b,c)},decryptKeyB64:function(a,b,c,d){return l(a,b,c,d)},getDecryptedKeyHex:function(a,b){var c=j(a),d=(c.type,c.cipher),e=c.ivsalt,f=c.data,g=k(d,b,e),h=g.keyhex,i=l(f,d,h,e);return i},getRSAKeyFromEncryptedPKCS5PEM:function(a,b){var c=this.getDecryptedKeyHex(a,b),d=new RSAKey;return d.readPrivateKeyFromASN1HexString(c),d},getEncryptedPKCS5PEMFromPrvKeyHex:function(a,b,c,d){var e="";if(("undefined"==typeof c||null==c)&&(c="AES-256-CBC"),"undefined"==typeof g[c])throw"KEYUTIL unsupported algorithm: "+c;if("undefined"==typeof d||null==d){var f=g[c].ivlen,h=i(f);d=h.toUpperCase()}var j=k(c,b,d),l=j.keyhex,n=m(a,c,l,d),o=n.replace(/(.{64})/g,"$1\r\n"),e="-----BEGIN RSA PRIVATE KEY-----\r\n";return e+="Proc-Type: 4,ENCRYPTED\r\n",e+="DEK-Info: "+c+","+d+"\r\n",e+="\r\n",e+=o,e+="\r\n-----END RSA PRIVATE KEY-----\r\n"},getEncryptedPKCS5PEMFromRSAKey:function(a,b,c,d){var e=new KJUR.asn1.DERInteger({"int":0}),f=new KJUR.asn1.DERInteger({bigint:a.n}),g=new KJUR.asn1.DERInteger({"int":a.e}),h=new KJUR.asn1.DERInteger({bigint:a.d}),i=new KJUR.asn1.DERInteger({bigint:a.p}),j=new KJUR.asn1.DERInteger({bigint:a.q}),k=new KJUR.asn1.DERInteger({bigint:a.dmp1}),l=new KJUR.asn1.DERInteger({bigint:a.dmq1}),m=new KJUR.asn1.DERInteger({bigint:a.coeff}),n=new KJUR.asn1.DERSequence({array:[e,f,g,h,i,j,k,l,m]}),o=n.getEncodedHex();return this.getEncryptedPKCS5PEMFromPrvKeyHex(o,b,c,d)},newEncryptedPKCS5PEM:function(a,b,c,d){("undefined"==typeof b||null==b)&&(b=1024),("undefined"==typeof c||null==c)&&(c="10001");var e=new RSAKey;e.generate(b,c);var f=null;return f="undefined"==typeof d||null==d?this.getEncryptedPKCS5PEMFromRSAKey(pkey,a):this.getEncryptedPKCS5PEMFromRSAKey(pkey,a,d)},getRSAKeyFromPlainPKCS8PEM:function(a){if(a.match(/ENCRYPTED/))throw"pem shall be not ENCRYPTED";var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getRSAKeyFromPlainPKCS8Hex(b);return c},getRSAKeyFromPlainPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=b.length)throw"outer DERSequence shall have 3 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmIdentifier is not rsaEnc: "+c;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]),d=ASN1HEX.getHexOfTLV_AtObj(a,b[2]),e=ASN1HEX.getHexOfV_AtObj(d,0),f=new RSAKey;return f.readPrivateKeyFromASN1HexString(e),f},parseHexOfEncryptedPKCS8:function(a){var b={},c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed format: SEQUENCE(0).items != 2: "+c.length;b.ciphertext=ASN1HEX.getHexOfV_AtObj(a,c[1]);var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[0]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+d.length;if("2a864886f70d01050d"!=ASN1HEX.getHexOfV_AtObj(a,d[0]))throw"this only supports pkcs5PBES2";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d[1]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+e.length;var f=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[1]);if(2!=f.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+f.length;if("2a864886f70d0307"!=ASN1HEX.getHexOfV_AtObj(a,f[0]))throw"this only supports TripleDES";b.encryptionSchemeAlg="TripleDES",b.encryptionSchemeIV=ASN1HEX.getHexOfV_AtObj(a,f[1]);var g=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[0]);if(2!=g.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+g.length;if("2a864886f70d01050c"!=ASN1HEX.getHexOfV_AtObj(a,g[0]))throw"this only supports pkcs5PBKDF2";var h=ASN1HEX.getPosArrayOfChildren_AtObj(a,g[1]);if(h.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length;b.pbkdf2Salt=ASN1HEX.getHexOfV_AtObj(a,h[0]);var i=ASN1HEX.getHexOfV_AtObj(a,h[1]);try{b.pbkdf2Iter=parseInt(i,16)}catch(j){throw"malformed format pbkdf2Iter: "+i}return b},getPBKDF2KeyHexFromParam:function(a,b){var c=CryptoJS.enc.Hex.parse(a.pbkdf2Salt),d=a.pbkdf2Iter,e=CryptoJS.PBKDF2(b,c,{keySize:6,iterations:d}),f=CryptoJS.enc.Hex.stringify(e);return f},getPlainPKCS8HexFromEncryptedPKCS8PEM:function(a,b){var c=this.getHexFromPEM(a,"ENCRYPTED PRIVATE KEY"),d=this.parseHexOfEncryptedPKCS8(c),e=KEYUTIL.getPBKDF2KeyHexFromParam(d,b),f={};f.ciphertext=CryptoJS.enc.Hex.parse(d.ciphertext);var g=CryptoJS.enc.Hex.parse(e),h=CryptoJS.enc.Hex.parse(d.encryptionSchemeIV),i=CryptoJS.TripleDES.decrypt(f,g,{iv:h}),j=CryptoJS.enc.Hex.stringify(i);return j},getRSAKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getRSAKeyFromPlainPKCS8Hex(c);return d},getKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getKeyFromPlainPrivatePKCS8Hex(c);return d},parsePlainPrivatePKCS8Hex:function(a){var b={};if(b.algparam=null,"30"!=a.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=c.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=a.substr(c[1],2))throw"malformed PKCS8 private key(code:003)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[1]);if(2!=d.length)throw"malformed PKCS8 private key(code:004)";if("06"!=a.substr(d[0],2))throw"malformed PKCS8 private key(code:005)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,d[0]),"06"==a.substr(d[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,d[1])),"04"!=a.substr(c[2],2))throw"malformed PKCS8 private key(code:006)";return b.keyidx=ASN1HEX.getStartPosOfV_AtObj(a,c[2]),b},getKeyFromPlainPrivatePKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getKeyFromPlainPrivatePKCS8Hex(b);return c},getKeyFromPlainPrivatePKCS8Hex:function(a){var b=this.parsePlainPrivatePKCS8Hex(a);if("2a864886f70d010101"==b.algoid){this.parsePrivateRawRSAKeyHexAtObj(a,b);var c=b.key,d=new RSAKey;return d.setPrivateEx(c.n,c.e,c.d,c.p,c.q,c.dp,c.dq,c.co),d}if("2a8648ce3d0201"==b.algoid){if(this.parsePrivateRawECKeyHexAtObj(a,b),void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,prv:b.key});return d}throw"unsupported private key algorithm"},getRSAKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getRSAKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8Hex:function(a){var b=this.parsePublicPKCS8Hex(a);if("2a864886f70d010101"==b.algoid){var c=this.parsePublicRawRSAKeyHex(b.key),d=new RSAKey;return d.setPublic(c.n,c.e),d}if("2a8648ce3d0201"==b.algoid){if(void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,pub:b.key});return d}throw"unsupported public key algorithm"},parsePublicRawRSAKeyHex:function(a){var b={};if("30"!=a.substr(0,2))throw"malformed RSA key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed RSA key(code:002)";if("02"!=a.substr(c[0],2))throw"malformed RSA key(code:003)";if(b.n=ASN1HEX.getHexOfV_AtObj(a,c[0]),"02"!=a.substr(c[1],2))throw"malformed RSA key(code:004)";return b.e=ASN1HEX.getHexOfV_AtObj(a,c[1]),b},parsePrivateRawRSAKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed RSA private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(9!=d.length)throw"malformed RSA private key(code:002)";b.key={},b.key.n=ASN1HEX.getHexOfV_AtObj(a,d[1]),b.key.e=ASN1HEX.getHexOfV_AtObj(a,d[2]),b.key.d=ASN1HEX.getHexOfV_AtObj(a,d[3]),b.key.p=ASN1HEX.getHexOfV_AtObj(a,d[4]),b.key.q=ASN1HEX.getHexOfV_AtObj(a,d[5]),b.key.dp=ASN1HEX.getHexOfV_AtObj(a,d[6]),b.key.dq=ASN1HEX.getHexOfV_AtObj(a,d[7]),b.key.co=ASN1HEX.getHexOfV_AtObj(a,d[8])},parsePrivateRawECKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed ECC private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(3!=d.length)throw"malformed ECC private key(code:002)";if("04"!=a.substr(d[1],2))throw"malformed ECC private key(code:003)";b.key=ASN1HEX.getHexOfV_AtObj(a,d[1])},parsePublicPKCS8Hex:function(a){var b={};b.algparam=null;var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"outer DERSequence shall have 2 elements: "+c.length;var d=c[0];if("30"!=a.substr(d,2))throw"malformed PKCS8 public key(code:001)";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"malformed PKCS8 public key(code:002)";if("06"!=a.substr(e[0],2))throw"malformed PKCS8 public key(code:003)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,e[0]),"06"==a.substr(e[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,e[1])),"03"!=a.substr(c[1],2))throw"malformed PKCS8 public key(code:004)";return b.key=ASN1HEX.getHexOfV_AtObj(a,c[1]).substr(2),b},getRSAKeyFromPublicPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=b.length)throw"outer DERSequence shall have 2 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[0]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmId is not rsaEncryption";if("03"!=a.substr(b[1],2))throw"PKCS8 Public Key is not BITSTRING encapslated.";var d=ASN1HEX.getStartPosOfV_AtObj(a,b[1])+2;if("30"!=a.substr(d,2))throw"PKCS8 Public Key is not SEQUENCE.";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"inner DERSequence shall have 2 elements: "+e.length;if("02"!=a.substr(e[0],2))throw"N is not ASN.1 INTEGER";if("02"!=a.substr(e[1],2))throw"E is not ASN.1 INTEGER";var f=ASN1HEX.getHexOfV_AtObj(a,e[0]),g=ASN1HEX.getHexOfV_AtObj(a,e[1]),h=new RSAKey;return h.setPublic(f,g),h}}}();KEYUTIL.getKey=function(a,b,c){if(a instanceof RSAKey)return a;if(a instanceof KJUR.crypto.ECDSA)return a;if(void 0!==a.xy&&void 0!==a.curve)return new KJUR.crypto.ECDSA({prv:a.xy,curve:a.curve});if(void 0!==a.n&&void 0!==a.e&&void 0!==a.d&&void 0!==a.p&&void 0!==a.q&&void 0!==a.dp&&void 0!==a.dq&&void 0!==a.co){var d=new RSAKey;return d.setPrivateEx(a.n,a.e,a.d,a.p,a.q,a.dp,a.dq,a.co),d}if(void 0!==a.d&&void 0!==a.curve)return new KJUR.crypto.ECDSA({pub:a.d,curve:a.curve});if(void 0!==a.n&&a.e){var d=new RSAKey;return d.setPublic(a.n,a.e),d}if(-1!=a.indexOf("-END CERTIFICATE-",0)||-1!=a.indexOf("-END X509 CERTIFICATE-",0)||-1!=a.indexOf("-END TRUSTED CERTIFICATE-",0))return X509.getPublicKeyFromCertPEM(a);if("pkcs8pub"===c)return KEYUTIL.getKeyFromPublicPKCS8Hex(a);if(-1!=a.indexOf("-END PUBLIC KEY-"))return KEYUTIL.getKeyFromPublicPKCS8PEM(a);if("pkcs5prv"===c){var d=new RSAKey;return d.readPrivateKeyFromASN1HexString(a),d}if("pkcs5prv"===c){var d=new RSAKey;return d.readPrivateKeyFromASN1HexString(a),d}if(-1!=a.indexOf("-END RSA PRIVATE KEY-")&&-1==a.indexOf("4,ENCRYPTED")){var d=new RSAKey;return d.readPrivateKeyFromPEMString(a),d}if(-1!=a.indexOf("-END PRIVATE KEY-"))return KEYUTIL.getKeyFromPlainPrivatePKCS8PEM(a);if(-1!=a.indexOf("-END RSA PRIVATE KEY-")&&-1!=a.indexOf("4,ENCRYPTED"))return KEYUTIL.getRSAKeyFromEncryptedPKCS5PEM(a,b);if(-1!=a.indexOf("-END ENCRYPTED PRIVATE KEY-"))return KEYUTIL.getKeyFromEncryptedPKCS8PEM(a,b);throw"not supported argument"},KEYUTIL.generateKeypair=function(a,b){if("RSA"==a){var c=b,d=new RSAKey;d.generate(c,"10001");var e=new RSAKey,f=d.n.toString(16),g=d.e.toString(16);e.setPublic(f,g);var h={};return h.prvKeyObj=d,h.pubKeyObj=e,h}if("EC"==a){var i=b,j=new KJUR.crypto.ECDSA({curve:i}),k=j.generateKeyPairHex(),d=new KJUR.crypto.ECDSA({curve:i});d.setPrivateKeyHex(k.ecprvhex);var e=new KJUR.crypto.ECDSA({curve:i});e.setPublicKeyHex(k.ecpubhex);var h={};return h.prvKeyObj=d,h.pubKeyObj=e,h}throw"unknown algorithm: "+a},RSAKey.prototype.readPrivateKeyFromPEMString=_rsapem_readPrivateKeyFromPEMString,RSAKey.prototype.readPrivateKeyFromASN1HexString=_rsapem_readPrivateKeyFromASN1HexString;var _RE_HEXDECONLY=new RegExp("");_RE_HEXDECONLY.compile("[^0-9a-f]","gi"),RSAKey.prototype.signWithMessageHash=_rsasign_signWithMessageHash,RSAKey.prototype.signString=_rsasign_signString,RSAKey.prototype.signStringWithSHA1=_rsasign_signStringWithSHA1,RSAKey.prototype.signStringWithSHA256=_rsasign_signStringWithSHA256,RSAKey.prototype.sign=_rsasign_signString,RSAKey.prototype.signWithSHA1=_rsasign_signStringWithSHA1,RSAKey.prototype.signWithSHA256=_rsasign_signStringWithSHA256,RSAKey.prototype.signWithMessageHashPSS=_rsasign_signWithMessageHashPSS,RSAKey.prototype.signStringPSS=_rsasign_signStringPSS,RSAKey.prototype.signPSS=_rsasign_signStringPSS,RSAKey.SALT_LEN_HLEN=-1,RSAKey.SALT_LEN_MAX=-2,RSAKey.prototype.verifyWithMessageHash=_rsasign_verifyWithMessageHash,RSAKey.prototype.verifyString=_rsasign_verifyString,RSAKey.prototype.verifyHexSignatureForMessage=_rsasign_verifyHexSignatureForMessage,RSAKey.prototype.verify=_rsasign_verifyString,RSAKey.prototype.verifyHexSignatureForByteArrayMessage=_rsasign_verifyHexSignatureForMessage,RSAKey.prototype.verifyWithMessageHashPSS=_rsasign_verifyWithMessageHashPSS,RSAKey.prototype.verifyStringPSS=_rsasign_verifyStringPSS,RSAKey.prototype.verifyPSS=_rsasign_verifyStringPSS,RSAKey.SALT_LEN_RECOVER=-2,X509.pemToBase64=function(a){var b=a;return b=b.replace("-----BEGIN CERTIFICATE-----",""),b=b.replace("-----END CERTIFICATE-----",""),b=b.replace(/[ \n]+/g,"")},X509.pemToHex=function(a){var b=X509.pemToBase64(a),c=b64tohex(b);return c},X509.getSubjectPublicKeyPosFromCertHex=function(a){var b=X509.getSubjectPublicKeyInfoPosFromCertHex(a);if(-1==b)return-1;var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,b);if(2!=c.length)return-1;var d=c[1];if("03"!=a.substring(d,d+2))return-1;var e=ASN1HEX.getStartPosOfV_AtObj(a,d);return"00"!=a.substring(e,e+2)?-1:e+2},X509.getSubjectPublicKeyInfoPosFromCertHex=function(a){var b=ASN1HEX.getStartPosOfV_AtObj(a,0),c=ASN1HEX.getPosArrayOfChildren_AtObj(a,b);return c.length<1?-1:"a003020102"==a.substring(c[0],c[0]+10)?c.length<6?-1:c[6]:c.length<5?-1:c[5]},X509.getPublicKeyHexArrayFromCertHex=function(a){var b=X509.getSubjectPublicKeyPosFromCertHex(a),c=ASN1HEX.getPosArrayOfChildren_AtObj(a,b);if(2!=c.length)return[];var d=ASN1HEX.getHexOfV_AtObj(a,c[0]),e=ASN1HEX.getHexOfV_AtObj(a,c[1]);return null!=d&&null!=e?[d,e]:[]},X509.getHexTbsCertificateFromCert=function(a){var b=ASN1HEX.getStartPosOfV_AtObj(a,0);return b},X509.getPublicKeyHexArrayFromCertPEM=function(a){var b=X509.pemToHex(a),c=X509.getPublicKeyHexArrayFromCertHex(b);return c},X509.hex2dn=function(a){for(var b="",c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0),d=0;d signature verified'):($(b).removeClass("valid-token"),$(b).addClass("invalid-token"),b.innerHTML=' invalid signature')}}function l(a,b){var c=$('input[name="secret"]'),d=$('textarea[name="private-key"]'),e=$('textarea[name="public-key"]');return"HS256"===a?c.val():"sign"===b?d.val():e.val()}function m(){return A.filter(":checked").val()}function n(){var a=A.filter(":checked").val();$(".js-input").attr("data-alg",a),$(".jwt-signature pre").hide().filter("."+a).show(),j(x)===s&&"RS256"===a?o():j(x)===t&&"HS256"===a&&p()}function o(){x.setValue(t),$(".jwt-signature textarea[name=public-key]").val(u),$(".jwt-signature textarea[name=private-key]").val(v)}function p(){x.setValue(s)}function q(){var a,b=$(this);a="public-key"===b.prop("name")?/-----BEGIN (PUBLIC KEY|CERTIFICATE)-----(.|\n)*-----END (PUBLIC KEY|CERTIFICATE)-----/.test(b.val()):/-----BEGIN RSA PRIVATE KEY-----(.|\n)*-----END RSA PRIVATE KEY-----/.test(b.val()),a?b.removeClass("error"):b.addClass("error")}var r,s="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",t="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE",u="-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB\n-----END PUBLIC KEY----- ",v="-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQABAoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5CpuGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0KSu5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aPFaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw==\n -----END RSA PRIVATE KEY----- ",w=CodeMirror,x=w(document.getElementsByClassName("js-input")[0],{mode:"jwt",theme:"night",lineWrapping:!0,autofocus:!0,extraKeys:{Tab:b}}),y=w(document.getElementsByClassName("js-header")[0],{mode:"application/json",lineWrapping:!0,extraKeys:{Tab:b},lint:!0}),z=w(document.getElementsByClassName("js-payload")[0],{mode:"application/json",lineWrapping:!0,extraKeys:{Tab:b},lint:!0}),A=$('input[name="algorithm"]');x.on("change",d),z.on("change",h),y.on("change",h);var B=document.getElementsByName("secret")[0],C=document.getElementsByName("is-base64-encoded")[0];if(n(),A.on("change",function(){n(),k()}),$(".jwt-signature textarea").on("change",k,!1),$(".jwt-signature textarea").on("keyup",k,!1),$(".jwt-signature textarea").on("keyup",q,!1),B.addEventListener("change",k,!1),B.addEventListener("keyup",k,!1),C.addEventListener("change",k,!1),document.location.search){var D=document.location.search.slice(1),E={};if(D=D.split("&"),D.forEach(function(a){a=a.split("="),E[a[0]]=a[1]}),E.value)return void x.setValue(decodeURIComponent(E.value))}if(document.location.hash){var D=document.location.hash.slice(1),E={};if(D=D.split("&"),D.forEach(function(a){a=a.split("="),E[a[0]]=a[1]}),E.id_token)return void x.setValue(decodeURIComponent(E.id_token))}g(function(a){r=a||s,x.setValue(r)})}(),function(){setInterval(function(){var a,b;return b=new Date(1987,5,30),a=new Date,$("#time").text(((a-b)/1e3).toFixed(0))},1e3)}.call(this),$('[data-toggle="tooltip"]').tooltip(),$(".stars").each(function(a,b){var c=$(b),d=c.attr("data-repo");d&&$.getJSON("http://api.github.com/repos/"+d,function(a){var b=$("");b.text(a.stargazers_count),c.find("i").after(b),c.show()})}); \ No newline at end of file +function hex2b64(a){var b,c,d="";for(b=0;b+3<=a.length;b+=3)c=parseInt(a.substring(b,b+3),16),d+=b64map.charAt(c>>6)+b64map.charAt(63&c);if(b+1==a.length?(c=parseInt(a.substring(b,b+1),16),d+=b64map.charAt(c<<2)):b+2==a.length&&(c=parseInt(a.substring(b,b+2),16),d+=b64map.charAt(c>>2)+b64map.charAt((3&c)<<4)),b64pad)for(;(3&d.length)>0;)d+=b64pad;return d}function b64tohex(a){var b,c,d,e="",f=0;for(b=0;bd||(0==f?(e+=int2char(d>>2),c=3&d,f=1):1==f?(e+=int2char(c<<2|d>>4),c=15&d,f=2):2==f?(e+=int2char(c),e+=int2char(d>>2),c=3&d,f=3):(e+=int2char(c<<2|d>>4),e+=int2char(15&d),f=0));return 1==f&&(e+=int2char(c<<2)),e}function b64toBA(a){var b,c=b64tohex(a),d=new Array;for(b=0;2*b=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpFromInt(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+this.DV:this.t=0}function nbv(a){var b=nbi();return b.fromInt(a),b}function bnpFromString(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void this.fromRadix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intAt(a,d);0>g?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<>this.DB-f):this[this.t-1]|=g<=this.DB&&(f-=this.DB))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<0)for(h>h)>0&&(e=!0,f=int2char(c));g>=0;)b>h?(c=(this[g]&(1<>(h+=this.DB-b)):(c=this[g]>>(h-=b)&d,0>=h&&(h+=this.DB,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnNegate(){var a=nbi();return BigInteger.ZERO.subTo(this,a),a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<>d;for(var g=c+1;g>d;d>0&&(b[this.t-c-1]|=(this.s&f)<c;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=0>d?-1:0,-1>d?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e=0;)a[c]=0;for(c=0;c=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t0?(d.lShiftTo(i,f),e.lShiftTo(i,c)):(d.copyTo(f),e.copyTo(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<1?f[j-2]>>this.F2:0),m=this.FV/l,n=(1<=0&&(c[c.t++]=1,c.subTo(r,c)),BigInteger.ONE.dlShiftTo(j,r),r.subTo(f,f);f.t=0;){var s=c[--p]==k?this.DM:Math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))0&&c.rShiftTo(i,c),0>g&&BigInteger.ZERO.subTo(c,c)}}}function bnMod(a){var b=nbi();return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b),b}function Classic(a){this.m=a}function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function cSqrTo(a,b){a.squareTo(b),this.reduce(b)}function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function Montgomery(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(b,b),b}function montRevert(a){var b=nbi();return a.copyTo(b),this.reduce(b),b}function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b),this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(a,b){if(a>4294967295||1>a)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);--f>=0;)if(b.sqrTo(c,d),(a&1<0)b.mulTo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnModPowInt(a,b){var c;return c=256>a||b.isEven()?new Classic(b):new Montgomery(b),this.exp(a,c)}function bnClone(){var a=nbi();return this.copyTo(a),a}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divRemTo(d,e,f);e.signum()>0;)g=(c+f.intValue()).toString(a).substr(1)+g,e.divRemTo(d,e,f);return f.intValue().toString(a)+g}function bnpFromRadix(a,b){this.fromInt(0),null==b&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,f=0,g=0,h=0;hi?"-"==a.charAt(h)&&0==this.signum()&&(e=!0):(g=b*g+i,++f>=c&&(this.dMultiply(d),this.dAddOffset(g,0),f=0,g=0))}f>0&&(this.dMultiply(Math.pow(b,f)),this.dAddOffset(g,0)),e&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var d=new Array,e=7&a;d.length=(a>>3)+1,b.nextBytes(d),e>0?d[0]&=(1<0)for(d>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<=0;)8>d?(c=(this[a]&(1<>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,0>=d&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;f>d;++d)c[d]=b(this[d],a[d]);if(a.ta?this.rShiftTo(-a,b):this.lShiftTo(a,b),b}function bnShiftRight(a){var b=nbi();return 0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b),b}function lbit(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bnGetLowestSetBit(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<c;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=0>d?-1:0,d>0?b[c++]=d:-1>d&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function bnAdd(a){var b=nbi();return this.addTo(a,b),b}function bnSubtract(a){var b=nbi();return this.subTo(a,b),b}function bnMultiply(a){var b=nbi();return this.multiplyTo(a,b),b}function bnSquare(){var a=nbi();return this.squareTo(a),a}function bnDivide(a){var b=nbi();return this.divRemTo(a,b,null),b}function bnRemainder(a){var b=nbi();return this.divRemTo(a,null,b),b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();return this.divRemTo(a,b,c),new Array(b,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}function bnPow(a){return this.exp(a,new NullExp)}function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpMultiplyUpperTo(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=nbi();return a.copyTo(b),this.reduce(b),b}function barrettRevert(a){return a}function barrettReduce(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b),this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnModPow(a,b){var c,d,e=a.bitLength(),f=nbv(1);if(0>=e)return f;c=18>e?1:48>e?3:144>e?4:768>e?5:6,d=8>e?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=new Array,h=3,i=c-1,j=(1<1){var k=nbi();for(d.sqrTo(g[1],k);j>=h;)g[h]=nbi(),d.mulTo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<0&&(l|=a[n-1]>>this.DB+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.DB,--n),o)g[l].copyTo(f),o=!1;else{for(;h>1;)d.sqrTo(f,p),d.sqrTo(p,f),h-=2;h>0?d.sqrTo(f,p):(m=f,f=p,p=m),d.mulTo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function bnpModInt(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&f.isEven()||(e.addTo(this,e),f.subTo(a,f)),e.rShiftTo(1,e)):f.isEven()||f.subTo(a,f),f.rShiftTo(1,f);for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&h.isEven()||(g.addTo(this,g),h.subTo(a,h)),g.rShiftTo(1,g)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(g,e),f.subTo(h,f)):(d.subTo(c,d),b&&g.subTo(e,g),h.subTo(f,h))}return 0!=d.compareTo(BigInteger.ONE)?BigInteger.ZERO:h.compareTo(a)>=0?h.subtract(a):h.signum()<0?(h.addTo(a,h),h.signum()<0?h.add(a):h):h}function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;bd;)d*=lowprimes[e++];for(d=c.modInt(d);e>b;)if(d%lowprimes[b++]==0)return!1}return c.millerRabin(a)}function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var d=b.shiftRight(c);a=a+1>>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;a>f;++f){e.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var g=e.modPow(d,this);if(0!=g.compareTo(BigInteger.ONE)&&0!=g.compareTo(b)){for(var h=1;h++b;++b)this.S[b]=b;for(c=0,b=0;256>b;++b)c=c+this.S[b]+a[b%a.length]&255,d=this.S[b],this.S[b]=this.S[c],this.S[c]=d;this.i=0,this.j=0}function ARC4next(){var a;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,a=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=a,this.S[a+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function rng_seed_int(a){rng_pool[rng_pptr++]^=255&a,rng_pool[rng_pptr++]^=a>>8&255,rng_pool[rng_pptr++]^=a>>16&255,rng_pool[rng_pptr++]^=a>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptra?"0"+a.toString(16):a.toString(16)}function pkcs1pad2(a,b){if(b=0&&b>0;){var e=a.charCodeAt(d--);128>e?c[--b]=e:e>127&&2048>e?(c[--b]=63&e|128,c[--b]=e>>6|192):(c[--b]=63&e|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;for(var f=new SecureRandom,g=new Array;b>2;){for(g[0]=0;0==g[0];)f.nextBytes(g);c[--b]=g[0]}return c[--b]=2,c[--b]=0,new BigInteger(c)}function oaep_mgf1_arr(a,b,c){for(var d="",e=0;d.length>24,(16711680&e)>>16,(65280&e)>>8,255&e]))),e+=1;return d}function oaep_pad(a,b,c){if(a.length+2*SHA1_SIZE+2>b)throw"Message too long for RSA";var d,e="";for(d=0;d0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16)):alert("Invalid RSA public key")}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){var b=pkcs1pad2(a,this.n.bitLength()+7>>3);if(null==b)return null;var c=this.doPublic(b);if(null==c)return null;var d=c.toString(16);return 0==(1&d.length)?d:"0"+d}function RSAEncryptOAEP(a,b){var c=oaep_pad(a,this.n.bitLength()+7>>3,b);if(null==c)return null;var d=this.doPublic(c);if(null==d)return null;var e=d.toString(16);return 0==(1&e.length)?e:"0"+e}function pkcs1unpad2(a,b){for(var c=a.toByteArray(),d=0;d=c.length)return null;for(var e="";++df?e+=String.fromCharCode(f):f>191&&224>f?(e+=String.fromCharCode((31&f)<<6|63&c[d+1]),++d):(e+=String.fromCharCode((15&f)<<12|(63&c[d+1])<<6|63&c[d+2]),d+=2)}return e}function oaep_mgf1_str(a,b,c){for(var d="",e=0;d.length>24,(16711680&e)>>16,(65280&e)>>8,255&e])),e+=1;return d}function oaep_unpad(a,b,c){a=a.toByteArray();var d;for(d=0;d0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16)):alert("Invalid RSA private key")}function RSASetPrivateEx(a,b,c,d,e,f,g,h){if(null==a)throw"RSASetPrivateEx N == null";if(null==b)throw"RSASetPrivateEx E == null";if(0==a.length)throw"RSASetPrivateEx N.length == 0";if(0==b.length)throw"RSASetPrivateEx E.length == 0";null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16),this.p=parseBigInt(d,16),this.q=parseBigInt(e,16),this.dmp1=parseBigInt(f,16),this.dmq1=parseBigInt(g,16),this.coeff=parseBigInt(h,16)):alert("Invalid RSA private key in RSASetPrivateEx")}function RSAGenerate(a,b){var c=new SecureRandom,d=a>>1;this.e=parseInt(b,16);for(var e=new BigInteger(b,16);;){for(;this.p=new BigInteger(a-d,1,c),0!=this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new BigInteger(d,1,c),0!=this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var f=this.p;this.p=this.q,this.q=f}var g=this.p.subtract(BigInteger.ONE),h=this.q.subtract(BigInteger.ONE),i=g.multiply(h);if(0==i.gcd(e).compareTo(BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=e.modInverse(i),this.dmp1=this.d.mod(g),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}}function RSADoPrivate(a){if(null==this.p||null==this.q)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),c=a.mod(this.q).modPow(this.dmq1,this.q);b.compareTo(c)<0;)b=b.add(this.p);return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c)}function RSADecrypt(a){var b=parseBigInt(a,16),c=this.doPrivate(b);return null==c?null:pkcs1unpad2(c,this.n.bitLength()+7>>3)}function RSADecryptOAEP(a,b){var c=parseBigInt(a,16),d=this.doPrivate(c);return null==d?null:oaep_unpad(d,this.n.bitLength()+7>>3,b)}function ECFieldElementFp(a,b){this.x=b,this.q=a}function feFpEquals(a){return a==this?!0:this.q.equals(a.q)&&this.x.equals(a.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(a){return new ECFieldElementFp(this.q,this.x.add(a.toBigInteger()).mod(this.q))}function feFpSubtract(a){return new ECFieldElementFp(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}function feFpMultiply(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(a,b,c,d){this.curve=a,this.x=b,this.y=c,null==d?this.z=BigInteger.ONE:this.z=d,this.zinv=null}function pointFpGetX(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(a){if(a==this)return!0;if(this.isInfinity())return a.isInfinity();if(a.isInfinity())return this.isInfinity();var b,c;return b=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q),b.equals(BigInteger.ZERO)?(c=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q),c.equals(BigInteger.ZERO)):!1}function pointFpIsInfinity(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q),c=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(c))return BigInteger.ZERO.equals(b)?this.twice():this.curve.getInfinity();var d=new BigInteger("3"),e=this.x.toBigInteger(),f=this.y.toBigInteger(),g=(a.x.toBigInteger(),a.y.toBigInteger(),c.square()),h=g.multiply(c),i=e.multiply(g),j=b.square().multiply(this.z),k=j.subtract(i.shiftLeft(1)).multiply(a.z).subtract(h).multiply(c).mod(this.curve.q),l=i.multiply(d).multiply(b).subtract(f.multiply(h)).subtract(j.multiply(b)).multiply(a.z).add(b.multiply(h)).mod(this.curve.q),m=h.multiply(this.z).multiply(a.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(k),this.curve.fromBigInteger(l),m)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var a=new BigInteger("3"),b=this.x.toBigInteger(),c=this.y.toBigInteger(),d=c.multiply(this.z),e=d.multiply(c).mod(this.curve.q),f=this.curve.a.toBigInteger(),g=b.square().multiply(a);BigInteger.ZERO.equals(f)||(g=g.add(this.z.square().multiply(f))),g=g.mod(this.curve.q);var h=g.square().subtract(b.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(d).mod(this.curve.q),i=g.multiply(a).multiply(b).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(g.square().multiply(g)).mod(this.curve.q),j=d.square().multiply(d).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(i),j)}function pointFpMultiply(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b,c=a,d=c.multiply(new BigInteger("3")),e=this.negate(),f=this;for(b=d.bitLength()-2;b>0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add(g?this:e))}return f}function pointFpMultiplyTwo(a,b,c){var d;d=a.bitLength()>c.bitLength()?a.bitLength()-1:c.bitLength()-1;for(var e=this.curve.getInfinity(),f=this.add(b);d>=0;)e=e.twice(),a.testBit(d)?e=c.testBit(d)?e.add(f):e.add(this):c.testBit(d)&&(e=e.add(b)),--d;return e}function ECCurveFp(a,b,c){this.q=a,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(c),this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(a){return a==this?!0:this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(a){return new ECFieldElementFp(this.q,a)}function curveFpDecodePointHex(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var b=(a.length-2)/2,c=a.substr(2,b),d=a.substr(b+2,b);return new ECPointFp(this,this.fromBigInteger(new BigInteger(c,16)),this.fromBigInteger(new BigInteger(d,16)));default:return null}}function Base64x(){}function stoBA(a){for(var b=new Array,c=0;ce;e++)c+="0";return c+a}function _rsasign_signString(a,b){var c=function(a){return KJUR.crypto.Util.hashString(a,b)},d=c(a);return this.signWithMessageHash(d,b)}function _rsasign_signWithMessageHash(a,b){ +var c=KJUR.crypto.Util.getPaddedDigestInfoHex(a,b,this.n.bitLength()),d=parseBigInt(c,16),e=this.doPrivate(d),f=e.toString(16);return _zeroPaddingOfSignature(f,this.n.bitLength())}function _rsasign_signStringWithSHA1(a){return _rsasign_signString.call(this,a,"sha1")}function _rsasign_signStringWithSHA256(a){return _rsasign_signString.call(this,a,"sha256")}function pss_mgf1_str(a,b,c){for(var d="",e=0;d.length>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),e+=1;return d}function _rsasign_signStringPSS(a,b,c){var d=function(a){return KJUR.crypto.Util.hashHex(a,b)},e=d(rstrtohex(a));return void 0===c&&(c=-1),this.signWithMessageHashPSS(e,b,c)}function _rsasign_signWithMessageHashPSS(a,b,c){var d,e=hextorstr(a),f=e.length,g=this.n.bitLength()-1,h=Math.ceil(g/8),i=function(a){return KJUR.crypto.Util.hashHex(a,b)};if(-1===c||void 0===c)c=f;else if(-2===c)c=h-f-2;else if(-2>c)throw"invalid salt length";if(f+c+2>h)throw"data too long";var j="";c>0&&(j=new Array(c),(new SecureRandom).nextBytes(j),j=String.fromCharCode.apply(String,j));var k=hextorstr(i(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+e+j))),l=[];for(d=0;h-c-f-2>d;d+=1)l[d]=0;var m=String.fromCharCode.apply(String,l)+""+j,n=pss_mgf1_str(k,m.length,i),o=[];for(d=0;d>8*h-g&255;for(o[0]&=~p,d=0;f>d;d++)o.push(k.charCodeAt(d));return o.push(188),_zeroPaddingOfSignature(this.doPrivate(new BigInteger(o)).toString(16),this.n.bitLength())}function _rsasign_getDecryptSignatureBI(a,b,c){var d=new RSAKey;d.setPublic(b,c);var e=d.doPublic(a);return e}function _rsasign_getHexDigestInfoFromSig(a,b,c){var d=_rsasign_getDecryptSignatureBI(a,b,c),e=d.toString(16).replace(/^1f+00/,"");return e}function _rsasign_getAlgNameAndHashFromHexDisgestInfo(a){for(var b in KJUR.crypto.Util.DIGESTINFOHEAD){var c=KJUR.crypto.Util.DIGESTINFOHEAD[b],d=c.length;if(a.substring(0,d)==c){var e=[b,a.substring(d)];return e}}return[]}function _rsasign_verifySignatureWithArgs(a,b,c,d){var e=_rsasign_getHexDigestInfoFromSig(b,c,d),f=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(0==f.length)return!1;var g=f[0],h=f[1],i=function(a){return KJUR.crypto.Util.hashString(a,g)},j=i(a);return h==j}function _rsasign_verifyHexSignatureForMessage(a,b){var c=parseBigInt(a,16),d=_rsasign_verifySignatureWithArgs(b,c,this.n.toString(16),this.e.toString(16));return d}function _rsasign_verifyString(a,b){b=b.replace(_RE_HEXDECONLY,""),b=b.replace(/[ \n]+/g,"");var c=parseBigInt(b,16);if(c.bitLength()>this.n.bitLength())return 0;var d=this.doPublic(c),e=d.toString(16).replace(/^1f+00/,""),f=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(0==f.length)return!1;var g=f[0],h=f[1],i=function(a){return KJUR.crypto.Util.hashString(a,g)},j=i(a);return h==j}function _rsasign_verifyWithMessageHash(a,b){b=b.replace(_RE_HEXDECONLY,""),b=b.replace(/[ \n]+/g,"");var c=parseBigInt(b,16);if(c.bitLength()>this.n.bitLength())return 0;var d=this.doPublic(c),e=d.toString(16).replace(/^1f+00/,""),f=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(0==f.length)return!1;var g=(f[0],f[1]);return g==a}function _rsasign_verifyStringPSS(a,b,c,d){var e=function(a){return KJUR.crypto.Util.hashHex(a,c)},f=e(rstrtohex(a));return void 0===d&&(d=-1),this.verifyWithMessageHashPSS(f,b,c,d)}function _rsasign_verifyWithMessageHashPSS(a,b,c,d){var e=new BigInteger(b,16);if(e.bitLength()>this.n.bitLength())return!1;var f,g=function(a){return KJUR.crypto.Util.hashHex(a,c)},h=hextorstr(a),i=h.length,j=this.n.bitLength()-1,k=Math.ceil(j/8);if(-1===d||void 0===d)d=i;else if(-2===d)d=k-i-2;else if(-2>d)throw"invalid salt length";if(i+d+2>k)throw"data too long";var l=this.doPublic(e).toByteArray();for(f=0;f>8*k-j&255;if(0!==(m.charCodeAt(0)&o))throw"bits beyond keysize not zero";var p=pss_mgf1_str(n,m.length,g),q=[];for(f=0;ff;f+=1)if(0!==q[f])throw"leftmost octets not zero";if(1!==q[r])throw"0x01 marker not found";return n===hextorstr(g(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+h+String.fromCharCode.apply(String,q.slice(-d)))))}function X509(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return a=a.replace(/(..)/g,"%$1"),a=decodeURIComponent(a)},this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return a=a.replace(/(..)/g,"%$1"),a=decodeURIComponent(a)},this.readCertPEM=function(a){var b=X509.pemToHex(a),c=X509.getPublicKeyHexArrayFromCertHex(b),d=new RSAKey;d.setPublic(c[0],c[1]),this.subjectPublicKeyRSA=d,this.subjectPublicKeyRSA_hN=c[0],this.subjectPublicKeyRSA_hE=c[1],this.hex=b},this.readCertPEMWithoutRSAInit=function(a){var b=X509.pemToHex(a),c=X509.getPublicKeyHexArrayFromCertHex(b);this.subjectPublicKeyRSA.setPublic(c[0],c[1]),this.subjectPublicKeyRSA_hN=c[0],this.subjectPublicKeyRSA_hE=c[1],this.hex=b}}function url_base64_decode(a){var b=a.replace(/-/g,"+").replace(/_/g,"/");switch(b.length%4){case 0:break;case 2:b+="==";break;case 3:b+="=";break;default:throw"Illegal base64url string!"}var c=window.atob(b);try{return decodeURIComponent(escape(c))}catch(d){return c}}var Zepto=function(){function a(a){return null==a?String(a):U[V.call(a)]||"object"}function b(b){return"function"==a(b)}function c(a){return null!=a&&a==a.window}function d(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function e(b){return"object"==a(b)}function f(a){return e(a)&&!c(a)&&Object.getPrototypeOf(a)==Object.prototype}function g(a){return"number"==typeof a.length}function h(a){return D.call(a,function(a){return null!=a})}function i(a){return a.length>0?x.fn.concat.apply([],a):a}function j(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function k(a){return a in G?G[a]:G[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function l(a,b){return"number"!=typeof b||H[j(a)]?b:b+"px"}function m(a){var b,c;return F[a]||(b=E.createElement(a),E.body.appendChild(b),c=getComputedStyle(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),"none"==c&&(c="block"),F[a]=c),F[a]}function n(a){return"children"in a?C.call(a.children):x.map(a.childNodes,function(a){return 1==a.nodeType?a:void 0})}function o(a,b,c){for(w in b)c&&(f(b[w])||Z(b[w]))?(f(b[w])&&!f(a[w])&&(a[w]={}),Z(b[w])&&!Z(a[w])&&(a[w]=[]),o(a[w],b[w],c)):b[w]!==v&&(a[w]=b[w])}function p(a,b){return null==b?x(a):x(a).filter(b)}function q(a,c,d,e){return b(c)?c.call(a,d,e):c}function r(a,b,c){null==c?a.removeAttribute(b):a.setAttribute(b,c)}function s(a,b){var c=a.className,d=c&&c.baseVal!==v;return b===v?d?c.baseVal:c:void(d?c.baseVal=b:a.className=b)}function t(a){var b;try{return a?"true"==a||("false"==a?!1:"null"==a?null:/^0/.test(a)||isNaN(b=Number(a))?/^[\[\{]/.test(a)?x.parseJSON(a):a:b):a}catch(c){return a}}function u(a,b){b(a);for(var c in a.childNodes)u(a.childNodes[c],b)}var v,w,x,y,z,A,B=[],C=B.slice,D=B.filter,E=window.document,F={},G={},H={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},I=/^\s*<(\w+|!)[^>]*>/,J=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,K=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,L=/^(?:body|html)$/i,M=/([A-Z])/g,N=["val","css","html","text","data","width","height","offset"],O=["after","prepend","before","append"],P=E.createElement("table"),Q=E.createElement("tr"),R={tr:E.createElement("tbody"),tbody:P,thead:P,tfoot:P,td:Q,th:Q,"*":E.createElement("div")},S=/complete|loaded|interactive/,T=/^[\w-]*$/,U={},V=U.toString,W={},X=E.createElement("div"),Y={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Z=Array.isArray||function(a){return a instanceof Array};return W.matches=function(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=X).appendChild(a),d=~W.qsa(e,b).indexOf(a),f&&X.removeChild(a),d},z=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},A=function(a){return D.call(a,function(b,c){return a.indexOf(b)==c})},W.fragment=function(a,b,c){var d,e,g;return J.test(a)&&(d=x(E.createElement(RegExp.$1))),d||(a.replace&&(a=a.replace(K,"<$1>")),b===v&&(b=I.test(a)&&RegExp.$1),b in R||(b="*"),g=R[b],g.innerHTML=""+a,d=x.each(C.call(g.childNodes),function(){g.removeChild(this)})),f(c)&&(e=x(d),x.each(c,function(a,b){N.indexOf(a)>-1?e[a](b):e.attr(a,b)})),d},W.Z=function(a,b){return a=a||[],a.__proto__=x.fn,a.selector=b||"",a},W.isZ=function(a){return a instanceof W.Z},W.init=function(a,c){var d;if(!a)return W.Z();if("string"==typeof a)if(a=a.trim(),"<"==a[0]&&I.test(a))d=W.fragment(a,RegExp.$1,c),a=null;else{if(c!==v)return x(c).find(a);d=W.qsa(E,a)}else{if(b(a))return x(E).ready(a);if(W.isZ(a))return a;if(Z(a))d=h(a);else if(e(a))d=[a],a=null;else if(I.test(a))d=W.fragment(a.trim(),RegExp.$1,c),a=null;else{if(c!==v)return x(c).find(a);d=W.qsa(E,a)}}return W.Z(d,a)},x=function(a,b){return W.init(a,b)},x.extend=function(a){var b,c=C.call(arguments,1);return"boolean"==typeof a&&(b=a,a=c.shift()),c.forEach(function(c){o(a,c,b)}),a},W.qsa=function(a,b){var c,e="#"==b[0],f=!e&&"."==b[0],g=e||f?b.slice(1):b,h=T.test(g);return d(a)&&h&&e?(c=a.getElementById(g))?[c]:[]:1!==a.nodeType&&9!==a.nodeType?[]:C.call(h&&!e?f?a.getElementsByClassName(g):a.getElementsByTagName(b):a.querySelectorAll(b))},x.contains=function(a,b){return a!==b&&a.contains(b)},x.type=a,x.isFunction=b,x.isWindow=c,x.isArray=Z,x.isPlainObject=f,x.isEmptyObject=function(a){var b;for(b in a)return!1;return!0},x.inArray=function(a,b,c){return B.indexOf.call(b,a,c)},x.camelCase=z,x.trim=function(a){return null==a?"":String.prototype.trim.call(a)},x.uuid=0,x.support={},x.expr={},x.map=function(a,b){var c,d,e,f=[];if(g(a))for(d=0;d=0?a:a+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(a){return B.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return b(a)?this.not(this.not(a)):x(D.call(this,function(b){return W.matches(b,a)}))},add:function(a,b){return x(A(this.concat(x(a,b))))},is:function(a){return this.length>0&&W.matches(this[0],a)},not:function(a){var c=[];if(b(a)&&a.call!==v)this.each(function(b){a.call(this,b)||c.push(this)});else{var d="string"==typeof a?this.filter(a):g(a)&&b(a.item)?C.call(a):x(a);this.forEach(function(a){d.indexOf(a)<0&&c.push(a)})}return x(c)},has:function(a){return this.filter(function(){return e(a)?x.contains(this,a):x(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!e(a)?a:x(a)},last:function(){var a=this[this.length-1];return a&&!e(a)?a:x(a)},find:function(a){var b,c=this;return b="object"==typeof a?x(a).filter(function(){var a=this;return B.some.call(c,function(b){return x.contains(b,a)})}):1==this.length?x(W.qsa(this[0],a)):this.map(function(){return W.qsa(this,a)})},closest:function(a,b){var c=this[0],e=!1;for("object"==typeof a&&(e=x(a));c&&!(e?e.indexOf(c)>=0:W.matches(c,a));)c=c!==b&&!d(c)&&c.parentNode;return x(c)},parents:function(a){for(var b=[],c=this;c.length>0;)c=x.map(c,function(a){return(a=a.parentNode)&&!d(a)&&b.indexOf(a)<0?(b.push(a),a):void 0});return p(b,a)},parent:function(a){return p(A(this.pluck("parentNode")),a)},children:function(a){return p(this.map(function(){return n(this)}),a)},contents:function(){return this.map(function(){return C.call(this.childNodes)})},siblings:function(a){return p(this.map(function(a,b){return D.call(n(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return x.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=m(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var c=b(a);if(this[0]&&!c)var d=x(a).get(0),e=d.parentNode||this.length>1;return this.each(function(b){x(this).wrapAll(c?a.call(this,b):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){x(this[0]).before(a=x(a));for(var b;(b=a.children()).length;)a=b.first();x(a).append(this)}return this},wrapInner:function(a){var c=b(a);return this.each(function(b){var d=x(this),e=d.contents(),f=c?a.call(this,b):a;e.length?e.wrapAll(f):d.append(f)})},unwrap:function(){return this.parent().each(function(){x(this).replaceWith(x(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(a){return this.each(function(){var b=x(this);(a===v?"none"==b.css("display"):a)?b.show():b.hide()})},prev:function(a){return x(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return x(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return 0===arguments.length?this.length>0?this[0].innerHTML:null:this.each(function(b){var c=this.innerHTML;x(this).empty().append(q(this,a,b,c))})},text:function(a){return 0===arguments.length?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=a===v?"":""+a})},attr:function(a,b){var c;return"string"==typeof a&&b===v?0==this.length||1!==this[0].nodeType?v:"value"==a&&"INPUT"==this[0].nodeName?this.val():!(c=this[0].getAttribute(a))&&a in this[0]?this[0][a]:c:this.each(function(c){if(1===this.nodeType)if(e(a))for(w in a)r(this,w,a[w]);else r(this,a,q(this,b,c,this.getAttribute(a)))})},removeAttr:function(a){return this.each(function(){1===this.nodeType&&r(this,a)})},prop:function(a,b){return a=Y[a]||a,b===v?this[0]&&this[0][a]:this.each(function(c){this[a]=q(this,b,c,this[a])})},data:function(a,b){var c=this.attr("data-"+a.replace(M,"-$1").toLowerCase(),b);return null!==c?t(c):v},val:function(a){return 0===arguments.length?this[0]&&(this[0].multiple?x(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(b){this.value=q(this,a,b,this.value)})},offset:function(a){if(a)return this.each(function(b){var c=x(this),d=q(this,a,b,c.offset()),e=c.offsetParent().offset(),f={top:d.top-e.top,left:d.left-e.left};"static"==c.css("position")&&(f.position="relative"),c.css(f)});if(0==this.length)return null;var b=this[0].getBoundingClientRect();return{left:b.left+window.pageXOffset,top:b.top+window.pageYOffset,width:Math.round(b.width),height:Math.round(b.height)}},css:function(b,c){if(arguments.length<2){var d=this[0],e=getComputedStyle(d,"");if(!d)return;if("string"==typeof b)return d.style[z(b)]||e.getPropertyValue(b);if(Z(b)){var f={};return x.each(Z(b)?b:[b],function(a,b){f[b]=d.style[z(b)]||e.getPropertyValue(b)}),f}}var g="";if("string"==a(b))c||0===c?g=j(b)+":"+l(b,c):this.each(function(){this.style.removeProperty(j(b))});else for(w in b)b[w]||0===b[w]?g+=j(w)+":"+l(w,b[w])+";":this.each(function(){this.style.removeProperty(j(w))});return this.each(function(){this.style.cssText+=";"+g})},index:function(a){return a?this.indexOf(x(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return a?B.some.call(this,function(a){return this.test(s(a))},k(a)):!1},addClass:function(a){return a?this.each(function(b){y=[];var c=s(this),d=q(this,a,b,c);d.split(/\s+/g).forEach(function(a){x(this).hasClass(a)||y.push(a)},this),y.length&&s(this,c+(c?" ":"")+y.join(" "))}):this},removeClass:function(a){return this.each(function(b){return a===v?s(this,""):(y=s(this),q(this,a,b,y).split(/\s+/g).forEach(function(a){y=y.replace(k(a)," ")}),void s(this,y.trim()))})},toggleClass:function(a,b){return a?this.each(function(c){var d=x(this),e=q(this,a,c,s(this));e.split(/\s+/g).forEach(function(a){(b===v?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})}):this},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===v?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a===v?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=L.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(x(a).css("margin-top"))||0,c.left-=parseFloat(x(a).css("margin-left"))||0,d.top+=parseFloat(x(b[0]).css("border-top-width"))||0,d.left+=parseFloat(x(b[0]).css("border-left-width"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||E.body;a&&!L.test(a.nodeName)&&"static"==x(a).css("position");)a=a.offsetParent;return a})}},x.fn.detach=x.fn.remove,["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});x.fn[a]=function(e){var f,g=this[0];return e===v?c(g)?g["inner"+b]:d(g)?g.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){g=x(this),g.css(a,q(this,e,b,g[a]()))})}}),O.forEach(function(b,c){var d=c%2;x.fn[b]=function(){var b,e,f=x.map(arguments,function(c){return b=a(c),"object"==b||"array"==b||null==c?c:W.fragment(c)}),g=this.length>1;return f.length<1?this:this.each(function(a,b){e=d?b:b.parentNode,b=0==c?b.nextSibling:1==c?b.firstChild:2==c?b:null,f.forEach(function(a){if(g)a=a.cloneNode(!0);else if(!e)return x(a).remove();u(e.insertBefore(a,b),function(a){null==a.nodeName||"SCRIPT"!==a.nodeName.toUpperCase()||a.type&&"text/javascript"!==a.type||a.src||window.eval.call(window,a.innerHTML)})})})},x.fn[d?b+"To":"insert"+(c?"Before":"After")]=function(a){return x(a)[b](this),this}}),W.Z.prototype=x.fn,W.uniq=A,W.deserializeValue=t,x.zepto=W,x}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(a){function b(a){return a._zid||(a._zid=m++)}function c(a,c,f,g){if(c=d(c),c.ns)var h=e(c.ns);return(q[b(a)]||[]).filter(function(a){return!(!a||c.e&&a.e!=c.e||c.ns&&!h.test(a.ns)||f&&b(a.fn)!==b(f)||g&&a.sel!=g)})}function d(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function e(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function f(a,b){return a.del&&!s&&a.e in t||!!b}function g(a){return u[a]||s&&t[a]||a}function h(c,e,h,i,k,m,n){var o=b(c),p=q[o]||(q[o]=[]);e.split(/\s/).forEach(function(b){if("ready"==b)return a(document).ready(h);var e=d(b);e.fn=h,e.sel=k,e.e in u&&(h=function(b){var c=b.relatedTarget;return!c||c!==this&&!a.contains(this,c)?e.fn.apply(this,arguments):void 0}),e.del=m;var o=m||h;e.proxy=function(a){if(a=j(a),!a.isImmediatePropagationStopped()){a.data=i;var b=o.apply(c,a._args==l?[a]:[a].concat(a._args));return b===!1&&(a.preventDefault(),a.stopPropagation()),b}},e.i=p.length,p.push(e),"addEventListener"in c&&c.addEventListener(g(e.e),e.proxy,f(e,n))})}function i(a,d,e,h,i){var j=b(a);(d||"").split(/\s/).forEach(function(b){c(a,b,e,h).forEach(function(b){delete q[j][b.i],"removeEventListener"in a&&a.removeEventListener(g(b.e),b.proxy,f(b,i))})})}function j(b,c){return(c||!b.isDefaultPrevented)&&(c||(c=b),a.each(y,function(a,d){var e=c[a];b[a]=function(){return this[d]=v,e&&e.apply(c,arguments)},b[d]=w}),(c.defaultPrevented!==l?c.defaultPrevented:"returnValue"in c?c.returnValue===!1:c.getPreventDefault&&c.getPreventDefault())&&(b.isDefaultPrevented=v)),b}function k(a){var b,c={originalEvent:a};for(b in a)x.test(b)||a[b]===l||(c[b]=a[b]);return j(c,a)}var l,m=1,n=Array.prototype.slice,o=a.isFunction,p=function(a){return"string"==typeof a},q={},r={},s="onfocusin"in window,t={focus:"focusin",blur:"focusout"},u={mouseenter:"mouseover",mouseleave:"mouseout"};r.click=r.mousedown=r.mouseup=r.mousemove="MouseEvents",a.event={add:h,remove:i},a.proxy=function(c,d){if(o(c)){var e=function(){return c.apply(d,arguments)};return e._zid=b(c),e}if(p(d))return a.proxy(c[d],c);throw new TypeError("expected function")},a.fn.bind=function(a,b,c){return this.on(a,b,c)},a.fn.unbind=function(a,b){return this.off(a,b)},a.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var v=function(){return!0},w=function(){return!1},x=/^([A-Z]|returnValue$|layer[XY]$)/,y={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};a.fn.delegate=function(a,b,c){return this.on(b,a,c)},a.fn.undelegate=function(a,b,c){return this.off(b,a,c)},a.fn.live=function(b,c){return a(document.body).delegate(this.selector,b,c),this},a.fn.die=function(b,c){return a(document.body).undelegate(this.selector,b,c),this},a.fn.on=function(b,c,d,e,f){var g,j,m=this;return b&&!p(b)?(a.each(b,function(a,b){m.on(a,c,d,b,f)}),m):(p(c)||o(e)||e===!1||(e=d,d=c,c=l),(o(d)||d===!1)&&(e=d,d=l),e===!1&&(e=w),m.each(function(l,m){f&&(g=function(a){return i(m,a.type,e),e.apply(this,arguments)}),c&&(j=function(b){var d,f=a(b.target).closest(c,m).get(0);return f&&f!==m?(d=a.extend(k(b),{currentTarget:f,liveFired:m}),(g||e).apply(f,[d].concat(n.call(arguments,1)))):void 0}),h(m,b,e,d,c,j||g)}))},a.fn.off=function(b,c,d){var e=this;return b&&!p(b)?(a.each(b,function(a,b){e.off(a,c,b)}),e):(p(c)||o(d)||d===!1||(d=c,c=l),d===!1&&(d=w),e.each(function(){i(this,b,d,c)}))},a.fn.trigger=function(b,c){return b=p(b)||a.isPlainObject(b)?a.Event(b):j(b),b._args=c,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(b):a(this).triggerHandler(b,c)})},a.fn.triggerHandler=function(b,d){var e,f;return this.each(function(g,h){e=k(p(b)?a.Event(b):b),e._args=d,e.target=h,a.each(c(h,b.type||b),function(a,b){return f=b.proxy(e),e.isImmediatePropagationStopped()?!1:void 0})}),f},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)}}),["focus","blur"].forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.each(function(){try{this[b]()}catch(a){}}),this}}),a.Event=function(a,b){p(a)||(b=a,a=b.type);var c=document.createEvent(r[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),j(c)}}(Zepto),function(a){function b(b,c,d){var e=a.Event(c);return a(b).trigger(e,d),!e.isDefaultPrevented()}function c(a,c,d,e){return a.global?b(c||s,d,e):void 0}function d(b){b.global&&0===a.active++&&c(b,null,"ajaxStart")}function e(b){b.global&&!--a.active&&c(b,null,"ajaxStop")}function f(a,b){var d=b.context;return b.beforeSend.call(d,a,b)===!1||c(b,d,"ajaxBeforeSend",[a,b])===!1?!1:void c(b,d,"ajaxSend",[a,b])}function g(a,b,d,e){var f=d.context,g="success";d.success.call(f,a,g,b),e&&e.resolveWith(f,[a,g,b]),c(d,f,"ajaxSuccess",[b,d,a]),i(g,b,d)}function h(a,b,d,e,f){var g=e.context;e.error.call(g,d,b,a),f&&f.rejectWith(g,[d,b,a]),c(e,g,"ajaxError",[d,e,a||b]),i(b,d,e)}function i(a,b,d){var f=d.context;d.complete.call(f,b,a),c(d,f,"ajaxComplete",[b,d]),e(d)}function j(){}function k(a){return a&&(a=a.split(";",2)[0]),a&&(a==x?"html":a==w?"json":u.test(a)?"script":v.test(a)&&"xml")||"text"}function l(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function m(b){b.processData&&b.data&&"string"!=a.type(b.data)&&(b.data=a.param(b.data,b.traditional)),!b.data||b.type&&"GET"!=b.type.toUpperCase()||(b.url=l(b.url,b.data),b.data=void 0)}function n(b,c,d,e){return a.isFunction(c)&&(e=d,d=c,c=void 0),a.isFunction(d)||(e=d,d=void 0),{url:b,data:c,success:d,dataType:e}}function o(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,i){f=a.type(i),e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]"),!e&&g?b.add(i.name,i.value):"array"==f||!d&&"object"==f?o(b,i,d,c):b.add(c,i)})}var p,q,r=0,s=window.document,t=/)<[^<]*)*<\/script>/gi,u=/^(?:text|application)\/javascript/i,v=/^(?:text|application)\/xml/i,w="application/json",x="text/html",y=/^\s*$/;a.active=0,a.ajaxJSONP=function(b,c){if(!("type"in b))return a.ajax(b);var d,e,i=b.jsonpCallback,j=(a.isFunction(i)?i():i)||"jsonp"+ ++r,k=s.createElement("script"),l=window[j],m=function(b){a(k).triggerHandler("error",b||"abort")},n={abort:m};return c&&c.promise(n),a(k).on("load error",function(f,i){clearTimeout(e),a(k).off().remove(),"error"!=f.type&&d?g(d[0],n,b,c):h(null,i||"error",n,b,c),window[j]=l,d&&a.isFunction(l)&&l(d[0]),l=d=void 0}),f(n,b)===!1?(m("abort"),n):(window[j]=function(){d=arguments},k.src=b.url.replace(/\?(.+)=\?/,"?$1="+j),s.head.appendChild(k),b.timeout>0&&(e=setTimeout(function(){m("timeout")},b.timeout)),n)},a.ajaxSettings={type:"GET",beforeSend:j,success:j,error:j,complete:j,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:w,xml:"application/xml, text/xml",html:x,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},a.ajax=function(b){var c=a.extend({},b||{}),e=a.Deferred&&a.Deferred();for(p in a.ajaxSettings)void 0===c[p]&&(c[p]=a.ajaxSettings[p]);d(c),c.crossDomain||(c.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(c.url)&&RegExp.$2!=window.location.host),c.url||(c.url=window.location.toString()),m(c),c.cache===!1&&(c.url=l(c.url,"_="+Date.now()));var i=c.dataType,n=/\?.+=\?/.test(c.url);if("jsonp"==i||n)return n||(c.url=l(c.url,c.jsonp?c.jsonp+"=?":c.jsonp===!1?"":"callback=?")),a.ajaxJSONP(c,e);var o,r=c.accepts[i],s={},t=function(a,b){s[a.toLowerCase()]=[a,b]},u=/^([\w-]+:)\/\//.test(c.url)?RegExp.$1:window.location.protocol,v=c.xhr(),w=v.setRequestHeader;if(e&&e.promise(v),c.crossDomain||t("X-Requested-With","XMLHttpRequest"),t("Accept",r||"*/*"),(r=c.mimeType||r)&&(r.indexOf(",")>-1&&(r=r.split(",",2)[0]),v.overrideMimeType&&v.overrideMimeType(r)),(c.contentType||c.contentType!==!1&&c.data&&"GET"!=c.type.toUpperCase())&&t("Content-Type",c.contentType||"application/x-www-form-urlencoded"),c.headers)for(q in c.headers)t(q,c.headers[q]);if(v.setRequestHeader=t,v.onreadystatechange=function(){if(4==v.readyState){v.onreadystatechange=j,clearTimeout(o);var b,d=!1;if(v.status>=200&&v.status<300||304==v.status||0==v.status&&"file:"==u){i=i||k(c.mimeType||v.getResponseHeader("content-type")),b=v.responseText;try{"script"==i?(1,eval)(b):"xml"==i?b=v.responseXML:"json"==i&&(b=y.test(b)?null:a.parseJSON(b))}catch(f){d=f}d?h(d,"parsererror",v,c,e):g(b,v,c,e)}else h(v.statusText||null,v.status?"error":"abort",v,c,e)}},f(v,c)===!1)return v.abort(),h(null,"abort",v,c,e),v;if(c.xhrFields)for(q in c.xhrFields)v[q]=c.xhrFields[q];var x="async"in c?c.async:!0;v.open(c.type,c.url,x,c.username,c.password);for(q in s)w.apply(v,s[q]);return c.timeout>0&&(o=setTimeout(function(){v.onreadystatechange=j,v.abort(),h(null,"timeout",v,c,e)},c.timeout)),v.send(c.data?c.data:null),v},a.get=function(){return a.ajax(n.apply(null,arguments))},a.post=function(){var b=n.apply(null,arguments);return b.type="POST",a.ajax(b)},a.getJSON=function(){var b=n.apply(null,arguments);return b.dataType="json",a.ajax(b)},a.fn.load=function(b,c,d){if(!this.length)return this;var e,f=this,g=b.split(/\s/),h=n(b,c,d),i=h.success;return g.length>1&&(h.url=g[0],e=g[1]),h.success=function(b){f.html(e?a("
").html(b.replace(t,"")).find(e):b),i&&i.apply(f,arguments)},a.ajax(h),this};var z=encodeURIComponent;a.param=function(a,b){var c=[];return c.add=function(a,b){this.push(z(a)+"="+z(b))},o(c,a,b),c.join("&").replace(/%20/g,"+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b,c=[];return a([].slice.call(this.get(0).elements)).each(function(){b=a(this);var d=b.attr("type");"fieldset"!=this.nodeName.toLowerCase()&&!this.disabled&&"submit"!=d&&"reset"!=d&&"button"!=d&&("radio"!=d&&"checkbox"!=d||this.checked)&&c.push({name:b.attr("name"),value:b.val()})}),c},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),function(a){"__proto__"in{}||a.extend(a.zepto,{Z:function(b,c){return b=b||[],a.extend(b,a.fn),b.selector=c||"",b.__Z=!0,b},isZ:function(b){return"array"===a.type(b)&&"__Z"in b}});try{getComputedStyle(void 0)}catch(b){var c=getComputedStyle;window.getComputedStyle=function(a){try{return c(a)}catch(b){return null}}}}(Zepto);var jsonlint=function(){var a={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:this.$=a.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\v/g," ").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(a);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=f[h-1];case 13:this.$={};break;case 14:this.$=f[h-1];break;case 15:this.$=[f[h-2],f[h]];break;case 16:this.$={},this.$[f[h][0]]=f[h][1];break;case 17:this.$=f[h-2],f[h-2][f[h][0]]=f[h][1];break;case 18:this.$=[];break;case 19:this.$=f[h-1];break;case 20:this.$=[f[h]];break;case 21:this.$=f[h-2],f[h-2].push(f[h])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2, +15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(a){e.length=e.length-2*a,f.length=f.length-a,g.length=g.length-a}function c(){var a;return a=d.lexer.lex()||1,"number"!=typeof a&&(a=d.symbols_[a]||a),a}var d=this,e=[0],f=[null],g=[],h=this.table,i="",j=0,k=0,l=0,m=2,n=1;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;g.push(o),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var p,q,r,s,t,u,v,w,x,y={};;){if(r=e[e.length-1],this.defaultActions[r]?s=this.defaultActions[r]:(null==p&&(p=c()),s=h[r]&&h[r][p]),"undefined"==typeof s||!s.length||!s[0]){if(!l){x=[];for(u in h[r])this.terminals_[u]&&u>2&&x.push("'"+this.terminals_[u]+"'");var z="";z=this.lexer.showPosition?"Parse error on line "+(j+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[p]+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(z,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:o,expected:x})}if(3==l){if(p==n)throw new Error(z||"Parsing halted.");k=this.lexer.yyleng,i=this.lexer.yytext,j=this.lexer.yylineno,o=this.lexer.yylloc,p=c()}for(;;){if(m.toString()in h[r])break;if(0==r)throw new Error(z||"Parsing halted.");b(1),r=e[e.length-1]}q=p,p=m,r=e[e.length-1],s=h[r]&&h[r][m],l=3}if(s[0]instanceof Array&&s.length>1)throw new Error("Parse Error: multiple actions possible at state: "+r+", token: "+p);switch(s[0]){case 1:e.push(p),f.push(this.lexer.yytext),g.push(this.lexer.yylloc),e.push(s[1]),p=null,q?(p=q,q=null):(k=this.lexer.yyleng,i=this.lexer.yytext,j=this.lexer.yylineno,o=this.lexer.yylloc,l>0&&l--);break;case 2:if(v=this.productions_[s[1]][1],y.$=f[f.length-v],y._$={first_line:g[g.length-(v||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(v||1)].first_column,last_column:g[g.length-1].last_column},t=this.performAction.call(y,i,k,j,this.yy,s[1],f,g),"undefined"!=typeof t)return t;v&&(e=e.slice(0,-1*v*2),f=f.slice(0,-1*v),g=g.slice(0,-1*v)),e.push(this.productions_[s[1]][0]),f.push(y.$),g.push(y._$),w=h[e[e.length-2]][e[e.length-1]],e.push(w);break;case 3:return!0}}return!0}},b=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parseError)throw new Error(a);this.yy.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.match+=a,this.matched+=a;var b=a.match(/\n/);return b&&this.yylineno++,this._input=this._input.slice(1),a},unput:function(a){return this._input=a+this._input,this},more:function(){return this._more=!0,this},less:function(a){this._input=this.match.slice(a)+this._input},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/\n.*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-1:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){switch(c){case 0:break;case 1:return 6;case 2:return b.yytext=b.yytext.substr(1,b.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},a.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],a.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}},a}();return a.lexer=b,a}();"undefined"!=typeof require&&"undefined"!=typeof exports&&(exports.parser=jsonlint,exports.parse=function(){return jsonlint.parse.apply(jsonlint,arguments)},exports.main=function(a){if(!a[1])throw new Error("Usage: "+a[0]+" FILE");if("undefined"!=typeof process)var b=require("fs").readFileSync(require("path").join(process.cwd(),a[1]),"utf8");else var c=require("file").path(require("file").cwd()),b=c.join(a[1]).read({charset:"utf-8"});return exports.parser.parse(b)},"undefined"!=typeof module&&require.main===module&&exports.main("undefined"!=typeof process?process.argv.slice(1):require("system").args));var jsonParse=function(){function a(a,b,c){return b?g[b]:String.fromCharCode(parseInt(c,16))}var b="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",c='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',d='(?:"'+c+'*")',e=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+b+"|"+d+")","g"),f=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),g={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},h=new String(""),i="\\",j=({"{":Object,"[":Array},Object.hasOwnProperty);return function(b,c){var d,g=b.match(e),k=g[0],l=!1;"{"===k?d={}:"["===k?d=[]:(d=[],l=!0);for(var m,n=[d],o=1-l,p=g.length;p>o;++o){k=g[o];var q;switch(k.charCodeAt(0)){default:q=n[0],q[m||q.length]=+k,m=void 0;break;case 34:if(k=k.substring(1,k.length-1),-1!==k.indexOf(i)&&(k=k.replace(f,a)),q=n[0],!m){if(!(q instanceof Array)){m=k||h;break}m=q.length}q[m]=k,m=void 0;break;case 91:q=n[0],n.unshift(q[m||q.length]=[]),m=void 0;break;case 93:n.shift();break;case 102:q=n[0],q[m||q.length]=!1,m=void 0;break;case 110:q=n[0],q[m||q.length]=null,m=void 0;break;case 116:q=n[0],q[m||q.length]=!0,m=void 0;break;case 123:q=n[0],n.unshift(q[m||q.length]={}),m=void 0;break;case 125:n.shift()}}if(l){if(1!==n.length)throw new Error;d=d[0]}else if(n.length)throw new Error;if(c){var r=function(a,b){var d=a[b];if(d&&"object"==typeof d){var e=null;for(var f in d)if(j.call(d,f)&&d!==a){var g=r(d,f);void 0!==g?d[f]=g:(e||(e=[]),e.push(f))}if(e)for(var h=e.length;--h>=0;)delete d[e[h]]}return c.call(a,b,d)};d=r({"":d},"")}return d}}();if(function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d||{};for(var e in _e)d.hasOwnProperty(e)||(d[e]=_e[e]);n(d);var f=d.value;"string"==typeof f&&(f=new yf(f,d.mode));var g=this.display=new b(c,f);g.wrapper.CodeMirror=this,k(this),i(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Fe&&lb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Md},pe&&setTimeout(Ud(kb,this,!0),20),ob(this);var h=this;Wa(this,function(){h.curOp.forceUpdate=!0,gd(h,f),d.autofocus&&!Fe||$d()==g.input?setTimeout(Ud(Jb,h),20):Kb(h);for(var a in af)af.hasOwnProperty(a)&&af[a](h,d[a],bf);for(var b=0;bb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Qd(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display.scroller;return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,barWidth:a.display.scrollbarH.clientWidth,docHeight:a.doc.height+va(a.display)}}function p(a,b){b||(b=o(a));var c=a.display,d=b.docHeight+Jf,e=b.scrollWidth>b.clientWidth,f=d>b.clientHeight;if(f?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=e?_d(c.measure)+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,d-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0"),e?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=f?_d(c.measure)+"px":"0",c.scrollbarH.firstChild.style.width=b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0"),e&&f?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=_d(c.measure)+"px"):c.scrollbarFiller.style.display="",e&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=_d(c.measure)+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="",Be&&0===_d(c.measure)){c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=Ce?"18px":"12px";var g=function(b){Fd(b)!=c.scrollbarV&&Fd(b)!=c.scrollbarH&&Xa(a,rb)(b)};Ff(c.scrollbarV,"mousedown",g),Ff(c.scrollbarH,"mousedown",g)}}function q(a,b,c){var d=c&&null!=c.top?c.top:a.scroller.scrollTop;d=Math.floor(d-ua(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=md(b,d),g=md(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;if(f>h)return{from:h,to:md(b,nd(hd(b,h))+a.wrapper.clientHeight)};if(Math.min(i,b.lastLine())>=g)return{from:md(b,nd(hd(b,i))-a.wrapper.clientHeight),to:i}}return{from:f,to:g}}function r(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=u(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=a.display.viewFrom&&g.to<=a.display.viewTo)break}return a.display.updateLineNumbers=null,d&&(Hd(a,"update",a),(a.display.viewFrom!=e||a.display.viewTo!=f)&&Hd(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)),d}function w(a,b,c){var d=a.display,e=a.doc;if(!d.wrapper.offsetWidth)return void cb(a);if(!(!c&&b.from>=d.viewFrom&&b.to<=d.viewTo&&0==gb(a))){s(a)&&cb(a);var f=B(a),g=e.first+e.size,h=Math.max(b.from-a.options.viewportMargin,e.first),i=Math.min(g,b.to+a.options.viewportMargin);d.viewFromi&&d.viewTo-i<20&&(i=Math.min(g,d.viewTo)),Me&&(h=Jc(a.doc,h),i=Kc(a.doc,i));var j=h!=d.viewFrom||i!=d.viewTo||d.lastSizeC!=d.wrapper.clientHeight;fb(a,h,i),d.viewOffset=nd(hd(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var k=gb(a);if(j||0!=k||c){var l=$d();return k>4&&(d.lineDiv.style.display="none"),C(a,d.updateLineNumbers,f),k>4&&(d.lineDiv.style.display=""),l&&$d()!=l&&l.offsetHeight&&l.focus(),Yd(d.cursorDiv),Yd(d.selectionDiv),j&&(d.lastSizeC=d.wrapper.clientHeight,qa(a,400)),z(a),!0}}}function x(a){var b=a.display,c=Aa(a,b.maxLine,b.maxLine.text.length).left;b.maxLineChanged=!1;var d=Math.max(0,c+3),e=Math.max(0,b.sizer.offsetLeft+d+Jf-b.scroller.clientWidth);b.sizer.style.minWidth=d+"px",ee&&(e=Sa(b)),(i>.001||-.001>i)&&(kd(f.line,e),A(f.line),f.rest))for(var j=0;j=b&&l.lineNumber;l.changes&&(Qd(l.changes,"gutter")>-1&&(m=!1),D(a,l,j,c)),m&&(Yd(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(t(a.options,j)))),h=l.node.nextSibling}else{var n=L(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function D(a,b,c,d){for(var e=0;e=0){var g=R(f.from(),e.from()),h=Q(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new T(i?h:g,i?g:h))}}return new S(a,b)}function V(a,b){return new S([new T(a,b||a)],0)}function W(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function X(a,b){if(b.linec?Ne(c,hd(a,c).text.length):Y(b,hd(a,b.line).text.length)}function Y(a,b){var c=a.ch;return null==c||c>b?Ne(a.line,b):0>c?Ne(a.line,0):a}function Z(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(Hf(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==Oe(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?X(a,Ne(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),h.appendChild(Xd("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return Ma(a,Ne(b,c),"div",l,d)}var h,i,l=hd(g,b),m=l.text.length;return ce(od(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottomi.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=wa(a.display),j=i.left,k=f.lineSpace.offsetWidth-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=hd(g,l.line),o=hd(g,m.line),p=Hc(n)==Hc(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top0&&(b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function qa(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=hf(b.mode,ta(a,b.frontier));Wa(a,function(){b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(e){if(b.frontier>=a.display.viewFrom){var f=e.styles;e.styles=Sc(a,e,d,!0);for(var g=!f||f.length!=e.styles.length,h=0;!g&&hc?(qa(a,a.options.workDelay),!0):void 0})})}}function sa(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=hd(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Of(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function ta(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=sa(a,b,c),g=f>d.first&&hd(d,f-1).stateAfter;return g=g?hf(d.mode,g):jf(d.mode),d.iter(f,b,function(c){Uc(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top); +}}f.push(c.bottom-c.top)}}function ya(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function za(a,b){b=Hc(b);var c=ld(b),d=a.display.externalMeasured=new $a(a.doc,b,c);d.lineN=c;var e=d.built=Wc(a,d);return d.text=e.pre,Zd(a.display.lineMeasure,e.pre),d}function Aa(a,b,c,d){return Da(a,Ca(a,b),c,d)}function Ba(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bc?(f=0,g=1,h="left"):l>c?(f=c-k,g=f+1):(j==i.length-3||c==l&&i[j+3]>c)&&(g=l-k,f=g-1,c>=l&&(h="right")),null!=f){if(e=i[j+2],k==l&&d==(e.insertLeft?"left":"right")&&(h=d),"left"==d&&0==f)for(;j&&i[j-2]==i[j-3]&&i[j-1].insertLeft;)e=i[(j-=3)+2],h="left";if("right"==d&&f==l-k)for(;jk+g&&Wd(b.line.text.charAt(k+g));)++g;if(re&&0==f&&g==l-k)m=e.parentNode.getBoundingClientRect();else if(ue&&a.options.lineWrapping){var n=Rf(e,f,g).getClientRects();m=n.length?n["right"==d?n.length-1:0]:Se}else m=Rf(e,f,g).getBoundingClientRect()}else{f>0&&(h=d="right");var n;m=a.options.lineWrapping&&(n=e.getClientRects()).length>1?n["right"==d?n.length-1:0]:e.getBoundingClientRect()}if(re&&!f&&(!m||!m.left&&!m.right)){var o=e.parentNode.getClientRects()[0];m=o?{left:o.left,right:o.left+Ta(a.display),top:o.top,bottom:o.bottom}:Se}for(var p,q=(m.bottom+m.top)/2-b.rect.top,r=b.view.measure.heights,j=0;jc.from?f(a-1):f(a,d)}d=d||hd(a.doc,b.line),e||(e=Ca(a,d));var h=od(d),i=b.ch;if(!h)return f(i);var j=ke(h,i),k=g(i,j);return null!=bg&&(k.other=g(i,bg)),k}function Oa(a,b){var c=0,b=X(a.doc,b);a.options.lineWrapping||(c=Ta(a.display)*b.ch);var d=hd(a.doc,b.line),e=nd(d)+ua(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function Pa(a,b,c,d){var e=Ne(a,b);return e.xRel=d,c&&(e.outside=!0),e}function Qa(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return Pa(d.first,0,!0,-1);var e=md(d,c),f=d.first+d.size-1;if(e>f)return Pa(d.first+d.size-1,hd(d,f).text.length,!0,1);0>b&&(b=0);for(var g=hd(d,e);;){var h=Ra(a,g,e,b,c),i=Fc(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=ld(g=j.to.line)}}function Ra(a,b,c,d,e){function f(d){var e=Na(a,Ne(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:gq)return Pa(c,n,r,1);for(;;){if(k?n==m||n==me(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Wd(b.text.charAt(s));)++s;var u=Pa(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=me(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function Sa(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Pe){Pe=Xd("pre");for(var b=0;49>b;++b)Pe.appendChild(document.createTextNode("x")),Pe.appendChild(Xd("br"));Pe.appendChild(document.createTextNode("x"))}Zd(a.measure,Pe);var c=Pe.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Yd(a.measure),c||1}function Ta(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Xd("span","xxxxxxxxxx"),c=Xd("pre",[b]);Zd(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function Ua(a){a.curOp={viewChanged:!1,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivity:!1,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Te},If++||(Bf=[])}function Va(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&m(a),b.viewChanged||b.forceUpdate||null!=b.scrollTop||b.scrollToPos&&(b.scrollToPos.from.line=d.viewTo)||d.maxLineChanged&&a.options.lineWrapping){var e=v(a,{top:b.scrollTop,ensure:b.scrollToPos},b.forceUpdate);a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)}if(!e&&b.selectionChanged&&ma(a),null!=b.scrollTop&&d.scroller.scrollTop!=b.scrollTop){var f=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,b.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f}if(null!=b.scrollLeft&&d.scroller.scrollLeft!=b.scrollLeft){var g=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,b.scrollLeft));d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g,r(a)}if(b.scrollToPos){var h=$b(a,X(a.doc,b.scrollToPos.from),X(a.doc,b.scrollToPos.to),b.scrollToPos.margin);b.scrollToPos.isCursor&&a.state.focused&&Zb(a,h)}b.selectionChanged&&pa(a),a.state.focused&&b.updateInput&&kb(a,b.typing);var i=b.maybeHiddenMarkers,j=b.maybeUnhiddenMarkers;if(i)for(var k=0;kf;f=d){var g=new $a(a.doc,hd(a.doc,f),f);d=f+g.size,e.push(g)}return e}function ab(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Me&&Jc(a.doc,b)e.viewFrom?cb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)cb(a);else if(b<=e.viewFrom){var f=eb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):cb(a)}else if(c>=e.viewTo){var f=eb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):cb(a)}else{var g=eb(a,b,b,-1),h=eb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(_a(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):cb(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[db(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Qd(g,c)&&g.push(c)}}}function cb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function db(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function eb(a,b,c,d){var e,f=db(a,b),g=a.display.view;if(!Me)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;Jc(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function fb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=_a(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=_a(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,db(a,c)))),d.viewTo=c}function gb(a){for(var b=a.display.view,c=0,d=0;dg&&c.charCodeAt(g)==e.charCodeAt(g);)++g;for(var i=e.slice(g),j=Zf(i),k=a.state.pasteIncoming&&j.length>1&&d.sel.ranges.length==j.length,l=d.sel.ranges.length-1;l>=0;l--){var m=d.sel.ranges[l],n=m.from(),o=m.to();g-1){ec(a,m.head.line,"smart");break}}}return cc(a),a.curOp.updateInput=p,a.curOp.typing=!0,e.length>1e3||e.indexOf("\n")>-1?b.value=a.display.prevInput="":a.display.prevInput=e,f&&Va(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function kb(a,b){var c,d,e=a.doc;if(a.somethingSelected()){a.display.prevInput="";var f=e.sel.primary();c=_f&&(f.to().line-f.from().line>100||(d=a.getSelection()).length>1e3);var g=c?"-":d||a.getSelection();a.display.input.value=g,a.state.focused&&Qf(a.display.input),ue&&!re&&(a.display.inputHasSelection=g)}else b||(a.display.prevInput=a.display.input.value="",ue&&!re&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function lb(a){"nocursor"==a.options.readOnly||Fe&&$d()==a.display.input||a.display.input.focus()}function mb(a){a.state.focused||(lb(a),Jb(a))}function nb(a){return a.options.readOnly||a.doc.cantEdit}function ob(a){function b(){a.state.focused&&setTimeout(Ud(lb,a),0)}function c(){null==h&&(h=setTimeout(function(){h=null,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=Vf=null,a.setSize()},100))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5e3):Gf(window,"resize",c)}function e(b){Jd(a,b)||Ef(b)}function f(b){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),Qf(g.input)),"cut"==b.type&&(a.state.cutIncoming=!0)}var g=a.display;Ff(g.scroller,"mousedown",Xa(a,rb)),pe?Ff(g.scroller,"dblclick",Xa(a,function(b){if(!Jd(a,b)){var c=qb(a,b);if(c&&!wb(a,b)&&!pb(a.display,b)){Cf(b);var d=jc(a.doc,c);aa(a.doc,d.anchor,d.head)}}})):Ff(g.scroller,"dblclick",function(b){Jd(a,b)||Cf(b)}),Ff(g.lineSpace,"selectstart",function(a){pb(g,a)||Cf(a)}),Ke||Ff(g.scroller,"contextmenu",function(b){Lb(a,b)}),Ff(g.scroller,"scroll",function(){g.scroller.clientHeight&&(zb(a,g.scroller.scrollTop),Ab(a,g.scroller.scrollLeft,!0),Hf(a,"scroll",a))}),Ff(g.scrollbarV,"scroll",function(){g.scroller.clientHeight&&zb(a,g.scrollbarV.scrollTop)}),Ff(g.scrollbarH,"scroll",function(){g.scroller.clientHeight&&Ab(a,g.scrollbarH.scrollLeft)}),Ff(g.scroller,"mousewheel",function(b){Bb(a,b)}),Ff(g.scroller,"DOMMouseScroll",function(b){Bb(a,b)}),Ff(g.scrollbarH,"mousedown",b),Ff(g.scrollbarV,"mousedown",b),Ff(g.wrapper,"scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});var h;Ff(window,"resize",c),setTimeout(d,5e3),Ff(g.input,"keyup",Xa(a,Hb)),Ff(g.input,"input",function(){ue&&!re&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),ib(a)}),Ff(g.input,"keydown",Xa(a,Gb)),Ff(g.input,"keypress",Xa(a,Ib)),Ff(g.input,"focus",Ud(Jb,a)),Ff(g.input,"blur",Ud(Kb,a)),a.options.dragDrop&&(Ff(g.scroller,"dragstart",function(b){yb(a,b)}),Ff(g.scroller,"dragenter",e),Ff(g.scroller,"dragover",e),Ff(g.scroller,"drop",Xa(a,xb))),Ff(g.scroller,"paste",function(b){pb(g,b)||(a.state.pasteIncoming=!0,lb(a),ib(a))}),Ff(g.input,"paste",function(){if(ve&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var b=g.input.selectionStart,c=g.input.selectionEnd;g.input.value+="$",g.input.selectionStart=b,g.input.selectionEnd=c,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,ib(a)}),Ff(g.input,"cut",f),Ff(g.input,"copy",f),Ae&&Ff(g.sizer,"mouseup",function(){$d()==g.input&&g.input.blur(),lb(a)})}function pb(a,b){for(var c=Fd(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function qb(a,b,c,d){var e=a.display;if(!c){var f=Fd(b);if(f==e.scrollbarH||f==e.scrollbarV||f==e.scrollbarFiller||f==e.gutterFiller)return null}var g,h,i=e.lineSpace.getBoundingClientRect();try{g=b.clientX-i.left,h=b.clientY-i.top}catch(b){return null}var j,k=Qa(a,g,h);if(d&&1==k.xRel&&(j=hd(a.doc,k.line).text).length==k.ch){var l=Of(j,j.length,a.options.tabSize)-j.length;k=Ne(k.line,Math.round((g-wa(a.display).left)/Ta(a.display))-l)}return k}function rb(a){if(!Jd(this,a)){var b=this,c=b.display;if(c.shift=a.shiftKey,pb(c,a))return void(ve||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!wb(b,a)){var d=qb(b,a);switch(window.focus(),Gd(a)){case 1:d?sb(b,a,d):Fd(a)==c.scroller&&Cf(a);break;case 2:ve&&(b.state.lastMiddleDown=+new Date),d&&aa(b.doc,d),setTimeout(Ud(lb,b),20),Cf(a);break;case 3:Ke&&Lb(b,a)}}}}function sb(a,b,c){setTimeout(Ud(mb,a),0);var d,e=+new Date;Re&&Re.time>e-400&&0==Oe(Re.pos,c)?d="triple":Qe&&Qe.time>e-400&&0==Oe(Qe.pos,c)?(d="double",Re={time:e,pos:c}):(d="single",Qe={time:e,pos:c});var f=a.doc.sel,g=Ge?b.metaKey:b.ctrlKey;a.options.dragDrop&&Yf&&!g&&!nb(a)&&"single"==d&&f.contains(c)>-1&&f.somethingSelected()?tb(a,b,c):ub(a,b,c,d,g)}function tb(a,b,c){var d=a.display,e=Xa(a,function(f){ve&&(d.scroller.draggable=!1),a.state.draggingText=!1,Gf(document,"mouseup",e),Gf(d.scroller,"drop",e),Math.abs(b.clientX-f.clientX)+Math.abs(b.clientY-f.clientY)<10&&(Cf(f),aa(a.doc,c),lb(a),pe&&!re&&setTimeout(function(){document.body.focus(),lb(a)},20))});ve&&(d.scroller.draggable=!0),a.state.draggingText=e,d.scroller.dragDrop&&d.scroller.dragDrop(),Ff(document,"mouseup",e),Ff(d.scroller,"drop",e)}function ub(a,b,c,d,e){function f(b){if(0!=Oe(p,b))if(p=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=Of(hd(j,c.line).text,c.ch,f),h=Of(hd(j,b.line).text,b.ch,f),i=Math.min(g,h),n=Math.max(g,h),o=Math.min(c.line,b.line),q=Math.min(a.lastLine(),Math.max(c.line,b.line));q>=o;o++){var r=hd(j,o).text,s=Nd(r,i,f);i==n?e.push(new T(Ne(o,s),Ne(o,s))):r.length>s&&e.push(new T(Ne(o,s),Ne(o,Nd(r,n,f))))}e.length||e.push(new T(c,c)),ga(j,U(m.ranges.slice(0,l).concat(e),l),Mf)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=jc(j,b);else var w=new T(Ne(b.line,0),X(j,Ne(b.line+1,0)));Oe(w.anchor,u)>0?(v=w.head,u=R(t.from(),w.anchor)):(v=w.anchor,u=Q(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new T(X(j,u),v),ga(j,U(e,l),Mf)}}function g(b){var c=++s,e=qb(a,b,!0,"rect"==d);if(e)if(0!=Oe(e,p)){mb(a),f(e);var h=q(i,j);(e.line>=h.to||e.liner.bottom?20:0;k&&setTimeout(Xa(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){s=1/0,Cf(b),lb(a),Gf(document,"mousemove",t),Gf(document,"mouseup",u),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Cf(b);var k,l,m=j.sel;if(e?(l=j.sel.contains(c),k=l>-1?j.sel.ranges[l]:new T(c,c)):k=j.sel.primary(),b.altKey)d="rect",e||(k=new T(c,c)),c=qb(a,b,!0,!0),l=-1;else if("double"==d){var n=jc(j,c);k=a.display.shift||j.extend?_(j,k,n.anchor,n.head):n}else if("triple"==d){var o=new T(Ne(c.line,0),X(j,Ne(c.line+1,0)));k=a.display.shift||j.extend?_(j,k,o.anchor,o.head):o}else k=_(j,k,c);e?l>-1?ca(j,l,k,Mf):(l=j.sel.ranges.length,ga(j,U(j.sel.ranges.concat([k]),l),{scroll:!1,origin:"*mouse"})):(l=0,ga(j,new S([k],0),Mf));var p=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Xa(a,function(a){(ue&&!se?a.buttons:Gd(a))?g(a):h(a)}),u=Xa(a,h);Ff(document,"mousemove",t),Ff(document,"mouseup",u)}function vb(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Cf(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!Kd(a,c))return Ed(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=md(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Ed(b)}}}function wb(a,b){return vb(a,b,"gutterClick",!0,Hd)}function xb(a){var b=this;if(!Jd(b,a)&&!pb(b.display,a)){Cf(a),pe&&(Ue=+new Date);var c=qb(b,a,!0),d=a.dataTransfer.files;if(c&&!nb(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=function(){if(f[d]=h.result,++g==e){c=X(b.doc,c);var a={from:c,to:c,text:Zf(f.join("\n")),origin:"paste"};Sb(b.doc,a),fa(b.doc,V(c,$e(a)))}},h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(Ud(lb,b),20);try{var f=a.dataTransfer.getData("Text");if(f){var j=b.state.draggingText&&b.listSelections();if(ha(b.doc,V(c,c)),j)for(var i=0;if.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&Ge&&ve)a:for(var g=b.target,h=e.view;g!=f;g=g.parentNode)for(var i=0;ij?k=Math.max(0,k+j-50):l=Math.min(a.doc.height,l+j+50),v(a,{top:k,bottom:l})}20>Ve&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,c=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null,c&&(We=(We*Ve+c)/(Ve+1),++Ve)}},200)):(e.wheelDX+=c,e.wheelDY+=d))}}function Cb(a,b,c){if("string"==typeof b&&(b=kf[b],!b))return!1;a.display.pollingFast&&jb(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{nb(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Kf}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function Db(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function Eb(a,b){var c=lc(a.options.keyMap),d=c.auto;clearTimeout(Xe),d&&!nf(b)&&(Xe=setTimeout(function(){lc(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,h(a))},50));var e=of(b,!0),f=!1;if(!e)return!1;var g=Db(a);return f=b.shiftKey?mf("Shift-"+e,g,function(b){return Cb(a,b,!0)})||mf(e,g,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?Cb(a,b):void 0}):mf(e,g,function(b){return Cb(a,b)}),f&&(Cf(b),pa(a),Hd(a,"keyHandled",a,e,b)),f}function Fb(a,b,c){var d=mf("'"+c+"'",Db(a),function(b){return Cb(a,b,!0)});return d&&(Cf(b),pa(a),Hd(a,"keyHandled",a,"'"+c+"'",b)),d}function Gb(a){var b=this;if(mb(b),!Jd(b,a)){pe&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=Eb(b,a);ye&&(Ze=d?c:null,!d&&88==c&&!_f&&(Ge?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut"))}}function Hb(a){Jd(this,a)||16==a.keyCode&&(this.doc.sel.shift=!1)}function Ib(a){var b=this;if(!Jd(b,a)){var c=a.keyCode,d=a.charCode;if(ye&&c==Ze)return Ze=null,void Cf(a);if(!(ye&&(!a.which||a.which<10)||Ae)||!Eb(b,a)){var e=String.fromCharCode(null==d?c:d);Fb(b,a,e)||(ue&&!re&&(b.display.inputHasSelection=null),ib(b))}}}function Jb(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(Hf(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(kb(a),ve&&setTimeout(Ud(kb,a,!0),0))),hb(a),pa(a))}function Kb(a){a.state.focused&&(Hf(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150)}function Lb(a,b){function c(){if(null!=e.input.selectionStart){var a=e.input.value="​"+(j?e.input.value:"");e.prevInput="​",e.input.selectionStart=1,e.input.selectionEnd=a.length}}function d(){if(e.inputDiv.style.position="relative",e.input.style.cssText=i,re&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=g),hb(a),null!=e.input.selectionStart){(!ue||re)&&c(),clearTimeout(Ye);var b=0,d=function(){"​"==e.prevInput&&0==e.input.selectionStart?Xa(a,kf.selectAll)(a):b++<10?Ye=setTimeout(d,500):kb(a)};Ye=setTimeout(d,200)}}if(!Jd(a,b,"contextmenu")){var e=a.display;if(!pb(e,b)&&!Mb(a,b)){var f=qb(a,b),g=e.scroller.scrollTop;if(f&&!ye){var h=a.options.resetSelectionOnContextMenu;h&&-1==a.doc.sel.contains(f)&&Xa(a,ga)(a.doc,V(f),Lf);var i=e.input.style.cssText;e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: transparent; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",lb(a),kb(a);var j=a.somethingSelected();if(j||(e.input.value=e.prevInput=" "),ue&&!re&&c(),Ke){Ef(b);var k=function(){Gf(window,"mouseup",k),setTimeout(d,20)};Ff(window,"mouseup",k)}else setTimeout(d,50)}}}}function Mb(a,b){return Kd(a,"gutterContextMenu")?vb(a,b,"gutterContextMenu",!1,Hf):!1}function Nb(a,b){if(Oe(a,b.from)<0)return a;if(Oe(a,b.to)<=0)return $e(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=$e(b).ch-b.to.ch),Ne(c,d)}function Ob(a,b){for(var c=[],d=0;d=0;--e)Tb(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Tb(a,b)}}function Tb(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Oe(b.from,b.to)){var c=Ob(a,b);td(a,b,c,a.cm?a.cm.curOp.id:NaN),Wb(a,b,c,uc(a,b));var d=[];fd(a,function(a,c){c||-1!=Qd(d,a.history)||(Dd(a.history,b),d.push(a.history)),Wb(a,b,null,uc(a,b))})}}function Ub(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i=0;--i){var l=d.changes[i];if(l.origin=b,k&&!Rb(a,l,!1))return void(g.length=0);j.push(qd(a,l));var m=i?Ob(a,l,null):Pd(g);Wb(a,l,m,wc(a,l)),a.cm&&cc(a.cm);var n=[];fd(a,function(a,b){b||-1!=Qd(n,a.history)||(Dd(a.history,l),n.push(a.history)),Wb(a,l,null,wc(a,l))})}}}}function Vb(a,b){a.first+=b,a.sel=new S(Rd(a.sel.ranges,function(a){return new T(Ne(a.anchor.line+b,a.anchor.ch),Ne(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm&&ab(a.cm,a.first,a.first-b,b)}function Wb(a,b,c,d){if(a.cm&&!a.cm.curOp)return Xa(a.cm,Wb)(a,b,c,d);if(b.to.linea.lastLine())){if(b.from.linef&&(b={from:b.from,to:Ne(f,hd(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=id(a,b.from,b.to),c||(c=Ob(a,b,null)),a.cm?Xb(a.cm,b,d):cd(a,b,d),ha(a,c,Lf)}}function Xb(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=ld(Hc(hd(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&(a.curOp.cursorActivity=!0),cd(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),qa(a,400);var k=b.text.length-(h.line-g.line)-1;g.line!=h.line||1!=b.text.length||bd(a.doc,b)?ab(a,g.line,h.line+1,k):bb(a,g.line,"text"),(Kd(a,"change")||Kd(a,"changes"))&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push({from:g,to:h,text:b.text,removed:b.removed,origin:b.origin})}function Yb(a,b,c,d,e){if(d||(d=c),Oe(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Zf(b)),Sb(a,{from:c,to:d,text:b,origin:e})}function Zb(a,b){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!De){var f=Xd("div","​",null,"position: absolute; top: "+(b.top-c.viewOffset-ua(a.display))+"px; height: "+(b.bottom-b.top+Jf)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}function $b(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=Na(a,b),g=c&&c!=b?Na(a,c):f,h=ac(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&(zb(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(Ab(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function _b(a,b,c,d,e){var f=ac(a,b,c,d,e);null!=f.scrollTop&&zb(a,f.scrollTop),null!=f.scrollLeft&&Ab(a,f.scrollLeft)}function ac(a,b,c,d,e){var f=a.display,g=Sa(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=f.scroller.clientHeight-Jf,j={},k=a.doc.height+va(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=f.scroller.clientWidth-Jf;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return o+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>p+o-3&&(j.scrollLeft=d+10-p),j}function bc(a,b,c){(null!=b||null!=c)&&dc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b), +null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function cc(a){dc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Ne(b.line,b.ch-1):b,d=Ne(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function dc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=Oa(a,b.from),d=Oa(a,b.to),e=ac(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function ec(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(a.doc.mode.indent?e=ta(a,b):c="prev");var g=a.options.tabSize,h=hd(f,b),i=Of(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=a.doc.mode.indent(e,h.text.slice(k.length),h.text),j==Kf)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Of(hd(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Od(j-m)),l!=k)Yb(a.doc,l,Ne(b,0),Ne(b,k.length),"+input");else for(var n=0;n=0;b--)Yb(a.doc,"",d[b].from,d[b].to,"+delete");cc(a)})}function hc(a,b,c,d,e){function f(){var b=h+c;return b=a.first+a.size?l=!1:(h=b,k=hd(a,b))}function g(a){var b=(e?me:ne)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?ge:fe)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=hd(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||g(!o);o=!1){var p=k.text.charAt(i)||"\n",q=Tf(p)?"w":n&&"\n"==p?"n":!n||/\s/.test(p)?null:"p";if(!n||o||q||(q="s"),m&&m!=q){0>c&&(c=1,g());break}if(q&&(m=q),c>0&&!g(!o))break}var r=la(a,Ne(h,i),j,!0);return l||(r.hitSide=!0),r}function ic(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*Sa(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=Qa(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function jc(a,b){var c=hd(a,b.line).text,d=b.ch,e=b.ch;if(c){(b.xRel<0||e==c.length)&&d?--d:++e;for(var f=c.charAt(d),g=Tf(f)?Tf:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Tf(a)};d>0&&g(c.charAt(d-1));)--d;for(;e0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Xd("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(Gc(a,b.line,b,c,f)||b.line!=c.line&&Gc(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Me=!0}f.addToHistory&&td(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&Hc(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&kd(a,0),rc(a,new oc(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Lc(a,b)&&kd(b,0)}),f.clearOnEnter&&Ff(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Le=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++rf,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)ab(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(var k=b.line;k<=c.line;k++)bb(j,k,"text");f.atomic&&ja(j.doc)}return Hd(j,"markerAdded",j,f),f}function nc(a,b,c,d,e){d=Td(d),d.shared=!1;var f=[mc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return fd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(mc(a,X(a,b),X(a,c),d,e));for(var i=0;i=b:f.to>b);(d||(d=[])).push(new oc(g,f.from,i?null:f.to))}}return d}function tc(a,b,c){if(a)for(var d,e=0;e=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(p);o.push(i)}return o}function vc(a){for(var b=0;b0)){var k=[i,1],l=Oe(j.from,h.from),m=Oe(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function yc(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Oe(j.to,c)||Bc(i.marker)-Ac(e))>0||k>=0&&(Oe(j.from,d)||Ac(i.marker)-Bc(e))<0))return!0}}}function Hc(a){for(var b;b=Ec(a);)a=b.find(-1,!0).line;return a}function Ic(a){for(var b,c;b=Fc(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function Jc(a,b){var c=hd(a,b),d=Hc(c);return c==d?b:ld(d)}function Kc(a,b){if(b>a.lastLine())return b;var c,d=hd(a,b);if(!Lc(a,d))return b;for(;c=Fc(d);)d=c.find(1,!0).line;return ld(d)+1}function Lc(a,b){var c=Me&&b.markedSpans;if(c)for(var d,e=0;eb.options.maxHighlightLength?(h=!1,g&&Uc(b,c,e,l.pos),l.pos=c.length,i=null):i=d.token(l,e),b.options.addModeClass){var m=a.innerMode(d,e).mode.name;m&&(i="m-"+(i?m+" "+i:m))}h&&k==i||(ji;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d),h+=2,i=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,b),h=c+2;else for(;h>c;c+=2){var f=e[c+1];e[c+1]=f?f+" "+b:b}})}return e}function Tc(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Sc(a,b,b.stateAfter=ta(a,ld(b)))),b.styles}function Uc(a,b,c,d){var e=a.doc.mode,f=new pf(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&e.blankLine&&e.blankLine(c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)e.token(f,c),f.start=f.pos}function Vc(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}if(/^\s*$/.test(a))return null;var e=b.cm.options.addModeClass?wf:vf;return e[a]||(e[a]=a.replace(/\S+/g,"cm-$&"))}function Wc(a,b){var c=Xd("span",null,null,ve?"padding-right: .1px":null),d={pre:Xd("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Yc,(ue||ve)&&a.getOption("lineWrapping")&&(d.addToken=Zc(d.addToken)),be(a.display.measure)&&(f=od(g))&&(d.addToken=$c(d.addToken,f)),d.map=[],ad(g,d,Tc(a,g)),0==d.map.length&&d.map.push(0,0,d.content.appendChild(ae(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return Hf(a,"renderLine",a,b.line,d.pre),d}function Xc(a){var b=Xd("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b}function Yc(a,b,c,d,e,f){if(b){var g=a.cm.options.specialChars,h=!1;if(g.test(b))for(var i=document.createDocumentFragment(),j=0;;){g.lastIndex=j;var k=g.exec(b),l=k?k.index-j:b.length-j;if(l){var m=document.createTextNode(b.slice(j,j+l));re?i.appendChild(Xd("span",[m])):i.appendChild(m),a.map.push(a.pos,a.pos+l,m),a.col+=l,a.pos+=l}if(!k)break;if(j+=l+1," "==k[0]){var n=a.cm.options.tabSize,o=n-a.col%n,m=i.appendChild(Xd("span",Od(o),"cm-tab"));a.col+=o}else{var m=a.cm.options.specialCharPlaceholder(k[0]);re?i.appendChild(Xd("span",[m])):i.appendChild(m),a.col+=1}a.map.push(a.pos,a.pos+1,m),a.pos++}else{a.col+=b.length;var i=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,i),re&&(h=!0),a.pos+=b.length}if(c||d||e||h){var p=c||"";d&&(p+=d),e&&(p+=e);var q=Xd("span",[i],p);return f&&(q.title=f),a.content.appendChild(q)}a.content.appendChild(i)}}function Zc(a){function b(a){for(var b=" ",c=0;ci&&l.from<=i)break}if(l.to>=j)return a(c,d,e,f,g,h);a(c,d.slice(0,l.to-i),e,f,null,h),f=null,d=d.slice(l.to-i),i=l.to}}}function _c(a,b,c,d){var e=!d&&c.widgetNode;e&&(a.map.push(a.pos,a.pos+b,e),a.content.appendChild(e)),a.pos+=b}function ad(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m=e.length,n=0,o=1,p="",q=0;;){if(q==n){h=i=j=k="",l=null,q=1/0;for(var r=[],s=0;sn)?(null!=t.to&&q>t.to&&(q=t.to,i=""),u.className&&(h+=" "+u.className),u.startStyle&&t.from==n&&(j+=" "+u.startStyle),u.endStyle&&t.to==q&&(i+=" "+u.endStyle),u.title&&!k&&(k=u.title),u.collapsed&&(!l||Cc(l.marker,u)<0)&&(l=t)):t.from>n&&q>t.from&&(q=t.from),"bookmark"==u.type&&t.from==n&&u.widgetNode&&r.push(u)}if(l&&(l.from||0)==n&&(_c(b,(null==l.to?m+1:l.to)-n,l.marker,null==l.from),null==l.to))return;if(!l&&r.length)for(var s=0;s=m)break;for(var v=Math.min(m,q);;){if(p){var w=n+p.length;if(!l){var x=w>v?p.slice(0,v-n):p;b.addToken(b,x,g?g+h:h,j,n+x.length==q?i:"",k)}if(w>=v){p=p.slice(v-n),n=v;break}n=w,j=""}p=e.slice(f,f=c[o++]),g=Vc(c[o++],b)}}else for(var o=1;o1&&a.remove(g.line+1,n-1),a.insert(g.line+1,p)}Hd(a,"change",a,b)}function dd(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function id(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function jd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function kd(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function ld(a){if(null==a.parent)return null;for(var b=a.parent,c=Qd(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function md(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function nd(a){a=Hc(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Pd(a.done)):void 0}function td(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=sd(e,e.lastOp==d))){var h=Pd(f.changes);0==Oe(b.from,b.to)&&0==Oe(b.from,h.to)?h.to=$e(b):f.changes.push(qd(a,b))}else{var i=Pd(e.done);for(i&&i.ranges||wd(a.sel,e.done),f={changes:[qd(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=g,e.lastOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Hf(a,"historyAdded")}function ud(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function vd(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastOp||f&&e.lastSelOrigin==f&&ud(a,f,Pd(e.done),b)?e.done[e.done.length-1]=b:wd(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastOp=c,d&&d.clearRedo!==!1&&rd(e.undone)}function wd(a,b){var c=Pd(b);c&&c.ranges&&c.equals(a)||b.push(a)}function xd(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function yd(a){if(!a)return null;for(var b,c=0;c-1&&(Pd(h)[l]=k[l],delete k[l])}}}return e}function Bd(a,b,c,d){c0}function Ld(a){a.prototype.on=function(a,b){Ff(this,a,b)},a.prototype.off=function(a,b){Gf(this,a,b)}}function Md(){this.id=null}function Nd(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function Od(a){for(;Pf.length<=a;)Pf.push(Pd(Pf)+" ");return Pf[a]}function Pd(a){return a[a.length-1]}function Qd(a,b){for(var c=0;c=768&&Uf.test(a)}function Xd(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function Zd(a,b){return Yd(a).appendChild(b)}function $d(){return document.activeElement}function _d(a){if(null!=Vf)return Vf;var b=Xd("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Zd(a,b),b.offsetWidth&&(Vf=b.offsetHeight-b.clientHeight),Vf||0}function ae(a){if(null==Wf){var b=Xd("span","​");Zd(a,Xd("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Wf=b.offsetWidth<=1&&b.offsetHeight>2&&!qe)}return Wf?Xd("span","​"):Xd("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function be(a){if(null!=Xf)return Xf;var b=Zd(a,document.createTextNode("AخA")),c=Rf(b,0,1).getBoundingClientRect();if(c.left==c.right)return!1;var d=Rf(b,1,2).getBoundingClientRect();return Xf=d.right-c.right<3}function ce(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function de(a){return a.level%2?a.to:a.from}function ee(a){return a.level%2?a.from:a.to}function fe(a){var b=od(a);return b?de(b[0]):0}function ge(a){var b=od(a);return b?ee(Pd(b)):a.text.length}function he(a,b){var c=hd(a.doc,b),d=Hc(c);d!=c&&(b=ld(d));var e=od(d),f=e?e[0].level%2?ge(d):fe(d):0;return Ne(b,f)}function ie(a,b){for(var c,d=hd(a.doc,b);c=Fc(d);)d=c.find(1,!0).line,b=null;var e=od(d),f=e?e[0].level%2?fe(d):ge(d):d.text.length;return Ne(null==b?ld(d):b,f)}function je(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function ke(a,b){bg=null;for(var c,d=0;db)return d;if(e.from==b||e.to==b){if(null!=c)return je(a,e.level,a[c].level)?(e.from!=e.to&&(bg=c),d):(e.from!=e.to&&(bg=d),c);c=d}}return c}function le(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Wd(a.text.charAt(b)));return b}function me(a,b,c,d){var e=od(a);if(!e)return ne(a,b,c,d);for(var f=ke(e,b),g=e[f],h=le(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?le(a,g.to,-1,d):le(a,g.from,1,d)}}function ne(a,b,c,d){var e=b+c;if(d)for(;e>0&&Wd(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var oe=/gecko\/\d/i.test(navigator.userAgent),pe=/MSIE \d/.test(navigator.userAgent),qe=pe&&(null==document.documentMode||document.documentMode<8),re=pe&&(null==document.documentMode||document.documentMode<9),se=pe&&(null==document.documentMode||document.documentMode<10),te=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),ue=pe||te,ve=/WebKit\//.test(navigator.userAgent),we=ve&&/Qt\/\d+\.\d+/.test(navigator.userAgent),xe=/Chrome\//.test(navigator.userAgent),ye=/Opera\//.test(navigator.userAgent),ze=/Apple Computer/.test(navigator.vendor),Ae=/KHTML\//.test(navigator.userAgent),Be=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Ce=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),De=/PhantomJS/.test(navigator.userAgent),Ee=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Fe=Ee||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Ge=Ee||/Mac/.test(navigator.platform),He=/win/i.test(navigator.platform),Ie=ye&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Ie&&(Ie=Number(Ie[1])),Ie&&Ie>=15&&(ye=!1,ve=!0);var Je=Ge&&(we||ye&&(null==Ie||12.11>Ie)),Ke=oe||ue&&!re,Le=!1,Me=!1,Ne=a.Pos=function(a,b){return this instanceof Ne?(this.line=a,void(this.ch=b)):new Ne(a,b)},Oe=a.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};S.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&Oe(a,d.to())<=0)return c}return-1}},T.prototype={from:function(){return R(this.anchor,this.head)},to:function(){return Q(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Pe,Qe,Re,Se={left:0,right:0,top:0,bottom:0},Te=0,Ue=0,Ve=0,We=null;ue?We=-.53:oe?We=15:xe?We=-.7:ze&&(We=-1/3);var Xe,Ye,Ze=null,$e=a.changeEnd=function(a){return a.text?Ne(a.from.line+a.text.length-1,Pd(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),lb(this),ib(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,af.hasOwnProperty(a)&&Xa(this,af[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(ec(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&cc(this));else{var f=Math.max(c,e.from().line),g=e.to();c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var h=f;c>h;++h)ec(this,h,a)}}}),getTokenAt:function(a,b){var c=this.doc;a=X(c,a);for(var d=ta(this,a.line,b),e=this.doc.mode,f=hd(c,a.line),g=new pf(f.text,this.options.tabSize);g.pos>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]d&&(a=d,c=!0);var e=hd(this.doc,a);return Ka(this,hd(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return Sa(this.display)},defaultCharWidth:function(){return Ta(this.display)},setGutterMarker:Ya(function(a,b,c){return fc(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Vd(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Ya(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,bb(b,d,"gutter"),Vd(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Ya(function(a,b,c){return fc(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}), +removeLineClass:Ya(function(a,b,c){return fc(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Ya(function(a,b,c){return Oc(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!Z(this.doc,a))return null;var b=a;if(a=hd(this.doc,a),!a)return null}else{var b=ld(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=Na(this,X(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&_b(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Ya(Gb),triggerOnKeyPress:Ya(Ib),triggerOnKeyUp:Ya(Hb),execCommand:function(a){return kf.hasOwnProperty(a)?kf[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=X(this.doc,a);b>f&&(g=hc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Ya(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?hc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Nf)}),deleteH:Ya(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):gc(this,function(c){var e=hc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=X(this.doc,a);b>g;++g){var i=Na(this,h,"div");if(null==f?f=i.left:i.left=f,h=ic(this,i,e,c),h.hitSide)break}return h},moveV:Ya(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.sel.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=Na(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=ic(c,h,a,b);return"page"==b&&g==d.sel.primary()&&bc(c,null,Ma(c,i,"div").top-h.top),i},Nf),e.length)for(var g=0;g.5)&&g(this),Hf(this,"refresh",this)}),swapDoc:Ya(function(a){var b=this.doc;return b.cm=null,gd(this,a),Ha(this),kb(this),this.scrollTo(a.scrollLeft,a.scrollTop),Hd(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ld(a);var _e=a.defaults={},af=a.optionHandlers={},bf=a.Init={toString:function(){return"CodeMirror.Init"}};kc("value","",function(a,b){a.setValue(b)},!0),kc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),kc("indentUnit",2,c,!0),kc("indentWithTabs",!1),kc("smartIndent",!0),kc("tabSize",4,function(a){d(a),Ha(a),ab(a)},!0),kc("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),a.refresh()},!0),kc("specialCharPlaceholder",Xc,function(a){a.refresh()},!0),kc("electricChars",!0),kc("rtlMoveVisually",!He),kc("wholeLineUpdateBefore",!0),kc("theme","default",function(a){i(a),j(a)},!0),kc("keyMap","default",h),kc("extraKeys",null),kc("lineWrapping",!1,e,!0),kc("gutters",[],function(a){n(a.options),j(a)},!0),kc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?u(a.display)+"px":"0",a.refresh()},!0),kc("coverGutterNextToScrollbar",!1,p,!0),kc("lineNumbers",!1,function(a){n(a.options),j(a)},!0),kc("firstLineNumber",1,j,!0),kc("lineNumberFormatter",function(a){return a},j,!0),kc("showCursorWhenSelecting",!1,ma,!0),kc("resetSelectionOnContextMenu",!0),kc("readOnly",!1,function(a,b){"nocursor"==b?(Kb(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||kb(a))}),kc("disableInput",!1,function(a,b){b||kb(a)},!0),kc("dragDrop",!0),kc("cursorBlinkRate",530),kc("cursorScrollMargin",0),kc("cursorHeight",1),kc("workTime",100),kc("workDelay",100),kc("flattenSpans",!0,d,!0),kc("addModeClass",!1,d,!0),kc("pollInterval",100),kc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),kc("historyEventDelay",1250),kc("viewportMargin",10,function(a){a.refresh()},!0),kc("maxHighlightLength",1e4,d,!0),kc("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),kc("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),kc("autofocus",null);var cf=a.modes={},df=a.mimeModes={};a.defineMode=function(b,c){if(a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2){c.dependencies=[];for(var d=2;d0&&d.chc;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),cc(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},lf=a.keyMap={};lf.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},lf.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},lf.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]},lf.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},lf["default"]=Ge?lf.macDefault:lf.pcDefault;var mf=a.lookupKey=function(a,b,c){function d(b){b=lc(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0;g=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var qf=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a};Ld(qf),qf.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&Ua(a),Kd(this,"clear")){var c=this.find();c&&Hd(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&ab(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&ja(a.doc)),Hd(a,"markerCleared",a,this),b&&Va(a)}},qf.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e=b.display.viewFrom&&dc;++c){var e=this.lines[c];this.height-=e.height,Qc(e),Hd(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},ed.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof dd))){var h=[];this.collapse(h),this.children=[new dd(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new dd(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new ed(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Qd(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new ed(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var xf=0,yf=a.Doc=function(a,b,c){if(!(this instanceof yf))return new yf(a,b,c);null==c&&(c=0),ed.call(this,[new dd([new uf("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=Ne(c,0);this.sel=V(d),this.history=new pd(null),this.id=++xf,this.modeOption=b,"string"==typeof a&&(a=Zf(a)),cd(this,{from:d,to:d,text:a}),ga(this,V(d),Lf)};yf.prototype=Sd(ed.prototype,{constructor:yf,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)Sb(this,d[f]);h?fa(this,h):this.cm&&cc(this.cm)},undo:Za(function(){Ub(this,"undo")}),redo:Za(function(){Ub(this,"redo")}),undoSelection:Za(function(){Ub(this,"undo",!0)}),redoSelection:Za(function(){Ub(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b){a=X(this,a),b=X(this,b);var c=[],d=a.line;return this.iter(a.line,b.line+1,function(e){var f=e.markedSpans;if(f)for(var g=0;gh.to||null==h.from&&d!=a.line||d==b.line&&h.from>b.ch||c.push(h.marker.parent||h.marker)}++d}),c},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=e,void++c)}),X(this,Ne(c,b))},indexFromPos:function(a){a=X(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Pf=[""],Qf=function(a){a.select()};Ee?Qf=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:ue&&(Qf=function(a){try{a.select()}catch(b){}}),[].indexOf&&(Qd=function(a,b){return a.indexOf(b)}),[].map&&(Rd=function(a,b){return a.map(b)});var Rf,Sf=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Tf=a.isWordChar=function(a){return/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||Sf.test(a))},Uf=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; +Rf=document.createRange?function(a,b,c){var d=document.createRange();return d.setEnd(a,c),d.setStart(a,b),d}:function(a,b,c){var d=document.body.createTextRange();return d.moveToElementText(a.parentNode),d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d},pe&&($d=function(){try{return document.activeElement}catch(a){return document.body}});var Vf,Wf,Xf,Yf=function(){if(re)return!1;var a=Xd("div");return"draggable"in a||"dragDrop"in a}(),Zf=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},$f=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},_f=function(){var a=Xd("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),ag={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};a.keyNames=ag,function(){for(var a=0;10>a;a++)ag[a+48]=ag[a+96]=String(a);for(var a=65;90>=a;a++)ag[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)ag[a+111]=ag[a+63235]="F"+a}();var bg,cg=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Pd(v).level&&(u=c.match(/\s+$/))&&(Pd(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),v[0].level!=Pd(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="4.0.1",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("javascript",function(b,c){function d(a){for(var b,c=!1,d=!1;null!=(b=a.next());){if(!c){if("/"==b&&!d)return;"["==b?d=!0:d&&"]"==b&&(d=!1)}c=!c&&"\\"==b}}function e(a,b,c){return na=a,oa=c,b}function f(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=g(c),b.tokenize(a,b);if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return e("number","number");if("."==c&&a.match(".."))return e("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return e(c);if("="==c&&a.eat(">"))return e("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),e("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),e("number","number");if("/"==c)return a.eat("*")?(b.tokenize=h,h(a,b)):a.eat("/")?(a.skipToEnd(),e("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(d(a),a.eatWhile(/[gimy]/),e("regexp","string-2")):(a.eatWhile(va),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c)return a.skipToEnd(),e("error","error");if(va.test(c))return a.eatWhile(va),e("operator","operator",a.current());a.eatWhile(/[\w\$_]/);var f=a.current(),j=ua.propertyIsEnumerable(f)&&ua[f];return j&&"."!=b.lastType?e(j.type,j.style,f):e("variable","variable",f)}function g(a){return function(b,c){var d,g=!1;if(ra&&"@"==b.peek()&&b.match(wa))return c.tokenize=f,e("jsonld-keyword","meta");for(;null!=(d=b.next())&&(d!=a||g);)g=!g&&"\\"==d;return g||(c.tokenize=f),e("string","string")}}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=f;break}d="*"==c}return e("comment","comment")}function i(a,b){for(var c,d=!1;null!=(c=a.next());){if(!d&&("`"==c||"$"==c&&a.eat("{"))){b.tokenize=f;break}d=!d&&"\\"==c}return e("quasi","string-2",a.current())}function j(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=xa.indexOf(g);if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(/[$\w]/.test(g))e=!0;else if(e&&!d){++f;break}}e&&!d&&(b.fatArrowAt=f)}}function k(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function l(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function m(a,b,c,d,e){var f=a.cc;for(za.state=a,za.stream=e,za.marked=null,za.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():sa?w:v;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return za.marked?za.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)za.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=za.state;if(d.context){if(za.marked="def",b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function q(){za.state.context={prev:za.state.context,vars:za.state.localVars},za.state.localVars=Aa}function r(){za.state.localVars=za.state.context.vars,za.state.context=za.state.context.prev}function s(a,b){var c=function(){var c=za.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new k(d,za.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function t(){var a=za.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function u(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function v(a,b){return"var"==a?o(s("vardef",b.length),R,u(";"),t):"keyword a"==a?o(s("form"),w,v,t):"keyword b"==a?o(s("form"),v,t):"{"==a?o(s("}"),O,t):";"==a?o():"if"==a?o(s("form"),w,v,t,W):"function"==a?o(aa):"for"==a?o(s("form"),X,v,t):"variable"==a?o(s("stat"),H):"switch"==a?o(s("form"),w,s("}","switch"),u("{"),O,t,t):"case"==a?o(w,u(":")):"default"==a?o(u(":")):"catch"==a?o(s("form"),q,u("("),ba,u(")"),v,t,r):"module"==a?o(s("form"),q,fa,r,t):"class"==a?o(s("form"),ca,ea,t):"export"==a?o(s("form"),ga,t):"import"==a?o(s("form"),ha,t):n(s("stat"),w,u(";"),t)}function w(a){return y(a,!1)}function x(a){return y(a,!0)}function y(a,b){if(za.state.fatArrowAt==za.stream.start){var c=b?G:F;if("("==a)return o(q,s(")"),M(S,")"),t,u("=>"),c,r);if("variable"==a)return n(q,S,u("=>"),c,r)}var d=b?C:B;return ya.hasOwnProperty(a)?o(d):"function"==a?o(aa):"keyword c"==a?o(b?A:z):"("==a?o(s(")"),z,ma,u(")"),t,d):"operator"==a||"spread"==a?o(b?x:w):"["==a?o(s("]"),ka,t,d):"{"==a?N(J,"}",null,d):o()}function z(a){return a.match(/[;\}\)\],]/)?n():n(w)}function A(a){return a.match(/[;\}\)\],]/)?n():n(x)}function B(a,b){return","==a?o(w):C(a,b,!1)}function C(a,b,c){var d=0==c?B:C,e=0==c?w:x;return"=>"==b?o(q,c?G:F,r):"operator"==a?/\+\+|--/.test(b)?o(d):"?"==b?o(w,u(":"),e):o(e):"quasi"==a?(za.cc.push(d),D(b)):";"!=a?"("==a?N(x,")","call",d):"."==a?o(I,d):"["==a?o(s("]"),z,u("]"),t,d):void 0:void 0}function D(a){return"${"!=a.slice(a.length-2)?o():o(w,E)}function E(a){return"}"==a?(za.marked="string-2",za.state.tokenize=i,o()):void 0}function F(a){return j(za.stream,za.state),n("{"==a?v:w)}function G(a){return j(za.stream,za.state),n("{"==a?v:x)}function H(a){return":"==a?o(t,v):n(B,u(";"),t)}function I(a){return"variable"==a?(za.marked="property",o()):void 0}function J(a,b){if("variable"==a){if(za.marked="property","get"==b||"set"==b)return o(K)}else if("number"==a||"string"==a)za.marked=ra?"property":a+" property";else if("["==a)return o(w,u("]"),L);return ya.hasOwnProperty(a)?o(L):void 0}function K(a){return"variable"!=a?n(L):(za.marked="property",o(aa))}function L(a){return":"==a?o(x):"("==a?n(aa):void 0}function M(a,b){function c(d){if(","==d){var e=za.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),o(a,c)}return d==b?o():o(u(b))}return function(d){return d==b?o():n(a,c)}}function N(a,b,c){for(var d=3;d!?|~^]/,wa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,xa="([{}])",ya={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},za={state:null,column:null,marked:null,cc:null},Aa={name:"this",next:{name:"arguments"}};return t.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-pa,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),j(a,b)),b.tokenize!=h&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==na?c:(b.lastType="operator"!=na||"++"!=oa&&"--"!=oa?na:"incdec",m(b,c,na,oa,a))},indent:function(b,d){if(b.tokenize==h)return a.Pass;if(b.tokenize!=f)return 0;for(var e=d&&d.charAt(0),g=b.lexical,i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==t)g=g.prev;else if(j!=W)break}"stat"==g.type&&"}"==e&&(g=g.prev),qa&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var k=g.type,l=e==k;return"vardef"==k?g.indented+("operator"==b.lastType||","==b.lastType?g.info+1:0):"form"==k&&"{"==e?g.indented:"form"==k?g.indented+pa:"stat"==k?g.indented+("operator"==b.lastType||","==b.lastType?qa||pa:0):"switch"!=g.info||l||0==c.doubleIndentSwitch?g.align?g.column+(l?0:1):g.indented+(l?0:pa):g.indented+(/^(?:case|default)\b/.test(d)?pa:2*pa)},electricChars:":{}",blockCommentStart:sa?null:"/*",blockCommentEnd:sa?null:"*/",lineComment:sa?null:"//",fold:"brace",helperType:sa?"json":"javascript",jsonldMode:ra,jsonMode:sa}}),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(b,c){function d(b){return e.parentNode?(e.style.top=Math.max(0,b.clientY-e.offsetHeight-5)+"px",void(e.style.left=b.clientX+5+"px")):a.off(document,"mousemove",d)}var e=document.createElement("div");return e.className="CodeMirror-lint-tooltip",e.appendChild(c.cloneNode(!0)),document.body.appendChild(e),a.on(document,"mousemove",d),d(b),null!=e.style.opacity&&(e.style.opacity=1),e}function c(a){a.parentNode&&a.parentNode.removeChild(a)}function d(a){a.parentNode&&(null==a.style.opacity&&c(a),a.style.opacity=0,setTimeout(function(){c(a)},600))}function e(c,e,f){function g(){a.off(f,"mouseout",g),h&&(d(h),h=null)}var h=b(c,e),i=setInterval(function(){if(h)for(var a=f;;a=a.parentNode){if(a==document.body)return;if(!a){g();break}}return h?void 0:clearInterval(i)},400);a.on(f,"mouseout",g)}function f(a,b,c){this.marked=[],this.options=b,this.timeout=null,this.hasGutter=c,this.onMouseOver=function(b){q(a,b)}}function g(b,c){if(c instanceof Function)return{getAnnotations:c};if(c&&c!==!0||(c={}),c.getAnnotations||(c.getAnnotations=b.getHelper(a.Pos(0,0),"lint")),!c.getAnnotations)throw new Error("Required option 'getAnnotations' missing (lint addon)");return c}function h(a){var b=a.state.lint;b.hasGutter&&a.clearGutter(r);for(var c=0;c1,c.options.tooltips))}}d.onUpdateLinting&&d.onUpdateLinting(b,e,a)}function o(a){var b=a.state.lint;clearTimeout(b.timeout),b.timeout=setTimeout(function(){m(a)},b.options.delay||500)}function p(a,b){var c=b.target||b.srcElement;e(b,l(a),c)}function q(a,b){if(/\bCodeMirror-lint-mark-/.test((b.target||b.srcElement).className))for(var c=0;c0){var k=f.character;i.forEach(function(a){k>a&&(k-=1)}),f.character=k}}var l=f.character-1,m=l+1;f.evidence&&(h=f.evidence.substring(l).search(/.\b/),h>-1&&(m+=h)),f.description=f.reason,f.start=f.character,f.end=m,f=c(f),f&&d.push({message:f.description,severity:f.severity,from:a.Pos(f.line-1,l),to:a.Pos(f.line-1,m)})}}}var g=["Dangerous comment"],h=[["Expected '{'","Statement body should be inside '{ }' braces."]],i=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];a.registerHelper("lint","javascript",b)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.registerHelper("lint","json",function(b){var c=[];jsonlint.parseError=function(b,d){var e=d.loc;c.push({from:a.Pos(e.first_line-1,e.first_column),to:a.Pos(e.last_line-1,e.last_column),message:b})};try{jsonlint.parse(b)}catch(d){}return c})}),"undefined"==typeof YAHOO||!YAHOO)var YAHOO={};YAHOO.namespace=function(){var a,b,c,d=arguments,e=null;for(a=0;a":">",'"':""","'":"'","/":"/","`":"`"},h=["toString","valueOf"],i={isArray:function(a){return b.toString.apply(a)===c},isBoolean:function(a){return"boolean"==typeof a},isFunction:function(a){return"function"==typeof a||b.toString.apply(a)===d},isNull:function(a){return null===a},isNumber:function(a){return"number"==typeof a&&isFinite(a)},isObject:function(b){return b&&("object"==typeof b||a.isFunction(b))||!1},isString:function(a){return"string"==typeof a},isUndefined:function(a){return"undefined"==typeof a},_IEEnumFix:YAHOO.env.ua.ie?function(c,d){var e,f,g;for(e=0;e"'\/`]/g,function(a){return g[a]})},extend:function(c,d,e){if(!d||!c)throw new Error("extend failed, please check that all dependencies are included.");var f,g=function(){};if(g.prototype=d.prototype,c.prototype=new g,c.prototype.constructor=c,c.superclass=d.prototype,d.prototype.constructor==b.constructor&&(d.prototype.constructor=d),e){for(f in e)a.hasOwnProperty(e,f)&&(c.prototype[f]=e[f]);a._IEEnumFix(c.prototype,e)}},augmentObject:function(b,c){if(!c||!b)throw new Error("Absorb failed, verify dependencies.");var d,e,f=arguments,g=f[2];if(g&&g!==!0)for(d=2;dd;d+=1)a.isObject(b[d])?f.push(c>0?a.dump(b[d],c-1):g):f.push(b[d]),f.push(i);f.length>1&&f.pop(),f.push("]")}else{f.push("{");for(d in b)a.hasOwnProperty(b,d)&&(f.push(d+j),a.isObject(b[d])?f.push(c>0?a.dump(b[d],c-1):g):f.push(b[d]),f.push(i));f.length>1&&f.pop(),f.push("}")}return f.join("")},substitute:function(b,c,d,f){for(var g,h,i,j,k,l,m,n,o,p=[],q=b.length,r="dump",s=" ",t="{",u="}";(g=b.lastIndexOf(t,q),!(0>g))&&(h=b.indexOf(u,g),!(g+1>h));)m=b.substring(g+1,h),j=m,l=null,i=j.indexOf(s),i>-1&&(l=j.substring(i+1),j=j.substring(0,i)),k=c[j],d&&(k=d(j,k,l)),a.isObject(k)?a.isArray(k)?k=a.dump(k,parseInt(l,10)):(l=l||"",n=l.indexOf(r),n>-1&&(l=l.substring(4)),o=k.toString(),k=o===e||n>-1?a.dump(k,parseInt(l,10)):o):a.isString(k)||a.isNumber(k)||(k="~-"+p.length+"-~",p[p.length]=m),b=b.substring(0,g)+k+b.substring(h+1),f===!1&&(q=g-1);for(g=p.length-1;g>=0;g-=1)b=b.replace(new RegExp("~-"+g+"-~"),"{"+p[g]+"}","g");return b},trim:function(a){try{return a.replace(/^\s+|\s+$/g,"")}catch(b){return a}},merge:function(){var b,c={},d=arguments,e=d.length;for(b=0;e>b;b+=1)a.augmentObject(c,d[b],!0);return c},later:function(b,c,d,e,g){b=b||0,c=c||{};var h,i,j=d,k=e;if(a.isString(d)&&(j=c[d]),!j)throw new TypeError("method undefined");return a.isUndefined(e)||a.isArray(k)||(k=[e]),h=function(){j.apply(c,k||f)},i=g?setInterval(h,b):setTimeout(h,b),{interval:g,cancel:function(){this.interval?clearInterval(i):clearTimeout(i)}}},isValue:function(b){return a.isObject(b)||a.isString(b)||a.isNumber(b)||a.isBoolean(b)}};a.hasOwnProperty=b.hasOwnProperty?function(a,b){return a&&a.hasOwnProperty&&a.hasOwnProperty(b)}:function(b,c){return!a.isUndefined(b[c])&&b.constructor.prototype[c]!==b[c]},i.augmentObject(a,i,!0),YAHOO.util.Lang=a,a.augment=a.augmentProto,YAHOO.augment=a.augmentProto,YAHOO.extend=a.extend}(),YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});var CryptoJS=CryptoJS||function(a,b){var c={},d=c.lib={},e=d.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;return b&&c.mixIn(b),c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)}),c.init.prototype=c,c.$super=this,c},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=d.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;e>f;f++){var g=c[f>>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;e>f;f+=4)b[d+f>>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=e.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c=[],d=0;b>d;d+=4)c.push(4294967296*a.random()|0);return new f.init(c,b)}}),g=c.enc={},h=g.Hex={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new f.init(c,b/2)}},i=g.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new f.init(c,b)}},j=g.Utf8={stringify:function(a){try{return decodeURIComponent(escape(i.stringify(a)))}catch(b){throw new Error("Malformed UTF-8 data")}},parse:function(a){return i.parse(unescape(encodeURIComponent(a)))}},k=d.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,g=this.blockSize,h=4*g,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*g,k=a.min(4*j,e);if(j){for(var l=0;j>l;l+=g)this._doProcessBlock(d,l);var m=d.splice(0,j);c.sigBytes-=k}return new f.init(m,k)},clone:function(){var a=e.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),l=(d.Hasher=k.extend({cfg:e.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){k.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new l.HMAC.init(a,c).finalize(b)}}}),c.algo={});return c}(Math);!function(a){var b=CryptoJS,c=b.lib,d=c.Base,e=c.WordArray,b=b.x64={};b.Word=d.extend({init:function(a,b){this.high=a,this.low=b}}),b.WordArray=d.extend({init:function(b,c){b=this.words=b||[],this.sigBytes=c!=a?c:8*b.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;b>d;d++){var f=a[d];c.push(f.high),c.push(f.low)}return e.create(c,this.sigBytes)},clone:function(){for(var a=d.clone.call(this),b=a.words=this.words.slice(0),c=b.length,e=0;c>e;e++)b[e]=b[e].clone();return a}})}(),function(){var a=CryptoJS,b=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,c){a=this._hasher=new a.init,"string"==typeof c&&(c=b.parse(c));var d=a.blockSize,e=4*d;c.sigBytes>e&&(c=a.finalize(c)),c.clamp();for(var f=this._oKey=c.clone(),g=this._iKey=c.clone(),h=f.words,i=g.words,j=0;d>j;j++)h[j]^=1549556828,i[j]^=909522486;f.sigBytes=g.sigBytes=e,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher;return a=b.finalize(a),b.reset(),b.finalize(this._oKey.clone().concat(a))}})}(),function(a){for(var b=CryptoJS,c=b.lib,d=c.WordArray,e=c.Hasher,c=b.algo,f=[],g=[],h=function(a){return 4294967296*(a-(0|a))|0},i=2,j=0;64>j;){var k;a:{k=i;for(var l=a.sqrt(k),m=2;l>=m;m++)if(!(k%m)){ +k=!1;break a}k=!0}k&&(8>j&&(f[j]=h(a.pow(i,.5))),g[j]=h(a.pow(i,1/3)),j++),i++}var n=[],c=c.SHA256=e.extend({_doReset:function(){this._hash=new d.init(f.slice(0))},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=c[5],k=c[6],l=c[7],m=0;64>m;m++){if(16>m)n[m]=0|a[b+m];else{var o=n[m-15],p=n[m-2];n[m]=((o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3)+n[m-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[m-16]}o=l+((i<<26|i>>>6)^(i<<21|i>>>11)^(i<<7|i>>>25))+(i&j^~i&k)+g[m]+n[m],p=((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+(d&e^d&f^e&f),l=k,k=j,j=i,i=h+o|0,h=f,f=e,e=d,d=o+p|0}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0,c[5]=c[5]+j|0,c[6]=c[6]+k|0,c[7]=c[7]+l|0},_doFinalize:function(){var b=this._data,c=b.words,d=8*this._nDataBytes,e=8*b.sigBytes;return c[e>>>5]|=128<<24-e%32,c[(e+64>>>9<<4)+14]=a.floor(d/4294967296),c[(e+64>>>9<<4)+15]=d,b.sigBytes=4*c.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA256=e._createHelper(c),b.HmacSHA256=e._createHmacHelper(c)}(Math),function(){var a=CryptoJS,b=a.lib.WordArray,c=a.algo,d=c.SHA256,c=c.SHA224=d.extend({_doReset:function(){this._hash=new b.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=d._doFinalize.call(this);return a.sigBytes-=4,a}});a.SHA224=d._createHelper(c),a.HmacSHA224=d._createHmacHelper(c)}(),function(){function a(){return e.create.apply(e,arguments)}for(var b=CryptoJS,c=b.lib.Hasher,d=b.x64,e=d.Word,f=d.WordArray,d=b.algo,g=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],h=[],i=0;80>i;i++)h[i]=a();d=d.SHA512=c.extend({_doReset:function(){this._hash=new f.init([new e.init(1779033703,4089235720),new e.init(3144134277,2227873595),new e.init(1013904242,4271175723),new e.init(2773480762,1595750129),new e.init(1359893119,2917565137),new e.init(2600822924,725511199),new e.init(528734635,4215389547),new e.init(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],i=c[3],j=c[4],k=c[5],l=c[6],c=c[7],m=d.high,n=d.low,o=e.high,p=e.low,q=f.high,r=f.low,s=i.high,t=i.low,u=j.high,v=j.low,w=k.high,x=k.low,y=l.high,z=l.low,A=c.high,B=c.low,C=m,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v,M=w,N=x,O=y,P=z,Q=A,R=B,S=0;80>S;S++){var T=h[S];if(16>S)var U=T.high=0|a[b+2*S],V=T.low=0|a[b+2*S+1];else{var U=h[S-15],V=U.high,W=U.low,U=(V>>>1|W<<31)^(V>>>8|W<<24)^V>>>7,W=(W>>>1|V<<31)^(W>>>8|V<<24)^(W>>>7|V<<25),X=h[S-2],V=X.high,Y=X.low,X=(V>>>19|Y<<13)^(V<<3|Y>>>29)^V>>>6,Y=(Y>>>19|V<<13)^(Y<<3|V>>>29)^(Y>>>6|V<<26),V=h[S-7],Z=V.high,$=h[S-16],_=$.high,$=$.low,V=W+V.low,U=U+Z+(W>>>0>V>>>0?1:0),V=V+Y,U=U+X+(Y>>>0>V>>>0?1:0),V=V+$,U=U+_+($>>>0>V>>>0?1:0);T.high=U,T.low=V}var Z=K&M^~K&O,$=L&N^~L&P,T=C&E^C&G^E&G,aa=D&F^D&H^F&H,W=(C>>>28|D<<4)^(C<<30|D>>>2)^(C<<25|D>>>7),X=(D>>>28|C<<4)^(D<<30|C>>>2)^(D<<25|C>>>7),Y=g[S],ba=Y.high,ca=Y.low,Y=R+((L>>>14|K<<18)^(L>>>18|K<<14)^(L<<23|K>>>9)),_=Q+((K>>>14|L<<18)^(K>>>18|L<<14)^(K<<23|L>>>9))+(R>>>0>Y>>>0?1:0),Y=Y+$,_=_+Z+($>>>0>Y>>>0?1:0),Y=Y+ca,_=_+ba+(ca>>>0>Y>>>0?1:0),Y=Y+V,_=_+U+(V>>>0>Y>>>0?1:0),V=X+aa,T=W+T+(X>>>0>V>>>0?1:0),Q=O,R=P,O=M,P=N,M=K,N=L,L=J+Y|0,K=I+_+(J>>>0>L>>>0?1:0)|0,I=G,J=H,G=E,H=F,E=C,F=D,D=Y+V|0,C=_+T+(Y>>>0>D>>>0?1:0)|0}n=d.low=n+D,d.high=m+C+(D>>>0>n>>>0?1:0),p=e.low=p+F,e.high=o+E+(F>>>0>p>>>0?1:0),r=f.low=r+H,f.high=q+G+(H>>>0>r>>>0?1:0),t=i.low=t+J,i.high=s+I+(J>>>0>t>>>0?1:0),v=j.low=v+L,j.high=u+K+(L>>>0>v>>>0?1:0),x=k.low=x+N,k.high=w+M+(N>>>0>x>>>0?1:0),z=l.low=z+P,l.high=y+O+(P>>>0>z>>>0?1:0),B=c.low=B+R,c.high=A+Q+(R>>>0>B>>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+128>>>10<<5)+30]=Math.floor(c/4294967296),b[(d+128>>>10<<5)+31]=c,a.sigBytes=4*b.length,this._process(),this._hash.toX32()},clone:function(){var a=c.clone.call(this);return a._hash=this._hash.clone(),a},blockSize:32}),b.SHA512=c._createHelper(d),b.HmacSHA512=c._createHmacHelper(d)}(),function(){var a=CryptoJS,b=a.x64,c=b.Word,d=b.WordArray,b=a.algo,e=b.SHA512,b=b.SHA384=e.extend({_doReset:function(){this._hash=new d.init([new c.init(3418070365,3238371032),new c.init(1654270250,914150663),new c.init(2438529370,812702999),new c.init(355462360,4144912697),new c.init(1731405415,4290775857),new c.init(2394180231,1750603025),new c.init(3675008525,1694076839),new c.init(1203062813,3204075428)])},_doFinalize:function(){var a=e._doFinalize.call(this);return a.sigBytes-=16,a}});a.SHA384=e._createHelper(b),a.HmacSHA384=e._createHmacHelper(b)}(),function(a){function b(a,b,c,d,e,f,g){return a=a+(b&c|~b&d)+e+g,(a<>>32-f)+b}function c(a,b,c,d,e,f,g){return a=a+(b&d|c&~d)+e+g,(a<>>32-f)+b}function d(a,b,c,d,e,f,g){return a=a+(b^c^d)+e+g,(a<>>32-f)+b}function e(a,b,c,d,e,f,g){return a=a+(c^(b|~d))+e+g,(a<>>32-f)+b}for(var f=CryptoJS,g=f.lib,h=g.WordArray,i=g.Hasher,g=f.algo,j=[],k=0;64>k;k++)j[k]=4294967296*a.abs(a.sin(k+1))|0;g=g.MD5=i.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(a,f){for(var g=0;16>g;g++){var h=f+g,i=a[h];a[h]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var g=this._hash.words,h=a[f+0],i=a[f+1],k=a[f+2],l=a[f+3],m=a[f+4],n=a[f+5],o=a[f+6],p=a[f+7],q=a[f+8],r=a[f+9],s=a[f+10],t=a[f+11],u=a[f+12],v=a[f+13],w=a[f+14],x=a[f+15],y=g[0],z=g[1],A=g[2],B=g[3],y=b(y,z,A,B,h,7,j[0]),B=b(B,y,z,A,i,12,j[1]),A=b(A,B,y,z,k,17,j[2]),z=b(z,A,B,y,l,22,j[3]),y=b(y,z,A,B,m,7,j[4]),B=b(B,y,z,A,n,12,j[5]),A=b(A,B,y,z,o,17,j[6]),z=b(z,A,B,y,p,22,j[7]),y=b(y,z,A,B,q,7,j[8]),B=b(B,y,z,A,r,12,j[9]),A=b(A,B,y,z,s,17,j[10]),z=b(z,A,B,y,t,22,j[11]),y=b(y,z,A,B,u,7,j[12]),B=b(B,y,z,A,v,12,j[13]),A=b(A,B,y,z,w,17,j[14]),z=b(z,A,B,y,x,22,j[15]),y=c(y,z,A,B,i,5,j[16]),B=c(B,y,z,A,o,9,j[17]),A=c(A,B,y,z,t,14,j[18]),z=c(z,A,B,y,h,20,j[19]),y=c(y,z,A,B,n,5,j[20]),B=c(B,y,z,A,s,9,j[21]),A=c(A,B,y,z,x,14,j[22]),z=c(z,A,B,y,m,20,j[23]),y=c(y,z,A,B,r,5,j[24]),B=c(B,y,z,A,w,9,j[25]),A=c(A,B,y,z,l,14,j[26]),z=c(z,A,B,y,q,20,j[27]),y=c(y,z,A,B,v,5,j[28]),B=c(B,y,z,A,k,9,j[29]),A=c(A,B,y,z,p,14,j[30]),z=c(z,A,B,y,u,20,j[31]),y=d(y,z,A,B,n,4,j[32]),B=d(B,y,z,A,q,11,j[33]),A=d(A,B,y,z,t,16,j[34]),z=d(z,A,B,y,w,23,j[35]),y=d(y,z,A,B,i,4,j[36]),B=d(B,y,z,A,m,11,j[37]),A=d(A,B,y,z,p,16,j[38]),z=d(z,A,B,y,s,23,j[39]),y=d(y,z,A,B,v,4,j[40]),B=d(B,y,z,A,h,11,j[41]),A=d(A,B,y,z,l,16,j[42]),z=d(z,A,B,y,o,23,j[43]),y=d(y,z,A,B,r,4,j[44]),B=d(B,y,z,A,u,11,j[45]),A=d(A,B,y,z,x,16,j[46]),z=d(z,A,B,y,k,23,j[47]),y=e(y,z,A,B,h,6,j[48]),B=e(B,y,z,A,p,10,j[49]),A=e(A,B,y,z,w,15,j[50]),z=e(z,A,B,y,n,21,j[51]),y=e(y,z,A,B,u,6,j[52]),B=e(B,y,z,A,l,10,j[53]),A=e(A,B,y,z,s,15,j[54]),z=e(z,A,B,y,i,21,j[55]),y=e(y,z,A,B,q,6,j[56]),B=e(B,y,z,A,x,10,j[57]),A=e(A,B,y,z,o,15,j[58]),z=e(z,A,B,y,v,21,j[59]),y=e(y,z,A,B,m,6,j[60]),B=e(B,y,z,A,t,10,j[61]),A=e(A,B,y,z,k,15,j[62]),z=e(z,A,B,y,r,21,j[63]);g[0]=g[0]+y|0,g[1]=g[1]+z|0,g[2]=g[2]+A|0,g[3]=g[3]+B|0},_doFinalize:function(){var b=this._data,c=b.words,d=8*this._nDataBytes,e=8*b.sigBytes;c[e>>>5]|=128<<24-e%32;var f=a.floor(d/4294967296);for(c[(e+64>>>9<<4)+15]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c[(e+64>>>9<<4)+14]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),b.sigBytes=4*(c.length+1),this._process(),b=this._hash,c=b.words,d=0;4>d;d++)e=c[d],c[d]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8);return b},clone:function(){var a=i.clone.call(this);return a._hash=this._hash.clone(),a}}),f.MD5=i._createHelper(g),f.HmacMD5=i._createHmacHelper(g)}(Math),function(){var a=CryptoJS,b=a.lib.WordArray;a.enc.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp(),a=[];for(var e=0;c>e;e+=3)for(var f=(b[e>>>2]>>>24-8*(e%4)&255)<<16|(b[e+1>>>2]>>>24-8*((e+1)%4)&255)<<8|b[e+2>>>2]>>>24-8*((e+2)%4)&255,g=0;4>g&&c>e+.75*g;g++)a.push(d.charAt(f>>>6*(3-g)&63));if(b=d.charAt(64))for(;a.length%4;)a.push(b);return a.join("")},parse:function(a){var c=a.length,d=this._map,e=d.charAt(64);e&&(e=a.indexOf(e),-1!=e&&(c=e));for(var e=[],f=0,g=0;c>g;g++)if(g%4){var h=d.indexOf(a.charAt(g-1))<<2*(g%4),i=d.indexOf(a.charAt(g))>>>6-2*(g%4);e[f>>>2]|=(h|i)<<24-8*(f%4),f++}return b.create(e,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),CryptoJS.lib.Cipher||function(a){var b=CryptoJS,c=b.lib,d=c.Base,e=c.WordArray,f=c.BufferedBlockAlgorithm,g=b.enc.Base64,h=b.algo.EvpKDF,i=c.Cipher=f.extend({cfg:d.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c),this._xformMode=a,this._key=b,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(a){return this._append(a),this._process()},finalize:function(a){return a&&this._append(a),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(b,c,d){return("string"==typeof c?o:n).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?o:n).decrypt(a,b,c,d)}}}});c.StreamCipher=i.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var j=b.mode={},k=function(b,c,d){var e=this._iv;e?this._iv=a:e=this._prevBlock;for(var f=0;d>f;f++)b[c+f]^=e[f]},l=(c.BlockCipherMode=d.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a,this._iv=b}})).extend();l.Encryptor=l.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize;k.call(this,a,b,d),c.encryptBlock(a,b),this._prevBlock=a.slice(b,b+d)}}),l.Decryptor=l.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=a.slice(b,b+d);c.decryptBlock(a,b),k.call(this,a,b,d),this._prevBlock=e}}),j=j.CBC=l,l=(b.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,f=[],g=0;c>g;g+=4)f.push(d);c=e.create(f,c),a.concat(c)},unpad:function(a){a.sigBytes-=255&a.words[a.sigBytes-1>>>2]}},c.BlockCipher=i.extend({cfg:i.cfg.extend({mode:j,padding:l}),reset:function(){i.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var m=c.CipherParams=d.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),j=(b.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;return a=a.salt,(a?e.create([1398893684,1701076831]).concat(a).concat(b):b).toString(g)},parse:function(a){a=g.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=e.create(b.slice(2,4));b.splice(0,4),a.sigBytes-=16}return m.create({ciphertext:a,salt:c})}},n=c.SerializableCipher=d.extend({cfg:d.extend({format:j}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d);return b=e.finalize(b),e=e.cfg,m.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){return d=this.cfg.extend(d),b=this._parse(b,d.format),a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),b=(b.kdf={}).OpenSSL={execute:function(a,b,c,d){return d||(d=e.random(8)),a=h.create({keySize:b+c}).compute(a,d),c=e.create(a.words.slice(b),4*c),a.sigBytes=4*b,m.create({key:a,iv:c,salt:d})}},o=c.PasswordBasedCipher=n.extend({cfg:n.cfg.extend({kdf:b}),encrypt:function(a,b,c,d){return d=this.cfg.extend(d),c=d.kdf.execute(c,a.keySize,a.ivSize),d.iv=c.iv,a=n.encrypt.call(this,a,b,c.key,d),a.mixIn(c),a},decrypt:function(a,b,c,d){return d=this.cfg.extend(d),b=this._parse(b,d.format),c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt),d.iv=c.iv,n.decrypt.call(this,a,b,c.key,d)}})}(),function(){for(var a=CryptoJS,b=a.lib.BlockCipher,c=a.algo,d=[],e=[],f=[],g=[],h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=0;256>o;o++)n[o]=128>o?o<<1:o<<1^283;for(var p=0,q=0,o=0;256>o;o++){var r=q^q<<1^q<<2^q<<3^q<<4,r=r>>>8^255&r^99;d[p]=r,e[r]=p;var s=n[p],t=n[s],u=n[t],v=257*n[r]^16843008*r;f[p]=v<<24|v>>>8,g[p]=v<<16|v>>>16,h[p]=v<<8|v>>>24,i[p]=v,v=16843009*u^65537*t^257*s^16843008*p,j[r]=v<<24|v>>>8,k[r]=v<<16|v>>>16,l[r]=v<<8|v>>>24,m[r]=v,p?(p=s^n[n[n[u^s]]],q^=n[n[q]]):p=q=1}var w=[0,1,2,4,8,16,32,64,128,27,54],c=c.AES=b.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes/4,a=4*((this._nRounds=c+6)+1),e=this._keySchedule=[],f=0;a>f;f++)if(c>f)e[f]=b[f];else{var g=e[f-1];f%c?c>6&&4==f%c&&(g=d[g>>>24]<<24|d[g>>>16&255]<<16|d[g>>>8&255]<<8|d[255&g]):(g=g<<8|g>>>24,g=d[g>>>24]<<24|d[g>>>16&255]<<16|d[g>>>8&255]<<8|d[255&g],g^=w[f/c|0]<<24),e[f]=e[f-c]^g}for(b=this._invKeySchedule=[],c=0;a>c;c++)f=a-c,g=c%4?e[f]:e[f-4],b[c]=4>c||4>=f?g:j[d[g>>>24]]^k[d[g>>>16&255]]^l[d[g>>>8&255]]^m[d[255&g]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,f,g,h,i,d)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c,this._doCryptBlock(a,b,this._invKeySchedule,j,k,l,m,e),c=a[b+1],a[b+1]=a[b+3],a[b+3]=c},_doCryptBlock:function(a,b,c,d,e,f,g,h){for(var i=this._nRounds,j=a[b]^c[0],k=a[b+1]^c[1],l=a[b+2]^c[2],m=a[b+3]^c[3],n=4,o=1;i>o;o++)var p=d[j>>>24]^e[k>>>16&255]^f[l>>>8&255]^g[255&m]^c[n++],q=d[k>>>24]^e[l>>>16&255]^f[m>>>8&255]^g[255&j]^c[n++],r=d[l>>>24]^e[m>>>16&255]^f[j>>>8&255]^g[255&k]^c[n++],m=d[m>>>24]^e[j>>>16&255]^f[k>>>8&255]^g[255&l]^c[n++],j=p,k=q,l=r;p=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[255&m])^c[n++],q=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[255&j])^c[n++],r=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[255&k])^c[n++],m=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[255&l])^c[n++],a[b]=p,a[b+1]=q,a[b+2]=r,a[b+3]=m},keySize:8});a.AES=b._createHelper(c)}(),function(){function a(a,b){var c=(this._lBlock>>>a^this._rBlock)&b;this._rBlock^=c,this._lBlock^=c<>>a^this._lBlock)&b;this._lBlock^=c,this._rBlock^=c<c;c++){var d=g[c]-1;b[c]=a[d>>>5]>>>31-d%32&1}for(a=this._subKeys=[],d=0;16>d;d++){for(var e=a[d]=[],f=i[d],c=0;24>c;c++)e[c/6|0]|=b[(h[c]-1+f)%28]<<31-c%6,e[4+(c/6|0)]|=b[28+(h[c+24]-1+f)%28]<<31-c%6;for(e[0]=e[0]<<1|e[0]>>>31,c=1;7>c;c++)e[c]>>>=4*(c-1)+3;e[7]=e[7]<<5|e[7]>>>27}for(b=this._invSubKeys=[],c=0;16>c;c++)b[c]=a[15-c]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._subKeys)},decryptBlock:function(a,b){this._doCryptBlock(a,b,this._invSubKeys)},_doCryptBlock:function(c,d,e){this._lBlock=c[d],this._rBlock=c[d+1],a.call(this,4,252645135),a.call(this,16,65535),b.call(this,2,858993459),b.call(this,8,16711935),a.call(this,1,1431655765);for(var f=0;16>f;f++){for(var g=e[f],h=this._lBlock,i=this._rBlock,l=0,m=0;8>m;m++)l|=j[m][((i^g[m])&k[m])>>>0];this._lBlock=i,this._rBlock=h^l}e=this._lBlock,this._lBlock=this._rBlock,this._rBlock=e,a.call(this,1,1431655765),b.call(this,8,16711935),b.call(this,2,858993459),a.call(this,16,65535),a.call(this,4,252645135),c[d]=this._lBlock,c[d+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});c.DES=d._createHelper(l),f=f.TripleDES=d.extend({_doReset:function(){var a=this._key.words;this._des1=l.createEncryptor(e.create(a.slice(0,2))),this._des2=l.createEncryptor(e.create(a.slice(2,4))),this._des3=l.createEncryptor(e.create(a.slice(4,6)))},encryptBlock:function(a,b){this._des1.encryptBlock(a,b),this._des2.decryptBlock(a,b),this._des3.encryptBlock(a,b)},decryptBlock:function(a,b){this._des3.decryptBlock(a,b),this._des2.encryptBlock(a,b),this._des1.decryptBlock(a,b)},keySize:6,ivSize:2,blockSize:2}),c.TripleDES=d._createHelper(f)}(),function(){var a=CryptoJS,b=a.lib,c=b.WordArray,d=b.Hasher,e=[],b=a.algo.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],f=c[1],g=c[2],h=c[3],i=c[4],j=0;80>j;j++){if(16>j)e[j]=0|a[b+j];else{var k=e[j-3]^e[j-8]^e[j-14]^e[j-16];e[j]=k<<1|k>>>31}k=(d<<5|d>>>27)+i+e[j],k=20>j?k+((f&g|~f&h)+1518500249):40>j?k+((f^g^h)+1859775393):60>j?k+((f&g|f&h|g&h)-1894007588):k+((f^g^h)-899497514),i=h,h=g,g=f<<30|f>>>2,f=d,d=k}c[0]=c[0]+d|0,c[1]=c[1]+f|0,c[2]=c[2]+g|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.SHA1=d._createHelper(b),a.HmacSHA1=d._createHmacHelper(b)}(),function(){var a=CryptoJS,b=a.lib,c=b.WordArray,d=b.Hasher,b=a.algo,e=c.create([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]),f=c.create([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=c.create([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]),h=c.create([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]),i=c.create([0,1518500249,1859775393,2400959708,2840853838]),j=c.create([1352829926,1548603684,1836072691,2053994217,0]),b=b.RIPEMD160=d.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=0;16>c;c++){var d=b+c,k=a[d];a[d]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l,m,n,o,p,q,r,s,t,u,d=this._hash.words,k=i.words,v=j.words,w=e.words,x=f.words,y=g.words,z=h.words;q=l=d[0],r=m=d[1],s=n=d[2],t=o=d[3],u=p=d[4];for(var A,c=0;80>c;c+=1)A=l+a[b+w[c]]|0,A=16>c?A+((m^n^o)+k[0]):32>c?A+((m&n|~m&o)+k[1]):48>c?A+(((m|~n)^o)+k[2]):64>c?A+((m&o|n&~o)+k[3]):A+((m^(n|~o))+k[4]),A|=0,A=A<>>32-y[c],A=A+p|0,l=p,p=o,o=n<<10|n>>>22,n=m,m=A,A=q+a[b+x[c]]|0,A=16>c?A+((r^(s|~t))+v[0]):32>c?A+((r&t|s&~t)+v[1]):48>c?A+(((r|~s)^t)+v[2]):64>c?A+((r&s|~r&t)+v[3]):A+((r^s^t)+v[4]),A|=0,A=A<>>32-z[c],A=A+u|0,q=u,u=t,t=s<<10|s>>>22,s=r,r=A;A=d[1]+n+t|0,d[1]=d[2]+o+u|0,d[2]=d[3]+p+q|0,d[3]=d[4]+l+r|0,d[4]=d[0]+m+s|0,d[0]=A},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;for(b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),a.sigBytes=4*(b.length+1),this._process(),a=this._hash,b=a.words,c=0;5>c;c++)d=b[c],b[c]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8);return a},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.RIPEMD160=d._createHelper(b),a.HmacRIPEMD160=d._createHmacHelper(b)}(Math),function(){var a=CryptoJS,b=a.lib,c=b.Base,d=b.WordArray,b=a.algo,e=b.HMAC,f=b.PBKDF2=c.extend({cfg:c.extend({keySize:4,hasher:b.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=e.create(c.hasher,a),g=d.create(),h=d.create([1]),i=g.words,j=h.words,k=c.keySize,c=c.iterations;i.lengthp;p++){o=f.finalize(o),f.reset();for(var q=o.words,r=0;n>r;r++)m[r]^=q[r]}g.concat(l),j[0]++}return g.sigBytes=4*k,g}});a.PBKDF2=function(a,b,c){return f.create(c).compute(a,b)}}();var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64pad="=",dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength, +BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256,rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if("Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;trng_pptr;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes;var SHA1_SIZE=20;RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,RSAKey.prototype.encryptOAEP=RSAEncryptOAEP,RSAKey.prototype.type="RSA";var SHA1_SIZE=20;RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.generate=RSAGenerate,RSAKey.prototype.decrypt=RSADecrypt,RSAKey.prototype.decryptOAEP=RSADecryptOAEP,ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex,ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ECPointFp.prototype.getEncoded=function(a){var b=function(a,b){var c=a.toByteArrayUnsigned();if(bc.length;)c.unshift(0);return c},c=this.getX().toBigInteger(),d=this.getY().toBigInteger(),e=b(c,32);return a?d.isEven()?e.unshift(2):e.unshift(3):(e.unshift(4),e=e.concat(b(d,32))),e},ECPointFp.decodeFrom=function(a,b){var c=(b[0],b.length-1),d=b.slice(1,1+c/2),e=b.slice(1+c/2,1+c);d.unshift(0),e.unshift(0);var f=new BigInteger(d),g=new BigInteger(e);return new ECPointFp(a,a.fromBigInteger(f),a.fromBigInteger(g))},ECPointFp.decodeFromHex=function(a,b){var c=(b.substr(0,2),b.length-2),d=b.substr(2,c/2),e=b.substr(2+c/2,c/2),f=new BigInteger(d,16),g=new BigInteger(e,16);return new ECPointFp(a,a.fromBigInteger(f),a.fromBigInteger(g))},ECPointFp.prototype.add2D=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;if(this.x.equals(a.x))return this.y.equals(a.y)?this.twice():this.curve.getInfinity();var b=a.x.subtract(this.x),c=a.y.subtract(this.y),d=c.divide(b),e=d.square().subtract(this.x).subtract(a.x),f=d.multiply(this.x.subtract(e)).subtract(this.y);return new ECPointFp(this.curve,e,f)},ECPointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var a=this.curve.fromBigInteger(BigInteger.valueOf(2)),b=this.curve.fromBigInteger(BigInteger.valueOf(3)),c=this.x.square().multiply(b).add(this.curve.a).divide(this.y.multiply(a)),d=c.square().subtract(this.x.multiply(a)),e=c.multiply(this.x.subtract(d)).subtract(this.y);return new ECPointFp(this.curve,d,e)},ECPointFp.prototype.multiply2D=function(a){if(this.isInfinity())return this;if(0==a.signum())return this.curve.getInfinity();var b,c=a,d=c.multiply(new BigInteger("3")),e=this.negate(),f=this;for(b=d.bitLength()-2;b>0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add2D(g?this:e))}return f},ECPointFp.prototype.isOnCurve=function(){var a=this.getX().toBigInteger(),b=this.getY().toBigInteger(),c=this.curve.getA().toBigInteger(),d=this.curve.getB().toBigInteger(),e=this.curve.getQ(),f=b.multiply(b).mod(e),g=a.multiply(a).multiply(a).add(c.multiply(a)).add(d).mod(e);return f.equals(g)},ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ECPointFp.prototype.validate=function(){var a=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var b=this.getX().toBigInteger(),c=this.getY().toBigInteger();if(b.compareTo(BigInteger.ONE)<0||b.compareTo(a.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(c.compareTo(BigInteger.ONE)<0||c.compareTo(a.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(a).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);return b.length%2==1&&(b="0"+b),b},this.bigIntToMinTwosComplementsHex=function(a){var b=a.toString(16);if("-"!=b.substr(0,1))b.length%2==1?b="0"+b:b.match(/^[0-7]/)||(b="00"+b);else{var c=b.substr(1),d=c.length;d%2==1?d+=1:b.match(/^[0-7]/)||(d+=2);for(var e="",f=0;d>f;f++)e+="f";var g=new BigInteger(e,16),h=g.xor(a).add(BigInteger.ONE);b=h.toString(16).replace(/^-/,"")}return b},this.getPEMStringFromHex=function(a,b){var c=(KJUR.asn1,CryptoJS.enc.Hex.parse(a)),d=CryptoJS.enc.Base64.stringify(c),e=d.replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,""),"-----BEGIN "+b+"-----\r\n"+e+"\r\n-----END "+b+"-----\r\n"},this.newObject=function(a){var b=KJUR.asn1,c=Object.keys(a);if(1!=c.length)throw"key of param shall be only one.";var d=c[0];if(-1==":bool:int:bitstr:octstr:null:oid:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+d+":"))throw"undefined key: "+d;if("bool"==d)return new b.DERBoolean(a[d]);if("int"==d)return new b.DERInteger(a[d]);if("bitstr"==d)return new b.DERBitString(a[d]);if("octstr"==d)return new b.DEROctetString(a[d]);if("null"==d)return new b.DERNull(a[d]);if("oid"==d)return new b.DERObjectIdentifier(a[d]);if("utf8str"==d)return new b.DERUTF8String(a[d]);if("numstr"==d)return new b.DERNumericString(a[d]);if("prnstr"==d)return new b.DERPrintableString(a[d]);if("telstr"==d)return new b.DERTeletexString(a[d]);if("ia5str"==d)return new b.DERIA5String(a[d]);if("utctime"==d)return new b.DERUTCTime(a[d]);if("gentime"==d)return new b.DERGeneralizedTime(a[d]);if("seq"==d){for(var e=a[d],f=[],g=0;gb)return c;var d=c.length/2;if(d>15)throw"ASN.1 length too long to represent by 8x: n = "+b.toString(16);var e=128+d;return e.toString(16)+c},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(a){this.hTLV=null,this.isModified=!0,this.s=a,this.hV=stohex(this.s)},this.setStringHex=function(a){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=a},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("string"==typeof a?this.setString(a):"undefined"!=typeof a.str?this.setString(a.str):"undefined"!=typeof a.hex&&this.setStringHex(a.hex))},YAHOO.lang.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(a){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(a){utc=a.getTime()+6e4*a.getTimezoneOffset();var b=new Date(utc);return b},this.formatDate=function(a,b){var c=this.zeroPadding,d=this.localDateToUTC(a),e=String(d.getFullYear());"utc"==b&&(e=e.substr(2,2));var f=c(String(d.getMonth()+1),2),g=c(String(d.getDate()),2),h=c(String(d.getHours()),2),i=c(String(d.getMinutes()),2),j=c(String(d.getSeconds()),2);return e+f+g+h+i+j+"Z"},this.zeroPadding=function(a,b){return a.length>=b?a:new Array(b-a.length+1).join("0")+a},this.getString=function(){return this.s},this.setString=function(a){this.hTLV=null,this.isModified=!0,this.s=a,this.hV=stohex(a)},this.setByDateValue=function(a,b,c,d,e,f){var g=new Date(Date.UTC(a,b-1,c,d,e,f,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},YAHOO.lang.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(a){this.hTLV=null,this.isModified=!0,this.asn1Array=a},this.appendASN1Object=function(a){this.hTLV=null,this.isModified=!0,this.asn1Array.push(a)},this.asn1Array=new Array,"undefined"!=typeof a&&"undefined"!=typeof a.array&&(this.asn1Array=a.array)},YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(a){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a)},this.setByInteger=function(a){var b=new BigInteger(String(a),10);this.setByBigInteger(b)},this.setValueHex=function(a){this.hV=a},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.bigint?this.setByBigInteger(a.bigint):"undefined"!=typeof a["int"]?this.setByInteger(a["int"]):"number"==typeof a?this.setByInteger(a):"undefined"!=typeof a.hex&&this.setValueHex(a.hex))},YAHOO.lang.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(a){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(a){this.hTLV=null,this.isModified=!0,this.hV=a},this.setUnusedBitsAndHexValue=function(a,b){if(0>a||a>7)throw"unused bits shall be from 0 to 7: u = "+a;var c="0"+a;this.hTLV=null,this.isModified=!0,this.hV=c+b},this.setByBinaryString=function(a){a=a.replace(/0+$/,"");var b=8-a.length%8;8==b&&(b=0);for(var c=0;b>=c;c++)a+="0";for(var d="",c=0;cc;c++)b[c]=!1;return b},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("string"==typeof a&&a.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(a):"undefined"!=typeof a.hex?this.setHexValueIncludingUnusedBits(a.hex):"undefined"!=typeof a.bin?this.setByBinaryString(a.bin):"undefined"!=typeof a.array&&this.setByBooleanArray(a.array))},YAHOO.lang.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(a){KJUR.asn1.DEROctetString.superclass.constructor.call(this,a),this.hT="04"},YAHOO.lang.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},YAHOO.lang.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(a){var b=function(a){var b=a.toString(16);return 1==b.length&&(b="0"+b),b},c=function(a){var c="",d=new BigInteger(a,10),e=d.toString(2),f=7-e.length%7;7==f&&(f=0);for(var g="",h=0;f>h;h++)g+="0";e=g+e;for(var h=0;h0&&10>c?c+1:-2},this.getHexOfL_AtObj=function(a,b){var c=this.getByteLengthOfL_AtObj(a,b);return 1>c?"":a.substring(b+2,b+2+2*c)},this.getIntOfL_AtObj=function(a,b){var c=this.getHexOfL_AtObj(a,b);if(""==c)return-1;var d;return d=parseInt(c.substring(0,1))<8?new BigInteger(c,16):new BigInteger(c.substring(2),16),d.intValue()},this.getStartPosOfV_AtObj=function(a,b){var c=this.getByteLengthOfL_AtObj(a,b);return 0>c?c:b+2*(c+1)},this.getHexOfV_AtObj=function(a,b){var c=this.getStartPosOfV_AtObj(a,b),d=this.getIntOfL_AtObj(a,b);return a.substring(c,c+2*d)},this.getHexOfTLV_AtObj=function(a,b){var c=a.substr(b,2),d=this.getHexOfL_AtObj(a,b),e=this.getHexOfV_AtObj(a,b);return c+d+e},this.getPosOfNextSibling_AtObj=function(a,b){var c=this.getStartPosOfV_AtObj(a,b),d=this.getIntOfL_AtObj(a,b);return c+2*d},this.getPosArrayOfChildren_AtObj=function(a,b){var c=new Array,d=this.getStartPosOfV_AtObj(a,b);c.push(d);for(var e=this.getIntOfL_AtObj(a,b),f=d,g=0;;){var h=this.getPosOfNextSibling_AtObj(a,f);if(null==h||h-d>=2*e)break;if(g>=200)break;c.push(h),f=h,g++}return c},this.getNthChildIndex_AtObj=function(a,b,c){var d=this.getPosArrayOfChildren_AtObj(a,b);return d[c]},this.getDecendantIndexByNthList=function(a,b,c){if(0==c.length)return b;var d=c.shift(),e=this.getPosArrayOfChildren_AtObj(a,b);return this.getDecendantIndexByNthList(a,e[d],c)},this.getDecendantHexTLVByNthList=function(a,b,c){var d=this.getDecendantIndexByNthList(a,b,c);return this.getHexOfTLV_AtObj(a,d)},this.getDecendantHexVByNthList=function(a,b,c){var d=this.getDecendantIndexByNthList(a,b,c);return this.getHexOfV_AtObj(a,d)}};"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),"undefined"!=typeof KJUR.asn1.x509&&KJUR.asn1.x509||(KJUR.asn1.x509={}),KJUR.asn1.x509.Certificate=function(a){KJUR.asn1.x509.Certificate.superclass.constructor.call(this);this.setRsaPrvKeyByPEMandPass=function(a,b){var c=PKCS5PKEY.getDecryptedKeyHex(a,b),d=new RSAKey;d.readPrivateKeyFromASN1HexString(c),this.rsaPrvKey=d},this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg,sig=new KJUR.crypto.Signature({alg:"SHA1withRSA",prov:"cryptojs/jsrsa"}),sig.initSign(this.rsaPrvKey),sig.updateHex(this.asn1TBSCert.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var a=new KJUR.asn1.DERSequence({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=a.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){var a=this.getEncodedHex(),b=CryptoJS.enc.Hex.parse(a),c=CryptoJS.enc.Base64.stringify(b),d=c.replace(/(.{64})/g,"$1\r\n");return"-----BEGIN CERTIFICATE-----\r\n"+d+"\r\n-----END CERTIFICATE-----\r\n"},"undefined"!=typeof a&&("undefined"!=typeof a.tbscertobj&&(this.asn1TBSCert=a.tbscertobj),"undefined"!=typeof a.rsaprvkey&&(this.rsaPrvKey=a.rsaprvkey),"undefined"!=typeof a.rsaprvpem&&"undefined"!=typeof a.rsaprvpas&&this.setRsaPrvKeyByPEMandPass(a.rsaprvpem,a.rsaprvpas))},YAHOO.lang.extend(KJUR.asn1.x509.Certificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.TBSCertificate=function(a){KJUR.asn1.x509.TBSCertificate.superclass.constructor.call(this),this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new KJUR.asn1.DERTaggedObject({obj:new KJUR.asn1.DERInteger({"int":2})}),this.asn1SerialNumber=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1NotBefore=null,this.asn1NotAfter=null,this.asn1Subject=null,this.asn1SubjPKey=null,this.extensionsArray=new Array},this.setSerialNumberByParam=function(a){this.asn1SerialNumber=new KJUR.asn1.DERInteger(a)},this.setSignatureAlgByParam=function(a){this.asn1SignatureAlg=new KJUR.asn1.x509.AlgorithmIdentifier(a)},this.setIssuerByParam=function(a){this.asn1Issuer=new KJUR.asn1.x509.X500Name(a)},this.setNotBeforeByParam=function(a){this.asn1NotBefore=new KJUR.asn1.x509.Time(a)},this.setNotAfterByParam=function(a){this.asn1NotAfter=new KJUR.asn1.x509.Time(a)},this.setSubjectByParam=function(a){this.asn1Subject=new KJUR.asn1.x509.X500Name(a)},this.setSubjectPublicKeyByParam=function(a){this.asn1SubjPKey=new KJUR.asn1.x509.SubjectPublicKeyInfo(a)},this.appendExtension=function(a){this.extensionsArray.push(a)},this.getEncodedHex=function(){if(null==this.asn1NotBefore||null==this.asn1NotAfter)throw"notBefore and/or notAfter not set";var a=new KJUR.asn1.DERSequence({array:[this.asn1NotBefore,this.asn1NotAfter]});if(this.asn1Array=new Array,this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1SerialNumber),this.asn1Array.push(this.asn1SignatureAlg),this.asn1Array.push(this.asn1Issuer),this.asn1Array.push(a),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey),this.extensionsArray.length>0){var b=new KJUR.asn1.DERSequence({array:this.extensionsArray}),c=new KJUR.asn1.DERTaggedObject({explicit:!0,tag:"a3",obj:b});this.asn1Array.push(c)}var d=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=d.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Extension=function(a){KJUR.asn1.x509.Extension.superclass.constructor.call(this);this.getEncodedHex=function(){var a=new KJUR.asn1.DERObjectIdentifier({oid:this.oid}),b=new KJUR.asn1.DEROctetString({hex:this.getExtnValueHex()}),c=new Array;c.push(a),this.critical&&c.push(new KJUR.asn1.DERBoolean),c.push(b);var d=new KJUR.asn1.DERSequence({array:c});return d.getEncodedHex()},this.critical=!1,"undefined"!=typeof a&&"undefined"!=typeof a.critical&&(this.critical=a.critical)},YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object),KJUR.asn1.x509.KeyUsage=function(a){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,a),this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15","undefined"!=typeof a&&"undefined"!=typeof a.bin&&(this.asn1ExtnValue=new KJUR.asn1.DERBitString(a))},YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage,KJUR.asn1.x509.Extension),KJUR.asn1.x509.BasicConstraints=function(a){KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this,a);this.getExtnValueHex=function(){var a=new Array;this.cA&&a.push(new KJUR.asn1.DERBoolean),this.pathLen>-1&&a.push(new KJUR.asn1.DERInteger({"int":this.pathLen}));var b=new KJUR.asn1.DERSequence({array:a});return this.asn1ExtnValue=b,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,"undefined"!=typeof a&&("undefined"!=typeof a.cA&&(this.cA=a.cA),"undefined"!=typeof a.pathLen&&(this.pathLen=a.pathLen))},YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.CRLDistributionPoints=function(a){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,a),this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(a){this.asn1ExtnValue=new KJUR.asn1.DERSequence({array:a})},this.setByOneURI=function(a){var b=new KJUR.asn1.x509.GeneralNames([{uri:a}]),c=new KJUR.asn1.x509.DistributionPointName(b),d=new KJUR.asn1.x509.DistributionPoint({dpobj:c});this.setByDPArray([d])},this.oid="2.5.29.31","undefined"!=typeof a&&("undefined"!=typeof a.array?this.setByDPArray(a.array):"undefined"!=typeof a.uri&&this.setByOneURI(a.uri))},YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.ExtKeyUsage=function(a){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,a),this.setPurposeArray=function(a){this.asn1ExtnValue=new KJUR.asn1.DERSequence;for(var b=0;b0){var a=new KJUR.asn1.DERSequence({array:this.aRevokedCert});this.asn1Array.push(a)}var b=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=b.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize=function(){this.asn1Version=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1ThisUpdate=null,this.asn1NextUpdate=null,this.aRevokedCert=new Array},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object),KJUR.asn1.x509.CRLEntry=function(a){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);this.setCertSerial=function(a){this.sn=new KJUR.asn1.DERInteger(a)},this.setRevocationDate=function(a){this.time=new KJUR.asn1.x509.Time(a)},this.getEncodedHex=function(){var a=new KJUR.asn1.DERSequence({array:[this.sn,this.time]});return this.TLV=a.getEncodedHex(),this.TLV},"undefined"!=typeof a&&("undefined"!=typeof a.time&&this.setRevocationDate(a.time), +"undefined"!=typeof a.sn&&this.setCertSerial(a.sn))},YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object),KJUR.asn1.x509.X500Name=function(a){KJUR.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=new Array,this.setByString=function(a){var b=a.split("/");b.shift();for(var c=0;ce)throw"key is too short for SigAlg: keylen="+c+","+b;for(var f="0001",g="00"+d,h="",i=e-f.length-g.length,j=0;i>j;j+=2)h+="ff";var k=f+h+g;return k},this.hashString=function(a,b){var c=new KJUR.crypto.MessageDigest({alg:b});return c.digestString(a)},this.hashHex=function(a,b){var c=new KJUR.crypto.MessageDigest({alg:b});return c.digestHex(a)},this.sha1=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha1",prov:"cryptojs"});return b.digestString(a)},this.sha256=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return b.digestString(a)},this.sha256Hex=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return b.digestHex(a)},this.sha512=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return b.digestString(a)},this.sha512Hex=function(a){var b=new KJUR.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return b.digestHex(a)},this.md5=function(a){var b=new KJUR.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return b.digestString(a)},this.ripemd160=function(a){var b=new KJUR.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return b.digestString(a)},this.getCryptoJSMDByName=function(a){}},KJUR.crypto.MessageDigest=function(params){var md=null,algName=null,provName=null;this.setAlgAndProvider=function(alg,prov){if(null!=alg&&void 0===prov&&(prov=KJUR.crypto.Util.DEFAULTPROVIDER[alg]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(alg)&&"cryptojs"==prov){try{this.md=eval(KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[alg]).create()}catch(ex){throw"setAlgAndProvider hash alg set fail alg="+alg+"/"+ex}this.updateString=function(a){this.md.update(a)},this.updateHex=function(a){var b=CryptoJS.enc.Hex.parse(a);this.md.update(b)},this.digest=function(){var a=this.md.finalize();return a.toString(CryptoJS.enc.Hex)},this.digestString=function(a){return this.updateString(a),this.digest()},this.digestHex=function(a){return this.updateHex(a),this.digest()}}if(-1!=":sha256:".indexOf(alg)&&"sjcl"==prov){try{this.md=new sjcl.hash.sha256}catch(ex){throw"setAlgAndProvider hash alg set fail alg="+alg+"/"+ex}this.updateString=function(a){this.md.update(a)},this.updateHex=function(a){var b=sjcl.codec.hex.toBits(a);this.md.update(b)},this.digest=function(){var a=this.md.finalize();return sjcl.codec.hex.fromBits(a)},this.digestString=function(a){return this.updateString(a),this.digest()},this.digestHex=function(a){return this.updateHex(a),this.digest()}}},this.updateString=function(a){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(a){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(a){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(a){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==params&&void 0!==params.alg&&(this.algName=params.alg,void 0===params.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},KJUR.crypto.Mac=function(params){var mac=null,pass=null,algName=null,provName=null,algProv=null;this.setAlgAndProvider=function(alg,prov){if(null==alg&&(alg="hmacsha1"),alg=alg.toLowerCase(),"hmac"!=alg.substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+alg;void 0===prov&&(prov=KJUR.crypto.Util.DEFAULTPROVIDER[alg]),this.algProv=alg+"/"+prov;var hashAlg=alg.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(hashAlg)&&"cryptojs"==prov){try{var mdObj=eval(KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[hashAlg]);this.mac=CryptoJS.algo.HMAC.create(mdObj,this.pass)}catch(ex){throw"setAlgAndProvider hash alg set fail hashAlg="+hashAlg+"/"+ex}this.updateString=function(a){this.mac.update(a)},this.updateHex=function(a){var b=CryptoJS.enc.Hex.parse(a);this.mac.update(b)},this.doFinal=function(){var a=this.mac.finalize();return a.toString(CryptoJS.enc.Hex)},this.doFinalString=function(a){return this.updateString(a),this.doFinal()},this.doFinalHex=function(a){return this.updateHex(a),this.doFinal()}}},this.updateString=function(a){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(a){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(a){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(a){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},void 0!==params&&(void 0!==params.pass&&(this.pass=params.pass),void 0!==params.alg&&(this.algName=params.alg,void 0===params.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},KJUR.crypto.Signature=function(a){var b=null;if(this._setAlgNames=function(){this.algName.match(/^(.+)with(.+)$/)&&(this.mdAlgName=RegExp.$1.toLowerCase(),this.pubkeyAlgName=RegExp.$2.toLowerCase())},this._zeroPaddingOfSignature=function(a,b){for(var c="",d=b/4-a.length,e=0;d>e;e++)c+="0";return c+a},this.setAlgAndProvider=function(a,b){if(this._setAlgNames(),"cryptojs/jsrsa"!=b)throw"provider not supported: "+b;if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new KJUR.crypto.MessageDigest({alg:this.mdAlgName})}catch(c){throw"setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+c}this.init=function(a,b){if("string"==typeof a)if(-1!=a.indexOf("-END ENCRYPTED PRIVATE KEY-",0)&&void 0!==b)this.prvKey=PKCS5PKEY.getKeyFromEncryptedPKCS8PEM(a,b),this.state="SIGN";else if(-1!=a.indexOf("-END RSA PRIVATE KEY-",0)&&-1!=a.indexOf(",ENCRYPTED",0)&&void 0!==b)this.prvKey=PKCS5PKEY.getRSAKeyFromEncryptedPKCS5PEM(a,b),this.state="SIGN";else if(-1!=a.indexOf("-END RSA PRIVATE KEY-",0)&&-1==a.indexOf(",ENCRYPTED",0)&&void 0===b)this.prvKey=new RSAKey,this.prvKey.readPrivateKeyFromPEMString(a),this.state="SIGN";else if(-1!=a.indexOf("-END PRIVATE KEY-",0)&&void 0===b)this.prvKey=PKCS5PKEY.getKeyFromPlainPrivatePKCS8PEM(a),this.state="SIGN";else if(-1!=a.indexOf("-END PUBLIC KEY-",0)&&void 0===b)this.pubKey=PKCS5PKEY.getKeyFromPublicPKCS8PEM(a),this.state="VERIFY";else{if(-1==a.indexOf("-END CERTIFICATE-",0)&&-1==a.indexOf("-END X509 CERTIFICATE-",0)&&-1==a.indexOf("-END TRUSTED CERTIFICATE-",0)||void 0!==b)throw"unsupported arguments";this.pubKey=X509.getPublicKeyFromCertPEM(a),this.state="VERIFY"}else if(a instanceof RSAKey)if(null!=a.d)this.prvKey=a,this.state="SIGN";else{if(null==a.n)throw"RSAKey object is not private and public key";this.pubKey=a,this.state="VERIFY"}else if(a instanceof KJUR.crypto.ECDSA)if(null!=a.prvKeyHex)this.prvKey=a,this.state="SIGN";else{if(null==a.pubKeyHex)throw"ECDSA object is not private and public key";this.pubKey=a,this.state="VERIFY"}},this.initSign=function(a){"string"==typeof a.ecprvhex&&"string"==typeof a.eccurvename?(this.ecprvhex=a.ecprvhex,this.eccurvename=a.eccurvename):this.prvKey=a,this.state="SIGN"},this.initVerifyByPublicKey=function(a){"string"==typeof a.ecpubhex&&"string"==typeof a.eccurvename?(this.ecpubhex=a.ecpubhex,this.eccurvename=a.eccurvename):a instanceof KJUR.crypto.ECDSA?this.pubKey=a:a instanceof RSAKey&&(this.pubKey=a),this.state="VERIFY"},this.initVerifyByCertificatePEM=function(a){var b=new X509;b.readCertPEM(a),this.pubKey=b.subjectPublicKeyRSA,this.state="VERIFY"},this.updateString=function(a){this.md.updateString(a)},this.updateHex=function(a){this.md.updateHex(a)},this.sign=function(){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecprvhex&&"undefined"!=typeof this.eccurvename){var a=new KJUR.crypto.ECDSA({curve:this.eccurvename});this.hSign=a.signHex(this.sHashHex,this.ecprvhex)}else if("rsaandmgf1"==this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if("rsa"==this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else{if(!(this.prvKey instanceof KJUR.crypto.ECDSA))throw"Signature: unsupported public key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(a){this.updateString(a),this.sign()},this.signHex=function(a){this.updateHex(a),this.sign()},this.verify=function(a){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecpubhex&&"undefined"!=typeof this.eccurvename){var b=new KJUR.crypto.ECDSA({curve:this.eccurvename});return b.verifyHex(this.sHashHex,a,this.ecpubhex)}if("rsaandmgf1"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,a,this.mdAlgName,this.pssSaltLen);if("rsa"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);if(this.pubKey instanceof KJUR.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(a,b){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.initVerifyByPublicKey=function(a){throw"initVerifyByPublicKey(rsaPubKeyy) not supported for this alg:prov="+this.algProvName},this.initVerifyByCertificatePEM=function(a){throw"initVerifyByCertificatePEM(certPEM) not supported for this alg:prov="+this.algProvName},this.initSign=function(a){throw"initSign(prvKey) not supported for this alg:prov="+this.algProvName},this.updateString=function(a){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(a){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(a){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(a){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(a){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=a,void 0!==a&&(void 0!==a.alg&&(this.algName=a.alg,void 0===a.prov?this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=a.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==a.psssaltlen&&(this.pssSaltLen=a.psssaltlen),void 0!==a.prvkeypem)){if(void 0!==a.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{var b=new RSAKey;b.readPrivateKeyFromPEMString(a.prvkeypem),this.initSign(b)}catch(c){throw"fatal error to load pem private key: "+c}}},KJUR.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1"}},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECDSA=function(a){var b="secp256r1",c=new SecureRandom;this.type="EC",this.getBigRandom=function(a){return new BigInteger(a.bitLength(),c).mod(a.subtract(BigInteger.ONE)).add(BigInteger.ONE)},this.setNamedCurve=function(a){this.ecparams=KJUR.crypto.ECParameterDB.getByName(a),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=a},this.setPrivateKeyHex=function(a){this.prvKeyHex=a},this.setPublicKeyHex=function(a){this.pubKeyHex=a},this.generateKeyPairHex=function(){var a=this.ecparams.n,b=this.getBigRandom(a),c=this.ecparams.G.multiply(b),d=c.getX().toBigInteger(),e=c.getY().toBigInteger(),f=this.ecparams.keylen/4,g=("0000000000"+b.toString(16)).slice(-f),h=("0000000000"+d.toString(16)).slice(-f),i=("0000000000"+e.toString(16)).slice(-f),j="04"+h+i;return this.prvKeyHex=g,this.pubKeyHex=j,{ecprvhex:g,ecpubhex:j}},this.signWithMessageHash=function(a){return this.signHex(a,this.prvKeyHex)},this.signHex=function(a,b){var c=new BigInteger(b,16),d=this.ecparams.n,e=new BigInteger(a,16);do var f=this.getBigRandom(d),g=this.ecparams.G,h=g.multiply(f),i=h.getX().toBigInteger().mod(d);while(i.compareTo(BigInteger.ZERO)<=0);var j=f.modInverse(d).multiply(e.add(c.multiply(i))).mod(d);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(i,j)},this.sign=function(a,b){var c=b,d=this.ecparams.n,e=BigInteger.fromByteArrayUnsigned(a);do var f=this.getBigRandom(d),g=this.ecparams.G,h=g.multiply(f),i=h.getX().toBigInteger().mod(d);while(i.compareTo(BigInteger.ZERO)<=0);var j=f.modInverse(d).multiply(e.add(c.multiply(i))).mod(d);return this.serializeSig(i,j)},this.verifyWithMessageHash=function(a,b){return this.verifyHex(a,b,this.pubKeyHex)},this.verifyHex=function(a,b,c){var d,e,f=KJUR.crypto.ECDSA.parseSigHex(b);d=f.r,e=f.s;var g;g=ECPointFp.decodeFromHex(this.ecparams.curve,c);var h=new BigInteger(a,16);return this.verifyRaw(h,d,e,g)},this.verify=function(a,b,c){var d,e;if(Bitcoin.Util.isArray(b)){var f=this.parseSig(b);d=f.r,e=f.s}else{if("object"!=typeof b||!b.r||!b.s)throw"Invalid value for signature";d=b.r,e=b.s}var g;if(c instanceof ECPointFp)g=c;else{if(!Bitcoin.Util.isArray(c))throw"Invalid format for pubkey value, must be byte array or ECPointFp";g=ECPointFp.decodeFrom(this.ecparams.curve,c)}var h=BigInteger.fromByteArrayUnsigned(a);return this.verifyRaw(h,d,e,g)},this.verifyRaw=function(a,b,c,d){var e=this.ecparams.n,f=this.ecparams.G;if(b.compareTo(BigInteger.ONE)<0||b.compareTo(e)>=0)return!1;if(c.compareTo(BigInteger.ONE)<0||c.compareTo(e)>=0)return!1;var g=c.modInverse(e),h=a.multiply(g).mod(e),i=b.multiply(g).mod(e),j=f.multiply(h).add(d.multiply(i)),k=j.getX().toBigInteger().mod(e);return k.equals(b)},this.serializeSig=function(a,b){var c=a.toByteArraySigned(),d=b.toByteArraySigned(),e=[];return e.push(2),e.push(c.length),e=e.concat(c),e.push(2),e.push(d.length),e=e.concat(d),e.unshift(e.length),e.unshift(48),e},this.parseSig=function(a){var b;if(48!=a[0])throw new Error("Signature not a valid DERSequence");if(b=2,2!=a[b])throw new Error("First element in signature must be a DERInteger");var c=a.slice(b+2,b+2+a[b+1]);if(b+=2+a[b+1],2!=a[b])throw new Error("Second element in signature must be a DERInteger");var d=a.slice(b+2,b+2+a[b+1]);b+=2+a[b+1];var e=BigInteger.fromByteArrayUnsigned(c),f=BigInteger.fromByteArrayUnsigned(d);return{r:e,s:f}},this.parseSigCompact=function(a){if(65!==a.length)throw"Signature has the wrong length";var b=a[0]-27;if(0>b||b>7)throw"Invalid signature type";var c=this.ecparams.n,d=BigInteger.fromByteArrayUnsigned(a.slice(1,33)).mod(c),e=BigInteger.fromByteArrayUnsigned(a.slice(33,65)).mod(c);return{r:d,s:e,i:b}},void 0!==a&&void 0!==a.curve&&(this.curveName=a.curve),void 0===this.curveName&&(this.curveName=b),this.setNamedCurve(this.curveName),void 0!==a&&(void 0!==a.prv&&(this.prvKeyHex=a.prv),void 0!==a.pub&&(this.pubKeyHex=a.pub))},KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a),c=new BigInteger(b.r,16),d=new BigInteger(b.s,16);return{r:c,s:d}},KJUR.crypto.ECDSA.parseSigHexInHexRS=function(a){if("30"!=a.substr(0,2))throw"signature is not a ASN.1 sequence";var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=b.length)throw"number of signature ASN.1 sequence elements seem wrong";var c=b[0],d=b[1];if("02"!=a.substr(c,2))throw"1st item of sequene of signature is not ASN.1 integer";if("02"!=a.substr(d,2))throw"2nd item of sequene of signature is not ASN.1 integer";var e=ASN1HEX.getHexOfV_AtObj(a,c),f=ASN1HEX.getHexOfV_AtObj(a,d);return{r:e,s:f}},KJUR.crypto.ECDSA.asn1SigToConcatSig=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a),c=b.r,d=b.s;if("00"==c.substr(0,2)&&c.length/2*8%128==8&&(c=c.substr(2)),"00"==d.substr(0,2)&&d.length/2*8%128==8&&(d=d.substr(2)),c.length/2*8%128!=0)throw"unknown ECDSA sig r length error";if(d.length/2*8%128!=0)throw"unknown ECDSA sig s length error";return c+d},KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if(a.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var b=a.substr(0,a.length/2),c=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(b,c)},KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(a,b){var c=new BigInteger(a,16),d=new BigInteger(b,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(c,d)},KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(a,b){var c=new KJUR.asn1.DERInteger({bigint:a}),d=new KJUR.asn1.DERInteger({bigint:b}),e=new KJUR.asn1.DERSequence({array:[c,d]});return e.getEncodedHex()},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECParameterDB=new function(){function a(a){return new BigInteger(a,16)}var b={},c={};this.getByName=function(a){var d=a;if("undefined"!=typeof c[d]&&(d=c[a]),"undefined"!=typeof b[d])return b[d];throw"unregistered EC curve name: "+d},this.regist=function(d,e,f,g,h,i,j,k,l,m,n,o){b[d]={};var p=a(f),q=a(g),r=a(h),s=a(i),t=a(j),u=new ECCurveFp(p,q,r),v=u.decodePointHex("04"+k+l);b[d].name=d,b[d].keylen=e,b[d].curve=u,b[d].G=v,b[d].n=s,b[d].h=t,b[d].oid=n,b[d].info=o;for(var w=0;w=2*h)break}var l={};return l.keyhex=i.substr(0,2*g[a].keylen),l.ivhex=i.substr(2*g[a].keylen,2*g[a].ivlen),l},l=function(a,b,c,d){var e=CryptoJS.enc.Base64.parse(a),f=CryptoJS.enc.Hex.stringify(e),h=g[b].proc,i=h(f,c,d);return i},m=function(a,b,c,d){var e=g[b].eproc,f=e(a,c,d);return f};return{version:"1.0.5",getHexFromPEM:function(a,b){var c=a;if(-1==c.indexOf("BEGIN "+b))throw"can't find PEM header: "+b;c=c.replace("-----BEGIN "+b+"-----",""),c=c.replace("-----END "+b+"-----","");var d=c.replace(/\s+/g,""),e=b64tohex(d);return e},getDecryptedKeyHexByKeyIV:function(a,b,c,d){var e=h(b);return e(a,c,d)},parsePKCS5PEM:function(a){return j(a)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(a,b,c){return k(a,b,c)},decryptKeyB64:function(a,b,c,d){return l(a,b,c,d)},getDecryptedKeyHex:function(a,b){var c=j(a),d=(c.type,c.cipher),e=c.ivsalt,f=c.data,g=k(d,b,e),h=g.keyhex,i=l(f,d,h,e);return i},getRSAKeyFromEncryptedPKCS5PEM:function(a,b){var c=this.getDecryptedKeyHex(a,b),d=new RSAKey;return d.readPrivateKeyFromASN1HexString(c),d},getEryptedPKCS5PEMFromPrvKeyHex:function(a,b,c,d){var e="";if(("undefined"==typeof c||null==c)&&(c="AES-256-CBC"),"undefined"==typeof g[c])throw"PKCS5PKEY unsupported algorithm: "+c;if("undefined"==typeof d||null==d){var f=g[c].ivlen,h=i(f);d=h.toUpperCase()}var j=k(c,b,d),l=j.keyhex,n=m(a,c,l,d),o=n.replace(/(.{64})/g,"$1\r\n"),e="-----BEGIN RSA PRIVATE KEY-----\r\n";return e+="Proc-Type: 4,ENCRYPTED\r\n",e+="DEK-Info: "+c+","+d+"\r\n",e+="\r\n",e+=o,e+="\r\n-----END RSA PRIVATE KEY-----\r\n"},getEryptedPKCS5PEMFromRSAKey:function(a,b,c,d){var e=new KJUR.asn1.DERInteger({"int":0}),f=new KJUR.asn1.DERInteger({bigint:a.n}),g=new KJUR.asn1.DERInteger({"int":a.e}),h=new KJUR.asn1.DERInteger({bigint:a.d}),i=new KJUR.asn1.DERInteger({bigint:a.p}),j=new KJUR.asn1.DERInteger({bigint:a.q}),k=new KJUR.asn1.DERInteger({bigint:a.dmp1}),l=new KJUR.asn1.DERInteger({bigint:a.dmq1}),m=new KJUR.asn1.DERInteger({bigint:a.coeff}),n=new KJUR.asn1.DERSequence({array:[e,f,g,h,i,j,k,l,m]}),o=n.getEncodedHex();return this.getEryptedPKCS5PEMFromPrvKeyHex(o,b,c,d)},newEncryptedPKCS5PEM:function(a,b,c,d){("undefined"==typeof b||null==b)&&(b=1024),("undefined"==typeof c||null==c)&&(c="10001");var e=new RSAKey;e.generate(b,c);var f=null;return f="undefined"==typeof d||null==d?this.getEncryptedPKCS5PEMFromRSAKey(pkey,a):this.getEncryptedPKCS5PEMFromRSAKey(pkey,a,d)},getRSAKeyFromPlainPKCS8PEM:function(a){if(a.match(/ENCRYPTED/))throw"pem shall be not ENCRYPTED";var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getRSAKeyFromPlainPKCS8Hex(b);return c},getRSAKeyFromPlainPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=b.length)throw"outer DERSequence shall have 3 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmIdentifier is not rsaEnc: "+c;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]),d=ASN1HEX.getHexOfTLV_AtObj(a,b[2]),e=ASN1HEX.getHexOfV_AtObj(d,0),f=new RSAKey;return f.readPrivateKeyFromASN1HexString(e),f},parseHexOfEncryptedPKCS8:function(a){var b={},c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed format: SEQUENCE(0).items != 2: "+c.length;b.ciphertext=ASN1HEX.getHexOfV_AtObj(a,c[1]);var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[0]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+d.length;if("2a864886f70d01050d"!=ASN1HEX.getHexOfV_AtObj(a,d[0]))throw"this only supports pkcs5PBES2";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d[1]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+e.length;var f=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[1]);if(2!=f.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+f.length;if("2a864886f70d0307"!=ASN1HEX.getHexOfV_AtObj(a,f[0]))throw"this only supports TripleDES";b.encryptionSchemeAlg="TripleDES",b.encryptionSchemeIV=ASN1HEX.getHexOfV_AtObj(a,f[1]);var g=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[0]);if(2!=g.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+g.length;if("2a864886f70d01050c"!=ASN1HEX.getHexOfV_AtObj(a,g[0]))throw"this only supports pkcs5PBKDF2";var h=ASN1HEX.getPosArrayOfChildren_AtObj(a,g[1]);if(h.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length;b.pbkdf2Salt=ASN1HEX.getHexOfV_AtObj(a,h[0]);var i=ASN1HEX.getHexOfV_AtObj(a,h[1]);try{b.pbkdf2Iter=parseInt(i,16)}catch(j){throw"malformed format pbkdf2Iter: "+i}return b},getPBKDF2KeyHexFromParam:function(a,b){var c=CryptoJS.enc.Hex.parse(a.pbkdf2Salt),d=a.pbkdf2Iter,e=CryptoJS.PBKDF2(b,c,{keySize:6,iterations:d}),f=CryptoJS.enc.Hex.stringify(e);return f},getPlainPKCS8HexFromEncryptedPKCS8PEM:function(a,b){var c=this.getHexFromPEM(a,"ENCRYPTED PRIVATE KEY"),d=this.parseHexOfEncryptedPKCS8(c),e=PKCS5PKEY.getPBKDF2KeyHexFromParam(d,b),f={};f.ciphertext=CryptoJS.enc.Hex.parse(d.ciphertext);var g=CryptoJS.enc.Hex.parse(e),h=CryptoJS.enc.Hex.parse(d.encryptionSchemeIV),i=CryptoJS.TripleDES.decrypt(f,g,{iv:h}),j=CryptoJS.enc.Hex.stringify(i);return j},getRSAKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getRSAKeyFromPlainPKCS8Hex(c);return d},getKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getKeyFromPlainPrivatePKCS8Hex(c);return d},parsePlainPrivatePKCS8Hex:function(a){var b={};if(b.algparam=null,"30"!=a.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=c.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=a.substr(c[1],2))throw"malformed PKCS8 private key(code:003)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[1]);if(2!=d.length)throw"malformed PKCS8 private key(code:004)";if("06"!=a.substr(d[0],2))throw"malformed PKCS8 private key(code:005)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,d[0]),"06"==a.substr(d[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,d[1])),"04"!=a.substr(c[2],2))throw"malformed PKCS8 private key(code:006)";return b.keyidx=ASN1HEX.getStartPosOfV_AtObj(a,c[2]),b},getKeyFromPlainPrivatePKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getKeyFromPlainPrivatePKCS8Hex(b);return c},getKeyFromPlainPrivatePKCS8Hex:function(a){var b=this.parsePlainPrivatePKCS8Hex(a);if("2a864886f70d010101"==b.algoid){this.parsePrivateRawRSAKeyHexAtObj(a,b);var c=b.key,d=new RSAKey;return d.setPrivateEx(c.n,c.e,c.d,c.p,c.q,c.dp,c.dq,c.co),d}if("2a8648ce3d0201"==b.algoid){if(this.parsePrivateRawECKeyHexAtObj(a,b),void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,prv:b.key});return d}throw"unsupported private key algorithm"},getRSAKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getRSAKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8Hex:function(a){var b=this.parsePublicPKCS8Hex(a);if("2a864886f70d010101"==b.algoid){var c=this.parsePublicRawRSAKeyHex(b.key),d=new RSAKey;return d.setPublic(c.n,c.e),d}if("2a8648ce3d0201"==b.algoid){if(void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,pub:b.key});return d}throw"unsupported public key algorithm"},parsePublicRawRSAKeyHex:function(a){var b={};if("30"!=a.substr(0,2))throw"malformed RSA key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed RSA key(code:002)";if("02"!=a.substr(c[0],2))throw"malformed RSA key(code:003)";if(b.n=ASN1HEX.getHexOfV_AtObj(a,c[0]),"02"!=a.substr(c[1],2))throw"malformed RSA key(code:004)";return b.e=ASN1HEX.getHexOfV_AtObj(a,c[1]),b},parsePrivateRawRSAKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed RSA private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(9!=d.length)throw"malformed RSA private key(code:002)";b.key={},b.key.n=ASN1HEX.getHexOfV_AtObj(a,d[1]),b.key.e=ASN1HEX.getHexOfV_AtObj(a,d[2]),b.key.d=ASN1HEX.getHexOfV_AtObj(a,d[3]),b.key.p=ASN1HEX.getHexOfV_AtObj(a,d[4]),b.key.q=ASN1HEX.getHexOfV_AtObj(a,d[5]),b.key.dp=ASN1HEX.getHexOfV_AtObj(a,d[6]),b.key.dq=ASN1HEX.getHexOfV_AtObj(a,d[7]),b.key.co=ASN1HEX.getHexOfV_AtObj(a,d[8])},parsePrivateRawECKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed ECC private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(3!=d.length)throw"malformed ECC private key(code:002)";if("04"!=a.substr(d[1],2))throw"malformed ECC private key(code:003)";b.key=ASN1HEX.getHexOfV_AtObj(a,d[1])},parsePublicPKCS8Hex:function(a){var b={};b.algparam=null;var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"outer DERSequence shall have 2 elements: "+c.length;var d=c[0];if("30"!=a.substr(d,2))throw"malformed PKCS8 public key(code:001)";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"malformed PKCS8 public key(code:002)";if("06"!=a.substr(e[0],2))throw"malformed PKCS8 public key(code:003)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,e[0]),"06"==a.substr(e[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,e[1])),"03"!=a.substr(c[1],2))throw"malformed PKCS8 public key(code:004)";return b.key=ASN1HEX.getHexOfV_AtObj(a,c[1]).substr(2),b},getRSAKeyFromPublicPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=b.length)throw"outer DERSequence shall have 2 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[0]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmId is not rsaEncryption";if("03"!=a.substr(b[1],2))throw"PKCS8 Public Key is not BITSTRING encapslated.";var d=ASN1HEX.getStartPosOfV_AtObj(a,b[1])+2;if("30"!=a.substr(d,2))throw"PKCS8 Public Key is not SEQUENCE.";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"inner DERSequence shall have 2 elements: "+e.length;if("02"!=a.substr(e[0],2))throw"N is not ASN.1 INTEGER";if("02"!=a.substr(e[1],2))throw"E is not ASN.1 INTEGER";var f=ASN1HEX.getHexOfV_AtObj(a,e[0]),g=ASN1HEX.getHexOfV_AtObj(a,e[1]),h=new RSAKey;return h.setPublic(f,g),h}}}(),KEYUTIL=function(){var a=function(a,b,d){return c(CryptoJS.AES,a,b,d)},b=function(a,b,d){return c(CryptoJS.TripleDES,a,b,d)},c=function(a,b,c,d){var e=CryptoJS.enc.Hex.parse(b),f=CryptoJS.enc.Hex.parse(c),g=CryptoJS.enc.Hex.parse(d),h={};h.key=f,h.iv=g,h.ciphertext=e;var i=a.decrypt(h,f,{iv:g});return CryptoJS.enc.Hex.stringify(i)},d=function(a,b,c){return f(CryptoJS.AES,a,b,c)},e=function(a,b,c){return f(CryptoJS.TripleDES,a,b,c)},f=function(a,b,c,d){var e=CryptoJS.enc.Hex.parse(b),f=CryptoJS.enc.Hex.parse(c),g=CryptoJS.enc.Hex.parse(d),h=a.encrypt(e,f,{iv:g}),i=CryptoJS.enc.Hex.parse(h.toString()),j=CryptoJS.enc.Base64.stringify(i);return j},g={"AES-256-CBC":{proc:a,eproc:d,keylen:32,ivlen:16},"AES-192-CBC":{proc:a,eproc:d,keylen:24,ivlen:16},"AES-128-CBC":{proc:a,eproc:d,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:b,eproc:e,keylen:24,ivlen:8}},h=function(a){return g[a].proc},i=function(a){var b=CryptoJS.lib.WordArray.random(a),c=CryptoJS.enc.Hex.stringify(b);return c},j=function(a){var b={};a.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"))&&(b.cipher=RegExp.$1,b.ivsalt=RegExp.$2),a.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"))&&(b.type=RegExp.$1);var c=-1,d=0;-1!=a.indexOf("\r\n\r\n")&&(c=a.indexOf("\r\n\r\n"),d=2),-1!=a.indexOf("\n\n")&&(c=a.indexOf("\n\n"),d=1);var e=a.indexOf("-----END");if(-1!=c&&-1!=e){var f=a.substring(c+2*d,e-d);f=f.replace(/\s+/g,""),b.data=f}return b},k=function(a,b,c){for(var d=c.substring(0,16),e=CryptoJS.enc.Hex.parse(d),f=CryptoJS.enc.Utf8.parse(b),h=g[a].keylen+g[a].ivlen,i="",j=null;;){var k=CryptoJS.algo.MD5.create();if(null!=j&&k.update(j),k.update(f),k.update(e),j=k.finalize(),i+=CryptoJS.enc.Hex.stringify(j),i.length>=2*h)break}var l={};return l.keyhex=i.substr(0,2*g[a].keylen),l.ivhex=i.substr(2*g[a].keylen,2*g[a].ivlen),l},l=function(a,b,c,d){var e=CryptoJS.enc.Base64.parse(a),f=CryptoJS.enc.Hex.stringify(e),h=g[b].proc,i=h(f,c,d);return i},m=function(a,b,c,d){var e=g[b].eproc,f=e(a,c,d);return f};return{version:"1.0.0",getHexFromPEM:function(a,b){var c=a;if(-1==c.indexOf("BEGIN "+b))throw"can't find PEM header: "+b;c=c.replace("-----BEGIN "+b+"-----",""),c=c.replace("-----END "+b+"-----","");var d=c.replace(/\s+/g,""),e=b64tohex(d);return e},getDecryptedKeyHexByKeyIV:function(a,b,c,d){var e=h(b);return e(a,c,d)},parsePKCS5PEM:function(a){return j(a)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(a,b,c){return k(a,b,c)},decryptKeyB64:function(a,b,c,d){return l(a,b,c,d)},getDecryptedKeyHex:function(a,b){var c=j(a),d=(c.type,c.cipher),e=c.ivsalt,f=c.data,g=k(d,b,e),h=g.keyhex,i=l(f,d,h,e);return i},getRSAKeyFromEncryptedPKCS5PEM:function(a,b){var c=this.getDecryptedKeyHex(a,b),d=new RSAKey;return d.readPrivateKeyFromASN1HexString(c),d},getEncryptedPKCS5PEMFromPrvKeyHex:function(a,b,c,d){var e="";if(("undefined"==typeof c||null==c)&&(c="AES-256-CBC"),"undefined"==typeof g[c])throw"KEYUTIL unsupported algorithm: "+c;if("undefined"==typeof d||null==d){var f=g[c].ivlen,h=i(f);d=h.toUpperCase()}var j=k(c,b,d),l=j.keyhex,n=m(a,c,l,d),o=n.replace(/(.{64})/g,"$1\r\n"),e="-----BEGIN RSA PRIVATE KEY-----\r\n";return e+="Proc-Type: 4,ENCRYPTED\r\n",e+="DEK-Info: "+c+","+d+"\r\n",e+="\r\n",e+=o,e+="\r\n-----END RSA PRIVATE KEY-----\r\n"},getEncryptedPKCS5PEMFromRSAKey:function(a,b,c,d){var e=new KJUR.asn1.DERInteger({"int":0}),f=new KJUR.asn1.DERInteger({bigint:a.n}),g=new KJUR.asn1.DERInteger({"int":a.e}),h=new KJUR.asn1.DERInteger({bigint:a.d}),i=new KJUR.asn1.DERInteger({bigint:a.p}),j=new KJUR.asn1.DERInteger({bigint:a.q}),k=new KJUR.asn1.DERInteger({bigint:a.dmp1}),l=new KJUR.asn1.DERInteger({bigint:a.dmq1}),m=new KJUR.asn1.DERInteger({bigint:a.coeff}),n=new KJUR.asn1.DERSequence({array:[e,f,g,h,i,j,k,l,m]}),o=n.getEncodedHex();return this.getEncryptedPKCS5PEMFromPrvKeyHex(o,b,c,d)},newEncryptedPKCS5PEM:function(a,b,c,d){("undefined"==typeof b||null==b)&&(b=1024),("undefined"==typeof c||null==c)&&(c="10001");var e=new RSAKey;e.generate(b,c);var f=null;return f="undefined"==typeof d||null==d?this.getEncryptedPKCS5PEMFromRSAKey(pkey,a):this.getEncryptedPKCS5PEMFromRSAKey(pkey,a,d)},getRSAKeyFromPlainPKCS8PEM:function(a){if(a.match(/ENCRYPTED/))throw"pem shall be not ENCRYPTED";var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getRSAKeyFromPlainPKCS8Hex(b);return c},getRSAKeyFromPlainPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=b.length)throw"outer DERSequence shall have 3 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmIdentifier is not rsaEnc: "+c;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[1]),d=ASN1HEX.getHexOfTLV_AtObj(a,b[2]),e=ASN1HEX.getHexOfV_AtObj(d,0),f=new RSAKey;return f.readPrivateKeyFromASN1HexString(e),f},parseHexOfEncryptedPKCS8:function(a){var b={},c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed format: SEQUENCE(0).items != 2: "+c.length;b.ciphertext=ASN1HEX.getHexOfV_AtObj(a,c[1]);var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[0]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+d.length;if("2a864886f70d01050d"!=ASN1HEX.getHexOfV_AtObj(a,d[0]))throw"this only supports pkcs5PBES2";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d[1]);if(2!=d.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+e.length;var f=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[1]);if(2!=f.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+f.length;if("2a864886f70d0307"!=ASN1HEX.getHexOfV_AtObj(a,f[0]))throw"this only supports TripleDES";b.encryptionSchemeAlg="TripleDES",b.encryptionSchemeIV=ASN1HEX.getHexOfV_AtObj(a,f[1]);var g=ASN1HEX.getPosArrayOfChildren_AtObj(a,e[0]);if(2!=g.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+g.length;if("2a864886f70d01050c"!=ASN1HEX.getHexOfV_AtObj(a,g[0]))throw"this only supports pkcs5PBKDF2";var h=ASN1HEX.getPosArrayOfChildren_AtObj(a,g[1]);if(h.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length;b.pbkdf2Salt=ASN1HEX.getHexOfV_AtObj(a,h[0]);var i=ASN1HEX.getHexOfV_AtObj(a,h[1]);try{b.pbkdf2Iter=parseInt(i,16)}catch(j){throw"malformed format pbkdf2Iter: "+i}return b},getPBKDF2KeyHexFromParam:function(a,b){var c=CryptoJS.enc.Hex.parse(a.pbkdf2Salt),d=a.pbkdf2Iter,e=CryptoJS.PBKDF2(b,c,{keySize:6,iterations:d}),f=CryptoJS.enc.Hex.stringify(e);return f},getPlainPKCS8HexFromEncryptedPKCS8PEM:function(a,b){var c=this.getHexFromPEM(a,"ENCRYPTED PRIVATE KEY"),d=this.parseHexOfEncryptedPKCS8(c),e=KEYUTIL.getPBKDF2KeyHexFromParam(d,b),f={};f.ciphertext=CryptoJS.enc.Hex.parse(d.ciphertext);var g=CryptoJS.enc.Hex.parse(e),h=CryptoJS.enc.Hex.parse(d.encryptionSchemeIV),i=CryptoJS.TripleDES.decrypt(f,g,{iv:h}),j=CryptoJS.enc.Hex.stringify(i);return j},getRSAKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getRSAKeyFromPlainPKCS8Hex(c);return d},getKeyFromEncryptedPKCS8PEM:function(a,b){var c=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(a,b),d=this.getKeyFromPlainPrivatePKCS8Hex(c);return d},parsePlainPrivatePKCS8Hex:function(a){var b={};if(b.algparam=null,"30"!=a.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(3!=c.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=a.substr(c[1],2))throw"malformed PKCS8 private key(code:003)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c[1]);if(2!=d.length)throw"malformed PKCS8 private key(code:004)";if("06"!=a.substr(d[0],2))throw"malformed PKCS8 private key(code:005)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,d[0]),"06"==a.substr(d[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,d[1])),"04"!=a.substr(c[2],2))throw"malformed PKCS8 private key(code:006)";return b.keyidx=ASN1HEX.getStartPosOfV_AtObj(a,c[2]),b},getKeyFromPlainPrivatePKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PRIVATE KEY"),c=this.getKeyFromPlainPrivatePKCS8Hex(b);return c},getKeyFromPlainPrivatePKCS8Hex:function(a){var b=this.parsePlainPrivatePKCS8Hex(a);if("2a864886f70d010101"==b.algoid){this.parsePrivateRawRSAKeyHexAtObj(a,b);var c=b.key,d=new RSAKey;return d.setPrivateEx(c.n,c.e,c.d,c.p,c.q,c.dp,c.dq,c.co),d}if("2a8648ce3d0201"==b.algoid){if(this.parsePrivateRawECKeyHexAtObj(a,b),void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,prv:b.key});return d}throw"unsupported private key algorithm"},getRSAKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getRSAKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8PEM:function(a){var b=this.getHexFromPEM(a,"PUBLIC KEY"),c=this.getKeyFromPublicPKCS8Hex(b);return c},getKeyFromPublicPKCS8Hex:function(a){var b=this.parsePublicPKCS8Hex(a);if("2a864886f70d010101"==b.algoid){var c=this.parsePublicRawRSAKeyHex(b.key),d=new RSAKey;return d.setPublic(c.n,c.e),d}if("2a8648ce3d0201"==b.algoid){if(void 0===KJUR.crypto.OID.oidhex2name[b.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+b.algparam;var e=KJUR.crypto.OID.oidhex2name[b.algparam],d=new KJUR.crypto.ECDSA({curve:e,pub:b.key});return d}throw"unsupported public key algorithm"},parsePublicRawRSAKeyHex:function(a){var b={};if("30"!=a.substr(0,2))throw"malformed RSA key(code:001)";var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"malformed RSA key(code:002)";if("02"!=a.substr(c[0],2))throw"malformed RSA key(code:003)";if(b.n=ASN1HEX.getHexOfV_AtObj(a,c[0]),"02"!=a.substr(c[1],2))throw"malformed RSA key(code:004)";return b.e=ASN1HEX.getHexOfV_AtObj(a,c[1]),b},parsePrivateRawRSAKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed RSA private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(9!=d.length)throw"malformed RSA private key(code:002)";b.key={},b.key.n=ASN1HEX.getHexOfV_AtObj(a,d[1]),b.key.e=ASN1HEX.getHexOfV_AtObj(a,d[2]),b.key.d=ASN1HEX.getHexOfV_AtObj(a,d[3]),b.key.p=ASN1HEX.getHexOfV_AtObj(a,d[4]),b.key.q=ASN1HEX.getHexOfV_AtObj(a,d[5]),b.key.dp=ASN1HEX.getHexOfV_AtObj(a,d[6]),b.key.dq=ASN1HEX.getHexOfV_AtObj(a,d[7]),b.key.co=ASN1HEX.getHexOfV_AtObj(a,d[8])},parsePrivateRawECKeyHexAtObj:function(a,b){var c=b.keyidx;if("30"!=a.substr(c,2))throw"malformed ECC private key(code:001)";var d=ASN1HEX.getPosArrayOfChildren_AtObj(a,c);if(3!=d.length)throw"malformed ECC private key(code:002)";if("04"!=a.substr(d[1],2))throw"malformed ECC private key(code:003)";b.key=ASN1HEX.getHexOfV_AtObj(a,d[1])},parsePublicPKCS8Hex:function(a){var b={};b.algparam=null;var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=c.length)throw"outer DERSequence shall have 2 elements: "+c.length;var d=c[0];if("30"!=a.substr(d,2))throw"malformed PKCS8 public key(code:001)";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"malformed PKCS8 public key(code:002)";if("06"!=a.substr(e[0],2))throw"malformed PKCS8 public key(code:003)";if(b.algoid=ASN1HEX.getHexOfV_AtObj(a,e[0]),"06"==a.substr(e[1],2)&&(b.algparam=ASN1HEX.getHexOfV_AtObj(a,e[1])),"03"!=a.substr(c[1],2))throw"malformed PKCS8 public key(code:004)";return b.key=ASN1HEX.getHexOfV_AtObj(a,c[1]).substr(2),b},getRSAKeyFromPublicPKCS8Hex:function(a){var b=ASN1HEX.getPosArrayOfChildren_AtObj(a,0);if(2!=b.length)throw"outer DERSequence shall have 2 elements: "+b.length;var c=ASN1HEX.getHexOfTLV_AtObj(a,b[0]);if("300d06092a864886f70d0101010500"!=c)throw"PKCS8 AlgorithmId is not rsaEncryption";if("03"!=a.substr(b[1],2))throw"PKCS8 Public Key is not BITSTRING encapslated.";var d=ASN1HEX.getStartPosOfV_AtObj(a,b[1])+2;if("30"!=a.substr(d,2))throw"PKCS8 Public Key is not SEQUENCE.";var e=ASN1HEX.getPosArrayOfChildren_AtObj(a,d);if(2!=e.length)throw"inner DERSequence shall have 2 elements: "+e.length;if("02"!=a.substr(e[0],2))throw"N is not ASN.1 INTEGER";if("02"!=a.substr(e[1],2))throw"E is not ASN.1 INTEGER";var f=ASN1HEX.getHexOfV_AtObj(a,e[0]),g=ASN1HEX.getHexOfV_AtObj(a,e[1]),h=new RSAKey;return h.setPublic(f,g),h}}}();KEYUTIL.getKey=function(a,b,c){if(a instanceof RSAKey)return a;if(a instanceof KJUR.crypto.ECDSA)return a;if(void 0!==a.xy&&void 0!==a.curve)return new KJUR.crypto.ECDSA({prv:a.xy,curve:a.curve});if(void 0!==a.n&&void 0!==a.e&&void 0!==a.d&&void 0!==a.p&&void 0!==a.q&&void 0!==a.dp&&void 0!==a.dq&&void 0!==a.co){var d=new RSAKey;return d.setPrivateEx(a.n,a.e,a.d,a.p,a.q,a.dp,a.dq,a.co),d}if(void 0!==a.d&&void 0!==a.curve)return new KJUR.crypto.ECDSA({pub:a.d,curve:a.curve});if(void 0!==a.n&&a.e){var d=new RSAKey;return d.setPublic(a.n,a.e),d}if(-1!=a.indexOf("-END CERTIFICATE-",0)||-1!=a.indexOf("-END X509 CERTIFICATE-",0)||-1!=a.indexOf("-END TRUSTED CERTIFICATE-",0))return X509.getPublicKeyFromCertPEM(a);if("pkcs8pub"===c)return KEYUTIL.getKeyFromPublicPKCS8Hex(a);if(-1!=a.indexOf("-END PUBLIC KEY-"))return KEYUTIL.getKeyFromPublicPKCS8PEM(a);if("pkcs5prv"===c){var d=new RSAKey;return d.readPrivateKeyFromASN1HexString(a),d}if("pkcs5prv"===c){var d=new RSAKey;return d.readPrivateKeyFromASN1HexString(a),d}if(-1!=a.indexOf("-END RSA PRIVATE KEY-")&&-1==a.indexOf("4,ENCRYPTED")){var d=new RSAKey;return d.readPrivateKeyFromPEMString(a),d}if(-1!=a.indexOf("-END PRIVATE KEY-"))return KEYUTIL.getKeyFromPlainPrivatePKCS8PEM(a);if(-1!=a.indexOf("-END RSA PRIVATE KEY-")&&-1!=a.indexOf("4,ENCRYPTED"))return KEYUTIL.getRSAKeyFromEncryptedPKCS5PEM(a,b);if(-1!=a.indexOf("-END ENCRYPTED PRIVATE KEY-"))return KEYUTIL.getKeyFromEncryptedPKCS8PEM(a,b);throw"not supported argument"},KEYUTIL.generateKeypair=function(a,b){if("RSA"==a){var c=b,d=new RSAKey;d.generate(c,"10001");var e=new RSAKey,f=d.n.toString(16),g=d.e.toString(16);e.setPublic(f,g);var h={};return h.prvKeyObj=d,h.pubKeyObj=e,h}if("EC"==a){var i=b,j=new KJUR.crypto.ECDSA({curve:i}),k=j.generateKeyPairHex(),d=new KJUR.crypto.ECDSA({curve:i});d.setPrivateKeyHex(k.ecprvhex);var e=new KJUR.crypto.ECDSA({curve:i});e.setPublicKeyHex(k.ecpubhex);var h={};return h.prvKeyObj=d,h.pubKeyObj=e,h}throw"unknown algorithm: "+a},RSAKey.prototype.readPrivateKeyFromPEMString=_rsapem_readPrivateKeyFromPEMString,RSAKey.prototype.readPrivateKeyFromASN1HexString=_rsapem_readPrivateKeyFromASN1HexString;var _RE_HEXDECONLY=new RegExp("");_RE_HEXDECONLY.compile("[^0-9a-f]","gi"),RSAKey.prototype.signWithMessageHash=_rsasign_signWithMessageHash,RSAKey.prototype.signString=_rsasign_signString,RSAKey.prototype.signStringWithSHA1=_rsasign_signStringWithSHA1,RSAKey.prototype.signStringWithSHA256=_rsasign_signStringWithSHA256,RSAKey.prototype.sign=_rsasign_signString,RSAKey.prototype.signWithSHA1=_rsasign_signStringWithSHA1,RSAKey.prototype.signWithSHA256=_rsasign_signStringWithSHA256,RSAKey.prototype.signWithMessageHashPSS=_rsasign_signWithMessageHashPSS,RSAKey.prototype.signStringPSS=_rsasign_signStringPSS,RSAKey.prototype.signPSS=_rsasign_signStringPSS,RSAKey.SALT_LEN_HLEN=-1,RSAKey.SALT_LEN_MAX=-2,RSAKey.prototype.verifyWithMessageHash=_rsasign_verifyWithMessageHash,RSAKey.prototype.verifyString=_rsasign_verifyString,RSAKey.prototype.verifyHexSignatureForMessage=_rsasign_verifyHexSignatureForMessage,RSAKey.prototype.verify=_rsasign_verifyString,RSAKey.prototype.verifyHexSignatureForByteArrayMessage=_rsasign_verifyHexSignatureForMessage,RSAKey.prototype.verifyWithMessageHashPSS=_rsasign_verifyWithMessageHashPSS,RSAKey.prototype.verifyStringPSS=_rsasign_verifyStringPSS,RSAKey.prototype.verifyPSS=_rsasign_verifyStringPSS,RSAKey.SALT_LEN_RECOVER=-2,X509.pemToBase64=function(a){var b=a;return b=b.replace("-----BEGIN CERTIFICATE-----",""),b=b.replace("-----END CERTIFICATE-----",""),b=b.replace(/[ \n]+/g,"")},X509.pemToHex=function(a){var b=X509.pemToBase64(a),c=b64tohex(b);return c},X509.getSubjectPublicKeyPosFromCertHex=function(a){var b=X509.getSubjectPublicKeyInfoPosFromCertHex(a);if(-1==b)return-1;var c=ASN1HEX.getPosArrayOfChildren_AtObj(a,b);if(2!=c.length)return-1;var d=c[1];if("03"!=a.substring(d,d+2))return-1;var e=ASN1HEX.getStartPosOfV_AtObj(a,d);return"00"!=a.substring(e,e+2)?-1:e+2},X509.getSubjectPublicKeyInfoPosFromCertHex=function(a){var b=ASN1HEX.getStartPosOfV_AtObj(a,0),c=ASN1HEX.getPosArrayOfChildren_AtObj(a,b);return c.length<1?-1:"a003020102"==a.substring(c[0],c[0]+10)?c.length<6?-1:c[6]:c.length<5?-1:c[5]},X509.getPublicKeyHexArrayFromCertHex=function(a){var b=X509.getSubjectPublicKeyPosFromCertHex(a),c=ASN1HEX.getPosArrayOfChildren_AtObj(a,b);if(2!=c.length)return[];var d=ASN1HEX.getHexOfV_AtObj(a,c[0]),e=ASN1HEX.getHexOfV_AtObj(a,c[1]);return null!=d&&null!=e?[d,e]:[]},X509.getHexTbsCertificateFromCert=function(a){var b=ASN1HEX.getStartPosOfV_AtObj(a,0);return b},X509.getPublicKeyHexArrayFromCertPEM=function(a){var b=X509.pemToHex(a),c=X509.getPublicKeyHexArrayFromCertHex(b);return c},X509.hex2dn=function(a){for(var b="",c=ASN1HEX.getPosArrayOfChildren_AtObj(a,0),d=0;d signature verified'):($(b).removeClass("valid-token"),$(b).addClass("invalid-token"),b.innerHTML=' invalid signature')}}function l(a,b){var c=$('input[name="secret"]'),d=$('textarea[name="private-key"]'),e=$('textarea[name="public-key"]');return"HS256"===a?c.val():"sign"===b?d.val():e.val()}function m(){return A.filter(":checked").val()}function n(){var a=A.filter(":checked").val();$(".js-input").attr("data-alg",a),$(".jwt-signature pre").hide().filter("."+a).show(),j(x)===s&&"RS256"===a?o():j(x)===t&&"HS256"===a&&p()}function o(){x.setValue(t),$(".jwt-signature textarea[name=public-key]").val(u),$(".jwt-signature textarea[name=private-key]").val(v)}function p(){x.setValue(s)}function q(){var a,b=$(this);a="public-key"===b.prop("name")?/-----BEGIN (PUBLIC KEY|CERTIFICATE)-----(.|\n)*-----END (PUBLIC KEY|CERTIFICATE)-----/.test(b.val()):/-----BEGIN RSA PRIVATE KEY-----(.|\n)*-----END RSA PRIVATE KEY-----/.test(b.val()),a?b.removeClass("error"):b.addClass("error")}var r,s="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",t="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE",u="-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB\n-----END PUBLIC KEY----- ",v="-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQABAoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5CpuGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0KSu5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aPFaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw==\n -----END RSA PRIVATE KEY----- ",w=CodeMirror,x=w(document.getElementsByClassName("js-input")[0],{mode:"jwt",theme:"night",lineWrapping:!0,autofocus:!0,extraKeys:{Tab:b}}),y=w(document.getElementsByClassName("js-header")[0],{mode:"application/json",lineWrapping:!0,extraKeys:{Tab:b},lint:!0}),z=w(document.getElementsByClassName("js-payload")[0],{mode:"application/json",lineWrapping:!0,extraKeys:{Tab:b},lint:!0}),A=$('input[name="algorithm"]');x.on("change",d),z.on("change",h),y.on("change",h);var B=document.getElementsByName("secret")[0],C=document.getElementsByName("is-base64-encoded")[0];if(n(),A.on("change",function(){n(),k()}),$(".jwt-signature textarea").on("change",k,!1),$(".jwt-signature textarea").on("keyup",k,!1),$(".jwt-signature textarea").on("keyup",q,!1),B.addEventListener("change",k,!1),B.addEventListener("keyup",k,!1),C.addEventListener("change",k,!1),document.location.search){var D=document.location.search.slice(1),E={};if(D=D.split("&"),D.forEach(function(a){a=a.split("="),E[a[0]]=a[1]}),E.value)return void x.setValue(decodeURIComponent(E.value))}if(document.location.hash){var D=document.location.hash.slice(1),E={};if(D=D.split("&"),D.forEach(function(a){a=a.split("="),E[a[0]]=a[1]}),E.id_token)return void x.setValue(decodeURIComponent(E.id_token))}g(function(a){r=a||s,x.setValue(r)})}(),function(){setInterval(function(){var a,b;return b=new Date(1987,5,30),a=new Date,$("#time").text(((a-b)/1e3).toFixed(0))},1e3)}.call(this),$('[data-toggle="tooltip"]').tooltip(),$(".stars").each(function(a,b){var c=$(b),d=c.attr("data-repo");d&&$.getJSON("http://api.github.com/repos/"+d,function(a){var b=$("");b.text(a.stargazers_count),c.find("i").after(b),c.show()})}); \ No newline at end of file diff --git a/html/index.html b/html/index.html index 4b846ac3..06a17ffc 100644 --- a/html/index.html +++ b/html/index.html @@ -37,1057 +37,814 @@ + + - -
- -