From 9e478b31feff081b81d7bd87f8f1835e6d005dc7 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 28 Nov 2016 23:58:14 +0000 Subject: [PATCH 01/15] add webpack config --- .babelrc | 16 + package.json | 23 +- src/browser.js | 2 + .../fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20127 bytes .../fonts/glyphicons-halflings-regular.svg | 288 ++ .../fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 45404 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23424 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 0 -> 18028 bytes src/css/index.js | 9 + src/html/index.html | 13 +- src/js/index.js | 135 + webpack-babel.js | 118 + webpack.config.js | 2 + yarn.lock | 4532 +++++++++++++++++ 14 files changed, 5125 insertions(+), 13 deletions(-) create mode 100644 .babelrc create mode 100644 src/browser.js create mode 100644 src/css/fonts/glyphicons-halflings-regular.eot create mode 100644 src/css/fonts/glyphicons-halflings-regular.svg create mode 100644 src/css/fonts/glyphicons-halflings-regular.ttf create mode 100644 src/css/fonts/glyphicons-halflings-regular.woff create mode 100644 src/css/fonts/glyphicons-halflings-regular.woff2 create mode 100644 src/css/index.js create mode 100644 src/js/index.js create mode 100644 webpack-babel.js create mode 100644 webpack.config.js create mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..bff4c9dd --- /dev/null +++ b/.babelrc @@ -0,0 +1,16 @@ +{ + "env": { + "test": { + "plugins": ["istanbul"] + } + }, + "plugins": ["transform-runtime"], + "presets": [ + ["env", { + "targets": { + "node": "current" + } + }] + ], + "sourceMaps": "inline" +} diff --git a/package.json b/package.json index 66b19375..6a820dd6 100755 --- a/package.json +++ b/package.json @@ -28,7 +28,20 @@ "type": "git", "url": "" }, + "scripts": { + "build": "./node_modules/.bin/webpack --bail", + "start": "./node_modules/.bin/webpack-dev-server --progress", + "eslint": "./node_modules/.bin/eslint ." + }, "devDependencies": { + "babel-core": "^6.18.2", + "babel-loader": "^6.2.8", + "babel-plugin-transform-runtime": "^6.15.0", + "babel-preset-env": "^0.0.9", + "babel-register": "^6.18.0", + "css-loader": "^0.26.0", + "extract-text-webpack-plugin": "2.0.0-beta.4", + "file-loader": "^0.9.0", "grunt": "~0.4.5", "grunt-chmod": "~1.1.1", "grunt-contrib-clean": "~1.0.0", @@ -42,6 +55,14 @@ "grunt-exec": "~0.4.6", "grunt-inline-alt": "~0.3.10", "grunt-jsdoc": "^1.1.0", - "ink-docstrap": "^1.1.4" + "html-webpack-plugin": "^2.24.1", + "ink-docstrap": "^1.1.4", + "style-loader": "^0.13.1", + "webpack": "2.1.0-beta.27", + "webpack-dev-server": "2.1.0-beta.12" + }, + "dependencies": { + "estraverse": "^4.2.0", + "json-loader": "^0.5.4" } } diff --git a/src/browser.js b/src/browser.js new file mode 100644 index 00000000..b63d8bf4 --- /dev/null +++ b/src/browser.js @@ -0,0 +1,2 @@ +import './css'; +import './js'; diff --git a/src/css/fonts/glyphicons-halflings-regular.eot b/src/css/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000000000000000000000000000000000000..b93a4953fff68df523aa7656497ee339d6026d64 GIT binary patch literal 20127 zcma%hV{j!vx9y2-`@~L8?1^pLwlPU2wr$&<*tR|KBoo`2;LUg6eW-eW-tKDb)vH%` z^`A!Vd<6hNSRMcX|Cb;E|1qflDggj6Kmr)xA10^t-vIc3*Z+F{r%|K(GyE^?|I{=9 zNq`(c8=wS`0!RZy0g3{M(8^tv41d}oRU?8#IBFtJy*9zAN5dcxqGlMZGL>GG%R#)4J zDJ2;)4*E1pyHia%>lMv3X7Q`UoFyoB@|xvh^)kOE3)IL&0(G&i;g08s>c%~pHkN&6 z($7!kyv|A2DsV2mq-5Ku)D#$Kn$CzqD-wm5Q*OtEOEZe^&T$xIb0NUL}$)W)Ck`6oter6KcQG9Zcy>lXip)%e&!lQgtQ*N`#abOlytt!&i3fo)cKV zP0BWmLxS1gQv(r_r|?9>rR0ZeEJPx;Vi|h1!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!t0NsH)pB zRK8-S{Dn*y3b|k^*?_B70<2gHt==l7c&cT>r`C#{S}J2;s#d{M)ncW(#Y$C*lByLQ z&?+{dR7*gpdT~(1;M(FfF==3z`^eW)=5a9RqvF-)2?S-(G zhS;p(u~_qBum*q}On@$#08}ynd0+spzyVco0%G6;<-i5&016cV5UKzhQ~)fX03|>L z8ej+HzzgVr6_5ZUpa4HW0Ca!=r1%*}Oo;2no&Zz8DfR)L!@r<5 z2viSZpmvo5XqXyAz{Ms7`7kX>fnr1gi4X~7KpznRT0{Xc5Cfz@43PjBMBoH@z_{~( z(Wd}IPJ9hH+%)Fc)0!hrV+(A;76rhtI|YHbEDeERV~Ya>SQg^IvlazFkSK(KG9&{q zkPIR~EeQaaBmwA<20}mBO?)N$(z1@p)5?%}rM| zGF()~Z&Kx@OIDRI$d0T8;JX@vj3^2%pd_+@l9~a4lntZ;AvUIjqIZbuNTR6@hNJoV zk4F;ut)LN4ARuyn2M6F~eg-e#UH%2P;8uPGFW^vq1vj8mdIayFOZo(tphk8C7hpT~ z1Fv8?b_LNR3QD9J+!v=p%}# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/css/fonts/glyphicons-halflings-regular.ttf b/src/css/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1413fc609ab6f21774de0cb7e01360095584f65b GIT binary patch literal 45404 zcmd?Sd0-pWwLh*qi$?oCk~i6sWlOeWJC3|4juU5JNSu9hS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GacTRr>Sd2T6dWi-{YX`v!D)kCWzG5xQB=?es5ON(%nkwUhNl zV>@xkWWWv*N+{e$(SrExvN6BXzU(Hxlx27{VYHf+LpIbTO+Yu(ltMk<;)3A(LU@ytVYFkYvTa79idMtUFhfxx?P!)2F`prNWW#Fub#l>N2s@nh&n_ zA4{#}|AIs9|A4P0ZF%fy=hDN!t#ifH<)4u2kirK~JUpjQ-J+~cXOZI&dIts;P}UeXslP6zKvpEKSN-$y>kJ^nw2tC9bv zo(|lT@?vZ!{_l|d^8Yh)eEBh*5ABh+Lzjw+?V)o z#P-W7361>E(Y4;@`sv;VKn G`u_lkUM?>H literal 0 HcmV?d00001 diff --git a/src/css/fonts/glyphicons-halflings-regular.woff2 b/src/css/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..64539b54c3751a6d9adb44c8e3a45ba5a73b77f0 GIT binary patch literal 18028 zcmV(~K+nH-Pew8T0RR9107h&84*&oF0I^&E07eM_0Rl|`00000000000000000000 z0000#Mn+Uk92y`7U;vDA2m}!b3WBL5f#qcZHUcCAhI9*rFaQJ~1&1OBl~F%;WnyLq z8)b|&?3j;$^FW}&KmNW53flIFARDZ7_Wz%hpoWaWlgHTHEHf()GI0&dMi#DFPaEt6 zCO)z0v0~C~q&0zBj^;=tv8q{$8JxX)>_`b}WQGgXi46R*CHJ}6r+;}OrvwA{_SY+o zK)H-vy{l!P`+NG*`*x6^PGgHH4!dsolgU4RKj@I8Xz~F6o?quCX&=VQ$Q{w01;M0? zKe|5r<_7CD z=eO3*x!r$aX2iFh3;}xNfx0v;SwBfGG+@Z;->HhvqfF4r__4$mU>Dl_1w;-9`~5rF~@!3;r~xP-hZvOfOx)A z#>8O3N{L{naf215f>m=bzbp7_(ssu&cx)Qo-{)!)Yz3A@Z0uZaM2yJ8#OGlzm?JO5gbrj~@)NB4@?>KE(K-$w}{};@dKY#K3+Vi64S<@!Z{(I{7l=!p9 z&kjG^P~0f46i13(w!hEDJga;*Eb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Z|Z5 z>xXfgmv!5Z^SYn+_x}K5B%G^sRwiez&z9|f!E!#oJlT2kCOV0000$L_|bHBqAarB4TD{W@grX1CUr72@caw0faEd7-K|4L_|cawbojjHdpd6 zI6~Iv5J?-Q4*&oF000000FV;^004t70Z6Qk1Xl{X9oJ{sRC2(cs?- literal 0 HcmV?d00001 diff --git a/src/css/index.js b/src/css/index.js new file mode 100644 index 00000000..88f3f0d1 --- /dev/null +++ b/src/css/index.js @@ -0,0 +1,9 @@ +import './lib/bootstrap-colorpicker.css'; +import './lib/prettify.css'; +import './lib/bootstrap3.min.css'; +import './lib/bootstrap-switch.css'; +import './lib/jquery.splitter.css'; +import './structure/overrides.css'; +import './structure/layout.css'; +import './structure/utils.css'; +import './themes/classic.css'; diff --git a/src/html/index.html b/src/html/index.html index b6979c8c..2692dc44 100755 --- a/src/html/index.html +++ b/src/html/index.html @@ -273,7 +273,7 @@ -
-
-

If you're a nerd like me, you might find statistics really fun! Here's some about the CyberChef code base:

-
<%= codebase_stats %>
-

What

A simple, intuitive web app for analysing and decoding data without having to deal with complex tools or programming languages. CyberChef encourages both technical and non-technical people to explore data formats, encryption and compression.

@@ -388,7 +379,5 @@
- - diff --git a/src/js/index.js b/src/js/index.js new file mode 100644 index 00000000..6ce8ca56 --- /dev/null +++ b/src/js/index.js @@ -0,0 +1,135 @@ +import './core/Ingredient.js'; +import './core/Dish.js'; +import './core/FlowControl.js'; +import './core/Operation.js'; +import './core/Recipe.js'; +import './core/Utils.js'; +import './core/Chef.js'; +import './lib/canvas_components.js'; +import './lib/punycode.js'; +import './lib/rawinflate.js'; +import './lib/unzip.js'; +import './lib/zlib_and_gzip.js'; +import './lib/split.js'; +import './lib/rawdeflate.js'; +import './lib/moment-timezone.js'; +import './lib/diff.js'; +import './lib/prettify.js'; +import './lib/bootstrap-3.3.6.js'; +import './lib/Sortable.js'; +import './lib/snowfall.jquery.js'; +import './lib/zip.js'; +import './lib/escodegen.browser.js'; +import './lib/bootstrap-switch.js'; +import './lib/yahoo.js'; +import './lib/vkbeautify.js'; +import './lib/moment.js'; +import './lib/bootstrap-colorpicker.js'; +import './lib/cryptojs/format-hex.js'; +import './lib/cryptojs/hmac.js'; +import './lib/cryptojs/pad-iso10126.js'; +import './lib/cryptojs/sha384.js'; +import './lib/cryptojs/aes.js'; +import './lib/cryptojs/pad-nopadding.js'; +import './lib/cryptojs/core.js'; +import './lib/cryptojs/pad-zeropadding.js'; +import './lib/cryptojs/mode-ctr.js'; +import './lib/cryptojs/sha1.js'; +import './lib/cryptojs/md5.js'; +import './lib/cryptojs/evpkdf.js'; +import './lib/cryptojs/rabbit.js'; +import './lib/cryptojs/rc4.js'; +import './lib/cryptojs/lib-typedarrays.js'; +import './lib/cryptojs/enc-base64.js'; +import './lib/cryptojs/sha3.js'; +import './lib/cryptojs/sha224.js'; +import './lib/cryptojs/mode-ofb.js'; +import './lib/cryptojs/rabbit-legacy.js'; +import './lib/cryptojs/ripemd160.js'; +import './lib/cryptojs/cipher-core.js'; +import './lib/cryptojs/pbkdf2.js'; +import './lib/cryptojs/pad-iso97971.js'; +import './lib/cryptojs/sha256.js'; +import './lib/cryptojs/x64-core.js'; +import './lib/cryptojs/mode-ecb.js'; +import './lib/cryptojs/sha512.js'; +import './lib/cryptojs/mode-ctr-gladman.js'; +import './lib/cryptojs/enc-utf16.js'; +import './lib/cryptojs/tripledes.js'; +import './lib/cryptojs/mode-cfb.js'; +import './lib/cryptojs/pad-ansix923.js'; +import './lib/bzip2.js'; +import './lib/jsbn/rsa.js'; +import './lib/jsbn/jsbn2.js'; +import './lib/jsbn/ec.js'; +import './lib/jsbn/prng4.js'; +import './lib/jsbn/jsbn.js'; +import './lib/jsbn/rng.js'; +import './lib/jsbn/base64.js'; +import './lib/jsbn/sec.js'; +import './lib/esmangle.min.js'; +import './lib/blowfish.dojo.js'; +import './lib/jquery-2.1.1.js'; +import './lib/esprima.js'; +import './lib/jsrasign/ecdsa-modified-1.0.js'; +import './lib/jsrasign/asn1-1.0.js'; +import './lib/jsrasign/x509-1.1.js'; +import './lib/jsrasign/asn1hex-1.1.js'; +import './lib/jsrasign/dsa-modified-1.0.js'; +import './lib/jsrasign/crypto-1.1.js'; +import './lib/jsrasign/asn1x509-1.0.js'; +import './lib/jsrasign/base64x-1.1.js'; +import './lib/jsrasign/ecparam-1.0.js'; +import './lib/jsrasign/keyutil-1.0.js'; +import './lib/uas_parser.js'; +import './config/OperationConfig.js'; +import './config/Categories.js'; +import './views/html/InputWaiter.js'; +import './views/html/HTMLCategory.js'; +import './views/html/OperationsWaiter.js'; +import './views/html/main.js'; +import './views/html/ControlsWaiter.js'; +import './views/html/HTMLOperation.js'; +import './views/html/OptionsWaiter.js'; +import './views/html/OutputWaiter.js'; +import './views/html/SeasonalWaiter.js'; +import './views/html/Manager.js'; +import './views/html/HighlighterWaiter.js'; +import './views/html/WindowWaiter.js'; +import './views/html/HTMLApp.js'; +import './views/html/HTMLIngredient.js'; +import './views/html/RecipeWaiter.js'; +import './operations/IP.js'; +import './operations/MAC.js'; +import './operations/Code.js'; +import './operations/Checksum.js'; +import './operations/CharEnc.js'; +import './operations/Extract.js'; +import './operations/URL.js'; +import './operations/FileType.js'; +import './operations/Cipher.js'; +import './operations/PublicKey.js'; +import './operations/Punycode.js'; +import './operations/OS.js'; +import './operations/Convert.js'; +import './operations/HTTP.js'; +import './operations/SeqUtils.js'; +import './operations/Rotate.js'; +import './operations/Unicode.js'; +import './operations/Endian.js'; +import './operations/Tidy.js'; +import './operations/StrUtils.js'; +import './operations/Numberwang.js'; +import './operations/HTML.js'; +import './operations/QuotedPrintable.js'; +import './operations/DateTime.js'; +import './operations/JS.js'; +import './operations/Base.js'; +import './operations/Hash.js'; +import './operations/Entropy.js'; +import './operations/Hexdump.js'; +import './operations/BitwiseOp.js'; +import './operations/ByteRepr.js'; +import './operations/UUID.js'; +import './operations/Base64.js'; +import './operations/Compress.js'; diff --git a/webpack-babel.js b/webpack-babel.js new file mode 100644 index 00000000..2efde3f7 --- /dev/null +++ b/webpack-babel.js @@ -0,0 +1,118 @@ +import path from 'path'; + +import HtmlWebpackPlugin from 'html-webpack-plugin'; +import ExtractTextPlugin from 'extract-text-webpack-plugin'; + +const fontLoader = 'file-loader?name=fnt/[name]-[sha512:hash:base64:7].[ext]'; + +function getCssOptions(target) { + if (target !== 'build') { + return `css-loader?${JSON.stringify({ + modules: false, + minimize: false, + sourceMap: true, + })}`; + } + + return `css-loader?${JSON.stringify({ + modules: false, + minimize: true, + sourceMap: true, + discardComments: { + removeAll: true, + }, + })}`; +} + +function css(target) { + const extractCSS = new ExtractTextPlugin('style/[name]-[contenthash].css'); + const cssOptions = getCssOptions(target); + function cssLoaderConf(loader) { + return extractCSS.extract({ + fallbackLoader: 'style-loader', + loader: `${cssOptions}${loader}`, + }); + } + + const cssLoader = cssLoaderConf(''); + const lessLoader = cssLoaderConf('!less-loader?sourceMap'); + const scssLoader = cssLoaderConf('!sass-loader?sourceMap'); + + return { + plugin: extractCSS, + loaders: [ + { test: /\.css$/, loader: cssLoader }, + { test: /\.less$/, loader: lessLoader }, + { test: /\.scss$/, loader: scssLoader }, + ], + }; +} + +const outputPath = 'dist/'; +const dirname = __dirname; +const cssConfig = css('build'); + +export default { + entry: './src/browser', + output: { + path: path.join(dirname, outputPath), + filename: '[name]-[chunkhash].bundle.js', + sourceMapFilename: 'source-maps/[file].map', + }, + devtool: '#source-maps', + devServer: { + inline: true, + }, + module: { + loaders: [ + { + test: /\.(js|es)$/, + exclude: /node_modules|bower_components/, + loader: 'babel-loader', + query: JSON.stringify({ + babelrc: false, + cacheDirectory: true, + presets: [ + [ + 'env', { + modules: false, + targets: { chrome: 55, firefox: 50} + }, + ], + ], + plugins: ['transform-runtime'], + env: { + test: { + plugins: ['istanbul'], + }, + }, + }), + }, + { test: /\.json$/, loader: 'json-loader' }, + { + test: /\.woff2?(\?[^/]*)?$/, + loader: fontLoader, + }, + { + test: /\.ttf(\?[^/]*)?$/, + loader: fontLoader, + }, + { + test: /\.eot(\?[^/]*)?$/, + loader: fontLoader, + }, + { + test: /\.svg(\?[^/]*)?$/, + loader: fontLoader, + }, + ].concat(cssConfig.loaders) + }, + plugins: [ + cssConfig.plugin, + new HtmlWebpackPlugin({ + template: './src/html/index.html', + filename: 'index.html', + compileTime: new Date().toISOString(), + }) + ] +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..79d5245e --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,2 @@ +require('babel-register'); +module.exports = require('./webpack-babel').default; diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..7955e398 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4532 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +abbrev@1: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + +accepts@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" + dependencies: + mime-types "~2.1.11" + negotiator "0.6.1" + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4, acorn@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.3.tgz#1a3e850b428e73ba6b09d1cc527f5aaad4d03ef1" + +ajv-keywords@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.1.1.tgz#02550bc605a3e576041565628af972e06c549d50" + +ajv@^4.7.0: + version "4.9.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.9.0.tgz#5a358085747b134eb567d6d15e015f1d7802f45c" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + +aproba@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" + +are-we-there-yet@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.0 || ^1.1.13" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +"argparse@~ 0.1.11": + version "0.1.16" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-0.1.16.tgz#cfd01e0fbba3d6caed049fbd758d40f65196f57c" + dependencies: + underscore "~1.7.0" + underscore.string "~2.4.0" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1.js@^4.0.0: + version "4.9.0" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.0.tgz#f71a1243f3e79d46d7b07d7fbf4824ee73af054a" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert@^1.1.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async@2.0.0-rc.4: + version "2.0.0-rc.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.0.0-rc.4.tgz#9b7f60724c17962a973f787419e0ebc5571dbad8" + dependencies: + lodash "^4.3.0" + +async@^1.5.0, async@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.2: + version "2.1.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.1.4.tgz#2d2160c7788032e4dd6cbe2502f1f9a2c8f6cde4" + dependencies: + lodash "^4.14.0" + +async@~0.1.22: + version "0.1.22" + resolved "https://registry.yarnpkg.com/async/-/async-0.1.22.tgz#0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061" + +async@~0.2.6, async@~0.2.9: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +autoprefixer@^6.3.1: + version "6.5.3" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.5.3.tgz#2d853af66d04449fcf50db3066279ab54c3e4b01" + dependencies: + browserslist "~1.4.0" + caniuse-db "^1.0.30000578" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^5.2.5" + postcss-value-parser "^3.2.3" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" + +babel-code-frame@^6.11.0, babel-code-frame@^6.16.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.16.0.tgz#f90e60da0862909d3ce098733b5d3987c97cb8de" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^2.0.0" + +babel-core@^6.18.0, babel-core@^6.18.2: + version "6.18.2" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.18.2.tgz#d8bb14dd6986fa4f3566a26ceda3964fa0e04e5b" + dependencies: + babel-code-frame "^6.16.0" + babel-generator "^6.18.0" + babel-helpers "^6.16.0" + babel-messages "^6.8.0" + babel-register "^6.18.0" + babel-runtime "^6.9.1" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.11.0" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-is-absolute "^1.0.0" + private "^0.1.6" + slash "^1.0.0" + source-map "^0.5.0" + +babel-generator@^6.18.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.19.0.tgz#9b2f244204777a3d6810ec127c673c87b349fac5" + dependencies: + babel-messages "^6.8.0" + babel-runtime "^6.9.0" + babel-types "^6.19.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + +babel-helper-builder-binary-assignment-operator-visitor@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.18.0.tgz#8ae814989f7a53682152e3401a04fabd0bb333a6" + dependencies: + babel-helper-explode-assignable-expression "^6.18.0" + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-helper-call-delegate@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd" + dependencies: + babel-helper-hoist-variables "^6.18.0" + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.18.0.tgz#8d6c85dc7fbb4c19be3de40474d18e97c3676ec2" + dependencies: + babel-helper-function-name "^6.18.0" + babel-runtime "^6.9.0" + babel-types "^6.18.0" + lodash "^4.2.0" + +babel-helper-explode-assignable-expression@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.18.0.tgz#14b8e8c2d03ad735d4b20f1840b24cd1f65239fe" + dependencies: + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" + dependencies: + babel-helper-get-function-arity "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-helper-get-function-arity@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.18.0.tgz#a5b19695fd3f9cdfc328398b47dafcd7094f9f24" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-helper-hoist-variables@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.18.0.tgz#a835b5ab8b46d6de9babefae4d98ea41e866b82a" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-helper-optimise-call-expression@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-helper-regex@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.18.0.tgz#ae0ebfd77de86cb2f1af258e2cc20b5fe893ecc6" + dependencies: + babel-runtime "^6.9.0" + babel-types "^6.18.0" + lodash "^4.2.0" + +babel-helper-remap-async-to-generator@^6.16.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.18.0.tgz#336cdf3cab650bb191b02fc16a3708e7be7f9ce5" + dependencies: + babel-helper-function-name "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" + dependencies: + babel-helper-optimise-call-expression "^6.18.0" + babel-messages "^6.8.0" + babel-runtime "^6.0.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-helpers@^6.16.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" + dependencies: + babel-runtime "^6.0.0" + babel-template "^6.16.0" + +babel-loader@^6.2.8: + version "6.2.8" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-6.2.8.tgz#30d7183aef60afc140b36443676b7acb4c12ac9c" + dependencies: + find-cache-dir "^0.1.1" + loader-utils "^0.2.11" + mkdirp "^0.5.1" + object-assign "^4.0.1" + +babel-messages@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-check-es2015-constants@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-trailing-function-commas@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.13.0.tgz#2b84b7d53dd744f94ff1fad7669406274b23f541" + +babel-plugin-transform-async-to-generator@^6.8.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999" + dependencies: + babel-helper-remap-async-to-generator "^6.16.0" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-arrow-functions@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz#ed95d629c4b5a71ae29682b998f70d9833eb366d" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-block-scoping@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.18.0.tgz#3bfdcfec318d46df22525cdea88f1978813653af" + dependencies: + babel-runtime "^6.9.0" + babel-template "^6.15.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + lodash "^4.2.0" + +babel-plugin-transform-es2015-classes@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9" + dependencies: + babel-helper-define-map "^6.18.0" + babel-helper-function-name "^6.18.0" + babel-helper-optimise-call-expression "^6.18.0" + babel-helper-replace-supers "^6.18.0" + babel-messages "^6.8.0" + babel-runtime "^6.9.0" + babel-template "^6.14.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-computed-properties@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz#f51010fd61b3bd7b6b60a5fdfd307bb7a5279870" + dependencies: + babel-helper-define-map "^6.8.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + +babel-plugin-transform-es2015-destructuring@^6.6.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533" + dependencies: + babel-runtime "^6.9.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.6.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz#fd8f7f7171fc108cc1c70c3164b9f15a81c25f7d" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.8.0" + +babel-plugin-transform-es2015-for-of@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-function-name@^6.3.13: + version "6.9.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719" + dependencies: + babel-helper-function-name "^6.8.0" + babel-runtime "^6.9.0" + babel-types "^6.9.0" + +babel-plugin-transform-es2015-literals@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz#50aa2e5c7958fc2ab25d74ec117e0cc98f046468" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-modules-amd@^6.18.0, babel-plugin-transform-es2015-modules-amd@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + +babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc" + dependencies: + babel-plugin-transform-strict-mode "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.16.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.12.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6" + dependencies: + babel-helper-hoist-variables "^6.18.0" + babel-runtime "^6.11.6" + babel-template "^6.14.0" + +babel-plugin-transform-es2015-modules-umd@^6.12.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + +babel-plugin-transform-es2015-object-super@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz#1b858740a5a4400887c23dcff6f4d56eea4a24c5" + dependencies: + babel-helper-replace-supers "^6.8.0" + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-parameters@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.18.0.tgz#9b2cfe238c549f1635ba27fc1daa858be70608b1" + dependencies: + babel-helper-call-delegate "^6.18.0" + babel-helper-get-function-arity "^6.18.0" + babel-runtime "^6.9.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-shorthand-properties@^6.3.13: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-spread@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz#0217f737e3b821fa5a669f187c6ed59205f05e9c" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-sticky-regex@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz#e73d300a440a35d5c64f5c2a344dc236e3df47be" + dependencies: + babel-helper-regex "^6.8.0" + babel-runtime "^6.0.0" + babel-types "^6.8.0" + +babel-plugin-transform-es2015-template-literals@^6.6.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz#86eb876d0a2c635da4ec048b4f7de9dfc897e66b" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-unicode-regex@^6.3.13: + version "6.11.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz#6298ceabaad88d50a3f4f392d8de997260f6ef2c" + dependencies: + babel-helper-regex "^6.8.0" + babel-runtime "^6.0.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz#db25742e9339eade676ca9acec46f955599a68a4" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.8.0" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.0.0" + +babel-plugin-transform-regenerator@^6.6.0: + version "6.16.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.16.1.tgz#a75de6b048a14154aae14b0122756c5bed392f59" + dependencies: + babel-runtime "^6.9.0" + babel-types "^6.16.0" + private "~0.1.5" + +babel-plugin-transform-runtime@^6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.15.0.tgz#3d75b4d949ad81af157570273846fb59aeb0d57c" + dependencies: + babel-runtime "^6.9.0" + +babel-plugin-transform-strict-mode@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-preset-env@^0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-0.0.9.tgz#7ca6128a3c7ea1c839a535e6e98fa2f14557c349" + dependencies: + babel-plugin-check-es2015-constants "^6.3.13" + babel-plugin-syntax-trailing-function-commas "^6.13.0" + babel-plugin-transform-async-to-generator "^6.8.0" + babel-plugin-transform-es2015-arrow-functions "^6.3.13" + babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" + babel-plugin-transform-es2015-block-scoping "^6.6.0" + babel-plugin-transform-es2015-classes "^6.6.0" + babel-plugin-transform-es2015-computed-properties "^6.3.13" + babel-plugin-transform-es2015-destructuring "^6.6.0" + babel-plugin-transform-es2015-duplicate-keys "^6.6.0" + babel-plugin-transform-es2015-for-of "^6.6.0" + babel-plugin-transform-es2015-function-name "^6.3.13" + babel-plugin-transform-es2015-literals "^6.3.13" + babel-plugin-transform-es2015-modules-amd "^6.8.0" + babel-plugin-transform-es2015-modules-commonjs "^6.6.0" + babel-plugin-transform-es2015-modules-systemjs "^6.12.0" + babel-plugin-transform-es2015-modules-umd "^6.12.0" + babel-plugin-transform-es2015-object-super "^6.3.13" + babel-plugin-transform-es2015-parameters "^6.6.0" + babel-plugin-transform-es2015-shorthand-properties "^6.3.13" + babel-plugin-transform-es2015-spread "^6.3.13" + babel-plugin-transform-es2015-sticky-regex "^6.3.13" + babel-plugin-transform-es2015-template-literals "^6.6.0" + babel-plugin-transform-es2015-typeof-symbol "^6.6.0" + babel-plugin-transform-es2015-unicode-regex "^6.3.13" + babel-plugin-transform-exponentiation-operator "^6.8.0" + babel-plugin-transform-regenerator "^6.6.0" + browserslist "^1.4.0" + +babel-register@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" + dependencies: + babel-core "^6.18.0" + babel-runtime "^6.11.6" + core-js "^2.4.0" + home-or-tmp "^2.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.2" + +babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.18.0.tgz#0f4177ffd98492ef13b9f823e9994a02584c9078" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.9.5" + +babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.8.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.16.0.tgz#e149dd1a9f03a35f817ddbc4d0481988e7ebc8ca" + dependencies: + babel-runtime "^6.9.0" + babel-traverse "^6.16.0" + babel-types "^6.16.0" + babylon "^6.11.0" + lodash "^4.2.0" + +babel-traverse@^6.16.0, babel-traverse@^6.18.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.19.0.tgz#68363fb821e26247d52a519a84b2ceab8df4f55a" + dependencies: + babel-code-frame "^6.16.0" + babel-messages "^6.8.0" + babel-runtime "^6.9.0" + babel-types "^6.19.0" + babylon "^6.11.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.8.0, babel-types@^6.9.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.19.0.tgz#8db2972dbed01f1192a8b602ba1e1e4c516240b9" + dependencies: + babel-runtime "^6.9.1" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babylon@^6.11.0: + version "6.14.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" + +balanced-match@^0.4.1, balanced-match@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +base64-js@^1.0.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" + +batch@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/batch/-/batch-0.5.3.tgz#3f3414f380321743bfc1042f9a83ff1d5824d464" + +bcrypt-pbkdf@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4" + dependencies: + tweetnacl "^0.14.3" + +big.js@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" + +binary-extensions@^1.0.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.7.0.tgz#6c1610db163abfb34edfe42fa423343a1e01185d" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +bluebird@^3.4.6, bluebird@~3.4.6: + version "3.4.6" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.6.tgz#01da8d821d87813d158967e743d5fe6c62cf8c0f" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.0.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +brorand@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" + dependencies: + buffer-xor "^1.0.2" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + inherits "^2.0.1" + +browserify-cipher@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" + dependencies: + pako "~0.2.0" + +browserslist@^1.4.0, browserslist@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.4.0.tgz#9cfdcf5384d9158f5b70da2aa00b30e8ff019049" + dependencies: + caniuse-db "^1.0.30000539" + +buffer-shims@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +buffer-xor@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +builtin-status-codes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-2.0.0.tgz#6f22003baacf003ccd287afe6872151fddc58579" + +bytes@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.3.0.tgz#d5b680a165b6201739acb611542aabc2d8ceb070" + +camel-case@3.0.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + dependencies: + no-case "^2.2.0" + upper-case "^1.1.1" + +camel-case@^1.1.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-1.2.2.tgz#1aca7c4d195359a2ce9955793433c6e5542511f2" + dependencies: + sentence-case "^1.1.1" + upper-case "^1.1.1" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + +caniuse-db@^1.0.30000539, caniuse-db@^1.0.30000578: + version "1.0.30000588" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000588.tgz#20baa051c5bd7e33ae32c7781b5379289c3d39d2" + +caseless@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" + +catharsis@~0.8.8: + version "0.8.8" + resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.8.tgz#693479f43aac549d806bd73e924cd0d944951a06" + dependencies: + underscore-contrib "~0.3.0" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +change-case@2.3.x: + version "2.3.1" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-2.3.1.tgz#2c4fde3f063bb41d00cd68e0d5a09db61cbe894f" + dependencies: + camel-case "^1.1.1" + constant-case "^1.1.0" + dot-case "^1.1.0" + is-lower-case "^1.1.0" + is-upper-case "^1.1.0" + lower-case "^1.1.1" + lower-case-first "^1.0.0" + param-case "^1.1.0" + pascal-case "^1.1.0" + path-case "^1.1.0" + sentence-case "^1.1.1" + snake-case "^1.1.0" + swap-case "^1.1.0" + title-case "^1.1.0" + upper-case "^1.1.1" + upper-case-first "^1.1.0" + +chokidar@^1.4.3, chokidar@^1.6.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +cipher-base@^1.0.0, cipher-base@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" + dependencies: + inherits "^2.0.1" + +clap@^1.0.9: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clap/-/clap-1.1.1.tgz#a8a93e0bfb7581ac199c4f001a5525a724ce696d" + dependencies: + chalk "^1.1.3" + +clean-css@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-1.1.7.tgz#601ef9cf7642b982cb33efc9488a6444c986686e" + dependencies: + commander "2.0.x" + +clean-css@3.4.x, clean-css@~3.4.2: + version "3.4.21" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-3.4.21.tgz#2101d5dbd19d63dbc16a75ebd570e7c33948f65b" + dependencies: + commander "2.8.x" + source-map "0.4.x" + +cli@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cli/-/cli-1.0.1.tgz#22817534f24bfa4950c34d532d48ecbc621b8c14" + dependencies: + exit "0.1.2" + glob "^7.1.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +coa@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/coa/-/coa-1.0.1.tgz#7f959346cfc8719e3f7233cd6852854a7c67d8a3" + dependencies: + q "^1.1.2" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +coffee-script@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.3.3.tgz#150d6b4cb522894369efed6a2101c20bc7f4a4f4" + +color-convert@^1.3.0: + version "1.8.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.8.2.tgz#be868184d7c8631766d54e7078e2672d7c7e3339" + dependencies: + color-name "^1.1.1" + +color-name@^1.0.0, color-name@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + +color-string@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991" + dependencies: + color-name "^1.0.0" + +color@^0.11.0: + version "0.11.4" + resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764" + dependencies: + clone "^1.0.2" + color-convert "^1.3.0" + color-string "^0.3.0" + +colormin@^1.0.5: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colormin/-/colormin-1.1.2.tgz#ea2f7420a72b96881a38aae59ec124a6f7298133" + dependencies: + color "^0.11.0" + css-color-names "0.0.4" + has "^1.0.1" + +colors@~0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" + +colors@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@2.0.x: + version "2.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.0.0.tgz#d1b86f901f8b64bd941bdeadaf924530393be928" + +commander@2.8.x: + version "2.8.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" + dependencies: + graceful-readlink ">= 1.0.0" + +commander@2.9.x, commander@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +compressible@~2.0.8: + version "2.0.9" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.9.tgz#6daab4e2b599c2770dd9e21e7a891b1c5a755425" + dependencies: + mime-db ">= 1.24.0 < 2" + +compression@^1.5.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.6.2.tgz#cceb121ecc9d09c52d7ad0c3350ea93ddd402bc3" + dependencies: + accepts "~1.3.3" + bytes "2.3.0" + compressible "~2.0.8" + debug "~2.2.0" + on-headers "~1.0.1" + vary "~1.1.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@1.5.x, concat-stream@^1.4.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + +connect-history-api-fallback@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.3.0.tgz#e51d17f8f0ef0db90a64fdb47de3051556e9f169" + +console-browserify@1.1.x, console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +constant-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-1.1.2.tgz#8ec2ca5ba343e00aa38dbf4e200fd5ac907efd63" + dependencies: + snake-case "^1.1.0" + upper-case "^1.1.1" + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +content-disposition@0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.1.tgz#87476c6a67c8daa87e32e87616df883ba7fb071b" + +content-type@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed" + +convert-source-map@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-ecdh@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + ripemd160 "^1.0.0" + sha.js "^2.3.6" + +create-hmac@^1.1.0, create-hmac@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" + dependencies: + create-hash "^1.1.0" + inherits "^2.0.1" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +crypto-browserify@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + +css-color-names@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" + +css-loader@^0.26.0: + version "0.26.0" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.26.0.tgz#160d378f5b8e0fd4ff6daf4f3580e2219b33025f" + dependencies: + babel-code-frame "^6.11.0" + css-selector-tokenizer "^0.7.0" + cssnano ">=2.6.1 <4" + loader-utils "~0.2.2" + lodash.camelcase "^4.3.0" + object-assign "^4.0.1" + postcss "^5.0.6" + postcss-modules-extract-imports "^1.0.0" + postcss-modules-local-by-default "^1.0.1" + postcss-modules-scope "^1.0.0" + postcss-modules-values "^1.1.0" + source-list-map "^0.1.4" + +css-select@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + +css-selector-tokenizer@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.6.0.tgz#6445f582c7930d241dcc5007a43d6fcb8f073152" + dependencies: + cssesc "^0.1.0" + fastparse "^1.1.1" + regexpu-core "^1.0.0" + +css-selector-tokenizer@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz#e6988474ae8c953477bf5e7efecfceccd9cf4c86" + dependencies: + cssesc "^0.1.0" + fastparse "^1.1.1" + regexpu-core "^1.0.0" + +css-what@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" + +cssesc@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" + +"cssnano@>=2.6.1 <4": + version "3.8.1" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.8.1.tgz#008a482148ee948cf0af2ee6e44bd97c53f886ec" + dependencies: + autoprefixer "^6.3.1" + decamelize "^1.1.2" + defined "^1.0.0" + has "^1.0.1" + object-assign "^4.0.1" + postcss "^5.0.14" + postcss-calc "^5.2.0" + postcss-colormin "^2.1.8" + postcss-convert-values "^2.3.4" + postcss-discard-comments "^2.0.4" + postcss-discard-duplicates "^2.0.1" + postcss-discard-empty "^2.0.1" + postcss-discard-overridden "^0.1.1" + postcss-discard-unused "^2.2.1" + postcss-filter-plugins "^2.0.0" + postcss-merge-idents "^2.1.5" + postcss-merge-longhand "^2.0.1" + postcss-merge-rules "^2.0.3" + postcss-minify-font-values "^1.0.2" + postcss-minify-gradients "^1.0.1" + postcss-minify-params "^1.0.4" + postcss-minify-selectors "^2.0.4" + postcss-normalize-charset "^1.1.0" + postcss-normalize-url "^3.0.7" + postcss-ordered-values "^2.1.0" + postcss-reduce-idents "^2.2.2" + postcss-reduce-initial "^1.0.0" + postcss-reduce-transforms "^1.0.3" + postcss-svgo "^2.1.1" + postcss-unique-selectors "^2.0.2" + postcss-value-parser "^3.2.3" + postcss-zindex "^2.0.1" + +csso@~2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/csso/-/csso-2.2.1.tgz#51fbb5347e50e81e6ed51668a48490ae6fe2afe2" + dependencies: + clap "^1.0.9" + source-map "^0.5.3" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +datauri@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/datauri/-/datauri-0.2.1.tgz#f4e8addbb3e54e3dc12d1c88543b8b0b1bf692fa" + dependencies: + mimer "*" + templayed "*" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +dateformat@1.0.2-1.2.3: + version "1.0.2-1.2.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.2-1.2.3.tgz#b0220c02de98617433b72851cf47de3df2cdbee9" + +debug@^2.1.1, debug@^2.2.0, debug@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + +debug@~0.7.0: + version "0.7.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39" + +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-extend@~0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +depd@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diffie-hellman@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dom-converter@~0.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.1.4.tgz#a45ef5727b890c9bffe6d7c876e7b19cb0e17f3b" + dependencies: + utila "~0.3" + +dom-serializer@0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + dependencies: + domelementtype "~1.1.1" + entities "~1.1.1" + +domain-browser@^1.1.1: + version "1.1.7" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" + +domelementtype@1, domelementtype@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domhandler@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.1.0.tgz#d2646f5e57f6c3bab11cf6cb05d3c0acf7412594" + dependencies: + domelementtype "1" + +domhandler@2.3, domhandler@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" + dependencies: + domelementtype "1" + +domutils@1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" + dependencies: + domelementtype "1" + +domutils@1.5, domutils@1.5.1, domutils@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + dependencies: + dom-serializer "0" + domelementtype "1" + +dot-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-1.1.2.tgz#1e73826900de28d6de5480bc1de31d0842b06bec" + dependencies: + sentence-case "^1.1.2" + +duplexer@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +elliptic@^6.0.0: + version "6.3.2" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + inherits "^2.0.1" + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + +encodeurl@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" + +enhanced-resolve@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-2.3.0.tgz#a115c32504b6302e85a76269d7a57ccdd962e359" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.3.0" + object-assign "^4.0.1" + tapable "^0.2.3" + +entities@1.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +errno@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + +error-ex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + dependencies: + is-arrayish "^0.2.1" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5, escape-string-regexp@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +espree@~3.1.7: + version "3.1.7" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.1.7.tgz#fd5deec76a97a5120a9cd3a7cb1177a0923b11d2" + dependencies: + acorn "^3.3.0" + acorn-jsx "^3.0.0" + +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +"esprima@~ 1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" + +estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +etag@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.7.0.tgz#03d30b5f67dd6e632d2945d30d6652731a34d5d8" + +eventemitter2@~0.4.13: + version "0.4.14" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab" + +eventemitter3@1.x.x: + version "1.2.0" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508" + +events@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + +eventsource@~0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-0.1.6.tgz#0acede849ed7dd1ccc32c811bb11b944d4f29232" + dependencies: + original ">=0.0.5" + +evp_bytestokey@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" + dependencies: + create-hash "^1.1.1" + +exit@0.1.2, exit@0.1.x, exit@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +express@^4.13.3: + version "4.14.0" + resolved "https://registry.yarnpkg.com/express/-/express-4.14.0.tgz#c1ee3f42cdc891fb3dc650a8922d51ec847d0d66" + dependencies: + accepts "~1.3.3" + array-flatten "1.1.1" + content-disposition "0.5.1" + content-type "~1.0.2" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "~2.2.0" + depd "~1.1.0" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.7.0" + finalhandler "0.5.0" + fresh "0.3.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.1" + path-to-regexp "0.1.7" + proxy-addr "~1.1.2" + qs "6.2.0" + range-parser "~1.2.0" + send "0.14.1" + serve-static "~1.11.1" + type-is "~1.6.13" + utils-merge "1.0.0" + vary "~1.1.0" + +extend@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extract-text-webpack-plugin@2.0.0-beta.4: + version "2.0.0-beta.4" + resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-2.0.0-beta.4.tgz#d32393069e7d90c8318d48392302618b56bc1ba9" + dependencies: + async "^1.5.0" + loader-utils "^0.2.3" + webpack-sources "^0.1.0" + +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + +fastparse@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" + +faye-websocket@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + dependencies: + websocket-driver ">=0.5.1" + +faye-websocket@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.0.tgz#d9ccf0e789e7db725d74bc4877d23aa42972ac50" + dependencies: + websocket-driver ">=0.5.1" + +faye-websocket@~0.4.3: + version "0.4.4" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.4.4.tgz#c14c5b3bf14d7417ffbfd990c0a7495cd9f337bc" + +figures@^1.0.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-loader@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.9.0.tgz#1d2daddd424ce6d1b07cfe3f79731bed3617ab42" + dependencies: + loader-utils "~0.2.5" + +file-sync-cmp@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz#a5e7a8ffbfa493b43b923bbd4ca89a53b63b612b" + +filename-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +finalhandler@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.5.0.tgz#e9508abece9b6dba871a6942a1d7911b91911ac7" + dependencies: + debug "~2.2.0" + escape-html "~1.0.3" + on-finished "~2.3.0" + statuses "~1.3.0" + unpipe "~1.0.0" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +findup-sync@~0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.1.3.tgz#7f3e7a97b82392c653bf06589bd85190e93c3683" + dependencies: + glob "~3.2.9" + lodash "~2.4.1" + +flatten@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" + +for-in@^0.1.5: + version "0.1.6" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" + +for-own@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + dependencies: + for-in "^0.1.5" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +forwarded@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363" + +fresh@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.3.0.tgz#651f838e22424e7566de161d8358caa199f83d4f" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.0.15" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.15.tgz#fa63f590f3c2ad91275e4972a6cea545fb0aae44" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.29" + +fstream-ignore@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +gauge@~2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.1.tgz#388473894fe8be5e13ffcdb8b93e4ed0616428c7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-color "^0.1.7" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +gaze@~0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f" + dependencies: + globule "~0.1.0" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +getobject@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/getobject/-/getobject-0.1.0.tgz#047a449789fa160d018f5486ed91320b6ec7885c" + +getpass@^0.1.1: + version "0.1.6" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^7.0.5, glob@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@~3.1.21: + version "3.1.21" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" + dependencies: + graceful-fs "~1.2.0" + inherits "1" + minimatch "~0.2.11" + +glob@~3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.11.tgz#4a973f635b9190f715d10987d5c00fd2815ebe3d" + dependencies: + inherits "2" + minimatch "0.3" + +globals@^9.0.0: + version "9.14.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" + +globule@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" + dependencies: + glob "~3.1.21" + lodash "~1.0.1" + minimatch "~0.2.11" + +graceful-fs@^4.1.2, graceful-fs@^4.1.9: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +graceful-fs@~1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +grunt-chmod@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/grunt-chmod/-/grunt-chmod-1.1.1.tgz#d1865c5a84e7ed9aefe509ffbf5290f97a257840" + dependencies: + shelljs "^0.5.3" + +grunt-contrib-clean@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/grunt-contrib-clean/-/grunt-contrib-clean-1.0.0.tgz#6b2ed94117e2c7ffe32ee04578c96fe4625a9b6d" + dependencies: + async "^1.5.2" + rimraf "^2.5.1" + +grunt-contrib-concat@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/grunt-contrib-concat/-/grunt-contrib-concat-1.0.1.tgz#61509863084e871d7e86de48c015259ed97745bd" + dependencies: + chalk "^1.0.0" + source-map "^0.5.3" + +grunt-contrib-copy@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/grunt-contrib-copy/-/grunt-contrib-copy-0.8.2.tgz#df31c90ffcc409bc9fafe44ec0dd1e4259916fea" + dependencies: + chalk "^1.1.1" + file-sync-cmp "^0.1.0" + +grunt-contrib-cssmin@~0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/grunt-contrib-cssmin/-/grunt-contrib-cssmin-0.14.0.tgz#88b0a92536969bb566281c5c61ec5062d833f3b7" + dependencies: + chalk "^1.0.0" + clean-css "~3.4.2" + maxmin "^1.1.0" + +grunt-contrib-htmlmin@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/grunt-contrib-htmlmin/-/grunt-contrib-htmlmin-0.6.0.tgz#f6332f1fe85af8d8bdd7f3e3dba051898a256363" + dependencies: + chalk "^1.0.0" + html-minifier "^1.0.0" + pretty-bytes "^2.0.1" + +grunt-contrib-jshint@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/grunt-contrib-jshint/-/grunt-contrib-jshint-1.0.0.tgz#30f405a51de656bfa6eb029b9a464b9fe02a402a" + dependencies: + chalk "^1.1.1" + hooker "^0.2.3" + jshint "~2.9.1" + +grunt-contrib-uglify@~0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/grunt-contrib-uglify/-/grunt-contrib-uglify-0.11.1.tgz#5e22a2f676cd11d871fc2a0f08aa9b2973045325" + dependencies: + chalk "^1.0.0" + lodash "^4.0.1" + maxmin "^2.0.0" + uglify-js "~2.6.0" + uri-path "^1.0.0" + +grunt-contrib-watch@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/grunt-contrib-watch/-/grunt-contrib-watch-0.6.1.tgz#64fdcba25a635f5b4da1b6ce6f90da0aeb6e3f15" + dependencies: + async "~0.2.9" + gaze "~0.5.1" + lodash "~2.4.1" + tiny-lr-fork "0.0.5" + +grunt-exec@~0.4.6: + version "0.4.7" + resolved "https://registry.yarnpkg.com/grunt-exec/-/grunt-exec-0.4.7.tgz#40051ffa4eb0c9657e053b95e88d44352a1c2c25" + +grunt-inline-alt@~0.3.10: + version "0.3.10" + resolved "https://registry.yarnpkg.com/grunt-inline-alt/-/grunt-inline-alt-0.3.10.tgz#2f3d6c3d7b9e910b7d961b01ac3ccae16fec3ac3" + dependencies: + clean-css "1.1.7" + datauri "~0.2.0" + uglify-js "2.4.1" + +grunt-jsdoc@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/grunt-jsdoc/-/grunt-jsdoc-1.1.0.tgz#4bcefe60587a646a5b720fe9abf94cc4887fe854" + dependencies: + jsdoc "^3.4.0" + +grunt-legacy-log-utils@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz#c0706b9dd9064e116f36f23fe4e6b048672c0f7e" + dependencies: + colors "~0.6.2" + lodash "~2.4.1" + underscore.string "~2.3.3" + +grunt-legacy-log@~0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz#ec29426e803021af59029f87d2f9cd7335a05531" + dependencies: + colors "~0.6.2" + grunt-legacy-log-utils "~0.1.1" + hooker "~0.2.3" + lodash "~2.4.1" + underscore.string "~2.3.3" + +grunt-legacy-util@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz#93324884dbf7e37a9ff7c026dff451d94a9e554b" + dependencies: + async "~0.1.22" + exit "~0.1.1" + getobject "~0.1.0" + hooker "~0.2.3" + lodash "~0.9.2" + underscore.string "~2.2.1" + which "~1.0.5" + +grunt@~0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/grunt/-/grunt-0.4.5.tgz#56937cd5194324adff6d207631832a9d6ba4e7f0" + dependencies: + async "~0.1.22" + coffee-script "~1.3.3" + colors "~0.6.2" + dateformat "1.0.2-1.2.3" + eventemitter2 "~0.4.13" + exit "~0.1.1" + findup-sync "~0.1.2" + getobject "~0.1.0" + glob "~3.1.21" + grunt-legacy-log "~0.1.0" + grunt-legacy-util "~0.2.0" + hooker "~0.2.3" + iconv-lite "~0.2.11" + js-yaml "~2.0.5" + lodash "~0.9.2" + minimatch "~0.2.12" + nopt "~1.0.10" + rimraf "~2.2.8" + underscore.string "~2.2.1" + which "~1.0.5" + +gzip-size@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-1.0.0.tgz#66cf8b101047227b95bace6ea1da0c177ed5c22f" + dependencies: + browserify-zlib "^0.1.4" + concat-stream "^1.4.1" + +gzip-size@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520" + dependencies: + duplexer "^0.1.1" + +handle-thing@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" + +har-validator@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" + dependencies: + chalk "^1.1.1" + commander "^2.9.0" + is-my-json-valid "^2.12.4" + pinkie-promise "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-color@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hash.js@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" + dependencies: + inherits "^2.0.1" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +he@1.0.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.0.0.tgz#6da5b265d7f2c3b5e480749168e0e159d05728da" + +he@1.1.x: + version "1.1.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.0.tgz#29319d49beec13a9b1f3c4f9b2a6dde4859bb2a7" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hooker@^0.2.3, hooker@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959" + +hosted-git-info@^2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + +hpack.js@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + dependencies: + inherits "^2.0.1" + obuf "^1.0.0" + readable-stream "^2.0.1" + wbuf "^1.1.0" + +html-comment-regex@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" + +html-minifier@^1.0.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-1.5.0.tgz#beb05fd9cc340945865c10f40aedf469af4b1534" + dependencies: + change-case "2.3.x" + clean-css "3.4.x" + commander "2.9.x" + concat-stream "1.5.x" + he "1.0.x" + ncname "1.0.x" + relateurl "0.2.x" + uglify-js "2.6.x" + +html-minifier@^3.1.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.2.3.tgz#d2ff536e24d95726c332493d8f77d84dbed85372" + dependencies: + camel-case "3.0.x" + clean-css "3.4.x" + commander "2.9.x" + he "1.1.x" + ncname "1.0.x" + param-case "2.1.x" + relateurl "0.2.x" + uglify-js "2.7.x" + +html-webpack-plugin@^2.24.1: + version "2.24.1" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-2.24.1.tgz#7f45fc678f66eac2d433f22336b4399da023b57e" + dependencies: + bluebird "^3.4.6" + html-minifier "^3.1.0" + loader-utils "^0.2.16" + lodash "^4.16.4" + pretty-error "^2.0.2" + toposort "^1.0.0" + +htmlparser2@3.8.x: + version "3.8.3" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068" + dependencies: + domelementtype "1" + domhandler "2.3" + domutils "1.5" + entities "1.0" + readable-stream "1.1" + +htmlparser2@^3.9.0: + version "3.9.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + +htmlparser2@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.3.0.tgz#cc70d05a59f6542e43f0e685c982e14c924a9efe" + dependencies: + domelementtype "1" + domhandler "2.1" + domutils "1.1" + readable-stream "1.0" + +http-deceiver@^1.2.4: + version "1.2.7" + resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" + +http-errors@~1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.5.1.tgz#788c0d2c1de2c81b9e6e8c01843b6b97eb920750" + dependencies: + inherits "2.0.3" + setprototypeof "1.0.2" + statuses ">= 1.3.1 < 2" + +http-proxy-middleware@~0.17.1: + version "0.17.2" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.17.2.tgz#572d517a6d2fb1063a469de294eed96066352007" + dependencies: + http-proxy "^1.15.1" + is-glob "^3.0.0" + lodash "^4.16.2" + micromatch "^2.3.11" + +http-proxy@^1.15.1: + version "1.15.2" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.15.2.tgz#642fdcaffe52d3448d2bda3b0079e9409064da31" + dependencies: + eventemitter3 "1.x.x" + requires-port "1.x.x" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" + +iconv-lite@~0.2.11: + version "0.2.11" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.2.11.tgz#1ce60a3a57864a292d1321ff4609ca4bb965adc8" + +icss-replace-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.0.2.tgz#cb0b6054eb3af6edc9ab1d62d01933e2d4c8bfa5" + +ieee754@^1.1.4: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +ini@~1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + +ink-docstrap@^1.1.4: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ink-docstrap/-/ink-docstrap-1.3.0.tgz#e9005e5bb9025cc9a9be8e44ad87f8ad5888c81d" + dependencies: + moment "^2.14.1" + sanitize-html "^1.13.0" + +interpret@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +ipaddr.js@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.1.1.tgz#c791d95f52b29c1247d5df80ada39b8a73647230" + +is-absolute-url@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.0.0.tgz#9c4b20b0e5c0cbef9a479a367ede6f991679f359" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.0.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-extglob@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.0.tgz#33411a482b046bf95e6b0cb27ee2711af4cf15ad" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-glob@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-lower-case@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-1.1.3.tgz#7e147be4768dc466db3bfb21cc60b31e6ad69393" + dependencies: + lower-case "^1.1.0" + +is-my-json-valid@^2.12.4: + version "2.15.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-svg@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" + dependencies: + html-comment-regex "^1.1.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-upper-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-1.1.2.tgz#8d0b1fa7e7933a1e58483600ec7d9661cbaf756f" + dependencies: + upper-case "^1.1.0" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +jodid25519@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + dependencies: + jsbn "~0.1.0" + +js-base64@^2.1.9: + version "2.1.9" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce" + +js-tokens@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" + +js-yaml@~2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-2.0.5.tgz#a25ae6509999e97df278c6719da11bd0687743a8" + dependencies: + argparse "~ 0.1.11" + esprima "~ 1.0.2" + +js-yaml@~3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +js2xmlparser@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-1.0.0.tgz#5a170f2e8d6476ce45405e04823242513782fe30" + +jsbn@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + +jsdoc@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.4.3.tgz#e5740d6145c681f6679e6c17783a88dbdd97ccd3" + dependencies: + bluebird "~3.4.6" + catharsis "~0.8.8" + escape-string-regexp "~1.0.5" + espree "~3.1.7" + js2xmlparser "~1.0.0" + klaw "~1.3.0" + marked "~0.3.6" + mkdirp "~0.5.1" + requizzle "~0.2.1" + strip-json-comments "~2.0.1" + taffydb "2.6.2" + underscore "~1.8.3" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +jshint@~2.9.1: + version "2.9.4" + resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.9.4.tgz#5e3ba97848d5290273db514aee47fe24cf592934" + dependencies: + cli "~1.0.0" + console-browserify "1.1.x" + exit "0.1.x" + htmlparser2 "3.8.x" + lodash "3.7.x" + minimatch "~3.0.2" + shelljs "0.3.x" + strip-json-comments "1.0.x" + +json-loader@^0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json3@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +json5@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonpointer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5" + +jsprim@^1.2.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + dependencies: + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kind-of@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.0.4.tgz#7b8ecf18a4e17f8269d73b501c9f232c96887a74" + dependencies: + is-buffer "^1.0.2" + +klaw@~1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + optionalDependencies: + graceful-fs "^4.1.9" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +loader-runner@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.2.0.tgz#824c1b699c4e7a2b6501b85902d5b862bf45b3fa" + +loader-utils@^0.2.11, loader-utils@^0.2.16, loader-utils@^0.2.3, loader-utils@^0.2.7, loader-utils@~0.2.2, loader-utils@~0.2.5: + version "0.2.16" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d" + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + object-assign "^4.0.1" + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + +lodash.indexof@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/lodash.indexof/-/lodash.indexof-4.0.5.tgz#53714adc2cddd6ed87638f893aa9b6c24e31ef3c" + +lodash@3.7.x: + version "3.7.0" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45" + +lodash@^4.0.1, lodash@^4.14.0, lodash@^4.16.2, lodash@^4.16.4, lodash@^4.2.0, lodash@^4.3.0: + version "4.17.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" + +lodash@~0.9.2: + version "0.9.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-0.9.2.tgz#8f3499c5245d346d682e5b0d3b40767e09f1a92c" + +lodash@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" + +lodash@~2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" + dependencies: + js-tokens "^2.0.0" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lower-case-first@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-1.0.2.tgz#e5da7c26f29a7073be02d52bac9980e5922adfa1" + dependencies: + lower-case "^1.1.2" + +lower-case@^1.1.0, lower-case@^1.1.1, lower-case@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.3.tgz#c92393d976793eee5ba4edb583cf8eae35bd9bfb" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +macaddress@^0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +marked@~0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7" + +math-expression-evaluator@^1.2.14: + version "1.2.14" + resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.14.tgz#39511771ed9602405fba9affff17eb4d2a3843ab" + dependencies: + lodash.indexof "^4.0.5" + +maxmin@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-1.1.0.tgz#71365e84a99dd8f8b3f7d5fde2f00d1e7f73be61" + dependencies: + chalk "^1.0.0" + figures "^1.0.1" + gzip-size "^1.0.0" + pretty-bytes "^1.0.0" + +maxmin@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-2.1.0.tgz#4d3b220903d95eee7eb7ac7fa864e72dc09a3166" + dependencies: + chalk "^1.0.0" + figures "^1.0.1" + gzip-size "^3.0.0" + pretty-bytes "^3.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +memory-fs@^0.3.0, memory-fs@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.3.0.tgz#7bcc6b629e3a43e871d7e29aca6ae8a7f15cbb20" + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +meow@^3.1.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +micromatch@^2.1.5, micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +miller-rabin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +"mime-db@>= 1.24.0 < 2", mime-db@~1.25.0: + version "1.25.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" + +mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.13, mime-types@~2.1.7: + version "2.1.13" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88" + dependencies: + mime-db "~1.25.0" + +mime@1.3.4, mime@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + +mimer@*: + version "0.2.1" + resolved "https://registry.yarnpkg.com/mimer/-/mimer-0.2.1.tgz#c63c5a17fe86423f5161a85d55c3ed5189baaffc" + +minimalistic-assert@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" + +minimatch@0.3: + version "0.3.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimatch@~0.2.11, minimatch@~0.2.12: + version "0.2.14" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.3, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +moment@^2.14.1: + version "2.17.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.17.0.tgz#a4c292e02aac5ddefb29a6eed24f51938dd3b74f" + +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + +nan@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" + +ncname@1.0.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" + dependencies: + xml-char-classes "^1.0.0" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + +no-case@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.0.tgz#ca2825ccb76b18e6f79d573dcfbf1eace33dd164" + dependencies: + lower-case "^1.1.1" + +node-libs-browser@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-1.1.1.tgz#2a38243abedd7dffcd07a97c9aca5668975a6fea" + dependencies: + assert "^1.1.1" + browserify-zlib "^0.1.4" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^1.0.0" + https-browserify "0.0.1" + os-browserify "^0.2.0" + path-browserify "0.0.0" + process "^0.11.0" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.0.5" + stream-browserify "^2.0.1" + stream-http "^2.3.1" + string_decoder "^0.10.25" + timers-browserify "^1.4.2" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.10.3" + vm-browserify "0.0.4" + +node-pre-gyp@^0.6.29: + version "0.6.32" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" + dependencies: + mkdirp "~0.5.1" + nopt "~3.0.6" + npmlog "^4.0.1" + rc "~1.1.6" + request "^2.79.0" + rimraf "~2.5.4" + semver "~5.3.0" + tar "~2.2.1" + tar-pack "~3.3.0" + +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + dependencies: + abbrev "1" + +nopt@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-2.0.0.tgz#ca7416f20a5e3f9c3b86180f96295fa3d0b52e0d" + dependencies: + abbrev "1" + +nopt@~3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +noptify@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/noptify/-/noptify-0.0.3.tgz#58f654a73d9753df0c51d9686dc92104a67f4bbb" + dependencies: + nopt "~2.0.0" + +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + +normalize-url@^1.4.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.8.0.tgz#a9550b079aa3523c85d78df24eef1959fce359ab" + dependencies: + object-assign "^4.0.1" + prepend-http "^1.0.0" + query-string "^4.1.0" + sort-keys "^1.0.0" + +npmlog@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.1.tgz#d14f503b4cd79710375553004ba96e6662fbc0b8" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.1" + set-blocking "~2.0.0" + +nth-check@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" + dependencies: + boolbase "~1.0.0" + +num2fraction@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +obuf@^1.0.0, obuf@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.1.tgz#104124b6c602c6796881a042541d36db43a5264e" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +once@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +opn@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +optimist@~0.3.5: + version "0.3.7" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9" + dependencies: + wordwrap "~0.0.2" + +original@>=0.0.5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/original/-/original-1.0.0.tgz#9147f93fa1696d04be61e01bd50baeaca656bd3b" + dependencies: + url-parse "1.0.x" + +os-browserify@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +pako@~0.2.0: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + +param-case@2.1.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.0.tgz#2619f90fd6c829ed0b958f1c84ed03a745a6d70a" + dependencies: + no-case "^2.2.0" + +param-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-1.1.2.tgz#dcb091a43c259b9228f1c341e7b6a44ea0bf9743" + dependencies: + sentence-case "^1.1.2" + +parse-asn1@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parseurl@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" + +pascal-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-1.1.2.tgz#3e5d64a20043830a7c49344c2d74b41be0c9c99b" + dependencies: + camel-case "^1.1.1" + upper-case-first "^1.1.0" + +path-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/path-case/-/path-case-1.1.2.tgz#50ce6ba0d3bed3dd0b5c2a9c4553697434409514" + dependencies: + sentence-case "^1.1.2" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pbkdf2@^3.0.3: + version "3.0.9" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" + dependencies: + create-hmac "^1.1.2" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +portfinder@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.10.tgz#7a4de9d98553c315da6f1e1ed05138eeb2d16bb8" + dependencies: + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" + +postcss-calc@^5.2.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" + dependencies: + postcss "^5.0.2" + postcss-message-helpers "^2.0.0" + reduce-css-calc "^1.2.6" + +postcss-colormin@^2.1.8: + version "2.2.1" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-2.2.1.tgz#dc5421b6ae6f779ef6bfd47352b94abe59d0316b" + dependencies: + colormin "^1.0.5" + postcss "^5.0.13" + postcss-value-parser "^3.2.3" + +postcss-convert-values@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-2.5.0.tgz#570aceb04b3061fb25f6f46bd0329e7ab6263c0b" + dependencies: + postcss "^5.0.11" + postcss-value-parser "^3.1.2" + +postcss-discard-comments@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz#befe89fafd5b3dace5ccce51b76b81514be00e3d" + dependencies: + postcss "^5.0.14" + +postcss-discard-duplicates@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-2.0.2.tgz#02be520e91571ffb10738766a981d5770989bb32" + dependencies: + postcss "^5.0.4" + +postcss-discard-empty@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz#d2b4bd9d5ced5ebd8dcade7640c7d7cd7f4f92b5" + dependencies: + postcss "^5.0.14" + +postcss-discard-overridden@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz#8b1eaf554f686fb288cd874c55667b0aa3668d58" + dependencies: + postcss "^5.0.16" + +postcss-discard-unused@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz#bce30b2cc591ffc634322b5fb3464b6d934f4433" + dependencies: + postcss "^5.0.14" + uniqs "^2.0.0" + +postcss-filter-plugins@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz#6d85862534d735ac420e4a85806e1f5d4286d84c" + dependencies: + postcss "^5.0.4" + uniqid "^4.0.0" + +postcss-merge-idents@^2.1.5: + version "2.1.7" + resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz#4c5530313c08e1d5b3bbf3d2bbc747e278eea270" + dependencies: + has "^1.0.1" + postcss "^5.0.10" + postcss-value-parser "^3.1.1" + +postcss-merge-longhand@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-2.0.1.tgz#ff59b5dec6d586ce2cea183138f55c5876fa9cdc" + dependencies: + postcss "^5.0.4" + +postcss-merge-rules@^2.0.3: + version "2.0.10" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-2.0.10.tgz#54b360be804e7e69a5c7222635247b92a3569e9b" + dependencies: + postcss "^5.0.4" + vendors "^1.0.0" + +postcss-message-helpers@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz#a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e" + +postcss-minify-font-values@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz#4b58edb56641eba7c8474ab3526cafd7bbdecb69" + dependencies: + object-assign "^4.0.1" + postcss "^5.0.4" + postcss-value-parser "^3.0.2" + +postcss-minify-gradients@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz#5dbda11373703f83cfb4a3ea3881d8d75ff5e6e1" + dependencies: + postcss "^5.0.12" + postcss-value-parser "^3.3.0" + +postcss-minify-params@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-1.0.5.tgz#82d602643b8616a61fb3634d7ede0289836d67f9" + dependencies: + alphanum-sort "^1.0.1" + postcss "^5.0.2" + postcss-value-parser "^3.0.2" + uniqs "^2.0.0" + +postcss-minify-selectors@^2.0.4: + version "2.0.7" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-2.0.7.tgz#bfb9248fe14db33770f036572de6b4897c48d81c" + dependencies: + alphanum-sort "^1.0.2" + has "^1.0.1" + postcss "^5.0.14" + postcss-selector-parser "^2.0.0" + +postcss-modules-extract-imports@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.0.1.tgz#8fb3fef9a6dd0420d3f6d4353cf1ff73f2b2a341" + dependencies: + postcss "^5.0.4" + +postcss-modules-local-by-default@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.1.1.tgz#29a10673fa37d19251265ca2ba3150d9040eb4ce" + dependencies: + css-selector-tokenizer "^0.6.0" + postcss "^5.0.4" + +postcss-modules-scope@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-1.0.2.tgz#ff977395e5e06202d7362290b88b1e8cd049de29" + dependencies: + css-selector-tokenizer "^0.6.0" + postcss "^5.0.4" + +postcss-modules-values@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-1.2.2.tgz#f0e7d476fe1ed88c5e4c7f97533a3e772ad94ca1" + dependencies: + icss-replace-symbols "^1.0.2" + postcss "^5.0.14" + +postcss-normalize-charset@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz#ef9ee71212d7fe759c78ed162f61ed62b5cb93f1" + dependencies: + postcss "^5.0.5" + +postcss-normalize-url@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-3.0.7.tgz#6bd90d0a4bc5a1df22c26ea65c53257dc3829f4e" + dependencies: + is-absolute-url "^2.0.0" + normalize-url "^1.4.0" + postcss "^5.0.14" + postcss-value-parser "^3.2.3" + +postcss-ordered-values@^2.1.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-2.2.2.tgz#be8b511741fab2dac8e614a2302e9d10267b0771" + dependencies: + postcss "^5.0.4" + postcss-value-parser "^3.0.1" + +postcss-reduce-idents@^2.2.2: + version "2.3.1" + resolved "https://registry.yarnpkg.com/postcss-reduce-idents/-/postcss-reduce-idents-2.3.1.tgz#024e8e219f52773313408573db9645ba62d2d2fe" + dependencies: + postcss "^5.0.4" + postcss-value-parser "^3.0.2" + +postcss-reduce-initial@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-1.0.0.tgz#8f739b938289ef2e48936d7101783e4741ca9bbb" + dependencies: + postcss "^5.0.4" + +postcss-reduce-transforms@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz#ff76f4d8212437b31c298a42d2e1444025771ae1" + dependencies: + has "^1.0.1" + postcss "^5.0.8" + postcss-value-parser "^3.0.1" + +postcss-selector-parser@^2.0.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-2.2.2.tgz#3d70f5adda130da51c7c0c2fc023f56b1374fe08" + dependencies: + flatten "^1.0.2" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-svgo@^2.1.1: + version "2.1.5" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-2.1.5.tgz#46fc0363f01bab6a36a9abb01c229fcc45363094" + dependencies: + is-svg "^2.0.0" + postcss "^5.0.14" + postcss-value-parser "^3.2.3" + svgo "^0.7.0" + +postcss-unique-selectors@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz#981d57d29ddcb33e7b1dfe1fd43b8649f933ca1d" + dependencies: + alphanum-sort "^1.0.1" + postcss "^5.0.4" + uniqs "^2.0.0" + +postcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^3.1.1, postcss-value-parser@^3.1.2, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15" + +postcss-zindex@^2.0.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-2.2.0.tgz#d2109ddc055b91af67fc4cb3b025946639d2af22" + dependencies: + has "^1.0.1" + postcss "^5.0.4" + uniqs "^2.0.0" + +postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.6, postcss@^5.0.8, postcss@^5.2.5: + version "5.2.6" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.6.tgz#a252cd67cd52585035f17e9ad12b35137a7bdd9e" + dependencies: + chalk "^1.1.3" + js-base64 "^2.1.9" + source-map "^0.5.6" + supports-color "^3.1.2" + +prepend-http@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-bytes@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84" + dependencies: + get-stdin "^4.0.1" + meow "^3.1.0" + +pretty-bytes@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-2.0.1.tgz#155ec4d0036f41391e7045d6dbe4963d525d264f" + dependencies: + get-stdin "^4.0.1" + meow "^3.1.0" + number-is-nan "^1.0.0" + +pretty-bytes@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-3.0.1.tgz#27d0008d778063a0b4811bb35c79f1bd5d5fbccf" + dependencies: + number-is-nan "^1.0.0" + +pretty-error@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.0.2.tgz#a7db19cbb529ca9f0af3d3a2f77d5caf8e5dec23" + dependencies: + renderkid "~2.0.0" + utila "~0.4" + +private@^0.1.6, private@~0.1.5: + version "0.1.6" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +process@^0.11.0, process@~0.11.0: + version "0.11.9" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" + +proxy-addr@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.2.tgz#b4cc5f22610d9535824c123aef9d3cf73c40ba37" + dependencies: + forwarded "~0.1.0" + ipaddr.js "1.1.1" + +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + +public-encrypt@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.2.4, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +q@^1.1.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" + +qs@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.0.tgz#3b7848c03c2dece69a9522b0fae8c4126d745f3b" + +qs@~0.5.2: + version "0.5.6" + resolved "https://registry.yarnpkg.com/qs/-/qs-0.5.6.tgz#31b1ad058567651c526921506b9a8793911a0384" + +qs@~6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" + +query-string@^4.1.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.2.3.tgz#9f27273d207a25a8ee4c7b8c74dcd45d556db822" + dependencies: + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +querystringify@0.0.x: + version "0.0.4" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-0.0.4.tgz#0cf7f84f9463ff0ae51c4c4b142d95be37724d9c" + +randomatic@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + +randombytes@^2.0.0, randombytes@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" + +range-parser@^1.0.3, range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + +rc@~1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~1.0.4" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +readable-stream@1.0: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@1.1: + version "1.1.13" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.1.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readable-stream@~2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +reduce-css-calc@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" + dependencies: + balanced-match "^0.4.2" + math-expression-evaluator "^1.2.14" + reduce-function-call "^1.0.1" + +reduce-function-call@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/reduce-function-call/-/reduce-function-call-1.0.2.tgz#5a200bf92e0e37751752fe45b0ab330fd4b6be99" + dependencies: + balanced-match "^0.4.2" + +regenerate@^1.2.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" + +regenerator-runtime@^0.9.5: + version "0.9.6" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.9.6.tgz#d33eb95d0d2001a4be39659707c51b0cb71ce029" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +regexp-quote@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/regexp-quote/-/regexp-quote-0.0.0.tgz#1e0f4650c862dcbfed54fd42b148e9bb1721fcf2" + +regexpu-core@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +relateurl@0.2.x: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + +renderkid@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.0.tgz#1859753e7a5adbf35443aba0d4e4579e78abee85" + dependencies: + css-select "^1.1.0" + dom-converter "~0.1" + htmlparser2 "~3.3.0" + strip-ansi "^3.0.0" + utila "~0.3" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@^2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + uuid "^3.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +requires-port@1.0.x, requires-port@1.x.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + +requizzle@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.1.tgz#6943c3530c4d9a7e46f1cddd51c158fc670cdbde" + dependencies: + underscore "~1.6.0" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.5.1, rimraf@~2.5.1, rimraf@~2.5.4: + version "2.5.4" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" + dependencies: + glob "^7.0.5" + +rimraf@~2.2.8: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + +ripemd160@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" + +sanitize-html@^1.13.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.13.0.tgz#4ee17cbec516bfe32f2ce6686a569d7e6b4f3631" + dependencies: + htmlparser2 "^3.9.0" + regexp-quote "0.0.0" + xtend "^4.0.0" + +sax@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" + +select-hose@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" + +"semver@2 || 3 || 4 || 5", semver@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +send@0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.14.1.tgz#a954984325392f51532a7760760e459598c89f7a" + dependencies: + debug "~2.2.0" + depd "~1.1.0" + destroy "~1.0.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.7.0" + fresh "0.3.0" + http-errors "~1.5.0" + mime "1.3.4" + ms "0.7.1" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.3.0" + +sentence-case@^1.1.1, sentence-case@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-1.1.3.tgz#8034aafc2145772d3abe1509aa42c9e1042dc139" + dependencies: + lower-case "^1.1.1" + +serve-index@^1.7.2: + version "1.8.0" + resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.8.0.tgz#7c5d96c13fb131101f93c1c5774f8516a1e78d3b" + dependencies: + accepts "~1.3.3" + batch "0.5.3" + debug "~2.2.0" + escape-html "~1.0.3" + http-errors "~1.5.0" + mime-types "~2.1.11" + parseurl "~1.3.1" + +serve-static@~1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.11.1.tgz#d6cce7693505f733c759de57befc1af76c0f0805" + dependencies: + encodeurl "~1.0.1" + escape-html "~1.0.3" + parseurl "~1.3.1" + send "0.14.1" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +setprototypeof@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.2.tgz#81a552141ec104b88e89ce383103ad5c66564d08" + +sha.js@^2.3.6: + version "2.4.8" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" + dependencies: + inherits "^2.0.1" + +shelljs@0.3.x: + version "0.3.0" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.3.0.tgz#3596e6307a781544f591f37da618360f31db57b1" + +shelljs@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.5.3.tgz#c54982b996c76ef0c1e6b59fbdc5825f5b713113" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +signal-exit@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.1.tgz#5a4c884992b63a7acd9badb7894c3ee9cfccad81" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +snake-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-1.1.2.tgz#0c2f25e305158d9a18d3d977066187fef8a5a66a" + dependencies: + sentence-case "^1.1.2" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +sockjs-client@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.1.tgz#284843e9a9784d7c474b1571b3240fca9dda4bb0" + dependencies: + debug "^2.2.0" + eventsource "~0.1.6" + faye-websocket "~0.11.0" + inherits "^2.0.1" + json3 "^3.3.2" + url-parse "^1.1.1" + +sockjs@0.3.18: + version "0.3.18" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.18.tgz#d9b289316ca7df77595ef299e075f0f937eb4207" + dependencies: + faye-websocket "^0.10.0" + uuid "^2.0.2" + +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + dependencies: + is-plain-obj "^1.0.0" + +source-list-map@^0.1.4, source-list-map@~0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.6.tgz#e1e6f94f0b40c4d28dcf8f5b8766e0e45636877f" + +source-map-support@^0.4.2: + version "0.4.6" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.6.tgz#32552aa64b458392a85eab3b0b5ee61527167aeb" + dependencies: + source-map "^0.5.3" + +source-map@0.4.x: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +source-map@~0.1.7: + version "0.1.43" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + dependencies: + amdefine ">=0.0.4" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +spdy-transport@^2.0.15: + version "2.0.18" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.0.18.tgz#43fc9c56be2cccc12bb3e2754aa971154e836ea6" + dependencies: + debug "^2.2.0" + hpack.js "^2.1.6" + obuf "^1.1.0" + readable-stream "^2.0.1" + wbuf "^1.4.0" + +spdy@^3.4.1: + version "3.4.4" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-3.4.4.tgz#e0406407ca90ff01b553eb013505442649f5a819" + dependencies: + debug "^2.2.0" + handle-thing "^1.2.4" + http-deceiver "^1.2.4" + select-hose "^2.0.0" + spdy-transport "^2.0.15" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jodid25519 "^1.0.0" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +"statuses@>= 1.3.1 < 2", statuses@~1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + +stream-browserify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-http@^2.3.1: + version "2.5.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.5.0.tgz#585eee513217ed98fe199817e7313b6f772a6802" + dependencies: + builtin-status-codes "^2.0.0" + inherits "^2.0.1" + readable-stream "^2.1.0" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@^0.10.25, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@1.0.x, strip-json-comments@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +style-loader@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.13.1.tgz#468280efbc0473023cd3a6cd56e33b5a1d7fc3a9" + dependencies: + loader-utils "^0.2.7" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.0, supports-color@^3.1.1, supports-color@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +svgo@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.1.tgz#287320fed972cb097e72c2bb1685f96fe08f8034" + dependencies: + coa "~1.0.1" + colors "~1.1.2" + csso "~2.2.1" + js-yaml "~3.6.1" + mkdirp "~0.5.1" + sax "~1.2.1" + whet.extend "~0.9.9" + +swap-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-1.1.2.tgz#c39203a4587385fad3c850a0bd1bcafa081974e3" + dependencies: + lower-case "^1.1.1" + upper-case "^1.1.1" + +taffydb@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" + +tapable@^0.2.3, tapable@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.4.tgz#a7814605089d4ba896c33c7e3566e13dcd194aa5" + +tar-pack@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" + dependencies: + debug "~2.2.0" + fstream "~1.0.10" + fstream-ignore "~1.0.5" + once "~1.3.3" + readable-stream "~2.1.4" + rimraf "~2.5.1" + tar "~2.2.1" + uid-number "~0.0.6" + +tar@~2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +templayed@*: + version "0.2.3" + resolved "https://registry.yarnpkg.com/templayed/-/templayed-0.2.3.tgz#4706df625bc6aecd86b7c9f6b0fb548b95cdf769" + +timers-browserify@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + dependencies: + process "~0.11.0" + +tiny-lr-fork@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/tiny-lr-fork/-/tiny-lr-fork-0.0.5.tgz#1e99e1e2a8469b736ab97d97eefa98c71f76ed0a" + dependencies: + debug "~0.7.0" + faye-websocket "~0.4.3" + noptify "~0.0.3" + qs "~0.5.2" + +title-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/title-case/-/title-case-1.1.2.tgz#fae4a6ae546bfa22d083a0eea910a40d12ed4f5a" + dependencies: + sentence-case "^1.1.1" + upper-case "^1.0.3" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +to-fast-properties@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + +toposort@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.0.tgz#b66cf385a1a8a8e68e45b8259e7f55875e8b06ef" + +tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + +tunnel-agent@~0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.3.tgz#3da382f670f25ded78d7b3d1792119bca0b7132d" + +type-is@~1.6.13: + version "1.6.14" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.14.tgz#e219639c17ded1ca0789092dd54a03826b817cb2" + dependencies: + media-typer "0.3.0" + mime-types "~2.1.13" + +typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +uglify-js@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.4.1.tgz#57b97aaf8160e5fa2118127e07082bf3a5c2b6e5" + dependencies: + async "~0.2.6" + optimist "~0.3.5" + source-map "~0.1.7" + uglify-to-browserify "~1.0.0" + +uglify-js@2.6.x, uglify-js@~2.6.0: + version "2.6.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.6.4.tgz#65ea2fb3059c9394692f15fed87c2b36c16b9adf" + dependencies: + async "~0.2.6" + source-map "~0.5.1" + uglify-to-browserify "~1.0.0" + yargs "~3.10.0" + +uglify-js@2.7.x, uglify-js@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.4.tgz#a295a0de12b6a650c031c40deb0dc40b14568bd2" + dependencies: + async "~0.2.6" + source-map "~0.5.1" + uglify-to-browserify "~1.0.0" + yargs "~3.10.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uid-number@~0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +underscore-contrib@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/underscore-contrib/-/underscore-contrib-0.3.0.tgz#665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7" + dependencies: + underscore "1.6.0" + +underscore.string@~2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.2.1.tgz#d7c0fa2af5d5a1a67f4253daee98132e733f0f19" + +underscore.string@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.3.3.tgz#71c08bf6b428b1133f37e78fa3a21c82f7329b0d" + +underscore.string@~2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b" + +underscore@1.6.0, underscore@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" + +underscore@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" + +underscore@~1.8.3: + version "1.8.3" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" + +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + +uniqid@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/uniqid/-/uniqid-4.1.0.tgz#33d9679f65022f48988a03fd24e7dcaf8f109eca" + dependencies: + macaddress "^0.2.8" + +uniqs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" + +unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +upper-case-first@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-1.1.2.tgz#5d79bedcff14419518fd2edb0a0507c9b6859115" + dependencies: + upper-case "^1.1.1" + +upper-case@^1.0.3, upper-case@^1.1.0, upper-case@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + +uri-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/uri-path/-/uri-path-1.0.0.tgz#9747f018358933c31de0fccfd82d138e67262e32" + +url-parse@1.0.x: + version "1.0.5" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.0.5.tgz#0854860422afdcfefeb6c965c662d4800169927b" + dependencies: + querystringify "0.0.x" + requires-port "1.0.x" + +url-parse@^1.1.1: + version "1.1.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.1.7.tgz#025cff999653a459ab34232147d89514cc87d74a" + dependencies: + querystringify "0.0.x" + requires-port "1.0.x" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3, util@^0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +utila@~0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.3.3.tgz#d7e8e7d7e309107092b05f8d9688824d633a4226" + +utila@~0.4: + version "0.4.0" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" + +utils-merge@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" + +uuid@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + +uuid@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +vary@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.0.tgz#e1e5affbbd16ae768dd2674394b9ad3022653140" + +vendors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.1.tgz#37ad73c8ee417fb3d580e785312307d274847f22" + +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + +vm-browserify@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +watchpack@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.1.0.tgz#42d44627464a2fadffc9308c0f7562cfde795f24" + dependencies: + async "2.0.0-rc.4" + chokidar "^1.4.3" + graceful-fs "^4.1.2" + +wbuf@^1.1.0, wbuf@^1.4.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.2.tgz#d697b99f1f59512df2751be42769c1580b5801fe" + dependencies: + minimalistic-assert "^1.0.0" + +webpack-dev-middleware@^1.4.0: + version "1.8.4" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.8.4.tgz#e8765c9122887ce9e3abd4cc9c3eb31b61e0948d" + dependencies: + memory-fs "~0.3.0" + mime "^1.3.4" + path-is-absolute "^1.0.0" + range-parser "^1.0.3" + +webpack-dev-server@2.1.0-beta.12: + version "2.1.0-beta.12" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.1.0-beta.12.tgz#f717e7b69214dae0e7a2061c12d128432d7520ef" + dependencies: + chokidar "^1.6.0" + compression "^1.5.2" + connect-history-api-fallback "^1.3.0" + express "^4.13.3" + http-proxy-middleware "~0.17.1" + opn "4.0.2" + portfinder "^1.0.9" + serve-index "^1.7.2" + sockjs "0.3.18" + sockjs-client "1.1.1" + spdy "^3.4.1" + strip-ansi "^3.0.0" + supports-color "^3.1.1" + webpack-dev-middleware "^1.4.0" + yargs "^6.0.0" + +webpack-sources@^0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.3.tgz#15ce2fb79d0a1da727444ba7c757bf164294f310" + dependencies: + source-list-map "~0.1.0" + source-map "~0.5.3" + +webpack@2.1.0-beta.27: + version "2.1.0-beta.27" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.1.0-beta.27.tgz#06cb802e44118159e46b7533ae76b0d84c8c89d8" + dependencies: + acorn "^4.0.3" + ajv "^4.7.0" + ajv-keywords "^1.1.1" + async "^2.1.2" + enhanced-resolve "^2.2.0" + interpret "^1.0.0" + loader-runner "^2.2.0" + loader-utils "^0.2.16" + memory-fs "~0.3.0" + mkdirp "~0.5.0" + node-libs-browser "^1.0.0" + object-assign "^4.0.1" + source-map "^0.5.3" + supports-color "^3.1.0" + tapable "~0.2.3" + uglify-js "~2.7.3" + watchpack "^1.0.0" + webpack-sources "^0.1.0" + yargs "^6.0.0" + +websocket-driver@>=0.5.1: + version "0.6.5" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.6.5.tgz#5cb2556ceb85f4373c6d8238aa691c8454e13a36" + dependencies: + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" + +whet.extend@~0.9.9: + version "0.9.9" + resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which@~1.0.5: + version "1.0.9" + resolved "https://registry.yarnpkg.com/which/-/which-1.0.9.tgz#460c1da0f810103d0321a9b633af9e575e64486f" + +wide-align@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" + dependencies: + string-width "^1.0.1" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrap-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.0.0.tgz#7d30f8f873f9a5bbc3a64dabc8d177e071ae426f" + dependencies: + string-width "^1.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xml-char-classes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" + +xtend@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yargs-parser@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.1.0.tgz#313df030f20124124aeae8fbab2da53ec28c56d7" + dependencies: + camelcase "^3.0.0" + +yargs@^6.0.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.4.0.tgz#816e1a866d5598ccf34e5596ddce22d92da490d4" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^4.1.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From 0d4254186074de25abab51c863b5a51673439749 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 29 Nov 2016 00:20:54 +0000 Subject: [PATCH 02/15] configure eslint --- .eslintignore | 3 + .eslintrc.json | 13 ++ package.json | 11 +- src/js/index.js | 8 +- yarn.lock | 573 +++++++++++++++++++++++++++++++++++++++++++++--- 5 files changed, 576 insertions(+), 32 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..03cd89de --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +src/js/lib/** +dist/** +build/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..573dfac3 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,13 @@ +{ + "extends": "airbnb-base", + "parser": "babel-eslint", + "plugins": ["babel"], + "settings": { + "import/resolver": { + "webpack": {} + } + }, + "env": { + "browser": true + } +} diff --git a/package.json b/package.json index 6a820dd6..8eec627d 100755 --- a/package.json +++ b/package.json @@ -35,11 +35,16 @@ }, "devDependencies": { "babel-core": "^6.18.2", + "babel-eslint": "^7.1.1", "babel-loader": "^6.2.8", "babel-plugin-transform-runtime": "^6.15.0", "babel-preset-env": "^0.0.9", "babel-register": "^6.18.0", "css-loader": "^0.26.0", + "eslint": "^3.11.1", + "eslint-config-airbnb-base": "^10.0.1", + "eslint-plugin-babel": "^4.0.0", + "eslint-plugin-import": "^2.2.0", "extract-text-webpack-plugin": "2.0.0-beta.4", "file-loader": "^0.9.0", "grunt": "~0.4.5", @@ -62,7 +67,11 @@ "webpack-dev-server": "2.1.0-beta.12" }, "dependencies": { + "esprima": "^3.1.2", "estraverse": "^4.2.0", - "json-loader": "^0.5.4" + "jquery": "^3.1.1", + "json-loader": "^0.5.4", + "moment": "^2.17.0", + "moment-timezone": "^0.5.10" } } diff --git a/src/js/index.js b/src/js/index.js index 6ce8ca56..b0ee92b5 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -12,7 +12,7 @@ import './lib/unzip.js'; import './lib/zlib_and_gzip.js'; import './lib/split.js'; import './lib/rawdeflate.js'; -import './lib/moment-timezone.js'; +import 'moment-timezone'; import './lib/diff.js'; import './lib/prettify.js'; import './lib/bootstrap-3.3.6.js'; @@ -23,7 +23,7 @@ import './lib/escodegen.browser.js'; import './lib/bootstrap-switch.js'; import './lib/yahoo.js'; import './lib/vkbeautify.js'; -import './lib/moment.js'; +import 'moment'; import './lib/bootstrap-colorpicker.js'; import './lib/cryptojs/format-hex.js'; import './lib/cryptojs/hmac.js'; @@ -69,8 +69,8 @@ import './lib/jsbn/base64.js'; import './lib/jsbn/sec.js'; import './lib/esmangle.min.js'; import './lib/blowfish.dojo.js'; -import './lib/jquery-2.1.1.js'; -import './lib/esprima.js'; +import 'jquery'; +import 'esprima'; import './lib/jsrasign/ecdsa-modified-1.0.js'; import './lib/jsrasign/asn1-1.0.js'; import './lib/jsrasign/x509-1.1.js'; diff --git a/yarn.lock b/yarn.lock index 7955e398..740be2d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,11 +23,11 @@ acorn@^3.0.4, acorn@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^4.0.3: +acorn@^4.0.1, acorn@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.3.tgz#1a3e850b428e73ba6b09d1cc527f5aaad4d03ef1" -ajv-keywords@^1.1.1: +ajv-keywords@^1.0.0, ajv-keywords@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.1.1.tgz#02550bc605a3e576041565628af972e06c549d50" @@ -54,6 +54,10 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + ansi-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" @@ -111,6 +115,16 @@ array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -228,6 +242,16 @@ babel-core@^6.18.0, babel-core@^6.18.2: slash "^1.0.0" source-map "^0.5.0" +babel-eslint@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" + dependencies: + babel-code-frame "^6.16.0" + babel-traverse "^6.15.0" + babel-types "^6.15.0" + babylon "^6.13.0" + lodash.pickby "^4.6.0" + babel-generator@^6.18.0: version "6.19.0" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.19.0.tgz#9b2f244204777a3d6810ec127c673c87b349fac5" @@ -642,7 +666,7 @@ babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-te babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.16.0, babel-traverse@^6.18.0: +babel-traverse@^6.15.0, babel-traverse@^6.16.0, babel-traverse@^6.18.0: version "6.19.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.19.0.tgz#68363fb821e26247d52a519a84b2ceab8df4f55a" dependencies: @@ -656,7 +680,7 @@ babel-traverse@^6.16.0, babel-traverse@^6.18.0: invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.8.0, babel-types@^6.9.0: +babel-types@^6.15.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.8.0, babel-types@^6.9.0: version "6.19.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.19.0.tgz#8db2972dbed01f1192a8b602ba1e1e4c516240b9" dependencies: @@ -665,7 +689,7 @@ babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.8. lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.11.0: +babylon@^6.11.0, babylon@^6.13.0: version "6.14.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" @@ -811,7 +835,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -builtin-modules@^1.0.0: +builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -823,6 +847,16 @@ bytes@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.3.0.tgz#d5b680a165b6201739acb611542aabc2d8ceb070" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -929,6 +963,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1: dependencies: inherits "^2.0.1" +circular-json@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + clap@^1.0.9: version "1.1.1" resolved "https://registry.yarnpkg.com/clap/-/clap-1.1.1.tgz#a8a93e0bfb7581ac199c4f001a5525a724ce696d" @@ -948,6 +986,16 @@ clean-css@3.4.x, clean-css@~3.4.2: commander "2.8.x" source-map "0.4.x" +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + cli@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/cli/-/cli-1.0.1.tgz#22817534f24bfa4950c34d532d48ecbc621b8c14" @@ -1080,7 +1128,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@1.5.x, concat-stream@^1.4.1: +concat-stream@1.5.x, concat-stream@^1.4.1, concat-stream@^1.4.6: version "1.5.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" dependencies: @@ -1113,6 +1161,10 @@ constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + content-disposition@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.1.tgz#87476c6a67c8daa87e32e87616df883ba7fb071b" @@ -1289,6 +1341,12 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" +d@^0.1.1, d@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" + dependencies: + es5-ext "~0.10.2" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1310,7 +1368,7 @@ dateformat@1.0.2-1.2.3: version "1.0.2-1.2.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.2-1.2.3.tgz#b0220c02de98617433b72851cf47de3df2cdbee9" -debug@^2.1.1, debug@^2.2.0, debug@~2.2.0: +debug@2.2.0, debug@^2.1.1, debug@^2.2.0, debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" dependencies: @@ -1328,10 +1386,26 @@ deep-extend@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1369,6 +1443,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +doctrine@1.5.0, doctrine@^1.2.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + dom-converter@~0.1: version "0.1.4" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.1.4.tgz#a45ef5727b890c9bffe6d7c876e7b19cb0e17f3b" @@ -1485,6 +1566,58 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" +es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: + version "0.10.12" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2: + version "2.0.0" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" + dependencies: + d "^0.1.1" + es5-ext "^0.10.7" + es6-symbol "3" + +es6-map@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" + dependencies: + d "~0.1.1" + es5-ext "~0.10.11" + es6-iterator "2" + es6-set "~0.1.3" + es6-symbol "~3.1.0" + event-emitter "~0.3.4" + +es6-set@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" + dependencies: + d "~0.1.1" + es5-ext "~0.10.11" + es6-iterator "2" + es6-symbol "3" + event-emitter "~0.3.4" + +es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" + dependencies: + d "~0.1.1" + es5-ext "~0.10.11" + +es6-weak-map@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" + dependencies: + d "^0.1.1" + es5-ext "^0.10.8" + es6-iterator "2" + es6-symbol "3" + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -1493,6 +1626,99 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5, escape-string-regexp@~ version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-config-airbnb-base@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-10.0.1.tgz#f17d4e52992c1d45d1b7713efbcd5ecd0e7e0506" + +eslint-import-resolver-node@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" + dependencies: + debug "^2.2.0" + object-assign "^4.0.1" + resolve "^1.1.6" + +eslint-module-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.0.0.tgz#a6f8c21d901358759cdc35dbac1982ae1ee58bce" + dependencies: + debug "2.2.0" + pkg-dir "^1.0.0" + +eslint-plugin-babel@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.0.0.tgz#a92114e2c493ac3034b030d7ecf96e174a76ef3f" + +eslint-plugin-import@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz#72ba306fad305d67c4816348a4699a4229ac8b4e" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.2.0" + doctrine "1.5.0" + eslint-import-resolver-node "^0.2.0" + eslint-module-utils "^2.0.0" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + pkg-up "^1.0.0" + +eslint@^3.11.1: + version "3.11.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.11.1.tgz#408be581041385cba947cd8d1cd2227782b55dbf" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.4.6" + debug "^2.1.1" + doctrine "^1.2.2" + escope "^3.6.0" + espree "^3.3.1" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.2.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~1.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.3.2.tgz#dbf3fadeb4ecb4d4778303e50103b3d36c88b89c" + dependencies: + acorn "^4.0.1" + acorn-jsx "^3.0.0" + espree@~3.1.7: version "3.1.7" resolved "https://registry.yarnpkg.com/espree/-/espree-3.1.7.tgz#fd5deec76a97a5120a9cd3a7cb1177a0923b11d2" @@ -1504,14 +1730,29 @@ esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.2.tgz#954b5d19321ca436092fa90f06d6798531fe8184" + "esprima@~ 1.0.2": version "1.0.4" resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" -estraverse@^4.2.0: +esrecurse@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + dependencies: + estraverse "~4.1.0" + object-assign "^4.0.1" + +estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" +estraverse@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1520,6 +1761,13 @@ etag@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/etag/-/etag-1.7.0.tgz#03d30b5f67dd6e632d2945d30d6652731a34d5d8" +event-emitter@~0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" + dependencies: + d "~0.1.1" + es5-ext "~0.10.7" + eventemitter2@~0.4.13: version "0.4.14" resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab" @@ -1544,6 +1792,10 @@ evp_bytestokey@^1.0.0: dependencies: create-hash "^1.1.1" +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + exit@0.1.2, exit@0.1.x, exit@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -1613,6 +1865,10 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +fast-levenshtein@~2.0.4: + version "2.0.5" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.5.tgz#bd33145744519ab1c36c3ee9f31f08e9079b67f2" + fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" @@ -1633,13 +1889,20 @@ faye-websocket@~0.4.3: version "0.4.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.4.4.tgz#c14c5b3bf14d7417ffbfd990c0a7495cd9f337bc" -figures@^1.0.1: +figures@^1.0.1, figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + file-loader@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.9.0.tgz#1d2daddd424ce6d1b07cfe3f79731bed3617ab42" @@ -1696,6 +1959,15 @@ findup-sync@~0.1.2: glob "~3.2.9" lodash "~2.4.1" +flat-cache@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.1.tgz#6c837d6225a7de5659323740b36d5361f71691ff" + dependencies: + circular-json "^0.3.0" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" @@ -1823,7 +2095,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^7.0.5, glob@^7.1.1: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -1849,10 +2121,21 @@ glob@~3.2.9: inherits "2" minimatch "0.3" -globals@^9.0.0: +globals@^9.0.0, globals@^9.2.0: version "9.14.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + globule@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" @@ -2240,6 +2523,14 @@ ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" +ignore@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + indent-string@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" @@ -2284,6 +2575,24 @@ ink-docstrap@^1.1.4: moment "^2.14.1" sanitize-html "^1.13.0" +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + interpret@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" @@ -2360,6 +2669,10 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -2378,7 +2691,7 @@ is-lower-case@^1.1.0: dependencies: lower-case "^1.1.0" -is-my-json-valid@^2.12.4: +is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: version "2.15.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" dependencies: @@ -2393,6 +2706,22 @@ is-number@^2.0.2, is-number@^2.1.0: dependencies: kind-of "^3.0.2" +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + is-plain-obj@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -2409,6 +2738,12 @@ is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + is-svg@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" @@ -2453,6 +2788,10 @@ jodid25519@^1.0.0: dependencies: jsbn "~0.1.0" +jquery@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.1.1.tgz#347c1c21c7e004115e0a4da32cece041fad3c8a3" + js-base64@^2.1.9: version "2.1.9" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce" @@ -2461,6 +2800,13 @@ js-tokens@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" +js-yaml@^3.5.1, js-yaml@~3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + js-yaml@~2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-2.0.5.tgz#a25ae6509999e97df278c6719da11bd0687743a8" @@ -2468,13 +2814,6 @@ js-yaml@~2.0.5: argparse "~ 0.1.11" esprima "~ 1.0.2" -js-yaml@~3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" - dependencies: - argparse "^1.0.7" - esprima "^2.6.0" - js2xmlparser@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-1.0.0.tgz#5a170f2e8d6476ce45405e04823242513782fe30" @@ -2529,7 +2868,7 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -2585,6 +2924,13 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -2612,15 +2958,23 @@ lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + lodash.indexof@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/lodash.indexof/-/lodash.indexof-4.0.5.tgz#53714adc2cddd6ed87638f893aa9b6c24e31ef3c" +lodash.pickby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" + lodash@3.7.x: version "3.7.0" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45" -lodash@^4.0.1, lodash@^4.14.0, lodash@^4.16.2, lodash@^4.16.4, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.0.1, lodash@^4.14.0, lodash@^4.16.2, lodash@^4.16.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" @@ -2791,7 +3145,7 @@ minimatch@0.3: lru-cache "2" sigmund "~1.0.0" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@~3.0.2: +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@~3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -2812,13 +3166,19 @@ minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -moment@^2.14.1: +moment-timezone@^0.5.10: + version "0.5.10" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.10.tgz#3766249c2d317d08f07d896d3033c26f87c4ae2b" + dependencies: + moment ">= 2.6.0" + +"moment@>= 2.6.0", moment@^2.14.1, moment@^2.17.0: version "2.17.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.17.0.tgz#a4c292e02aac5ddefb29a6eed24f51938dd3b74f" @@ -2826,10 +3186,18 @@ ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" +mute-stream@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" + nan@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + ncname@1.0.x: version "1.0.0" resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" @@ -3002,6 +3370,10 @@ once@~1.3.3: dependencies: wrappy "1" +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + opn@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95" @@ -3015,6 +3387,17 @@ optimist@~0.3.5: dependencies: wordwrap "~0.0.2" +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + original@>=0.0.5: version "1.0.0" resolved "https://registry.yarnpkg.com/original/-/original-1.0.0.tgz#9147f93fa1696d04be61e01bd50baeaca656bd3b" @@ -3111,6 +3494,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -3149,6 +3536,16 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" +pkg-up@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" + dependencies: + find-up "^1.0.0" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + portfinder@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.10.tgz#7a4de9d98553c315da6f1e1ed05138eeb2d16bb8" @@ -3392,6 +3789,10 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 source-map "^0.5.6" supports-color "^3.1.2" +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -3440,6 +3841,10 @@ process@^0.11.0, process@~0.11.0: version "0.11.9" resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + proxy-addr@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.2.tgz#b4cc5f22610d9535824c123aef9d3cf73c40ba37" @@ -3605,6 +4010,20 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +readline2@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + mute-stream "0.0.5" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -3732,6 +4151,13 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + requires-port@1.0.x, requires-port@1.x.x: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -3742,13 +4168,28 @@ requizzle@~0.2.1: dependencies: underscore "~1.6.0" +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve@^1.1.6: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.1, rimraf@~2.5.1, rimraf@~2.5.4: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@~2.5.1, rimraf@~2.5.4: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" dependencies: @@ -3762,6 +4203,16 @@ ripemd160@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +rx-lite@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" + sanitize-html@^1.13.0: version "1.13.0" resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.13.0.tgz#4ee17cbec516bfe32f2ce6686a569d7e6b4f3631" @@ -3853,6 +4304,14 @@ shelljs@^0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.5.3.tgz#c54982b996c76ef0c1e6b59fbdc5825f5b713113" +shelljs@^0.7.5: + version "0.7.5" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.5.tgz#2eef7a50a21e1ccf37da00df767ec69e30ad0675" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + sigmund@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" @@ -3865,6 +4324,10 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + snake-case@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-1.1.2.tgz#0c2f25e305158d9a18d3d977066187fef8a5a66a" @@ -4013,6 +4476,13 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + string_decoder@^0.10.25, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -4033,13 +4503,17 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" dependencies: get-stdin "^4.0.1" -strip-json-comments@1.0.x, strip-json-comments@~1.0.4: +strip-json-comments@1.0.x, strip-json-comments@~1.0.1, strip-json-comments@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" @@ -4082,6 +4556,17 @@ swap-case@^1.1.0: lower-case "^1.1.1" upper-case "^1.1.1" +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + taffydb@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" @@ -4115,6 +4600,14 @@ templayed@*: version "0.2.3" resolved "https://registry.yarnpkg.com/templayed/-/templayed-0.2.3.tgz#4706df625bc6aecd86b7c9f6b0fb548b95cdf769" +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + timers-browserify@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" @@ -4159,6 +4652,10 @@ trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -4171,6 +4668,12 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.3.tgz#3da382f670f25ded78d7b3d1792119bca0b7132d" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + type-is@~1.6.13: version "1.6.14" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.14.tgz#e219639c17ded1ca0789092dd54a03826b817cb2" @@ -4300,6 +4803,12 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + dependencies: + os-homedir "^1.0.0" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -4475,6 +4984,10 @@ wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + wrap-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.0.0.tgz#7d30f8f873f9a5bbc3a64dabc8d177e071ae426f" @@ -4485,6 +4998,12 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + xml-char-classes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" From ad730d806b380eb5122f32bcad36aa44c15a4fc6 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 29 Nov 2016 00:22:34 +0000 Subject: [PATCH 03/15] eslint autofix --- Gruntfile.js | 811 ++-- src/js/config/Categories.js | 492 +-- src/js/config/OperationConfig.js | 5480 ++++++++++++------------ src/js/core/Chef.js | 120 +- src/js/core/Dish.js | 208 +- src/js/core/FlowControl.js | 185 +- src/js/core/Ingredient.js | 78 +- src/js/core/Operation.js | 126 +- src/js/core/Recipe.js | 215 +- src/js/core/Utils.js | 1068 ++--- src/js/operations/Base.js | 46 +- src/js/operations/Base64.js | 500 +-- src/js/operations/BitwiseOp.js | 289 +- src/js/operations/ByteRepr.js | 486 +-- src/js/operations/CharEnc.js | 44 +- src/js/operations/Checksum.js | 144 +- src/js/operations/Cipher.js | 434 +- src/js/operations/Code.js | 358 +- src/js/operations/Compress.js | 387 +- src/js/operations/Convert.js | 612 +-- src/js/operations/DateTime.js | 262 +- src/js/operations/Endian.js | 118 +- src/js/operations/Entropy.js | 194 +- src/js/operations/Extract.js | 366 +- src/js/operations/FileType.js | 858 ++-- src/js/operations/HTML.js | 1465 +++---- src/js/operations/HTTP.js | 52 +- src/js/operations/Hash.js | 484 +-- src/js/operations/Hexdump.js | 269 +- src/js/operations/IP.js | 1154 ++--- src/js/operations/JS.js | 177 +- src/js/operations/MAC.js | 88 +- src/js/operations/Numberwang.js | 22 +- src/js/operations/OS.js | 526 +-- src/js/operations/PublicKey.js | 1818 ++++---- src/js/operations/Punycode.js | 48 +- src/js/operations/QuotedPrintable.js | 302 +- src/js/operations/Rotate.js | 218 +- src/js/operations/SeqUtils.js | 244 +- src/js/operations/StrUtils.js | 714 ++- src/js/operations/Tidy.js | 268 +- src/js/operations/URL.js | 167 +- src/js/operations/UUID.js | 40 +- src/js/operations/Unicode.js | 58 +- src/js/views/html/ControlsWaiter.js | 382 +- src/js/views/html/HTMLApp.js | 753 ++-- src/js/views/html/HTMLCategory.js | 40 +- src/js/views/html/HTMLIngredient.js | 321 +- src/js/views/html/HTMLOperation.js | 122 +- src/js/views/html/HighlighterWaiter.js | 499 ++- src/js/views/html/InputWaiter.js | 248 +- src/js/views/html/Manager.js | 266 +- src/js/views/html/OperationsWaiter.js | 341 +- src/js/views/html/OptionsWaiter.js | 128 +- src/js/views/html/OutputWaiter.js | 148 +- src/js/views/html/RecipeWaiter.js | 436 +- src/js/views/html/SeasonalWaiter.js | 304 +- src/js/views/html/WindowWaiter.js | 24 +- src/js/views/html/main.js | 64 +- webpack-babel.js | 10 +- 60 files changed, 13067 insertions(+), 13014 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index c968f125..aa16b96a 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,152 +1,152 @@ -module.exports = function(grunt) { - grunt.file.defaultEncoding = "utf8"; - grunt.file.preserveBOM = false; - - // Tasks - grunt.registerTask("dev", - "A persistent task which creates a development build whenever source files are modified.", - ["clean:dev", "concat:css", "concat:js", "copy:html_dev", "copy:static_dev", "chmod:build", "watch"]); - - grunt.registerTask("prod", - "Creates a production-ready build. Use the --msg flag to add a compile message.", - ["jshint", "exec:stats", "clean", "jsdoc", "concat", "copy", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod"]); - - grunt.registerTask("docs", - "Compiles documentation in the /docs directory.", - ["clean:docs", "jsdoc", "chmod:docs"]); - - grunt.registerTask("stats", - "Provides statistics about the code base such as how many lines there are as well as details of file sizes before and after compression.", - ["concat:js", "uglify:prod", "exec:stats", "exec:repo_size", "exec:display_stats"]); - - grunt.registerTask("default", - "Lints the code base and shows stats", - ["jshint", "exec:stats", "exec:display_stats"]); - - grunt.registerTask("doc", "docs"); - grunt.registerTask("lint", "jshint"); - - - // Load tasks provided by each plugin - grunt.loadNpmTasks("grunt-contrib-jshint"); - grunt.loadNpmTasks("grunt-jsdoc"); - grunt.loadNpmTasks("grunt-contrib-clean"); - grunt.loadNpmTasks("grunt-contrib-concat"); - grunt.loadNpmTasks("grunt-contrib-copy"); - grunt.loadNpmTasks("grunt-contrib-uglify"); - grunt.loadNpmTasks("grunt-contrib-cssmin"); - grunt.loadNpmTasks("grunt-contrib-htmlmin"); - grunt.loadNpmTasks("grunt-inline-alt"); - grunt.loadNpmTasks("grunt-chmod"); - grunt.loadNpmTasks("grunt-exec"); - grunt.loadNpmTasks("grunt-contrib-watch"); - - - // JS includes - var js_files = [ - // Third party framework libraries - "src/js/lib/jquery-2.1.1.js", - "src/js/lib/bootstrap-3.3.6.js", - "src/js/lib/split.js", - "src/js/lib/bootstrap-switch.js", - "src/js/lib/yahoo.js", - "src/js/lib/snowfall.jquery.js", - - // Third party operation libraries - "src/js/lib/cryptojs/core.js", - "src/js/lib/cryptojs/x64-core.js", - "src/js/lib/cryptojs/enc-base64.js", - "src/js/lib/cryptojs/enc-utf16.js", - "src/js/lib/cryptojs/md5.js", - "src/js/lib/cryptojs/evpkdf.js", - "src/js/lib/cryptojs/cipher-core.js", - "src/js/lib/cryptojs/mode-cfb.js", - "src/js/lib/cryptojs/mode-ctr-gladman.js", - "src/js/lib/cryptojs/mode-ctr.js", - "src/js/lib/cryptojs/mode-ecb.js", - "src/js/lib/cryptojs/mode-ofb.js", - "src/js/lib/cryptojs/format-hex.js", - "src/js/lib/cryptojs/lib-typedarrays.js", - "src/js/lib/cryptojs/pad-ansix923.js", - "src/js/lib/cryptojs/pad-iso10126.js", - "src/js/lib/cryptojs/pad-iso97971.js", - "src/js/lib/cryptojs/pad-nopadding.js", - "src/js/lib/cryptojs/pad-zeropadding.js", - "src/js/lib/cryptojs/aes.js", - "src/js/lib/cryptojs/hmac.js", - "src/js/lib/cryptojs/rabbit-legacy.js", - "src/js/lib/cryptojs/rabbit.js", - "src/js/lib/cryptojs/ripemd160.js", - "src/js/lib/cryptojs/sha1.js", - "src/js/lib/cryptojs/sha256.js", - "src/js/lib/cryptojs/sha224.js", - "src/js/lib/cryptojs/sha512.js", - "src/js/lib/cryptojs/sha384.js", - "src/js/lib/cryptojs/sha3.js", - "src/js/lib/cryptojs/tripledes.js", - "src/js/lib/cryptojs/rc4.js", - "src/js/lib/cryptojs/pbkdf2.js", - "src/js/lib/jsbn/jsbn.js", - "src/js/lib/jsbn/jsbn2.js", - "src/js/lib/jsbn/base64.js", - "src/js/lib/jsbn/ec.js", - "src/js/lib/jsbn/prng4.js", - "src/js/lib/jsbn/rng.js", - "src/js/lib/jsbn/rsa.js", - "src/js/lib/jsbn/sec.js", - "src/js/lib/jsrasign/asn1-1.0.js", - "src/js/lib/jsrasign/asn1hex-1.1.js", - "src/js/lib/jsrasign/asn1x509-1.0.js", - "src/js/lib/jsrasign/base64x-1.1.js", - "src/js/lib/jsrasign/crypto-1.1.js", - "src/js/lib/jsrasign/dsa-modified-1.0.js", - "src/js/lib/jsrasign/ecdsa-modified-1.0.js", - "src/js/lib/jsrasign/ecparam-1.0.js", - "src/js/lib/jsrasign/keyutil-1.0.js", - "src/js/lib/jsrasign/x509-1.1.js", - "src/js/lib/blowfish.dojo.js", - "src/js/lib/rawdeflate.js", - "src/js/lib/rawinflate.js", - "src/js/lib/zip.js", - "src/js/lib/unzip.js", - "src/js/lib/zlib_and_gzip.js", - "src/js/lib/bzip2.js", - "src/js/lib/punycode.js", - "src/js/lib/uas_parser.js", - "src/js/lib/esprima.js", - "src/js/lib/escodegen.browser.js", - "src/js/lib/esmangle.min.js", - "src/js/lib/diff.js", - "src/js/lib/moment.js", - "src/js/lib/moment-timezone.js", - "src/js/lib/prettify.js", - "src/js/lib/vkbeautify.js", - "src/js/lib/Sortable.js", - "src/js/lib/bootstrap-colorpicker.js", - - // Custom libraries - "src/js/lib/canvas_components.js", - - // Utility functions - "src/js/core/Utils.js", - - // Operation objects - "src/js/operations/*.js", - - // Core framework objects - "src/js/core/*.js", - "src/js/config/Categories.js", - "src/js/config/OperationConfig.js", - - // HTML view objects - "src/js/views/html/*.js", - "!src/js/views/html/main.js", - - // Start the app! - "src/js/views/html/main.js", - ]; +module.exports = function (grunt) { + grunt.file.defaultEncoding = 'utf8'; + grunt.file.preserveBOM = false; - var banner = '/**\n\ + // Tasks + grunt.registerTask('dev', + 'A persistent task which creates a development build whenever source files are modified.', + ['clean:dev', 'concat:css', 'concat:js', 'copy:html_dev', 'copy:static_dev', 'chmod:build', 'watch']); + + grunt.registerTask('prod', + 'Creates a production-ready build. Use the --msg flag to add a compile message.', + ['jshint', 'exec:stats', 'clean', 'jsdoc', 'concat', 'copy', 'cssmin', 'uglify:prod', 'inline', 'htmlmin', 'chmod']); + + grunt.registerTask('docs', + 'Compiles documentation in the /docs directory.', + ['clean:docs', 'jsdoc', 'chmod:docs']); + + grunt.registerTask('stats', + 'Provides statistics about the code base such as how many lines there are as well as details of file sizes before and after compression.', + ['concat:js', 'uglify:prod', 'exec:stats', 'exec:repo_size', 'exec:display_stats']); + + grunt.registerTask('default', + 'Lints the code base and shows stats', + ['jshint', 'exec:stats', 'exec:display_stats']); + + grunt.registerTask('doc', 'docs'); + grunt.registerTask('lint', 'jshint'); + + + // Load tasks provided by each plugin + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-jsdoc'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-htmlmin'); + grunt.loadNpmTasks('grunt-inline-alt'); + grunt.loadNpmTasks('grunt-chmod'); + grunt.loadNpmTasks('grunt-exec'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + + // JS includes + const js_files = [ + // Third party framework libraries + 'src/js/lib/jquery-2.1.1.js', + 'src/js/lib/bootstrap-3.3.6.js', + 'src/js/lib/split.js', + 'src/js/lib/bootstrap-switch.js', + 'src/js/lib/yahoo.js', + 'src/js/lib/snowfall.jquery.js', + + // Third party operation libraries + 'src/js/lib/cryptojs/core.js', + 'src/js/lib/cryptojs/x64-core.js', + 'src/js/lib/cryptojs/enc-base64.js', + 'src/js/lib/cryptojs/enc-utf16.js', + 'src/js/lib/cryptojs/md5.js', + 'src/js/lib/cryptojs/evpkdf.js', + 'src/js/lib/cryptojs/cipher-core.js', + 'src/js/lib/cryptojs/mode-cfb.js', + 'src/js/lib/cryptojs/mode-ctr-gladman.js', + 'src/js/lib/cryptojs/mode-ctr.js', + 'src/js/lib/cryptojs/mode-ecb.js', + 'src/js/lib/cryptojs/mode-ofb.js', + 'src/js/lib/cryptojs/format-hex.js', + 'src/js/lib/cryptojs/lib-typedarrays.js', + 'src/js/lib/cryptojs/pad-ansix923.js', + 'src/js/lib/cryptojs/pad-iso10126.js', + 'src/js/lib/cryptojs/pad-iso97971.js', + 'src/js/lib/cryptojs/pad-nopadding.js', + 'src/js/lib/cryptojs/pad-zeropadding.js', + 'src/js/lib/cryptojs/aes.js', + 'src/js/lib/cryptojs/hmac.js', + 'src/js/lib/cryptojs/rabbit-legacy.js', + 'src/js/lib/cryptojs/rabbit.js', + 'src/js/lib/cryptojs/ripemd160.js', + 'src/js/lib/cryptojs/sha1.js', + 'src/js/lib/cryptojs/sha256.js', + 'src/js/lib/cryptojs/sha224.js', + 'src/js/lib/cryptojs/sha512.js', + 'src/js/lib/cryptojs/sha384.js', + 'src/js/lib/cryptojs/sha3.js', + 'src/js/lib/cryptojs/tripledes.js', + 'src/js/lib/cryptojs/rc4.js', + 'src/js/lib/cryptojs/pbkdf2.js', + 'src/js/lib/jsbn/jsbn.js', + 'src/js/lib/jsbn/jsbn2.js', + 'src/js/lib/jsbn/base64.js', + 'src/js/lib/jsbn/ec.js', + 'src/js/lib/jsbn/prng4.js', + 'src/js/lib/jsbn/rng.js', + 'src/js/lib/jsbn/rsa.js', + 'src/js/lib/jsbn/sec.js', + 'src/js/lib/jsrasign/asn1-1.0.js', + 'src/js/lib/jsrasign/asn1hex-1.1.js', + 'src/js/lib/jsrasign/asn1x509-1.0.js', + 'src/js/lib/jsrasign/base64x-1.1.js', + 'src/js/lib/jsrasign/crypto-1.1.js', + 'src/js/lib/jsrasign/dsa-modified-1.0.js', + 'src/js/lib/jsrasign/ecdsa-modified-1.0.js', + 'src/js/lib/jsrasign/ecparam-1.0.js', + 'src/js/lib/jsrasign/keyutil-1.0.js', + 'src/js/lib/jsrasign/x509-1.1.js', + 'src/js/lib/blowfish.dojo.js', + 'src/js/lib/rawdeflate.js', + 'src/js/lib/rawinflate.js', + 'src/js/lib/zip.js', + 'src/js/lib/unzip.js', + 'src/js/lib/zlib_and_gzip.js', + 'src/js/lib/bzip2.js', + 'src/js/lib/punycode.js', + 'src/js/lib/uas_parser.js', + 'src/js/lib/esprima.js', + 'src/js/lib/escodegen.browser.js', + 'src/js/lib/esmangle.min.js', + 'src/js/lib/diff.js', + 'src/js/lib/moment.js', + 'src/js/lib/moment-timezone.js', + 'src/js/lib/prettify.js', + 'src/js/lib/vkbeautify.js', + 'src/js/lib/Sortable.js', + 'src/js/lib/bootstrap-colorpicker.js', + + // Custom libraries + 'src/js/lib/canvas_components.js', + + // Utility functions + 'src/js/core/Utils.js', + + // Operation objects + 'src/js/operations/*.js', + + // Core framework objects + 'src/js/core/*.js', + 'src/js/config/Categories.js', + 'src/js/config/OperationConfig.js', + + // HTML view objects + 'src/js/views/html/*.js', + '!src/js/views/html/main.js', + + // Start the app! + 'src/js/views/html/main.js', + ]; + + const banner = '/**\n\ * CyberChef - The Cyber Swiss Army Knife\n\ *\n\ * @copyright Crown Copyright 2016\n\ @@ -167,278 +167,277 @@ module.exports = function(grunt) { * limitations under the License.\n\ */\n'; - var template_options = { - data: { - compile_msg: grunt.option("compile-msg") || grunt.option("msg") || "", - codebase_stats: grunt.file.read("src/static/stats.txt").split("\n").join("
") - } - }; - + const template_options = { + data: { + compile_msg: grunt.option('compile-msg') || grunt.option('msg') || '', + codebase_stats: grunt.file.read('src/static/stats.txt').split('\n').join('
'), + }, + }; + // Project configuration - grunt.initConfig({ - jshint: { - options: { - jshintrc: "src/js/.jshintrc" - }, - gruntfile: ["Gruntfile.js"], - core: ["src/js/core/**/*.js"], - config: ["src/js/config/**/*.js"], - views: ["src/js/views/**/*.js"], - operations: ["src/js/operations/**/*.js"], - }, - jsdoc: { - options: { - destination: "docs", - template: "node_modules/ink-docstrap/template", - recurse: true, - readme: "./README.md", - configure: "docs/jsdoc.conf.json" - }, - all: { - src: [ - "src/js/**/*.js", - "!src/js/lib/**/*", - ], - } - }, - clean: { - dev: ["build/dev/*"], - prod: ["build/prod/*"], - docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"], - }, - concat: { - options: { - process: template_options - }, - css: { - options: { - banner: banner.replace(/\/\*\*/g, "/*!"), - process: function(content, srcpath) { + grunt.initConfig({ + jshint: { + options: { + jshintrc: 'src/js/.jshintrc', + }, + gruntfile: ['Gruntfile.js'], + core: ['src/js/core/**/*.js'], + config: ['src/js/config/**/*.js'], + views: ['src/js/views/**/*.js'], + operations: ['src/js/operations/**/*.js'], + }, + jsdoc: { + options: { + destination: 'docs', + template: 'node_modules/ink-docstrap/template', + recurse: true, + readme: './README.md', + configure: 'docs/jsdoc.conf.json', + }, + all: { + src: [ + 'src/js/**/*.js', + '!src/js/lib/**/*', + ], + }, + }, + clean: { + dev: ['build/dev/*'], + prod: ['build/prod/*'], + docs: ['docs/*', '!docs/*.conf.json', '!docs/*.ico'], + }, + concat: { + options: { + process: template_options, + }, + css: { + options: { + banner: banner.replace(/\/\*\*/g, '/*!'), + process(content, srcpath) { // Change special comments from /** to /*! to comply with cssmin - content = content.replace(/^\/\*\* /g, "/*! "); - return grunt.template.process(content); - } - }, - src: [ - "src/css/lib/**/*.css", - "src/css/structure/**/*.css", - "src/css/themes/classic.css" - ], - dest: "build/dev/styles.css" - }, - js: { - options: { - banner: '"use strict";\n' - }, - src: js_files, - dest: "build/dev/scripts.js" - } + content = content.replace(/^\/\*\* /g, '/*! '); + return grunt.template.process(content); + }, }, - copy: { - html_dev: { - options: { - process: function(content, srcpath) { - return grunt.template.process(content, template_options); - } - }, - src: "src/html/index.html", - dest: "build/dev/index.html" - }, - html_prod: { - options: { - process: function(content, srcpath) { - return grunt.template.process(content, template_options); - } - }, - src: "src/html/index.html", - dest: "build/prod/index.html" - }, - html_inline: { - options: { - process: function(content, srcpath) { + src: [ + 'src/css/lib/**/*.css', + 'src/css/structure/**/*.css', + 'src/css/themes/classic.css', + ], + dest: 'build/dev/styles.css', + }, + js: { + options: { + banner: '"use strict";\n', + }, + src: js_files, + dest: 'build/dev/scripts.js', + }, + }, + copy: { + html_dev: { + options: { + process(content, srcpath) { + return grunt.template.process(content, template_options); + }, + }, + src: 'src/html/index.html', + dest: 'build/dev/index.html', + }, + html_prod: { + options: { + process(content, srcpath) { + return grunt.template.process(content, template_options); + }, + }, + src: 'src/html/index.html', + dest: 'build/prod/index.html', + }, + html_inline: { + options: { + process(content, srcpath) { // TODO: Do all this in Jade - content = content.replace( - 'Download CyberChef', - 'Compile time: ' + grunt.template.today("dd/mm/yyyy HH:MM:ss") + ' UTC'); - return grunt.template.process(content, template_options); - } - }, - src: "src/html/index.html", - dest: "build/prod/cyberchef.htm" - }, - static_dev: { - files: [ - { - expand: true, - cwd: "src/static/", - src: [ - "**/*", - "**/.*", - "!stats.txt" - ], - dest: "build/dev/" - } - ] - }, - static_prod: { - files: [ - { - expand: true, - cwd: "src/static/", - src: [ - "**/*", - "**/.*", - "!stats.txt" - ], - dest: "build/prod/" - } - ] - } + content = content.replace( + 'Download CyberChef', + `Compile time: ${grunt.template.today('dd/mm/yyyy HH:MM:ss')} UTC`); + return grunt.template.process(content, template_options); + }, }, - uglify: { - options: { - preserveComments: function(node, comment) { - if (comment.value.indexOf("* @license") === 0) return true; - return false; - }, - screwIE8: true, - ASCIIOnly: true, - beautify: { - beautify: false, - inline_script: true, - ascii_only: true, - screw_ie8: true - }, - compress: { - screw_ie8: true - }, - banner: banner - }, - prod: { - src: "build/dev/scripts.js", - dest: "build/prod/scripts.js" - } + src: 'src/html/index.html', + dest: 'build/prod/cyberchef.htm', + }, + static_dev: { + files: [ + { + expand: true, + cwd: 'src/static/', + src: [ + '**/*', + '**/.*', + '!stats.txt', + ], + dest: 'build/dev/', + }, + ], + }, + static_prod: { + files: [ + { + expand: true, + cwd: 'src/static/', + src: [ + '**/*', + '**/.*', + '!stats.txt', + ], + dest: 'build/prod/', + }, + ], + }, + }, + uglify: { + options: { + preserveComments(node, comment) { + if (comment.value.indexOf('* @license') === 0) return true; + return false; }, - cssmin: { - prod: { - src: "build/dev/styles.css", - dest: "build/prod/styles.css" - } + screwIE8: true, + ASCIIOnly: true, + beautify: { + beautify: false, + inline_script: true, + ascii_only: true, + screw_ie8: true, }, - htmlmin: { - prod: { - options: { - removeComments: true, - collapseWhitespace: true, - minifyJS: true, - minifyCSS: true - }, - src: "build/prod/index.html", - dest: "build/prod/index.html" - }, - inline: { - options: { - removeComments: true, - collapseWhitespace: true, - minifyJS: false, - minifyCSS: false - }, - src: "build/prod/cyberchef.htm", - dest: "build/prod/cyberchef.htm" - } + compress: { + screw_ie8: true, }, - inline: { - options: { - tag: "", - inlineTagAttributes: { - js: "type='application/javascript'", - css: "type='text/css'" - } - }, - prod: { - src: "build/prod/cyberchef.htm", - dest: "build/prod/cyberchef.htm" - } + banner, + }, + prod: { + src: 'build/dev/scripts.js', + dest: 'build/prod/scripts.js', + }, + }, + cssmin: { + prod: { + src: 'build/dev/styles.css', + dest: 'build/prod/styles.css', + }, + }, + htmlmin: { + prod: { + options: { + removeComments: true, + collapseWhitespace: true, + minifyJS: true, + minifyCSS: true, }, - chmod: { - build: { - options: { - mode: "755", - }, - src: ["build/**/*", "build/**/.htaccess", "build/"] - }, - docs: { - options: { - mode: "755", - }, - src: ["docs/**/*", "docs/"] - } + src: 'build/prod/index.html', + dest: 'build/prod/index.html', + }, + inline: { + options: { + removeComments: true, + collapseWhitespace: true, + minifyJS: false, + minifyCSS: false, }, - exec: { - repo_size: { - command: [ - "git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'", - "du -hs | egrep -o '^[^\t]*' | xargs printf '%b\trepository size\n'" - ].join(";"), - stderr: false - }, - stats: { - command: "rm src/static/stats.txt;" + + src: 'build/prod/cyberchef.htm', + dest: 'build/prod/cyberchef.htm', + }, + }, + inline: { + options: { + tag: '', + inlineTagAttributes: { + js: "type='application/javascript'", + css: "type='text/css'", + }, + }, + prod: { + src: 'build/prod/cyberchef.htm', + dest: 'build/prod/cyberchef.htm', + }, + }, + chmod: { + build: { + options: { + mode: '755', + }, + src: ['build/**/*', 'build/**/.htaccess', 'build/'], + }, + docs: { + options: { + mode: '755', + }, + src: ['docs/**/*', 'docs/'], + }, + }, + exec: { + repo_size: { + command: [ + "git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'", + "du -hs | egrep -o '^[^\t]*' | xargs printf '%b\trepository size\n'", + ].join(';'), + stderr: false, + }, + stats: { + command: `rm src/static/stats.txt;${ [ - "ls src/ -R1 | grep '^$' -v | grep ':$' -v | wc -l | xargs printf '%b\tsource files\n'", - "find src/ -regex '.*\..*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "du -hs src/ | pcregrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", + "ls src/ -R1 | grep '^$' -v | grep ':$' -v | wc -l | xargs printf '%b\tsource files\n'", + "find src/ -regex '.*\..*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", + "du -hs src/ | pcregrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - "ls src/js/ -R1 | grep '\.js$' | wc -l | xargs printf '\n%b\tJavaScript source files\n'", - "find src/js/ -regex '.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", + "ls src/js/ -R1 | grep '\.js$' | wc -l | xargs printf '\n%b\tJavaScript source files\n'", + "find src/js/ -regex '.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", + "find src/js/ -regex '.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - "find src/js/ -regex '.*/lib/.*\.js' -print | wc -l | xargs printf '\n%b\tthird party JavaScript source files\n'", - "find src/js/ -regex '.*/lib/.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*/lib/.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", + "find src/js/ -regex '.*/lib/.*\.js' -print | wc -l | xargs printf '\n%b\tthird party JavaScript source files\n'", + "find src/js/ -regex '.*/lib/.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", + "find src/js/ -regex '.*/lib/.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | wc -l | xargs printf '\n%b\tfirst party JavaScript source files\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", + "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | wc -l | xargs printf '\n%b\tfirst party JavaScript source files\n'", + "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", + "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - "du build/dev/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '\n%b\tuncompressed JavaScript size\n'", - "du build/prod/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '%b\tcompressed JavaScript size\n'", - - "grep -E '^\\s+name: ' src/js/config/Categories.js | wc -l | xargs printf '\n%b\tcategories\n'", - "grep -E '^\\s+\"[A-Za-z0-9 \\-]+\": {' src/js/config/OperationConfig.js | wc -l | xargs printf '%b\toperations\n'", - - ].join(" >> src/static/stats.txt;") + " >> src/static/stats.txt;", - stderr: false - }, - display_stats: { - command: "cat src/static/stats.txt" - }, - clean_git: { - command: "git gc --prune=now --aggressive" - }, - }, - watch: { - css: { - files: "src/css/**/*.css", - tasks: ["concat:css", "chmod:build"] - }, - js: { - files: "src/js/**/*.js", - tasks: ["concat:js_all", "chmod:build"] - }, - html: { - files: "src/html/**/*.html", - tasks: ["copy:html_dev", "chmod:build"] - }, - static: { - files: ["src/static/**/*", "src/static/**/.*"], - tasks: ["copy:static_dev", "chmod:build"] - }, - grunt: { - files: "Gruntfile.js", - tasks: ["clean:dev", "concat:css", "concat:js_all", "copy:html_dev", "copy:static_dev", "chmod:build"] - } - }, - }); + "du build/dev/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '\n%b\tuncompressed JavaScript size\n'", + "du build/prod/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '%b\tcompressed JavaScript size\n'", + "grep -E '^\\s+name: ' src/js/config/Categories.js | wc -l | xargs printf '\n%b\tcategories\n'", + "grep -E '^\\s+\"[A-Za-z0-9 \\-]+\": {' src/js/config/OperationConfig.js | wc -l | xargs printf '%b\toperations\n'", + + ].join(' >> src/static/stats.txt;')} >> src/static/stats.txt;`, + stderr: false, + }, + display_stats: { + command: 'cat src/static/stats.txt', + }, + clean_git: { + command: 'git gc --prune=now --aggressive', + }, + }, + watch: { + css: { + files: 'src/css/**/*.css', + tasks: ['concat:css', 'chmod:build'], + }, + js: { + files: 'src/js/**/*.js', + tasks: ['concat:js_all', 'chmod:build'], + }, + html: { + files: 'src/html/**/*.html', + tasks: ['copy:html_dev', 'chmod:build'], + }, + static: { + files: ['src/static/**/*', 'src/static/**/.*'], + tasks: ['copy:static_dev', 'chmod:build'], + }, + grunt: { + files: 'Gruntfile.js', + tasks: ['clean:dev', 'concat:css', 'concat:js_all', 'copy:html_dev', 'copy:static_dev', 'chmod:build'], + }, + }, + }); }; diff --git a/src/js/config/Categories.js b/src/js/config/Categories.js index 02c2b1f5..02305f80 100755 --- a/src/js/config/Categories.js +++ b/src/js/config/Categories.js @@ -17,250 +17,250 @@ * @constant * @type {CatConf[]} */ -var Categories = [ - { - name: "Favourites", - ops: [] - }, - { - name: "Data format", - ops: [ - "To Hexdump", - "From Hexdump", - "To Hex", - "From Hex", - "To Charcode", - "From Charcode", - "To Decimal", - "From Decimal", - "To Binary", - "From Binary", - "To Base64", - "From Base64", - "Show Base64 offsets", - "To Base32", - "From Base32", - "To Base", - "From Base", - "To HTML Entity", - "From HTML Entity", - "URL Encode", - "URL Decode", - "Unescape Unicode Characters", - "To Quoted Printable", - "From Quoted Printable", - "To Punycode", - "From Punycode", - "To Hex Content", - "From Hex Content", - "PEM to Hex", - "Hex to PEM", - "Parse ASN.1 hex string", - "Change IP format", - "Text encoding", - "Swap endianness", - ] - }, - { - name: "Encryption / Encoding", - ops: [ - "AES Encrypt", - "AES Decrypt", - "Blowfish Encrypt", - "Blowfish Decrypt", - "DES Encrypt", - "DES Decrypt", - "Triple DES Encrypt", - "Triple DES Decrypt", - "Rabbit Encrypt", - "Rabbit Decrypt", - "RC4", - "RC4 Drop", - "ROT13", - "XOR", - "XOR Brute Force", - "Derive PBKDF2 key", - "Derive EVP key", - ] - }, - { - name: "Public Key", - ops: [ - "Parse X.509 certificate", - "Parse ASN.1 hex string", - "PEM to Hex", - "Hex to PEM", - "Hex to Object Identifier", - "Object Identifier to Hex", - ] - }, - { - name: "Logical operations", - ops: [ - "XOR", - "XOR Brute Force", - "OR", - "NOT", - "AND", - "ADD", - "SUB", - "Rotate left", - "Rotate right", - "ROT13", - ] - }, - { - name: "Networking", - ops: [ - "Strip HTTP headers", - "Parse User Agent", - "Parse IP range", - "Parse IPv6 address", - "Parse URI", - "URL Encode", - "URL Decode", - "Format MAC addresses", - "Change IP format", - "Group IP addresses", - ] - }, - { - name: "Language", - ops: [ - "Text encoding", - "Unescape Unicode Characters", - ] - }, - { - name: "Utils", - ops: [ - "Diff", - "Remove whitespace", - "Remove null bytes", - "To Upper case", - "To Lower case", - "Add line numbers", - "Remove line numbers", - "Reverse", - "Sort", - "Unique", - "Split", - "Count occurrences", - "Expand alphabet range", - "Parse escaped string", - "Drop bytes", - "Take bytes", - "Pad lines", - "Find / Replace", - "Regular expression", - "Offset checker", - "Convert distance", - "Convert area", - "Convert mass", - "Convert speed", - "Convert data units", - "Parse UNIX file permissions", - "Swap endianness", - "Parse colour code", - ] - }, - { - name: "Date / Time", - ops: [ - "Parse DateTime", - "Translate DateTime Format", - "From UNIX Timestamp", - "To UNIX Timestamp", - "Extract dates", - ] - }, - { - name: "Extractors", - ops: [ - "Strings", - "Extract IP addresses", - "Extract email addresses", - "Extract MAC addresses", - "Extract URLs", - "Extract domains", - "Extract file paths", - "Extract dates", - "Regular expression", - ] - }, - { - name: "Compression", - ops: [ - "Raw Deflate", - "Raw Inflate", - "Zlib Deflate", - "Zlib Inflate", - "Gzip", - "Gunzip", - "Zip", - "Unzip", - "Bzip2 Decompress", - ] - }, - { - name: "Hashing", - ops: [ - "Analyse hash", - "Generate all hashes", - "MD5", - "SHA1", - "SHA224", - "SHA256", - "SHA384", - "SHA512", - "SHA3", - "RIPEMD-160", - "HMAC", - "Fletcher-16 Checksum", - "Adler-32 Checksum", - "CRC-32 Checksum", - "TCP/IP Checksum", - ] - }, - { - name: "Code tidy", - ops: [ - "Syntax highlighter", - "Generic Code Beautify", - "JavaScript Parser", - "JavaScript Beautify", - "JavaScript Minify", - "JSON Beautify", - "JSON Minify", - "XML Beautify", - "XML Minify", - "SQL Beautify", - "SQL Minify", - "CSS Beautify", - "CSS Minify", - "Strip HTML tags", - "Diff", - ] - }, - { - name: "Other", - ops: [ - "Entropy", - "Frequency distribution", - "Detect File Type", - "Scan for Embedded Files", - "Generate UUID", - "Numberwang", - ] - }, - { - name: "Flow control", - ops: [ - "Fork", - "Merge", - "Jump", - "Conditional Jump", - "Return", - ] - }, +const Categories = [ + { + name: 'Favourites', + ops: [], + }, + { + name: 'Data format', + ops: [ + 'To Hexdump', + 'From Hexdump', + 'To Hex', + 'From Hex', + 'To Charcode', + 'From Charcode', + 'To Decimal', + 'From Decimal', + 'To Binary', + 'From Binary', + 'To Base64', + 'From Base64', + 'Show Base64 offsets', + 'To Base32', + 'From Base32', + 'To Base', + 'From Base', + 'To HTML Entity', + 'From HTML Entity', + 'URL Encode', + 'URL Decode', + 'Unescape Unicode Characters', + 'To Quoted Printable', + 'From Quoted Printable', + 'To Punycode', + 'From Punycode', + 'To Hex Content', + 'From Hex Content', + 'PEM to Hex', + 'Hex to PEM', + 'Parse ASN.1 hex string', + 'Change IP format', + 'Text encoding', + 'Swap endianness', + ], + }, + { + name: 'Encryption / Encoding', + ops: [ + 'AES Encrypt', + 'AES Decrypt', + 'Blowfish Encrypt', + 'Blowfish Decrypt', + 'DES Encrypt', + 'DES Decrypt', + 'Triple DES Encrypt', + 'Triple DES Decrypt', + 'Rabbit Encrypt', + 'Rabbit Decrypt', + 'RC4', + 'RC4 Drop', + 'ROT13', + 'XOR', + 'XOR Brute Force', + 'Derive PBKDF2 key', + 'Derive EVP key', + ], + }, + { + name: 'Public Key', + ops: [ + 'Parse X.509 certificate', + 'Parse ASN.1 hex string', + 'PEM to Hex', + 'Hex to PEM', + 'Hex to Object Identifier', + 'Object Identifier to Hex', + ], + }, + { + name: 'Logical operations', + ops: [ + 'XOR', + 'XOR Brute Force', + 'OR', + 'NOT', + 'AND', + 'ADD', + 'SUB', + 'Rotate left', + 'Rotate right', + 'ROT13', + ], + }, + { + name: 'Networking', + ops: [ + 'Strip HTTP headers', + 'Parse User Agent', + 'Parse IP range', + 'Parse IPv6 address', + 'Parse URI', + 'URL Encode', + 'URL Decode', + 'Format MAC addresses', + 'Change IP format', + 'Group IP addresses', + ], + }, + { + name: 'Language', + ops: [ + 'Text encoding', + 'Unescape Unicode Characters', + ], + }, + { + name: 'Utils', + ops: [ + 'Diff', + 'Remove whitespace', + 'Remove null bytes', + 'To Upper case', + 'To Lower case', + 'Add line numbers', + 'Remove line numbers', + 'Reverse', + 'Sort', + 'Unique', + 'Split', + 'Count occurrences', + 'Expand alphabet range', + 'Parse escaped string', + 'Drop bytes', + 'Take bytes', + 'Pad lines', + 'Find / Replace', + 'Regular expression', + 'Offset checker', + 'Convert distance', + 'Convert area', + 'Convert mass', + 'Convert speed', + 'Convert data units', + 'Parse UNIX file permissions', + 'Swap endianness', + 'Parse colour code', + ], + }, + { + name: 'Date / Time', + ops: [ + 'Parse DateTime', + 'Translate DateTime Format', + 'From UNIX Timestamp', + 'To UNIX Timestamp', + 'Extract dates', + ], + }, + { + name: 'Extractors', + ops: [ + 'Strings', + 'Extract IP addresses', + 'Extract email addresses', + 'Extract MAC addresses', + 'Extract URLs', + 'Extract domains', + 'Extract file paths', + 'Extract dates', + 'Regular expression', + ], + }, + { + name: 'Compression', + ops: [ + 'Raw Deflate', + 'Raw Inflate', + 'Zlib Deflate', + 'Zlib Inflate', + 'Gzip', + 'Gunzip', + 'Zip', + 'Unzip', + 'Bzip2 Decompress', + ], + }, + { + name: 'Hashing', + ops: [ + 'Analyse hash', + 'Generate all hashes', + 'MD5', + 'SHA1', + 'SHA224', + 'SHA256', + 'SHA384', + 'SHA512', + 'SHA3', + 'RIPEMD-160', + 'HMAC', + 'Fletcher-16 Checksum', + 'Adler-32 Checksum', + 'CRC-32 Checksum', + 'TCP/IP Checksum', + ], + }, + { + name: 'Code tidy', + ops: [ + 'Syntax highlighter', + 'Generic Code Beautify', + 'JavaScript Parser', + 'JavaScript Beautify', + 'JavaScript Minify', + 'JSON Beautify', + 'JSON Minify', + 'XML Beautify', + 'XML Minify', + 'SQL Beautify', + 'SQL Minify', + 'CSS Beautify', + 'CSS Minify', + 'Strip HTML tags', + 'Diff', + ], + }, + { + name: 'Other', + ops: [ + 'Entropy', + 'Frequency distribution', + 'Detect File Type', + 'Scan for Embedded Files', + 'Generate UUID', + 'Numberwang', + ], + }, + { + name: 'Flow control', + ops: [ + 'Fork', + 'Merge', + 'Jump', + 'Conditional Jump', + 'Return', + ], + }, ]; diff --git a/src/js/config/OperationConfig.js b/src/js/config/OperationConfig.js index f011a0b2..f8c74a9a 100755 --- a/src/js/config/OperationConfig.js +++ b/src/js/config/OperationConfig.js @@ -20,7 +20,7 @@ * @property {boolean} [flow_control] - True if the operation is for Flow Control * @property {ArgConf[]} [args] - A list of configuration objects for the arguments */ - + /** * Type definition for an ArgConf. @@ -45,2742 +45,2742 @@ * @constant * @type {Object.} */ -var OperationConfig = { - "Fork": { - description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.

For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.", - run: FlowControl.run_fork, - input_type: "string", - output_type: "string", - flow_control: true, - args: [ - { - name: "Split delimiter", - type: "binary_short_string", - value: FlowControl.FORK_DELIM - }, - { - name: "Merge delimiter", - type: "binary_short_string", - value: FlowControl.MERGE_DELIM - } - ] - }, - "Merge": { - description: "Consolidate all branches back into a single trunk. The opposite of Fork.", - run: FlowControl.run_merge, - input_type: "string", - output_type: "string", - flow_control: true, - args: [] - }, - "Jump": { - description: "Jump forwards or backwards over the specified number of operations.", - run: FlowControl.run_jump, - input_type: "string", - output_type: "string", - flow_control: true, - args: [ - { - name: "Number of operations to jump over", - type: "number", - value: FlowControl.JUMP_NUM - }, - { - name: "Maximum jumps (if jumping backwards)", - type: "number", - value: FlowControl.MAX_JUMPS - } - ] - }, - "Conditional Jump": { - description: "Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.", - run: FlowControl.run_cond_jump, - input_type: "string", - output_type: "string", - flow_control: true, - args: [ - { - name: "Match (regex)", - type: "string", - value: "" - }, - { - name: "Number of operations to jump over if match found", - type: "number", - value: FlowControl.JUMP_NUM - }, - { - name: "Maximum jumps (if jumping backwards)", - type: "number", - value: FlowControl.MAX_JUMPS - } - ] - }, - "Return": { - description: "End execution of operations at this point in the recipe.", - run: FlowControl.run_return, - input_type: "string", - output_type: "string", - flow_control: true, - args: [] - }, - "From Base64": { - description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

This operation decodes data from an ASCII Base64 string back into its raw format.

e.g. aGVsbG8= becomes hello", - run: Base64.run_from, - highlight: Base64.highlight_from, - highlight_reverse: Base64.highlight_to, - input_type: "string", - output_type: "byte_array", - args: [ - { - name: "Alphabet", - type: "editable_option", - value: Base64.ALPHABET_OPTIONS - }, - { - name: "Remove non‑alphabet chars", - type: "boolean", - value: Base64.REMOVE_NON_ALPH_CHARS - } - ] - }, - "To Base64": { - description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

This operation encodes data in an ASCII Base64 string.

e.g. hello becomes aGVsbG8=", - run: Base64.run_to, - highlight: Base64.highlight_to, - highlight_reverse: Base64.highlight_from, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Alphabet", - type: "editable_option", - value: Base64.ALPHABET_OPTIONS - }, - ] - }, - "From Base32": { - description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.", - run: Base64.run_from_32, - input_type: "string", - output_type: "byte_array", - args: [ - { - name: "Alphabet", - type: "binary_string", - value: Base64.BASE32_ALPHABET - }, - { - name: "Remove non‑alphabet chars", - type: "boolean", - value: Base64.REMOVE_NON_ALPH_CHARS - } - ] - }, - "To Base32": { - description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.", - run: Base64.run_to_32, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Alphabet", - type: "binary_string", - value: Base64.BASE32_ALPHABET - } - ] - }, - "Show Base64 offsets": { - description: "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.

This operation shows all possible offsets for a given string so that each possible encoding can be considered.", - run: Base64.run_offsets, - input_type: "byte_array", - output_type: "html", - args: [ - { - name: "Alphabet", - type: "binary_string", - value: Base64.ALPHABET - }, - { - name: "Show variable chars and padding", - type: "boolean", - value: Base64.OFFSETS_SHOW_VARIABLE - } - ] - }, - "XOR": { - description: "XOR the input with the given key.
e.g. fe023da5

Options
Null preserving: If the current byte is 0x00 or the same as the key, skip it.

Differential: Set the key to the value of the previously decoded byte.", - run: BitwiseOp.run_xor, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: BitwiseOp.KEY_FORMAT - }, - { - name: "Null preserving", - type: "boolean", - value: BitwiseOp.XOR_PRESERVE_NULLS - }, - { - name: "Differential", - type: "boolean", - value: BitwiseOp.XOR_DIFFERENTIAL - } - ] - }, - "XOR Brute Force": { - description: "Enumerate all possible XOR solutions. Current maximum key length is 2 due to browser performance.

Optionally enter a regex string that you expect to find in the plaintext to filter results (crib).", - run: BitwiseOp.run_xor_brute, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Key length", - type: "option", - value: BitwiseOp.XOR_BRUTE_KEY_LENGTH - }, - { - name: "Length of sample", - type: "number", - value: BitwiseOp.XOR_BRUTE_SAMPLE_LENGTH - }, - { - name: "Offset of sample", - type: "number", - value: BitwiseOp.XOR_BRUTE_SAMPLE_OFFSET - }, - { - name: "Null preserving", - type: "boolean", - value: BitwiseOp.XOR_PRESERVE_NULLS - }, - { - name: "Differential", - type: "boolean", - value: BitwiseOp.XOR_DIFFERENTIAL - }, - { - name: "Crib (known plaintext string)", - type: "binary_string", - value: "" - }, - { - name: "Print key", - type: "boolean", - value: BitwiseOp.XOR_BRUTE_PRINT_KEY - }, - { - name: "Output as hex", - type: "boolean", - value: BitwiseOp.XOR_BRUTE_OUTPUT_HEX - } - ] - }, - "NOT": { - description: "Returns the inverse of each byte.", - run: BitwiseOp.run_not, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [] - }, - "AND": { - description: "AND the input with the given key.
e.g. fe023da5", - run: BitwiseOp.run_and, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: BitwiseOp.KEY_FORMAT - } - ] - }, - "OR": { - description: "OR the input with the given key.
e.g. fe023da5", - run: BitwiseOp.run_or, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: BitwiseOp.KEY_FORMAT - } - ] - }, - "ADD": { - description: "ADD the input with the given key (e.g. fe023da5), MOD 255", - run: BitwiseOp.run_add, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: BitwiseOp.KEY_FORMAT - } - ] - }, - "SUB": { - description: "SUB the input with the given key (e.g. fe023da5), MOD 255", - run: BitwiseOp.run_sub, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: BitwiseOp.KEY_FORMAT - } - ] - }, - "From Hex": { - description: "Converts a hexadecimal byte string back into a its raw value.

e.g. ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a becomes the UTF-8 encoded string Γειά σου", - run: ByteRepr.run_from_hex, - highlight: ByteRepr.highlight_from, - highlight_reverse: ByteRepr.highlight_to, - input_type: "string", - output_type: "byte_array", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.HEX_DELIM_OPTIONS - } - ] - }, - "To Hex": { - description: "Converts the input string to hexadecimal bytes separated by the specified delimiter.

e.g. The UTF-8 encoded string Γειά σου becomes ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a", - run: ByteRepr.run_to_hex, - highlight: ByteRepr.highlight_to, - highlight_reverse: ByteRepr.highlight_from, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.HEX_DELIM_OPTIONS - } - ] - }, - "From Charcode": { - description: "Converts unicode character codes back into text.

e.g. 0393 03b5 03b9 03ac 20 03c3 03bf 03c5 becomes Γειά σου", - run: ByteRepr.run_from_charcode, - highlight: ByteRepr.highlight_from, - highlight_reverse: ByteRepr.highlight_to, - input_type: "string", - output_type: "byte_array", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.DELIM_OPTIONS - }, - { - name: "Base", - type: "number", - value: ByteRepr.CHARCODE_BASE - } - ] - }, - "To Charcode": { - description: "Converts text to its unicode character code equivalent.

e.g. Γειά σου becomes 0393 03b5 03b9 03ac 20 03c3 03bf 03c5", - run: ByteRepr.run_to_charcode, - highlight: ByteRepr.highlight_to, - highlight_reverse: ByteRepr.highlight_from, - input_type: "string", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.DELIM_OPTIONS - }, - { - name: "Base", - type: "number", - value: ByteRepr.CHARCODE_BASE - } - ] - }, - "From Binary": { - description: "Converts a binary string back into its raw form.

e.g. 01001000 01101001 becomes Hi", - run: ByteRepr.run_from_binary, - highlight: ByteRepr.highlight_from_binary, - highlight_reverse: ByteRepr.highlight_to_binary, - input_type: "string", - output_type: "byte_array", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.BIN_DELIM_OPTIONS - } - ] - }, - "To Binary": { - description: "Displays the input data as a binary string.

e.g. Hi becomes 01001000 01101001", - run: ByteRepr.run_to_binary, - highlight: ByteRepr.highlight_to_binary, - highlight_reverse: ByteRepr.highlight_from_binary, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.BIN_DELIM_OPTIONS - } - ] - }, - "From Decimal": { - description: "Converts the data from an ordinal integer array back into its raw form.

e.g. 72 101 108 108 111 becomes Hello", - run: ByteRepr.run_from_decimal, - input_type: "string", - output_type: "byte_array", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.DELIM_OPTIONS - } - ] - }, - "To Decimal": { - description: "Converts the input data to an ordinal integer array.

e.g. Hello becomes 72 101 108 108 111", - run: ByteRepr.run_to_decimal, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: ByteRepr.DELIM_OPTIONS - } - ] - }, - "From Hexdump": { - description: "Attempts to convert a hexdump back into raw data. This operation supports many different hexdump variations, but probably not all. Make sure you verify that the data it gives you is correct before continuing analysis.", - run: Hexdump.run_from, - highlight: Hexdump.highlight_from, - highlight_reverse: Hexdump.highlight_to, - input_type: "string", - output_type: "byte_array", - args: [] - }, - "To Hexdump": { - description: "Creates a hexdump of the input data, displaying both the hexademinal values of each byte and an ASCII representation alongside.", - run: Hexdump.run_to, - highlight: Hexdump.highlight_to, - highlight_reverse: Hexdump.highlight_from, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Width", - type: "number", - value: Hexdump.WIDTH - }, - { - name: "Upper case hex", - type: "boolean", - value: Hexdump.UPPER_CASE - }, - { - name: "Include final length", - type: "boolean", - value: Hexdump.INCLUDE_FINAL_LENGTH - } - ] - }, - "From Base": { - description: "Converts a number to decimal from a given numerical base.", - run: Base.run_from, - input_type: "string", - output_type: "number", - args: [ - { - name: "Radix", - type: "number", - value: Base.DEFAULT_RADIX - } - ] - }, - "To Base": { - description: "Converts a decimal number to a given numerical base.", - run: Base.run_to, - input_type: "number", - output_type: "string", - args: [ - { - name: "Radix", - type: "number", - value: Base.DEFAULT_RADIX - } - ] - }, - "From HTML Entity": { - description: "Converts HTML entities back to characters

e.g. &amp; becomes &", // tags required to stop the browser just printing & - run: HTML.run_from_entity, - input_type: "string", - output_type: "string", - args: [] - }, - "To HTML Entity": { - description: "Converts characters to HTML entities

e.g. & becomes &amp;", // tags required to stop the browser just printing & - run: HTML.run_to_entity, - input_type: "string", - output_type: "string", - args: [ - { - name: "Convert all characters", - type: "boolean", - value: HTML.CONVERT_ALL - }, - { - name: "Convert to", - type: "option", - value: HTML.CONVERT_OPTIONS - } - ] - }, - "Strip HTML tags": { - description: "Removes all HTML tags from the input.", - run: HTML.run_strip_tags, - input_type: "string", - output_type: "string", - args: [ - { - name: "Remove indentation", - type: "boolean", - value: HTML.REMOVE_INDENTATION - }, - { - name: "Remove excess line breaks", - type: "boolean", - value: HTML.REMOVE_LINE_BREAKS - } - ] - }, - "URL Decode": { - description: "Converts URI/URL percent-encoded characters back to their raw values.

e.g. %3d becomes =", - run: URL_.run_from, - input_type: "string", - output_type: "string", - args: [] - }, - "URL Encode": { - description: "Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.

e.g. = becomes %3d", - run: URL_.run_to, - input_type: "string", - output_type: "string", - args: [ - { - name: "Encode all special chars", - type: "boolean", - value: URL_.ENCODE_ALL - } - ] - }, - "Parse URI": { - description: "Pretty prints complicated Uniform Resource Identifier (URI) strings for ease of reading. Particularly useful for Uniform Resource Locators (URLs) with a lot of arguments.", - run: URL_.run_parse, - input_type: "string", - output_type: "string", - args: [] - }, - "Unescape Unicode Characters": { - description: "Converts unicode-escaped character notation back into raw characters.

Supports the prefixes:
  • \\u
  • %u
  • U+
e.g. \\u03c3\\u03bf\\u03c5 becomes σου", - run: Unicode.run_unescape, - input_type: "string", - output_type: "string", - args: [ - { - name: "Prefix", - type: "option", - value: Unicode.PREFIXES - } - ] - }, - "From Quoted Printable": { - description: "Converts QP-encoded text back to standard text.", - run: QuotedPrintable.run_from, - input_type: "string", - output_type: "byte_array", - args: [] - }, - "To Quoted Printable": { - description: "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.", - run: QuotedPrintable.run_to, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "From Punycode": { - description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

e.g. mnchen-3ya decodes to münchen", - run: Punycode.run_to_unicode, - input_type: "string", - output_type: "string", - args: [ - { - name: "Internationalised domain name", - type: "boolean", - value: Punycode.IDN - } - ] - }, - "To Punycode": { - description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

e.g. münchen encodes to mnchen-3ya", - run: Punycode.run_to_ascii, - input_type: "string", - output_type: "string", - args: [ - { - name: "Internationalised domain name", - type: "boolean", - value: Punycode.IDN - } - ] - }, - "From Hex Content": { - description: "Translates hexadecimal bytes in text back to raw bytes.

e.g. foo|3d|bar becomes foo=bar.", - run: ByteRepr.run_from_hex_content, - input_type: "string", - output_type: "byte_array", - args: [] - }, - "To Hex Content": { - description: "Converts special characters in a string to hexadecimal.

e.g. foo=bar becomes foo|3d|bar.", - run: ByteRepr.run_to_hex_content, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Convert", - type: "option", - value: ByteRepr.HEX_CONTENT_CONVERT_WHICH - }, - { - name: "Print spaces between bytes", - type: "boolean", - value: ByteRepr.HEX_CONTENT_SPACES_BETWEEN_BYTES - }, - ] - }, - "Change IP format": { - description: "Convert an IP address from one format to another, e.g. 172.20.23.54 to ac141736", - run: IP.run_change_ip_format, - input_type: "string", - output_type: "string", - args: [ - { - name: "Input format", - type: "option", - value: IP.IP_FORMAT_LIST - }, - { - name: "Output format", - type: "option", - value: IP.IP_FORMAT_LIST - } - ] - }, - "Parse IP range": { - description: "Given a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0), this operation provides network information and enumerates all IP addresses in the range.

IPv6 is supported but will not be enumerated.", - run: IP.run_parse_ip_range, - input_type: "string", - output_type: "string", - args: [ - { - name: "Include network info", - type: "boolean", - value: IP.INCLUDE_NETWORK_INFO - }, - { - name: "Enumerate IP addresses", - type: "boolean", - value: IP.ENUMERATE_ADDRESSES - }, - { - name: "Allow large queries", - type: "boolean", - value: IP.ALLOW_LARGE_LIST - } - ] - }, - "Group IP addresses": { - description: "Groups a list of IP addresses into subnets. Supports both IPv4 and IPv6 addresses.", - run: IP.run_group_ips, - input_type: "string", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: IP.DELIM_OPTIONS - }, - { - name: "Subnet (CIDR)", - type: "number", - value: IP.GROUP_CIDR - }, - { - name: "Only show the subnets", - type: "boolean", - value: IP.GROUP_ONLY_SUBNET - } - ] - }, - "Parse IPv6 address": { - description: "Displays the longhand and shorthand versions of a valid IPv6 address.

Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.", - run: IP.run_parse_ipv6, - input_type: "string", - output_type: "string", - args: [] - }, - "Text encoding": { - description: "Translates the data between different character encodings.

Supported charsets are:
  • UTF8
  • UTF16
  • UTF16LE (little-endian)
  • UTF16BE (big-endian)
  • Hex
  • Base64
  • Latin1 (ISO-8859-1)
  • Windows-1251
", - run: CharEnc.run, - input_type: "string", - output_type: "string", - args: [ - { - name: "Input type", - type: "option", - value: CharEnc.IO_FORMAT - }, - { - name: "Output type", - type: "option", - value: CharEnc.IO_FORMAT - }, - ] - }, - "AES Decrypt": { - description: "To successfully decrypt AES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 16 bytes of encrypted material.", - run: Cipher.run_aes_dec, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT2 - }, - ] - }, - "AES Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

AES-128, AES-192, and AES-256 are supported. The variant will be chosen based on the size of the key passed in. If a passphrase is used, a 256-bit key will be generated.", - run: Cipher.run_aes_enc, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Output result", - type: "option", - value: Cipher.RESULT_TYPE - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - ] - }, - "DES Decrypt": { - description: "To successfully decrypt DES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 8 bytes of encrypted material.", - run: Cipher.run_des_dec, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT2 - }, - ] - }, - "DES Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.", - run: Cipher.run_des_enc, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Output result", - type: "option", - value: Cipher.RESULT_TYPE - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - ] - }, - "Triple DES Decrypt": { - description: "To successfully decrypt Triple DES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 8 bytes of encrypted material.", - run: Cipher.run_triple_des_dec, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT2 - }, - ] - }, - "Triple DES Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Triple DES applies DES three times to each block to increase key size.", - run: Cipher.run_triple_des_enc, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Output result", - type: "option", - value: Cipher.RESULT_TYPE - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - ] - }, - "Blowfish Decrypt": { - description: "Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.", - run: Cipher.run_blowfish_dec, - input_type: "string", - output_type: "string", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "Mode", - type: "option", - value: Cipher.BLOWFISH_MODES - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT3 - }, - ] - }, - "Blowfish Encrypt": { - description: "Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.", - run: Cipher.run_blowfish_enc, - input_type: "string", - output_type: "string", - args: [ - { - name: "Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "Mode", - type: "option", - value: Cipher.BLOWFISH_MODES - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT3 - }, - ] - }, - "Rabbit Decrypt": { - description: "To successfully decrypt Rabbit, you need either:
  • The passphrase
  • Or the key and IV (This is currently broken. You need the key and salt at the moment.)
The IV should be the first 8 bytes of encrypted material.", - run: Cipher.run_rabbit_dec, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT2 - }, - ] - }, - "Rabbit Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2 year process where 22 designs were evaluated.", - run: Cipher.run_rabbit_enc, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase/Key", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "IV", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - - }, - { - name: "Salt", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT1 - }, - { - name: "Mode", - type: "option", - value: Cipher.MODES - }, - { - name: "Padding", - type: "option", - value: Cipher.PADDING - }, - { - name: "Output result", - type: "option", - value: Cipher.RESULT_TYPE - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT1 - }, - ] - }, - "RC4": { - description: "RC4 is a widely-used stream cipher. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.", - run: Cipher.run_rc4, - highlight: true, - highlight_reverse: true, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT4 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT4 - }, - ] - }, - "RC4 Drop": { - description: "It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.", - run: Cipher.run_rc4drop, - highlight: true, - highlight_reverse: true, - input_type: "string", - output_type: "string", - args: [ - { - name: "Passphrase", - type: "toggle_string", - value: "", - toggle_values: Cipher.IO_FORMAT2 - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT4 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT4 - }, - { - name: "Number of bytes to drop", - type: "number", - value: Cipher.RC4DROP_BYTES - }, - ] - }, - "Derive PBKDF2 key": { - description: "PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

Enter your passphrase as the input and then set the relevant options to generate a key.", - run: Cipher.run_pbkdf2, - input_type: "string", - output_type: "string", - args: [ - { - name: "Key size", - type: "number", - value: Cipher.KDF_KEY_SIZE - }, - { - name: "Iterations", - type: "number", - value: Cipher.KDF_ITERATIONS - }, - { - name: "Salt (hex)", - type: "string", - value: "" - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT2 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT3 - }, - ] - }, - "Derive EVP key": { - description: "EVP is a password-based key derivation function used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

Enter your passphrase as the input and then set the relevant options to generate a key.", - run: Cipher.run_evpkdf, - input_type: "string", - output_type: "string", - args: [ - { - name: "Key size", - type: "number", - value: Cipher.KDF_KEY_SIZE - }, - { - name: "Iterations", - type: "number", - value: Cipher.KDF_ITERATIONS - }, - { - name: "Salt (hex)", - type: "string", - value: "" - }, - { - name: "Input format", - type: "option", - value: Cipher.IO_FORMAT2 - }, - { - name: "Output format", - type: "option", - value: Cipher.IO_FORMAT3 - }, - ] - }, - "Rotate right": { - description: "Rotates each byte to the right by the number of bits specified. Currently only supports 8-bit values.", - run: Rotate.run_rotr, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Number of bits", - type: "number", - value: Rotate.ROTATE_AMOUNT - }, - { - name: "Rotate as a whole", - type: "boolean", - value: Rotate.ROTATE_WHOLE - } - ] - }, - "Rotate left": { - description: "Rotates each byte to the left by the number of bits specified. Currently only supports 8-bit values.", - run: Rotate.run_rotl, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Number of bits", - type: "number", - value: Rotate.ROTATE_AMOUNT - }, - { - name: "Rotate as a whole", - type: "boolean", - value: Rotate.ROTATE_WHOLE - } - ] - }, - "ROT13": { - description: "A simple caesar substitution cipher which rotates alphabet characters by the specified amount (default 13).", - run: Rotate.run_rot13, - highlight: true, - highlight_reverse: true, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Rotate lower case chars", - type: "boolean", - value: Rotate.ROT13_LOWERCASE - }, - { - name: "Rotate upper case chars", - type: "boolean", - value: Rotate.ROT13_UPPERCASE - }, - { - name: "Amount", - type: "number", - value: Rotate.ROT13_AMOUNT - }, - ] - }, - "Strip HTTP headers": { - description: "Removes HTTP headers from a request or response by looking for the first instance of a double newline.", - run: HTTP.run_strip_headers, - input_type: "string", - output_type: "string", - args: [] - }, - "Parse User Agent": { - description: "Attempts to identify and categorise information contained in a user-agent string.", - run: HTTP.run_parse_user_agent, - input_type: "string", - output_type: "string", - args: [] - }, - "Format MAC addresses": { - description: "Displays given MAC addresses in multiple different formats.

Expects addresses in a list separated by newlines, spaces or commas.

WARNING: There are no validity checks.", - run: MAC.run_format, - input_type: "string", - output_type: "string", - args: [ - { - name: "Output case", - type: "option", - value: MAC.OUTPUT_CASE - }, - { - name: "No delimiter", - type: "boolean", - value: MAC.NO_DELIM - }, - { - name: "Dash delimiter", - type: "boolean", - value: MAC.DASH_DELIM - }, - { - name: "Colon delimiter", - type: "boolean", - value: MAC.COLON_DELIM - }, - { - name: "Cisco style", - type: "boolean", - value: MAC.CISCO_STYLE - } - ] - }, - "Offset checker": { - description: "Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.", - run: StrUtils.run_offset_checker, - input_type: "string", - output_type: "html", - args: [ - { - name: "Sample delimiter", - type: "binary_string", - value: StrUtils.OFF_CHK_SAMPLE_DELIMITER - } - ] - }, - "Remove whitespace": { - description: "Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.

This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.", - run: Tidy.run_remove_whitespace, - input_type: "string", - output_type: "string", - args: [ - { - name: "Spaces", - type: "boolean", - value: Tidy.REMOVE_SPACES - }, - { - name: "Carriage returns (\\r)", - type: "boolean", - value: Tidy.REMOVE_CARIAGE_RETURNS - }, - { - name: "Line feeds (\\n)", - type: "boolean", - value: Tidy.REMOVE_LINE_FEEDS - }, - { - name: "Tabs", - type: "boolean", - value: Tidy.REMOVE_TABS - }, - { - name: "Form feeds (\\f)", - type: "boolean", - value: Tidy.REMOVE_FORM_FEEDS - }, - { - name: "Full stops", - type: "boolean", - value: Tidy.REMOVE_FULL_STOPS - } - ] - }, - "Remove null bytes": { - description: "Removes all null bytes (0x00) from the input.", - run: Tidy.run_remove_nulls, - input_type: "byte_array", - output_type: "byte_array", - args: [] - }, - "Drop bytes": { - description: "Cuts the specified number of bytes out of the data.", - run: Tidy.run_drop_bytes, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Start", - type: "number", - value: Tidy.DROP_START - }, - { - name: "Length", - type: "number", - value: Tidy.DROP_LENGTH - }, - { - name: "Apply to each line", - type: "boolean", - value: Tidy.APPLY_TO_EACH_LINE - } - ] - }, - "Take bytes": { - description: "Takes a slice of the specified number of bytes from the data.", - run: Tidy.run_take_bytes, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Start", - type: "number", - value: Tidy.TAKE_START - }, - { - name: "Length", - type: "number", - value: Tidy.TAKE_LENGTH - }, - { - name: "Apply to each line", - type: "boolean", - value: Tidy.APPLY_TO_EACH_LINE - } - ] - }, - "Pad lines": { - description: "Add the specified number of the specified character to the beginning or end of each line", - run: Tidy.run_pad, - input_type: "string", - output_type: "string", - args: [ - { - name: "Position", - type: "option", - value: Tidy.PAD_POSITION - }, - { - name: "Length", - type: "number", - value: Tidy.PAD_LENGTH - }, - { - name: "Character", - type: "binary_short_string", - value: Tidy.PAD_CHAR - } - ] - }, - "Reverse": { - description: "Reverses the input string.", - run: SeqUtils.run_reverse, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "By", - type: "option", - value: SeqUtils.REVERSE_BY - } - ] - }, - "Sort": { - description: "Alphabetically sorts strings separated by the specified delimiter.

The IP address option supports IPv4 only.", - run: SeqUtils.run_sort, - input_type: "string", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: SeqUtils.DELIMITER_OPTIONS - }, - { - name: "Reverse", - type: "boolean", - value: SeqUtils.SORT_REVERSE - }, - { - name: "Order", - type: "option", - value: SeqUtils.SORT_ORDER - } - ] - }, - "Unique": { - description: "Removes duplicate strings from the input.", - run: SeqUtils.run_unique, - input_type: "string", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "option", - value: SeqUtils.DELIMITER_OPTIONS - } - ] - }, - "Count occurrences": { - description: "Counts the number of times the provided string occurs in the input.", - run: SeqUtils.run_count, - input_type: "string", - output_type: "number", - args: [ - { - name: "Search string", - type: "toggle_string", - value: "", - toggle_values: SeqUtils.SEARCH_TYPE - } - ] - }, - "Add line numbers": { - description: "Adds line numbers to the output.", - run: SeqUtils.run_add_line_numbers, - input_type: "string", - output_type: "string", - args: [] - }, - "Remove line numbers": { - description: "Removes line numbers from the output if they can be trivially detected.", - run: SeqUtils.run_remove_line_numbers, - input_type: "string", - output_type: "string", - args: [] - }, - "Find / Replace": { - description: "Replaces all occurrences of the first string with the second.

The three match options are only relevant to regex search strings.", - run: StrUtils.run_find_replace, - manual_bake: true, - input_type: "string", - output_type: "string", - args: [ - { - name: "Find", - type: "toggle_string", - value: "", - toggle_values: StrUtils.SEARCH_TYPE - }, - { - name: "Replace", - type: "binary_string", - value: "" - }, - { - name: "Global match", - type: "boolean", - value: StrUtils.FIND_REPLACE_GLOBAL, - }, - { - name: "Case insensitive", - type: "boolean", - value: StrUtils.FIND_REPLACE_CASE, - }, - { - name: "Multiline matching", - type: "boolean", - value: StrUtils.FIND_REPLACE_MULTILINE, - }, - - ] - }, - "To Upper case": { - description: "Converts the input string to upper case, optionally limiting scope to only the first character in each word, sentence or paragraph.", - run: StrUtils.run_upper, - highlight: true, - highlight_reverse: true, - input_type: "string", - output_type: "string", - args: [ - { - name: "Scope", - type: "option", - value: StrUtils.CASE_SCOPE - } - ] - }, - "To Lower case": { - description: "Converts every character in the input to lower case.", - run: StrUtils.run_lower, - highlight: true, - highlight_reverse: true, - input_type: "string", - output_type: "string", - args: [] - }, - "Split": { - description: "Splits a string into sections around a given delimiter.", - run: StrUtils.run_split, - input_type: "string", - output_type: "string", - args: [ - { - name: "Split delimiter", - type: "binary_short_string", - value: StrUtils.SPLIT_DELIM - }, - { - name: "Join delimiter", - type: "option", - value: StrUtils.DELIMITER_OPTIONS - } - ] - }, - "Strings": { - description: "Extracts all strings from the input.", - run: Extract.run_strings, - input_type: "string", - output_type: "string", - args: [ - { - name: "Minimum length", - type: "number", - value: Extract.MIN_STRING_LEN - }, - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract IP addresses": { - description: "Extracts all IPv4 and IPv6 addresses.

Warning: Given a string 710.65.0.456, this will match 10.65.0.45 so always check the original input!", - run: Extract.run_ip, - input_type: "string", - output_type: "string", - args: [ - { - name: "IPv4", - type: "boolean", - value: Extract.INCLUDE_IPV4 - }, - { - name: "IPv6", - type: "boolean", - value: Extract.INCLUDE_IPV6 - }, - { - name: "Remove local IPv4 addresses", - type: "boolean", - value: Extract.REMOVE_LOCAL - }, - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract email addresses": { - description: "Extracts all email addresses from the input.", - run: Extract.run_email, - input_type: "string", - output_type: "string", - args: [ - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract MAC addresses": { - description: "Extracts all Media Access Control (MAC) addresses from the input.", - run: Extract.run_mac, - input_type: "string", - output_type: "string", - args: [ - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract URLs": { - description: "Extracts Uniform Resource Locators (URLs) from the input. The protocol (http, ftp etc.) is required otherwise there will be far too many false positives.", - run: Extract.run_urls, - input_type: "string", - output_type: "string", - args: [ - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract domains": { - description: "Extracts domain names with common Top-Level Domains (TLDs).
Note that this will not include paths. Use Extract URLs to find entire URLs.", - run: Extract.run_domains, - input_type: "string", - output_type: "string", - args: [ - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract file paths": { - description: "Extracts anything that looks like a Windows or UNIX file path.

Note that if UNIX is selected, there will likely be a lot of false positives.", - run: Extract.run_file_paths, - input_type: "string", - output_type: "string", - args: [ - { - name: "Windows", - type: "boolean", - value: Extract.INCLUDE_WIN_PATH - }, - { - name: "UNIX", - type: "boolean", - value: Extract.INCLUDE_UNIX_PATH - }, - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Extract dates": { - description: "Extracts dates in the following formats
  • yyyy-mm-dd
  • dd/mm/yyyy
  • mm/dd/yyyy
Dividers can be any of /, -, . or space", - run: Extract.run_dates, - input_type: "string", - output_type: "string", - args: [ - { - name: "Display total", - type: "boolean", - value: Extract.DISPLAY_TOTAL - } - ] - }, - "Regular expression": { - description: "Define your own regular expression to search the input data with, optionally choosing from a list of pre-defined patterns.", - run: StrUtils.run_regex, - manual_bake: true, - input_type: "string", - output_type: "html", - args: [ - { - name: "Built in regexes", - type: "populate_option", - value: StrUtils.REGEX_PRE_POPULATE, - target: 1, - }, - { - name: "Regex", - type: "text", - value: "" - }, - { - name: "Case insensitive", - type: "boolean", - value: StrUtils.REGEX_CASE_INSENSITIVE - }, - { - name: "Multiline matching", - type: "boolean", - value: StrUtils.REGEX_MULTILINE_MATCHING - }, - { - name: "Display total", - type: "boolean", - value: StrUtils.DISPLAY_TOTAL - }, - { - name: "Output format", - type: "option", - value: StrUtils.OUTPUT_FORMAT - }, - ] - }, - "From UNIX Timestamp": { - description: "Converts a UNIX timestamp to a datetime string.

e.g. 978346800 becomes Mon 1 January 2001 11:00:00 UTC", - run: DateTime.run_from_unix_timestamp, - input_type: "number", - output_type: "string", - args: [ - { - name: "Units", - type: "option", - value: DateTime.UNITS - } - ] - }, - "To UNIX Timestamp": { - description: "Parses a datetime string and returns the corresponding UNIX timestamp.

e.g. Mon 1 January 2001 11:00:00 UTC becomes 978346800", - run: DateTime.run_to_unix_timestamp, - input_type: "string", - output_type: "number", - args: [ - { - name: "Units", - type: "option", - value: DateTime.UNITS - } - ] - }, - "Translate DateTime Format": { - description: "Parses a datetime string in one format and re-writes it in another.

Run with no input to see the relevant format string examples.", - run: DateTime.run_translate_format, - input_type: "string", - output_type: "html", - args: [ - { - name: "Built in formats", - type: "populate_option", - value: DateTime.DATETIME_FORMATS, - target: 1 - }, - { - name: "Input format string", - type: "binary_string", - value: DateTime.INPUT_FORMAT_STRING - }, - { - name: "Input timezone", - type: "option", - value: DateTime.TIMEZONES - }, - { - name: "Output format string", - type: "binary_string", - value: DateTime.OUTPUT_FORMAT_STRING - }, - { - name: "Output timezone", - type: "option", - value: DateTime.TIMEZONES - } - ] - }, - "Parse DateTime": { - description: "Parses a DateTime string in your specified format and displays it in whichever timezone you choose with the following information:
  • Date
  • Time
  • Period (AM/PM)
  • Timezone
  • UTC offset
  • Daylight Saving Time
  • Leap year
  • Days in this month
  • Day of year
  • Week number
  • Quarter
Run with no input to see format string examples if required.", - run: DateTime.run_parse, - input_type: "string", - output_type: "html", - args: [ - { - name: "Built in formats", - type: "populate_option", - value: DateTime.DATETIME_FORMATS, - target: 1 - }, - { - name: "Input format string", - type: "binary_string", - value: DateTime.INPUT_FORMAT_STRING - }, - { - name: "Input timezone", - type: "option", - value: DateTime.TIMEZONES - }, - ] - }, - "Convert distance": { - description: "Converts a unit of distance to another format.", - run: Convert.run_distance, - input_type: "number", - output_type: "number", - args: [ - { - name: "Input units", - type: "option", - value: Convert.DISTANCE_UNITS - }, - { - name: "Output units", - type: "option", - value: Convert.DISTANCE_UNITS - } - ] - }, - "Convert area": { - description: "Converts a unit of area to another format.", - run: Convert.run_area, - input_type: "number", - output_type: "number", - args: [ - { - name: "Input units", - type: "option", - value: Convert.AREA_UNITS - }, - { - name: "Output units", - type: "option", - value: Convert.AREA_UNITS - } - ] - }, - "Convert mass": { - description: "Converts a unit of mass to another format.", - run: Convert.run_mass, - input_type: "number", - output_type: "number", - args: [ - { - name: "Input units", - type: "option", - value: Convert.MASS_UNITS - }, - { - name: "Output units", - type: "option", - value: Convert.MASS_UNITS - } - ] - }, - "Convert speed": { - description: "Converts a unit of speed to another format.", - run: Convert.run_speed, - input_type: "number", - output_type: "number", - args: [ - { - name: "Input units", - type: "option", - value: Convert.SPEED_UNITS - }, - { - name: "Output units", - type: "option", - value: Convert.SPEED_UNITS - } - ] - }, - "Convert data units": { - description: "Converts a unit of data to another format.", - run: Convert.run_data_size, - input_type: "number", - output_type: "number", - args: [ - { - name: "Input units", - type: "option", - value: Convert.DATA_UNITS - }, - { - name: "Output units", - type: "option", - value: Convert.DATA_UNITS - } - ] - }, - "Raw Deflate": { - description: "Compresses data using the deflate algorithm with no headers.", - run: Compress.run_raw_deflate, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Compression type", - type: "option", - value: Compress.COMPRESSION_TYPE - } - ] - }, - "Raw Inflate": { - description: "Decompresses data which has been compressed using the deflate algorithm with no headers.", - run: Compress.run_raw_inflate, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Start index", - type: "number", - value: Compress.INFLATE_INDEX - }, - { - name: "Initial output buffer size", - type: "number", - value: Compress.INFLATE_BUFFER_SIZE - }, - { - name: "Buffer expansion type", - type: "option", - value: Compress.INFLATE_BUFFER_TYPE - }, - { - name: "Resize buffer after decompression", - type: "boolean", - value: Compress.INFLATE_RESIZE - }, - { - name: "Verify result", - type: "boolean", - value: Compress.INFLATE_VERIFY - } - ] - }, - "Zlib Deflate": { - description: "Compresses data using the deflate algorithm adding zlib headers.", - run: Compress.run_zlib_deflate, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Compression type", - type: "option", - value: Compress.COMPRESSION_TYPE - } - ] - }, - "Zlib Inflate": { - description: "Decompresses data which has been compressed using the deflate algorithm with zlib headers.", - run: Compress.run_zlib_inflate, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Start index", - type: "number", - value: Compress.INFLATE_INDEX - }, - { - name: "Initial output buffer size", - type: "number", - value: Compress.INFLATE_BUFFER_SIZE - }, - { - name: "Buffer expansion type", - type: "option", - value: Compress.INFLATE_BUFFER_TYPE - }, - { - name: "Resize buffer after decompression", - type: "boolean", - value: Compress.INFLATE_RESIZE - }, - { - name: "Verify result", - type: "boolean", - value: Compress.INFLATE_VERIFY - } - ] - }, - "Gzip": { - description: "Compresses data using the deflate algorithm with gzip headers.", - run: Compress.run_gzip, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Compression type", - type: "option", - value: Compress.COMPRESSION_TYPE - }, - { - name: "Filename (optional)", - type: "string", - value: "" - }, - { - name: "Comment (optional)", - type: "string", - value: "" - }, - { - name: "Include file checksum", - type: "boolean", - value: Compress.GZIP_CHECKSUM - } - ] - }, - "Gunzip": { - description: "Decompresses data which has been compressed using the deflate algorithm with gzip headers.", - run: Compress.run_gunzip, - input_type: "byte_array", - output_type: "byte_array", - args: [] - }, - "Zip": { - description: "Compresses data using the PKZIP algorithm with the given filename.

No support for multiple files at this time.", - run: Compress.run_pkzip, - input_type: "byte_array", - output_type: "byte_array", - args: [ - { - name: "Filename", - type: "string", - value: Compress.PKZIP_FILENAME - }, - { - name: "Comment", - type: "string", - value: "" - }, - { - name: "Password", - type: "binary_string", - value: "" - }, - { - name: "Compression method", - type: "option", - value: Compress.COMPRESSION_METHOD - }, - { - name: "Operating system", - type: "option", - value: Compress.OS - }, - { - name: "Compression type", - type: "option", - value: Compress.COMPRESSION_TYPE - } - ] - }, - "Unzip": { - description: "Decompresses data using the PKZIP algorithm and displays it per file, with support for passwords.", - run: Compress.run_pkunzip, - input_type: "byte_array", - output_type: "html", - args: [ - { - name: "Password", - type: "binary_string", - value: "" - }, - { - name: "Verify result", - type: "boolean", - value: Compress.PKUNZIP_VERIFY - } - ] - }, - "Bzip2 Decompress": { - description: "Decompresses data using the Bzip2 algorithm.", - run: Compress.run_bzip2_decompress, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "Generic Code Beautify": { - description: "Attempts to pretty print C-style languages such as C, C++, C#, Java, PHP, JavaScript etc.

This will not do a perfect job, and the resulting code may not work any more. This operation is designed purely to make obfuscated or minified code more easy to read and understand.

Things which will not work properly:
  • For loop formatting
  • Do-While loop formatting
  • Switch/Case indentation
  • Certain bit shift operators
", - run: Code.run_generic_beautify, - input_type: "string", - output_type: "string", - args: [] - }, - "JavaScript Parser": { - description: "Returns an Abstract Syntax Tree for valid JavaScript code.", - run: JS.run_parse, - input_type: "string", - output_type: "string", - args: [ - { - name: "Location info", - type: "boolean", - value: JS.PARSE_LOC - }, - { - name: "Range info", - type: "boolean", - value: JS.PARSE_RANGE - }, - { - name: "Include tokens array", - type: "boolean", - value: JS.PARSE_TOKENS - }, - { - name: "Include comments array", - type: "boolean", - value: JS.PARSE_COMMENT - }, - { - name: "Report errors and try to continue", - type: "boolean", - value: JS.PARSE_TOLERANT - }, - ] - }, - "JavaScript Beautify": { - description: "Parses and pretty prints valid JavaScript code. Also works with JavaScript Object Notation (JSON).", - run: JS.run_beautify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Indent string", - type: "binary_short_string", - value: JS.BEAUTIFY_INDENT - }, - { - name: "Quotes", - type: "option", - value: JS.BEAUTIFY_QUOTES - }, - { - name: "Semicolons before closing braces", - type: "boolean", - value: JS.BEAUTIFY_SEMICOLONS - }, - { - name: "Include comments", - type: "boolean", - value: JS.BEAUTIFY_COMMENT - }, - ] - }, - "JavaScript Minify": { - description: "Compresses JavaScript code.", - run: JS.run_minify, - input_type: "string", - output_type: "string", - args: [] - }, - "XML Beautify": { - description: "Indents and prettifies eXtensible Markup Language (XML) code.", - run: Code.run_xml_beautify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Indent string", - type: "binary_short_string", - value: Code.BEAUTIFY_INDENT - } - ] - }, - "JSON Beautify": { - description: "Indents and prettifies JavaScript Object Notation (JSON) code.", - run: Code.run_json_beautify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Indent string", - type: "binary_short_string", - value: Code.BEAUTIFY_INDENT - } - ] - }, - "CSS Beautify": { - description: "Indents and prettifies Cascading Style Sheets (CSS) code.", - run: Code.run_css_beautify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Indent string", - type: "binary_short_string", - value: Code.BEAUTIFY_INDENT - } - ] - }, - "SQL Beautify": { - description: "Indents and prettifies Structured Query Language (SQL) code.", - run: Code.run_sql_beautify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Indent string", - type: "binary_short_string", - value: Code.BEAUTIFY_INDENT - } - ] - }, - "XML Minify": { - description: "Compresses eXtensible Markup Language (XML) code.", - run: Code.run_xml_minify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Preserve comments", - type: "boolean", - value: Code.PRESERVE_COMMENTS - } - ] - }, - "JSON Minify": { - description: "Compresses JavaScript Object Notation (JSON) code.", - run: Code.run_json_minify, - input_type: "string", - output_type: "string", - args: [] - }, - "CSS Minify": { - description: "Compresses Cascading Style Sheets (CSS) code.", - run: Code.run_css_minify, - input_type: "string", - output_type: "string", - args: [ - { - name: "Preserve comments", - type: "boolean", - value: Code.PRESERVE_COMMENTS - } - ] - }, - "SQL Minify": { - description: "Compresses Structured Query Language (SQL) code.", - run: Code.run_sql_minify, - input_type: "string", - output_type: "string", - args: [] - }, - "Analyse hash": { - description: "Tries to determine information about a given hash and suggests which algorithm may have been used to generate it based on its length.", - run: Hash.run_analyse, - input_type: "string", - output_type: "string", - args: [] - }, - "MD5": { - description: "MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.

However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.", - run: Hash.run_md5, - input_type: "string", - output_type: "string", - args: [] - }, - "SHA1": { - description: "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.

However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.", - run: Hash.run_sha1, - input_type: "string", - output_type: "string", - args: [] - }, - "SHA224": { - description: "SHA-224 is largely identical to SHA-256 but is truncated to 224 bytes.", - run: Hash.run_sha224, - input_type: "string", - output_type: "string", - args: [] - }, - "SHA256": { - description: "SHA-256 is one of the four variants in the SHA-2 set. It isn't as widely used as SHA-1, though it provides much better security.", - run: Hash.run_sha256, - input_type: "string", - output_type: "string", - args: [] - }, - "SHA384": { - description: "SHA-384 is largely identical to SHA-512 but is truncated to 384 bytes.", - run: Hash.run_sha384, - input_type: "string", - output_type: "string", - args: [] - }, - "SHA512": { - description: "SHA-512 is largely identical to SHA-256 but operates on 64-bit words rather than 32.", - run: Hash.run_sha512, - input_type: "string", - output_type: "string", - args: [] - }, - "SHA3": { - description: "This is an implementation of Keccak[c=2d]. SHA3 functions based on different implementations of Keccak will give different results.", - run: Hash.run_sha3, - input_type: "string", - output_type: "string", - args: [ - { - name: "Output length", - type: "option", - value: Hash.SHA3_LENGTH - } - ] - }, - "RIPEMD-160": { - description: "RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.

RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.

RIPEMD-160 is an improved, 160-bit version of the original RIPEMD, and the most common version in the family.", - run: Hash.run_ripemd160, - input_type: "string", - output_type: "string", - args: [] - }, - "HMAC": { - description: "Keyed-Hash Message Authentication Codes (HMAC) are a mechanism for message authentication using cryptographic hash functions.", - run: Hash.run_hmac, - input_type: "string", - output_type: "string", - args: [ - { - name: "Password", - type: "binary_string", - value: "" - }, - { - name: "Hashing function", - type: "option", - value: Hash.HMAC_FUNCTIONS - }, - ] - }, - "Fletcher-16 Checksum": { - description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.", - run: Checksum.run_fletcher16, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "Adler-32 Checksum": { - description: "Adler-32 is a checksum algorithm which was invented by Mark Adler in 1995, and is a modification of the Fletcher checksum. Compared to a cyclic redundancy check of the same length, it trades reliability for speed (preferring the latter).

Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32.", - run: Checksum.run_adler32, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "CRC-32 Checksum": { - description: "A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.

The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of Ethernet and many other standards is the work of several researchers and was published in 1975.", - run: Checksum.run_crc32, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "Generate all hashes": { - description: "Generates all available hashes and checksums for the input.", - run: Hash.run_all, - input_type: "string", - output_type: "string", - args: [] - }, - "Entropy": { - description: "Calculates the Shannon entropy of the input data which gives an idea of its randomness. 8 is the maximum.", - run: Entropy.run_entropy, - input_type: "byte_array", - output_type: "html", - args: [ - { - name: "Chunk size", - type: "number", - value: Entropy.CHUNK_SIZE - } - ] - }, - "Frequency distribution": { - description: "Displays the distribution of bytes in the data as a graph.", - run: Entropy.run_freq_distrib, - input_type: "byte_array", - output_type: "html", - args: [ - { - name: "Show 0%'s", - type: "boolean", - value: Entropy.FREQ_ZEROS - } - ] - }, - "Numberwang": { - description: "Based on the popular gameshow by Mitchell and Webb.", - run: Numberwang.run, - input_type: "string", - output_type: "string", - args: [] - }, - "Parse X.509 certificate": { - description: "X.509 is an ITU-T standard for a public key infrastructure (PKI) and Privilege Management Infrastructure (PMI). It is commonly involved with SSL/TLS security.

This operation displays the contents of a certificate in a human readable format, similar to the openssl command line tool.", - run: PublicKey.run_parse_x509, - input_type: "string", - output_type: "string", - args: [ - { - name: "Input format", - type: "option", - value: PublicKey.X509_INPUT_FORMAT - } - ] - }, - "PEM to Hex": { - description: "Converts PEM (Privacy Enhanced Mail) format to a hexadecimal DER (Distinguished Encoding Rules) string.", - run: PublicKey.run_pem_to_hex, - input_type: "string", - output_type: "string", - args: [] - }, - "Hex to PEM": { - description: "Converts a hexadecimal DER (Distinguished Encoding Rules) string into PEM (Privacy Enhanced Mail) format.", - run: PublicKey.run_hex_to_pem, - input_type: "string", - output_type: "string", - args: [ - { - name: "Header string", - type: "string", - value: PublicKey.PEM_HEADER_STRING - } - ] - }, - "Hex to Object Identifier": { - description: "Converts a hexadecimal string into an object identifier (OID).", - run: PublicKey.run_hex_to_object_identifier, - input_type: "string", - output_type: "string", - args: [] - }, - "Object Identifier to Hex": { - description: "Converts an object identifier (OID) into a hexadecimal string.", - run: PublicKey.run_object_identifier_to_hex, - input_type: "string", - output_type: "string", - args: [] - }, - "Parse ASN.1 hex string": { - description: "Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.

This operation parses arbitrary ASN.1 data and presents the resulting tree.", - run: PublicKey.run_parse_asn1_hex_string, - input_type: "string", - output_type: "string", - args: [ - { - name: "Starting index", - type: "number", - value: 0 - }, - { - name: "Truncate octet strings longer than", - type: "number", - value: PublicKey.ASN1_TRUNCATE_LENGTH - } - ] - }, - "Detect File Type": { - description: "Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.

Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.", - run: FileType.run_detect, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "Scan for Embedded Files": { - description: "Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.

WARNING: Files over about 100KB in size will take a VERY long time to process.", - run: FileType.run_scan_for_embedded_files, - input_type: "byte_array", - output_type: "string", - args: [ - { - name: "Ignore common byte sequences", - type: "boolean", - value: FileType.IGNORE_COMMON_BYTE_SEQUENCES - } - ] - }, - "Expand alphabet range": { - description: "Expand an alphabet range string into a list of the characters in that range.

e.g. a-z becomes abcdefghijklmnopqrstuvwxyz.", - run: SeqUtils.run_expand_alph_range, - input_type: "string", - output_type: "string", - args: [ - { - name: "Delimiter", - type: "binary_string", - value: "" - } - ] - }, - "Diff": { - description: "Compares two inputs (separated by the specified delimiter) and highlights the differences between them.", - run: StrUtils.run_diff, - input_type: "string", - output_type: "html", - args: [ - { - name: "Sample delimiter", - type: "binary_string", - value: StrUtils.DIFF_SAMPLE_DELIMITER - }, - { - name: "Diff by", - type: "option", - value: StrUtils.DIFF_BY - }, - { - name: "Show added", - type: "boolean", - value: true - }, - { - name: "Show removed", - type: "boolean", - value: true - }, - { - name: "Ignore whitespace (relevant for word and line)", - type: "boolean", - value: false - } - ] - }, - "Parse UNIX file permissions": { - description: "Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.

Input should be in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.", - run: OS.run_parse_unix_perms, - input_type: "string", - output_type: "string", - args: [] - }, - "Swap endianness": { - description: "Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.", - run: Endian.run_swap_endianness, - highlight: true, - highlight_reverse: true, - input_type: "string", - output_type: "string", - args: [ - { - name: "Data format", - type: "option", - value: Endian.DATA_FORMAT - }, - { - name: "Word length (bytes)", - type: "number", - value: Endian.WORD_LENGTH - }, - { - name: "Pad incomplete words", - type: "boolean", - value: Endian.PAD_INCOMPLETE_WORDS - } - ] - }, - "Syntax highlighter": { - description: "Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.", - run: Code.run_syntax_highlight, - highlight: true, - highlight_reverse: true, - input_type: "string", - output_type: "html", - args: [ - { - name: "Language/File extension", - type: "option", - value: Code.LANGUAGES - }, - { - name: "Display line numbers", - type: "boolean", - value: Code.LINE_NUMS - } - ] - }, - "Parse escaped string": { - description: "Replaces escaped characters with the bytes they represent.

e.g.Hello\\nWorld becomes Hello
World
", - run: StrUtils.run_parse_escaped_string, - input_type: "string", - output_type: "string", - args: [] - }, - "TCP/IP Checksum": { - description: "Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.", - run: Checksum.run_tcp_ip, - input_type: "byte_array", - output_type: "string", - args: [] - }, - "Parse colour code": { - description: "Converts a colour code in a standard format to other standard formats and displays the colour itself.

Example inputs
  • #d9edf7
  • rgba(217,237,247,1)
  • hsla(200,65%,91%,1)
  • cmyk(0.12, 0.04, 0.00, 0.03)
", - run: HTML.run_parse_colour_code, - input_type: "string", - output_type: "html", - args: [] - }, - "Generate UUID": { - description: "Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).

A version 4 UUID relies on random numbers, in this case generated using window.crypto if available and falling back to Math.random if not.", - run: UUID.run_generate_v4, - input_type: "string", - output_type: "string", - args: [] - } -}; \ No newline at end of file +const OperationConfig = { + Fork: { + description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.

For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.", + run: FlowControl.run_fork, + input_type: 'string', + output_type: 'string', + flow_control: true, + args: [ + { + name: 'Split delimiter', + type: 'binary_short_string', + value: FlowControl.FORK_DELIM, + }, + { + name: 'Merge delimiter', + type: 'binary_short_string', + value: FlowControl.MERGE_DELIM, + }, + ], + }, + Merge: { + description: 'Consolidate all branches back into a single trunk. The opposite of Fork.', + run: FlowControl.run_merge, + input_type: 'string', + output_type: 'string', + flow_control: true, + args: [], + }, + Jump: { + description: 'Jump forwards or backwards over the specified number of operations.', + run: FlowControl.run_jump, + input_type: 'string', + output_type: 'string', + flow_control: true, + args: [ + { + name: 'Number of operations to jump over', + type: 'number', + value: FlowControl.JUMP_NUM, + }, + { + name: 'Maximum jumps (if jumping backwards)', + type: 'number', + value: FlowControl.MAX_JUMPS, + }, + ], + }, + 'Conditional Jump': { + description: 'Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.', + run: FlowControl.run_cond_jump, + input_type: 'string', + output_type: 'string', + flow_control: true, + args: [ + { + name: 'Match (regex)', + type: 'string', + value: '', + }, + { + name: 'Number of operations to jump over if match found', + type: 'number', + value: FlowControl.JUMP_NUM, + }, + { + name: 'Maximum jumps (if jumping backwards)', + type: 'number', + value: FlowControl.MAX_JUMPS, + }, + ], + }, + Return: { + description: 'End execution of operations at this point in the recipe.', + run: FlowControl.run_return, + input_type: 'string', + output_type: 'string', + flow_control: true, + args: [], + }, + 'From Base64': { + description: 'Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

This operation decodes data from an ASCII Base64 string back into its raw format.

e.g. aGVsbG8= becomes hello', + run: Base64.run_from, + highlight: Base64.highlight_from, + highlight_reverse: Base64.highlight_to, + input_type: 'string', + output_type: 'byte_array', + args: [ + { + name: 'Alphabet', + type: 'editable_option', + value: Base64.ALPHABET_OPTIONS, + }, + { + name: 'Remove non‑alphabet chars', + type: 'boolean', + value: Base64.REMOVE_NON_ALPH_CHARS, + }, + ], + }, + 'To Base64': { + description: 'Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

This operation encodes data in an ASCII Base64 string.

e.g. hello becomes aGVsbG8=', + run: Base64.run_to, + highlight: Base64.highlight_to, + highlight_reverse: Base64.highlight_from, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Alphabet', + type: 'editable_option', + value: Base64.ALPHABET_OPTIONS, + }, + ], + }, + 'From Base32': { + description: 'Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.', + run: Base64.run_from_32, + input_type: 'string', + output_type: 'byte_array', + args: [ + { + name: 'Alphabet', + type: 'binary_string', + value: Base64.BASE32_ALPHABET, + }, + { + name: 'Remove non‑alphabet chars', + type: 'boolean', + value: Base64.REMOVE_NON_ALPH_CHARS, + }, + ], + }, + 'To Base32': { + description: 'Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.', + run: Base64.run_to_32, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Alphabet', + type: 'binary_string', + value: Base64.BASE32_ALPHABET, + }, + ], + }, + 'Show Base64 offsets': { + description: "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.

This operation shows all possible offsets for a given string so that each possible encoding can be considered.", + run: Base64.run_offsets, + input_type: 'byte_array', + output_type: 'html', + args: [ + { + name: 'Alphabet', + type: 'binary_string', + value: Base64.ALPHABET, + }, + { + name: 'Show variable chars and padding', + type: 'boolean', + value: Base64.OFFSETS_SHOW_VARIABLE, + }, + ], + }, + XOR: { + description: 'XOR the input with the given key.
e.g. fe023da5

Options
Null preserving: If the current byte is 0x00 or the same as the key, skip it.

Differential: Set the key to the value of the previously decoded byte.', + run: BitwiseOp.run_xor, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: BitwiseOp.KEY_FORMAT, + }, + { + name: 'Null preserving', + type: 'boolean', + value: BitwiseOp.XOR_PRESERVE_NULLS, + }, + { + name: 'Differential', + type: 'boolean', + value: BitwiseOp.XOR_DIFFERENTIAL, + }, + ], + }, + 'XOR Brute Force': { + description: 'Enumerate all possible XOR solutions. Current maximum key length is 2 due to browser performance.

Optionally enter a regex string that you expect to find in the plaintext to filter results (crib).', + run: BitwiseOp.run_xor_brute, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Key length', + type: 'option', + value: BitwiseOp.XOR_BRUTE_KEY_LENGTH, + }, + { + name: 'Length of sample', + type: 'number', + value: BitwiseOp.XOR_BRUTE_SAMPLE_LENGTH, + }, + { + name: 'Offset of sample', + type: 'number', + value: BitwiseOp.XOR_BRUTE_SAMPLE_OFFSET, + }, + { + name: 'Null preserving', + type: 'boolean', + value: BitwiseOp.XOR_PRESERVE_NULLS, + }, + { + name: 'Differential', + type: 'boolean', + value: BitwiseOp.XOR_DIFFERENTIAL, + }, + { + name: 'Crib (known plaintext string)', + type: 'binary_string', + value: '', + }, + { + name: 'Print key', + type: 'boolean', + value: BitwiseOp.XOR_BRUTE_PRINT_KEY, + }, + { + name: 'Output as hex', + type: 'boolean', + value: BitwiseOp.XOR_BRUTE_OUTPUT_HEX, + }, + ], + }, + NOT: { + description: 'Returns the inverse of each byte.', + run: BitwiseOp.run_not, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [], + }, + AND: { + description: 'AND the input with the given key.
e.g. fe023da5', + run: BitwiseOp.run_and, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: BitwiseOp.KEY_FORMAT, + }, + ], + }, + OR: { + description: 'OR the input with the given key.
e.g. fe023da5', + run: BitwiseOp.run_or, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: BitwiseOp.KEY_FORMAT, + }, + ], + }, + ADD: { + description: 'ADD the input with the given key (e.g. fe023da5), MOD 255', + run: BitwiseOp.run_add, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: BitwiseOp.KEY_FORMAT, + }, + ], + }, + SUB: { + description: 'SUB the input with the given key (e.g. fe023da5), MOD 255', + run: BitwiseOp.run_sub, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: BitwiseOp.KEY_FORMAT, + }, + ], + }, + 'From Hex': { + description: 'Converts a hexadecimal byte string back into a its raw value.

e.g. ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a becomes the UTF-8 encoded string Γειά σου', + run: ByteRepr.run_from_hex, + highlight: ByteRepr.highlight_from, + highlight_reverse: ByteRepr.highlight_to, + input_type: 'string', + output_type: 'byte_array', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.HEX_DELIM_OPTIONS, + }, + ], + }, + 'To Hex': { + description: 'Converts the input string to hexadecimal bytes separated by the specified delimiter.

e.g. The UTF-8 encoded string Γειά σου becomes ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a', + run: ByteRepr.run_to_hex, + highlight: ByteRepr.highlight_to, + highlight_reverse: ByteRepr.highlight_from, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.HEX_DELIM_OPTIONS, + }, + ], + }, + 'From Charcode': { + description: 'Converts unicode character codes back into text.

e.g. 0393 03b5 03b9 03ac 20 03c3 03bf 03c5 becomes Γειά σου', + run: ByteRepr.run_from_charcode, + highlight: ByteRepr.highlight_from, + highlight_reverse: ByteRepr.highlight_to, + input_type: 'string', + output_type: 'byte_array', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.DELIM_OPTIONS, + }, + { + name: 'Base', + type: 'number', + value: ByteRepr.CHARCODE_BASE, + }, + ], + }, + 'To Charcode': { + description: 'Converts text to its unicode character code equivalent.

e.g. Γειά σου becomes 0393 03b5 03b9 03ac 20 03c3 03bf 03c5', + run: ByteRepr.run_to_charcode, + highlight: ByteRepr.highlight_to, + highlight_reverse: ByteRepr.highlight_from, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.DELIM_OPTIONS, + }, + { + name: 'Base', + type: 'number', + value: ByteRepr.CHARCODE_BASE, + }, + ], + }, + 'From Binary': { + description: 'Converts a binary string back into its raw form.

e.g. 01001000 01101001 becomes Hi', + run: ByteRepr.run_from_binary, + highlight: ByteRepr.highlight_from_binary, + highlight_reverse: ByteRepr.highlight_to_binary, + input_type: 'string', + output_type: 'byte_array', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.BIN_DELIM_OPTIONS, + }, + ], + }, + 'To Binary': { + description: 'Displays the input data as a binary string.

e.g. Hi becomes 01001000 01101001', + run: ByteRepr.run_to_binary, + highlight: ByteRepr.highlight_to_binary, + highlight_reverse: ByteRepr.highlight_from_binary, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.BIN_DELIM_OPTIONS, + }, + ], + }, + 'From Decimal': { + description: 'Converts the data from an ordinal integer array back into its raw form.

e.g. 72 101 108 108 111 becomes Hello', + run: ByteRepr.run_from_decimal, + input_type: 'string', + output_type: 'byte_array', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.DELIM_OPTIONS, + }, + ], + }, + 'To Decimal': { + description: 'Converts the input data to an ordinal integer array.

e.g. Hello becomes 72 101 108 108 111', + run: ByteRepr.run_to_decimal, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: ByteRepr.DELIM_OPTIONS, + }, + ], + }, + 'From Hexdump': { + description: 'Attempts to convert a hexdump back into raw data. This operation supports many different hexdump variations, but probably not all. Make sure you verify that the data it gives you is correct before continuing analysis.', + run: Hexdump.run_from, + highlight: Hexdump.highlight_from, + highlight_reverse: Hexdump.highlight_to, + input_type: 'string', + output_type: 'byte_array', + args: [], + }, + 'To Hexdump': { + description: 'Creates a hexdump of the input data, displaying both the hexademinal values of each byte and an ASCII representation alongside.', + run: Hexdump.run_to, + highlight: Hexdump.highlight_to, + highlight_reverse: Hexdump.highlight_from, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Width', + type: 'number', + value: Hexdump.WIDTH, + }, + { + name: 'Upper case hex', + type: 'boolean', + value: Hexdump.UPPER_CASE, + }, + { + name: 'Include final length', + type: 'boolean', + value: Hexdump.INCLUDE_FINAL_LENGTH, + }, + ], + }, + 'From Base': { + description: 'Converts a number to decimal from a given numerical base.', + run: Base.run_from, + input_type: 'string', + output_type: 'number', + args: [ + { + name: 'Radix', + type: 'number', + value: Base.DEFAULT_RADIX, + }, + ], + }, + 'To Base': { + description: 'Converts a decimal number to a given numerical base.', + run: Base.run_to, + input_type: 'number', + output_type: 'string', + args: [ + { + name: 'Radix', + type: 'number', + value: Base.DEFAULT_RADIX, + }, + ], + }, + 'From HTML Entity': { + description: 'Converts HTML entities back to characters

e.g. &amp; becomes &', // tags required to stop the browser just printing & + run: HTML.run_from_entity, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'To HTML Entity': { + description: 'Converts characters to HTML entities

e.g. & becomes &amp;', // tags required to stop the browser just printing & + run: HTML.run_to_entity, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Convert all characters', + type: 'boolean', + value: HTML.CONVERT_ALL, + }, + { + name: 'Convert to', + type: 'option', + value: HTML.CONVERT_OPTIONS, + }, + ], + }, + 'Strip HTML tags': { + description: 'Removes all HTML tags from the input.', + run: HTML.run_strip_tags, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Remove indentation', + type: 'boolean', + value: HTML.REMOVE_INDENTATION, + }, + { + name: 'Remove excess line breaks', + type: 'boolean', + value: HTML.REMOVE_LINE_BREAKS, + }, + ], + }, + 'URL Decode': { + description: 'Converts URI/URL percent-encoded characters back to their raw values.

e.g. %3d becomes =', + run: URL_.run_from, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'URL Encode': { + description: 'Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.

e.g. = becomes %3d', + run: URL_.run_to, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Encode all special chars', + type: 'boolean', + value: URL_.ENCODE_ALL, + }, + ], + }, + 'Parse URI': { + description: 'Pretty prints complicated Uniform Resource Identifier (URI) strings for ease of reading. Particularly useful for Uniform Resource Locators (URLs) with a lot of arguments.', + run: URL_.run_parse, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Unescape Unicode Characters': { + description: 'Converts unicode-escaped character notation back into raw characters.

Supports the prefixes:
  • \\u
  • %u
  • U+
e.g. \\u03c3\\u03bf\\u03c5 becomes σου', + run: Unicode.run_unescape, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Prefix', + type: 'option', + value: Unicode.PREFIXES, + }, + ], + }, + 'From Quoted Printable': { + description: 'Converts QP-encoded text back to standard text.', + run: QuotedPrintable.run_from, + input_type: 'string', + output_type: 'byte_array', + args: [], + }, + 'To Quoted Printable': { + description: "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.", + run: QuotedPrintable.run_to, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'From Punycode': { + description: 'Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

e.g. mnchen-3ya decodes to münchen', + run: Punycode.run_to_unicode, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Internationalised domain name', + type: 'boolean', + value: Punycode.IDN, + }, + ], + }, + 'To Punycode': { + description: 'Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

e.g. münchen encodes to mnchen-3ya', + run: Punycode.run_to_ascii, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Internationalised domain name', + type: 'boolean', + value: Punycode.IDN, + }, + ], + }, + 'From Hex Content': { + description: 'Translates hexadecimal bytes in text back to raw bytes.

e.g. foo|3d|bar becomes foo=bar.', + run: ByteRepr.run_from_hex_content, + input_type: 'string', + output_type: 'byte_array', + args: [], + }, + 'To Hex Content': { + description: 'Converts special characters in a string to hexadecimal.

e.g. foo=bar becomes foo|3d|bar.', + run: ByteRepr.run_to_hex_content, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Convert', + type: 'option', + value: ByteRepr.HEX_CONTENT_CONVERT_WHICH, + }, + { + name: 'Print spaces between bytes', + type: 'boolean', + value: ByteRepr.HEX_CONTENT_SPACES_BETWEEN_BYTES, + }, + ], + }, + 'Change IP format': { + description: 'Convert an IP address from one format to another, e.g. 172.20.23.54 to ac141736', + run: IP.run_change_ip_format, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Input format', + type: 'option', + value: IP.IP_FORMAT_LIST, + }, + { + name: 'Output format', + type: 'option', + value: IP.IP_FORMAT_LIST, + }, + ], + }, + 'Parse IP range': { + description: 'Given a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0), this operation provides network information and enumerates all IP addresses in the range.

IPv6 is supported but will not be enumerated.', + run: IP.run_parse_ip_range, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Include network info', + type: 'boolean', + value: IP.INCLUDE_NETWORK_INFO, + }, + { + name: 'Enumerate IP addresses', + type: 'boolean', + value: IP.ENUMERATE_ADDRESSES, + }, + { + name: 'Allow large queries', + type: 'boolean', + value: IP.ALLOW_LARGE_LIST, + }, + ], + }, + 'Group IP addresses': { + description: 'Groups a list of IP addresses into subnets. Supports both IPv4 and IPv6 addresses.', + run: IP.run_group_ips, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: IP.DELIM_OPTIONS, + }, + { + name: 'Subnet (CIDR)', + type: 'number', + value: IP.GROUP_CIDR, + }, + { + name: 'Only show the subnets', + type: 'boolean', + value: IP.GROUP_ONLY_SUBNET, + }, + ], + }, + 'Parse IPv6 address': { + description: 'Displays the longhand and shorthand versions of a valid IPv6 address.

Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.', + run: IP.run_parse_ipv6, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Text encoding': { + description: 'Translates the data between different character encodings.

Supported charsets are:
  • UTF8
  • UTF16
  • UTF16LE (little-endian)
  • UTF16BE (big-endian)
  • Hex
  • Base64
  • Latin1 (ISO-8859-1)
  • Windows-1251
', + run: CharEnc.run, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Input type', + type: 'option', + value: CharEnc.IO_FORMAT, + }, + { + name: 'Output type', + type: 'option', + value: CharEnc.IO_FORMAT, + }, + ], + }, + 'AES Decrypt': { + description: 'To successfully decrypt AES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 16 bytes of encrypted material.', + run: Cipher.run_aes_dec, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT2, + }, + ], + }, + 'AES Encrypt': { + description: 'Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

AES-128, AES-192, and AES-256 are supported. The variant will be chosen based on the size of the key passed in. If a passphrase is used, a 256-bit key will be generated.', + run: Cipher.run_aes_enc, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Output result', + type: 'option', + value: Cipher.RESULT_TYPE, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + ], + }, + 'DES Decrypt': { + description: 'To successfully decrypt DES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 8 bytes of encrypted material.', + run: Cipher.run_des_dec, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT2, + }, + ], + }, + 'DES Encrypt': { + description: 'Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.', + run: Cipher.run_des_enc, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Output result', + type: 'option', + value: Cipher.RESULT_TYPE, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + ], + }, + 'Triple DES Decrypt': { + description: 'To successfully decrypt Triple DES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 8 bytes of encrypted material.', + run: Cipher.run_triple_des_dec, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT2, + }, + ], + }, + 'Triple DES Encrypt': { + description: 'Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Triple DES applies DES three times to each block to increase key size.', + run: Cipher.run_triple_des_enc, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Output result', + type: 'option', + value: Cipher.RESULT_TYPE, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + ], + }, + 'Blowfish Decrypt': { + description: 'Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.', + run: Cipher.run_blowfish_dec, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.BLOWFISH_MODES, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT3, + }, + ], + }, + 'Blowfish Encrypt': { + description: 'Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.', + run: Cipher.run_blowfish_enc, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.BLOWFISH_MODES, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT3, + }, + ], + }, + 'Rabbit Decrypt': { + description: 'To successfully decrypt Rabbit, you need either:
  • The passphrase
  • Or the key and IV (This is currently broken. You need the key and salt at the moment.)
The IV should be the first 8 bytes of encrypted material.', + run: Cipher.run_rabbit_dec, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT2, + }, + ], + }, + 'Rabbit Encrypt': { + description: 'Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2 year process where 22 designs were evaluated.', + run: Cipher.run_rabbit_enc, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase/Key', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'IV', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + + }, + { + name: 'Salt', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT1, + }, + { + name: 'Mode', + type: 'option', + value: Cipher.MODES, + }, + { + name: 'Padding', + type: 'option', + value: Cipher.PADDING, + }, + { + name: 'Output result', + type: 'option', + value: Cipher.RESULT_TYPE, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT1, + }, + ], + }, + RC4: { + description: "RC4 is a widely-used stream cipher. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.", + run: Cipher.run_rc4, + highlight: true, + highlight_reverse: true, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT4, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT4, + }, + ], + }, + 'RC4 Drop': { + description: 'It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.', + run: Cipher.run_rc4drop, + highlight: true, + highlight_reverse: true, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Passphrase', + type: 'toggle_string', + value: '', + toggle_values: Cipher.IO_FORMAT2, + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT4, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT4, + }, + { + name: 'Number of bytes to drop', + type: 'number', + value: Cipher.RC4DROP_BYTES, + }, + ], + }, + 'Derive PBKDF2 key': { + description: "PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

Enter your passphrase as the input and then set the relevant options to generate a key.", + run: Cipher.run_pbkdf2, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Key size', + type: 'number', + value: Cipher.KDF_KEY_SIZE, + }, + { + name: 'Iterations', + type: 'number', + value: Cipher.KDF_ITERATIONS, + }, + { + name: 'Salt (hex)', + type: 'string', + value: '', + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT2, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT3, + }, + ], + }, + 'Derive EVP key': { + description: "EVP is a password-based key derivation function used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

Enter your passphrase as the input and then set the relevant options to generate a key.", + run: Cipher.run_evpkdf, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Key size', + type: 'number', + value: Cipher.KDF_KEY_SIZE, + }, + { + name: 'Iterations', + type: 'number', + value: Cipher.KDF_ITERATIONS, + }, + { + name: 'Salt (hex)', + type: 'string', + value: '', + }, + { + name: 'Input format', + type: 'option', + value: Cipher.IO_FORMAT2, + }, + { + name: 'Output format', + type: 'option', + value: Cipher.IO_FORMAT3, + }, + ], + }, + 'Rotate right': { + description: 'Rotates each byte to the right by the number of bits specified. Currently only supports 8-bit values.', + run: Rotate.run_rotr, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Number of bits', + type: 'number', + value: Rotate.ROTATE_AMOUNT, + }, + { + name: 'Rotate as a whole', + type: 'boolean', + value: Rotate.ROTATE_WHOLE, + }, + ], + }, + 'Rotate left': { + description: 'Rotates each byte to the left by the number of bits specified. Currently only supports 8-bit values.', + run: Rotate.run_rotl, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Number of bits', + type: 'number', + value: Rotate.ROTATE_AMOUNT, + }, + { + name: 'Rotate as a whole', + type: 'boolean', + value: Rotate.ROTATE_WHOLE, + }, + ], + }, + ROT13: { + description: 'A simple caesar substitution cipher which rotates alphabet characters by the specified amount (default 13).', + run: Rotate.run_rot13, + highlight: true, + highlight_reverse: true, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Rotate lower case chars', + type: 'boolean', + value: Rotate.ROT13_LOWERCASE, + }, + { + name: 'Rotate upper case chars', + type: 'boolean', + value: Rotate.ROT13_UPPERCASE, + }, + { + name: 'Amount', + type: 'number', + value: Rotate.ROT13_AMOUNT, + }, + ], + }, + 'Strip HTTP headers': { + description: 'Removes HTTP headers from a request or response by looking for the first instance of a double newline.', + run: HTTP.run_strip_headers, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Parse User Agent': { + description: 'Attempts to identify and categorise information contained in a user-agent string.', + run: HTTP.run_parse_user_agent, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Format MAC addresses': { + description: 'Displays given MAC addresses in multiple different formats.

Expects addresses in a list separated by newlines, spaces or commas.

WARNING: There are no validity checks.', + run: MAC.run_format, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Output case', + type: 'option', + value: MAC.OUTPUT_CASE, + }, + { + name: 'No delimiter', + type: 'boolean', + value: MAC.NO_DELIM, + }, + { + name: 'Dash delimiter', + type: 'boolean', + value: MAC.DASH_DELIM, + }, + { + name: 'Colon delimiter', + type: 'boolean', + value: MAC.COLON_DELIM, + }, + { + name: 'Cisco style', + type: 'boolean', + value: MAC.CISCO_STYLE, + }, + ], + }, + 'Offset checker': { + description: 'Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.', + run: StrUtils.run_offset_checker, + input_type: 'string', + output_type: 'html', + args: [ + { + name: 'Sample delimiter', + type: 'binary_string', + value: StrUtils.OFF_CHK_SAMPLE_DELIMITER, + }, + ], + }, + 'Remove whitespace': { + description: 'Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.

This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.', + run: Tidy.run_remove_whitespace, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Spaces', + type: 'boolean', + value: Tidy.REMOVE_SPACES, + }, + { + name: 'Carriage returns (\\r)', + type: 'boolean', + value: Tidy.REMOVE_CARIAGE_RETURNS, + }, + { + name: 'Line feeds (\\n)', + type: 'boolean', + value: Tidy.REMOVE_LINE_FEEDS, + }, + { + name: 'Tabs', + type: 'boolean', + value: Tidy.REMOVE_TABS, + }, + { + name: 'Form feeds (\\f)', + type: 'boolean', + value: Tidy.REMOVE_FORM_FEEDS, + }, + { + name: 'Full stops', + type: 'boolean', + value: Tidy.REMOVE_FULL_STOPS, + }, + ], + }, + 'Remove null bytes': { + description: 'Removes all null bytes (0x00) from the input.', + run: Tidy.run_remove_nulls, + input_type: 'byte_array', + output_type: 'byte_array', + args: [], + }, + 'Drop bytes': { + description: 'Cuts the specified number of bytes out of the data.', + run: Tidy.run_drop_bytes, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Start', + type: 'number', + value: Tidy.DROP_START, + }, + { + name: 'Length', + type: 'number', + value: Tidy.DROP_LENGTH, + }, + { + name: 'Apply to each line', + type: 'boolean', + value: Tidy.APPLY_TO_EACH_LINE, + }, + ], + }, + 'Take bytes': { + description: 'Takes a slice of the specified number of bytes from the data.', + run: Tidy.run_take_bytes, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Start', + type: 'number', + value: Tidy.TAKE_START, + }, + { + name: 'Length', + type: 'number', + value: Tidy.TAKE_LENGTH, + }, + { + name: 'Apply to each line', + type: 'boolean', + value: Tidy.APPLY_TO_EACH_LINE, + }, + ], + }, + 'Pad lines': { + description: 'Add the specified number of the specified character to the beginning or end of each line', + run: Tidy.run_pad, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Position', + type: 'option', + value: Tidy.PAD_POSITION, + }, + { + name: 'Length', + type: 'number', + value: Tidy.PAD_LENGTH, + }, + { + name: 'Character', + type: 'binary_short_string', + value: Tidy.PAD_CHAR, + }, + ], + }, + Reverse: { + description: 'Reverses the input string.', + run: SeqUtils.run_reverse, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'By', + type: 'option', + value: SeqUtils.REVERSE_BY, + }, + ], + }, + Sort: { + description: 'Alphabetically sorts strings separated by the specified delimiter.

The IP address option supports IPv4 only.', + run: SeqUtils.run_sort, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: SeqUtils.DELIMITER_OPTIONS, + }, + { + name: 'Reverse', + type: 'boolean', + value: SeqUtils.SORT_REVERSE, + }, + { + name: 'Order', + type: 'option', + value: SeqUtils.SORT_ORDER, + }, + ], + }, + Unique: { + description: 'Removes duplicate strings from the input.', + run: SeqUtils.run_unique, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'option', + value: SeqUtils.DELIMITER_OPTIONS, + }, + ], + }, + 'Count occurrences': { + description: 'Counts the number of times the provided string occurs in the input.', + run: SeqUtils.run_count, + input_type: 'string', + output_type: 'number', + args: [ + { + name: 'Search string', + type: 'toggle_string', + value: '', + toggle_values: SeqUtils.SEARCH_TYPE, + }, + ], + }, + 'Add line numbers': { + description: 'Adds line numbers to the output.', + run: SeqUtils.run_add_line_numbers, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Remove line numbers': { + description: 'Removes line numbers from the output if they can be trivially detected.', + run: SeqUtils.run_remove_line_numbers, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Find / Replace': { + description: 'Replaces all occurrences of the first string with the second.

The three match options are only relevant to regex search strings.', + run: StrUtils.run_find_replace, + manual_bake: true, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Find', + type: 'toggle_string', + value: '', + toggle_values: StrUtils.SEARCH_TYPE, + }, + { + name: 'Replace', + type: 'binary_string', + value: '', + }, + { + name: 'Global match', + type: 'boolean', + value: StrUtils.FIND_REPLACE_GLOBAL, + }, + { + name: 'Case insensitive', + type: 'boolean', + value: StrUtils.FIND_REPLACE_CASE, + }, + { + name: 'Multiline matching', + type: 'boolean', + value: StrUtils.FIND_REPLACE_MULTILINE, + }, + + ], + }, + 'To Upper case': { + description: 'Converts the input string to upper case, optionally limiting scope to only the first character in each word, sentence or paragraph.', + run: StrUtils.run_upper, + highlight: true, + highlight_reverse: true, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Scope', + type: 'option', + value: StrUtils.CASE_SCOPE, + }, + ], + }, + 'To Lower case': { + description: 'Converts every character in the input to lower case.', + run: StrUtils.run_lower, + highlight: true, + highlight_reverse: true, + input_type: 'string', + output_type: 'string', + args: [], + }, + Split: { + description: 'Splits a string into sections around a given delimiter.', + run: StrUtils.run_split, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Split delimiter', + type: 'binary_short_string', + value: StrUtils.SPLIT_DELIM, + }, + { + name: 'Join delimiter', + type: 'option', + value: StrUtils.DELIMITER_OPTIONS, + }, + ], + }, + Strings: { + description: 'Extracts all strings from the input.', + run: Extract.run_strings, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Minimum length', + type: 'number', + value: Extract.MIN_STRING_LEN, + }, + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract IP addresses': { + description: 'Extracts all IPv4 and IPv6 addresses.

Warning: Given a string 710.65.0.456, this will match 10.65.0.45 so always check the original input!', + run: Extract.run_ip, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'IPv4', + type: 'boolean', + value: Extract.INCLUDE_IPV4, + }, + { + name: 'IPv6', + type: 'boolean', + value: Extract.INCLUDE_IPV6, + }, + { + name: 'Remove local IPv4 addresses', + type: 'boolean', + value: Extract.REMOVE_LOCAL, + }, + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract email addresses': { + description: 'Extracts all email addresses from the input.', + run: Extract.run_email, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract MAC addresses': { + description: 'Extracts all Media Access Control (MAC) addresses from the input.', + run: Extract.run_mac, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract URLs': { + description: 'Extracts Uniform Resource Locators (URLs) from the input. The protocol (http, ftp etc.) is required otherwise there will be far too many false positives.', + run: Extract.run_urls, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract domains': { + description: 'Extracts domain names with common Top-Level Domains (TLDs).
Note that this will not include paths. Use Extract URLs to find entire URLs.', + run: Extract.run_domains, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract file paths': { + description: 'Extracts anything that looks like a Windows or UNIX file path.

Note that if UNIX is selected, there will likely be a lot of false positives.', + run: Extract.run_file_paths, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Windows', + type: 'boolean', + value: Extract.INCLUDE_WIN_PATH, + }, + { + name: 'UNIX', + type: 'boolean', + value: Extract.INCLUDE_UNIX_PATH, + }, + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Extract dates': { + description: 'Extracts dates in the following formats
  • yyyy-mm-dd
  • dd/mm/yyyy
  • mm/dd/yyyy
Dividers can be any of /, -, . or space', + run: Extract.run_dates, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Display total', + type: 'boolean', + value: Extract.DISPLAY_TOTAL, + }, + ], + }, + 'Regular expression': { + description: 'Define your own regular expression to search the input data with, optionally choosing from a list of pre-defined patterns.', + run: StrUtils.run_regex, + manual_bake: true, + input_type: 'string', + output_type: 'html', + args: [ + { + name: 'Built in regexes', + type: 'populate_option', + value: StrUtils.REGEX_PRE_POPULATE, + target: 1, + }, + { + name: 'Regex', + type: 'text', + value: '', + }, + { + name: 'Case insensitive', + type: 'boolean', + value: StrUtils.REGEX_CASE_INSENSITIVE, + }, + { + name: 'Multiline matching', + type: 'boolean', + value: StrUtils.REGEX_MULTILINE_MATCHING, + }, + { + name: 'Display total', + type: 'boolean', + value: StrUtils.DISPLAY_TOTAL, + }, + { + name: 'Output format', + type: 'option', + value: StrUtils.OUTPUT_FORMAT, + }, + ], + }, + 'From UNIX Timestamp': { + description: 'Converts a UNIX timestamp to a datetime string.

e.g. 978346800 becomes Mon 1 January 2001 11:00:00 UTC', + run: DateTime.run_from_unix_timestamp, + input_type: 'number', + output_type: 'string', + args: [ + { + name: 'Units', + type: 'option', + value: DateTime.UNITS, + }, + ], + }, + 'To UNIX Timestamp': { + description: 'Parses a datetime string and returns the corresponding UNIX timestamp.

e.g. Mon 1 January 2001 11:00:00 UTC becomes 978346800', + run: DateTime.run_to_unix_timestamp, + input_type: 'string', + output_type: 'number', + args: [ + { + name: 'Units', + type: 'option', + value: DateTime.UNITS, + }, + ], + }, + 'Translate DateTime Format': { + description: 'Parses a datetime string in one format and re-writes it in another.

Run with no input to see the relevant format string examples.', + run: DateTime.run_translate_format, + input_type: 'string', + output_type: 'html', + args: [ + { + name: 'Built in formats', + type: 'populate_option', + value: DateTime.DATETIME_FORMATS, + target: 1, + }, + { + name: 'Input format string', + type: 'binary_string', + value: DateTime.INPUT_FORMAT_STRING, + }, + { + name: 'Input timezone', + type: 'option', + value: DateTime.TIMEZONES, + }, + { + name: 'Output format string', + type: 'binary_string', + value: DateTime.OUTPUT_FORMAT_STRING, + }, + { + name: 'Output timezone', + type: 'option', + value: DateTime.TIMEZONES, + }, + ], + }, + 'Parse DateTime': { + description: 'Parses a DateTime string in your specified format and displays it in whichever timezone you choose with the following information:
  • Date
  • Time
  • Period (AM/PM)
  • Timezone
  • UTC offset
  • Daylight Saving Time
  • Leap year
  • Days in this month
  • Day of year
  • Week number
  • Quarter
Run with no input to see format string examples if required.', + run: DateTime.run_parse, + input_type: 'string', + output_type: 'html', + args: [ + { + name: 'Built in formats', + type: 'populate_option', + value: DateTime.DATETIME_FORMATS, + target: 1, + }, + { + name: 'Input format string', + type: 'binary_string', + value: DateTime.INPUT_FORMAT_STRING, + }, + { + name: 'Input timezone', + type: 'option', + value: DateTime.TIMEZONES, + }, + ], + }, + 'Convert distance': { + description: 'Converts a unit of distance to another format.', + run: Convert.run_distance, + input_type: 'number', + output_type: 'number', + args: [ + { + name: 'Input units', + type: 'option', + value: Convert.DISTANCE_UNITS, + }, + { + name: 'Output units', + type: 'option', + value: Convert.DISTANCE_UNITS, + }, + ], + }, + 'Convert area': { + description: 'Converts a unit of area to another format.', + run: Convert.run_area, + input_type: 'number', + output_type: 'number', + args: [ + { + name: 'Input units', + type: 'option', + value: Convert.AREA_UNITS, + }, + { + name: 'Output units', + type: 'option', + value: Convert.AREA_UNITS, + }, + ], + }, + 'Convert mass': { + description: 'Converts a unit of mass to another format.', + run: Convert.run_mass, + input_type: 'number', + output_type: 'number', + args: [ + { + name: 'Input units', + type: 'option', + value: Convert.MASS_UNITS, + }, + { + name: 'Output units', + type: 'option', + value: Convert.MASS_UNITS, + }, + ], + }, + 'Convert speed': { + description: 'Converts a unit of speed to another format.', + run: Convert.run_speed, + input_type: 'number', + output_type: 'number', + args: [ + { + name: 'Input units', + type: 'option', + value: Convert.SPEED_UNITS, + }, + { + name: 'Output units', + type: 'option', + value: Convert.SPEED_UNITS, + }, + ], + }, + 'Convert data units': { + description: 'Converts a unit of data to another format.', + run: Convert.run_data_size, + input_type: 'number', + output_type: 'number', + args: [ + { + name: 'Input units', + type: 'option', + value: Convert.DATA_UNITS, + }, + { + name: 'Output units', + type: 'option', + value: Convert.DATA_UNITS, + }, + ], + }, + 'Raw Deflate': { + description: 'Compresses data using the deflate algorithm with no headers.', + run: Compress.run_raw_deflate, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Compression type', + type: 'option', + value: Compress.COMPRESSION_TYPE, + }, + ], + }, + 'Raw Inflate': { + description: 'Decompresses data which has been compressed using the deflate algorithm with no headers.', + run: Compress.run_raw_inflate, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Start index', + type: 'number', + value: Compress.INFLATE_INDEX, + }, + { + name: 'Initial output buffer size', + type: 'number', + value: Compress.INFLATE_BUFFER_SIZE, + }, + { + name: 'Buffer expansion type', + type: 'option', + value: Compress.INFLATE_BUFFER_TYPE, + }, + { + name: 'Resize buffer after decompression', + type: 'boolean', + value: Compress.INFLATE_RESIZE, + }, + { + name: 'Verify result', + type: 'boolean', + value: Compress.INFLATE_VERIFY, + }, + ], + }, + 'Zlib Deflate': { + description: 'Compresses data using the deflate algorithm adding zlib headers.', + run: Compress.run_zlib_deflate, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Compression type', + type: 'option', + value: Compress.COMPRESSION_TYPE, + }, + ], + }, + 'Zlib Inflate': { + description: 'Decompresses data which has been compressed using the deflate algorithm with zlib headers.', + run: Compress.run_zlib_inflate, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Start index', + type: 'number', + value: Compress.INFLATE_INDEX, + }, + { + name: 'Initial output buffer size', + type: 'number', + value: Compress.INFLATE_BUFFER_SIZE, + }, + { + name: 'Buffer expansion type', + type: 'option', + value: Compress.INFLATE_BUFFER_TYPE, + }, + { + name: 'Resize buffer after decompression', + type: 'boolean', + value: Compress.INFLATE_RESIZE, + }, + { + name: 'Verify result', + type: 'boolean', + value: Compress.INFLATE_VERIFY, + }, + ], + }, + Gzip: { + description: 'Compresses data using the deflate algorithm with gzip headers.', + run: Compress.run_gzip, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Compression type', + type: 'option', + value: Compress.COMPRESSION_TYPE, + }, + { + name: 'Filename (optional)', + type: 'string', + value: '', + }, + { + name: 'Comment (optional)', + type: 'string', + value: '', + }, + { + name: 'Include file checksum', + type: 'boolean', + value: Compress.GZIP_CHECKSUM, + }, + ], + }, + Gunzip: { + description: 'Decompresses data which has been compressed using the deflate algorithm with gzip headers.', + run: Compress.run_gunzip, + input_type: 'byte_array', + output_type: 'byte_array', + args: [], + }, + Zip: { + description: 'Compresses data using the PKZIP algorithm with the given filename.

No support for multiple files at this time.', + run: Compress.run_pkzip, + input_type: 'byte_array', + output_type: 'byte_array', + args: [ + { + name: 'Filename', + type: 'string', + value: Compress.PKZIP_FILENAME, + }, + { + name: 'Comment', + type: 'string', + value: '', + }, + { + name: 'Password', + type: 'binary_string', + value: '', + }, + { + name: 'Compression method', + type: 'option', + value: Compress.COMPRESSION_METHOD, + }, + { + name: 'Operating system', + type: 'option', + value: Compress.OS, + }, + { + name: 'Compression type', + type: 'option', + value: Compress.COMPRESSION_TYPE, + }, + ], + }, + Unzip: { + description: 'Decompresses data using the PKZIP algorithm and displays it per file, with support for passwords.', + run: Compress.run_pkunzip, + input_type: 'byte_array', + output_type: 'html', + args: [ + { + name: 'Password', + type: 'binary_string', + value: '', + }, + { + name: 'Verify result', + type: 'boolean', + value: Compress.PKUNZIP_VERIFY, + }, + ], + }, + 'Bzip2 Decompress': { + description: 'Decompresses data using the Bzip2 algorithm.', + run: Compress.run_bzip2_decompress, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'Generic Code Beautify': { + description: 'Attempts to pretty print C-style languages such as C, C++, C#, Java, PHP, JavaScript etc.

This will not do a perfect job, and the resulting code may not work any more. This operation is designed purely to make obfuscated or minified code more easy to read and understand.

Things which will not work properly:
  • For loop formatting
  • Do-While loop formatting
  • Switch/Case indentation
  • Certain bit shift operators
', + run: Code.run_generic_beautify, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'JavaScript Parser': { + description: 'Returns an Abstract Syntax Tree for valid JavaScript code.', + run: JS.run_parse, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Location info', + type: 'boolean', + value: JS.PARSE_LOC, + }, + { + name: 'Range info', + type: 'boolean', + value: JS.PARSE_RANGE, + }, + { + name: 'Include tokens array', + type: 'boolean', + value: JS.PARSE_TOKENS, + }, + { + name: 'Include comments array', + type: 'boolean', + value: JS.PARSE_COMMENT, + }, + { + name: 'Report errors and try to continue', + type: 'boolean', + value: JS.PARSE_TOLERANT, + }, + ], + }, + 'JavaScript Beautify': { + description: 'Parses and pretty prints valid JavaScript code. Also works with JavaScript Object Notation (JSON).', + run: JS.run_beautify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Indent string', + type: 'binary_short_string', + value: JS.BEAUTIFY_INDENT, + }, + { + name: 'Quotes', + type: 'option', + value: JS.BEAUTIFY_QUOTES, + }, + { + name: 'Semicolons before closing braces', + type: 'boolean', + value: JS.BEAUTIFY_SEMICOLONS, + }, + { + name: 'Include comments', + type: 'boolean', + value: JS.BEAUTIFY_COMMENT, + }, + ], + }, + 'JavaScript Minify': { + description: 'Compresses JavaScript code.', + run: JS.run_minify, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'XML Beautify': { + description: 'Indents and prettifies eXtensible Markup Language (XML) code.', + run: Code.run_xml_beautify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Indent string', + type: 'binary_short_string', + value: Code.BEAUTIFY_INDENT, + }, + ], + }, + 'JSON Beautify': { + description: 'Indents and prettifies JavaScript Object Notation (JSON) code.', + run: Code.run_json_beautify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Indent string', + type: 'binary_short_string', + value: Code.BEAUTIFY_INDENT, + }, + ], + }, + 'CSS Beautify': { + description: 'Indents and prettifies Cascading Style Sheets (CSS) code.', + run: Code.run_css_beautify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Indent string', + type: 'binary_short_string', + value: Code.BEAUTIFY_INDENT, + }, + ], + }, + 'SQL Beautify': { + description: 'Indents and prettifies Structured Query Language (SQL) code.', + run: Code.run_sql_beautify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Indent string', + type: 'binary_short_string', + value: Code.BEAUTIFY_INDENT, + }, + ], + }, + 'XML Minify': { + description: 'Compresses eXtensible Markup Language (XML) code.', + run: Code.run_xml_minify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Preserve comments', + type: 'boolean', + value: Code.PRESERVE_COMMENTS, + }, + ], + }, + 'JSON Minify': { + description: 'Compresses JavaScript Object Notation (JSON) code.', + run: Code.run_json_minify, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'CSS Minify': { + description: 'Compresses Cascading Style Sheets (CSS) code.', + run: Code.run_css_minify, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Preserve comments', + type: 'boolean', + value: Code.PRESERVE_COMMENTS, + }, + ], + }, + 'SQL Minify': { + description: 'Compresses Structured Query Language (SQL) code.', + run: Code.run_sql_minify, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Analyse hash': { + description: 'Tries to determine information about a given hash and suggests which algorithm may have been used to generate it based on its length.', + run: Hash.run_analyse, + input_type: 'string', + output_type: 'string', + args: [], + }, + MD5: { + description: "MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.

However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.", + run: Hash.run_md5, + input_type: 'string', + output_type: 'string', + args: [], + }, + SHA1: { + description: "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.

However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.", + run: Hash.run_sha1, + input_type: 'string', + output_type: 'string', + args: [], + }, + SHA224: { + description: 'SHA-224 is largely identical to SHA-256 but is truncated to 224 bytes.', + run: Hash.run_sha224, + input_type: 'string', + output_type: 'string', + args: [], + }, + SHA256: { + description: "SHA-256 is one of the four variants in the SHA-2 set. It isn't as widely used as SHA-1, though it provides much better security.", + run: Hash.run_sha256, + input_type: 'string', + output_type: 'string', + args: [], + }, + SHA384: { + description: 'SHA-384 is largely identical to SHA-512 but is truncated to 384 bytes.', + run: Hash.run_sha384, + input_type: 'string', + output_type: 'string', + args: [], + }, + SHA512: { + description: 'SHA-512 is largely identical to SHA-256 but operates on 64-bit words rather than 32.', + run: Hash.run_sha512, + input_type: 'string', + output_type: 'string', + args: [], + }, + SHA3: { + description: 'This is an implementation of Keccak[c=2d]. SHA3 functions based on different implementations of Keccak will give different results.', + run: Hash.run_sha3, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Output length', + type: 'option', + value: Hash.SHA3_LENGTH, + }, + ], + }, + 'RIPEMD-160': { + description: 'RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.

RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.

RIPEMD-160 is an improved, 160-bit version of the original RIPEMD, and the most common version in the family.', + run: Hash.run_ripemd160, + input_type: 'string', + output_type: 'string', + args: [], + }, + HMAC: { + description: 'Keyed-Hash Message Authentication Codes (HMAC) are a mechanism for message authentication using cryptographic hash functions.', + run: Hash.run_hmac, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Password', + type: 'binary_string', + value: '', + }, + { + name: 'Hashing function', + type: 'option', + value: Hash.HMAC_FUNCTIONS, + }, + ], + }, + 'Fletcher-16 Checksum': { + description: 'The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.', + run: Checksum.run_fletcher16, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'Adler-32 Checksum': { + description: 'Adler-32 is a checksum algorithm which was invented by Mark Adler in 1995, and is a modification of the Fletcher checksum. Compared to a cyclic redundancy check of the same length, it trades reliability for speed (preferring the latter).

Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32.', + run: Checksum.run_adler32, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'CRC-32 Checksum': { + description: 'A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.

The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of Ethernet and many other standards is the work of several researchers and was published in 1975.', + run: Checksum.run_crc32, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'Generate all hashes': { + description: 'Generates all available hashes and checksums for the input.', + run: Hash.run_all, + input_type: 'string', + output_type: 'string', + args: [], + }, + Entropy: { + description: 'Calculates the Shannon entropy of the input data which gives an idea of its randomness. 8 is the maximum.', + run: Entropy.run_entropy, + input_type: 'byte_array', + output_type: 'html', + args: [ + { + name: 'Chunk size', + type: 'number', + value: Entropy.CHUNK_SIZE, + }, + ], + }, + 'Frequency distribution': { + description: 'Displays the distribution of bytes in the data as a graph.', + run: Entropy.run_freq_distrib, + input_type: 'byte_array', + output_type: 'html', + args: [ + { + name: "Show 0%'s", + type: 'boolean', + value: Entropy.FREQ_ZEROS, + }, + ], + }, + Numberwang: { + description: 'Based on the popular gameshow by Mitchell and Webb.', + run: Numberwang.run, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Parse X.509 certificate': { + description: 'X.509 is an ITU-T standard for a public key infrastructure (PKI) and Privilege Management Infrastructure (PMI). It is commonly involved with SSL/TLS security.

This operation displays the contents of a certificate in a human readable format, similar to the openssl command line tool.', + run: PublicKey.run_parse_x509, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Input format', + type: 'option', + value: PublicKey.X509_INPUT_FORMAT, + }, + ], + }, + 'PEM to Hex': { + description: 'Converts PEM (Privacy Enhanced Mail) format to a hexadecimal DER (Distinguished Encoding Rules) string.', + run: PublicKey.run_pem_to_hex, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Hex to PEM': { + description: 'Converts a hexadecimal DER (Distinguished Encoding Rules) string into PEM (Privacy Enhanced Mail) format.', + run: PublicKey.run_hex_to_pem, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Header string', + type: 'string', + value: PublicKey.PEM_HEADER_STRING, + }, + ], + }, + 'Hex to Object Identifier': { + description: 'Converts a hexadecimal string into an object identifier (OID).', + run: PublicKey.run_hex_to_object_identifier, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Object Identifier to Hex': { + description: 'Converts an object identifier (OID) into a hexadecimal string.', + run: PublicKey.run_object_identifier_to_hex, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Parse ASN.1 hex string': { + description: 'Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.

This operation parses arbitrary ASN.1 data and presents the resulting tree.', + run: PublicKey.run_parse_asn1_hex_string, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Starting index', + type: 'number', + value: 0, + }, + { + name: 'Truncate octet strings longer than', + type: 'number', + value: PublicKey.ASN1_TRUNCATE_LENGTH, + }, + ], + }, + 'Detect File Type': { + description: "Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.

Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.", + run: FileType.run_detect, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'Scan for Embedded Files': { + description: 'Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.

WARNING: Files over about 100KB in size will take a VERY long time to process.', + run: FileType.run_scan_for_embedded_files, + input_type: 'byte_array', + output_type: 'string', + args: [ + { + name: 'Ignore common byte sequences', + type: 'boolean', + value: FileType.IGNORE_COMMON_BYTE_SEQUENCES, + }, + ], + }, + 'Expand alphabet range': { + description: 'Expand an alphabet range string into a list of the characters in that range.

e.g. a-z becomes abcdefghijklmnopqrstuvwxyz.', + run: SeqUtils.run_expand_alph_range, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Delimiter', + type: 'binary_string', + value: '', + }, + ], + }, + Diff: { + description: 'Compares two inputs (separated by the specified delimiter) and highlights the differences between them.', + run: StrUtils.run_diff, + input_type: 'string', + output_type: 'html', + args: [ + { + name: 'Sample delimiter', + type: 'binary_string', + value: StrUtils.DIFF_SAMPLE_DELIMITER, + }, + { + name: 'Diff by', + type: 'option', + value: StrUtils.DIFF_BY, + }, + { + name: 'Show added', + type: 'boolean', + value: true, + }, + { + name: 'Show removed', + type: 'boolean', + value: true, + }, + { + name: 'Ignore whitespace (relevant for word and line)', + type: 'boolean', + value: false, + }, + ], + }, + 'Parse UNIX file permissions': { + description: 'Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.

Input should be in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.', + run: OS.run_parse_unix_perms, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'Swap endianness': { + description: 'Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.', + run: Endian.run_swap_endianness, + highlight: true, + highlight_reverse: true, + input_type: 'string', + output_type: 'string', + args: [ + { + name: 'Data format', + type: 'option', + value: Endian.DATA_FORMAT, + }, + { + name: 'Word length (bytes)', + type: 'number', + value: Endian.WORD_LENGTH, + }, + { + name: 'Pad incomplete words', + type: 'boolean', + value: Endian.PAD_INCOMPLETE_WORDS, + }, + ], + }, + 'Syntax highlighter': { + description: "Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.", + run: Code.run_syntax_highlight, + highlight: true, + highlight_reverse: true, + input_type: 'string', + output_type: 'html', + args: [ + { + name: 'Language/File extension', + type: 'option', + value: Code.LANGUAGES, + }, + { + name: 'Display line numbers', + type: 'boolean', + value: Code.LINE_NUMS, + }, + ], + }, + 'Parse escaped string': { + description: 'Replaces escaped characters with the bytes they represent.

e.g.Hello\\nWorld becomes Hello
World
', + run: StrUtils.run_parse_escaped_string, + input_type: 'string', + output_type: 'string', + args: [], + }, + 'TCP/IP Checksum': { + description: 'Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.', + run: Checksum.run_tcp_ip, + input_type: 'byte_array', + output_type: 'string', + args: [], + }, + 'Parse colour code': { + description: 'Converts a colour code in a standard format to other standard formats and displays the colour itself.

Example inputs
  • #d9edf7
  • rgba(217,237,247,1)
  • hsla(200,65%,91%,1)
  • cmyk(0.12, 0.04, 0.00, 0.03)
', + run: HTML.run_parse_colour_code, + input_type: 'string', + output_type: 'html', + args: [], + }, + 'Generate UUID': { + description: 'Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).

A version 4 UUID relies on random numbers, in this case generated using window.crypto if available and falling back to Math.random if not.', + run: UUID.run_generate_v4, + input_type: 'string', + output_type: 'string', + args: [], + }, +}; diff --git a/src/js/core/Chef.js b/src/js/core/Chef.js index 459cdcf9..5edf2f7e 100755 --- a/src/js/core/Chef.js +++ b/src/js/core/Chef.js @@ -7,8 +7,8 @@ * * @class */ -var Chef = function() { - this.dish = new Dish(); +const Chef = function () { + this.dish = new Dish(); }; @@ -30,62 +30,62 @@ var Chef = function() { * @returns {number} response.duration - The number of ms it took to execute the recipe * @returns {number} response.error - The error object thrown by a failed operation (false if no error) */ -Chef.prototype.bake = function(input_text, recipe_config, options, progress, step) { - var start_time = new Date().getTime(), - recipe = new Recipe(recipe_config), - contains_fc = recipe.contains_flow_control(), - error = false; - +Chef.prototype.bake = function (input_text, recipe_config, options, progress, step) { + let start_time = new Date().getTime(), + recipe = new Recipe(recipe_config), + contains_fc = recipe.contains_flow_control(), + error = false; + // Reset attempt_highlight flag - if (options.hasOwnProperty("attempt_highlight")) { - options.attempt_highlight = true; - } - - if (contains_fc) options.attempt_highlight = false; - + if (options.hasOwnProperty('attempt_highlight')) { + options.attempt_highlight = true; + } + + if (contains_fc) options.attempt_highlight = false; + // Clean up progress - if (progress >= recipe_config.length) { - progress = 0; - } - - if (step) { + if (progress >= recipe_config.length) { + progress = 0; + } + + if (step) { // Unset breakpoint on this step - recipe.set_breakpoint(progress, false); + recipe.set_breakpoint(progress, false); // Set breakpoint on next step - recipe.set_breakpoint(progress + 1, true); - } - + recipe.set_breakpoint(progress + 1, true); + } + // If stepping with flow control, we have to start from the beginning // but still want to skip all previous breakpoints - if (progress > 0 && contains_fc) { - recipe.remove_breaks_up_to(progress); - progress = 0; - } - - // If starting from scratch, load data - if (progress === 0) { - this.dish.set(input_text, Dish.STRING); - } + if (progress > 0 && contains_fc) { + recipe.remove_breaks_up_to(progress); + progress = 0; + } - try { - progress = recipe.execute(this.dish, progress); - } catch (err) { + // If starting from scratch, load data + if (progress === 0) { + this.dish.set(input_text, Dish.STRING); + } + + try { + progress = recipe.execute(this.dish, progress); + } catch (err) { // We can't throw the error from here as we will return in the finally block and ignore it // so we return the error in the result instead. - error = err; - progress = err.progress; - } finally { - return { - result: this.dish.type == Dish.HTML ? + error = err; + progress = err.progress; + } finally { + return { + result: this.dish.type == Dish.HTML ? this.dish.get(Dish.HTML) : this.dish.get(Dish.STRING), - type: Dish.enum_lookup(this.dish.type), - progress: progress, - options: options, - duration: new Date().getTime() - start_time, - error: error - }; - } + type: Dish.enum_lookup(this.dish.type), + progress, + options, + duration: new Date().getTime() - start_time, + error, + }; + } }; @@ -94,27 +94,27 @@ Chef.prototype.bake = function(input_text, recipe_config, options, progress, ste * it swaps out the memory for that tab. If the CyberChef tab has been unfocused for more than a * minute, we run a silent bake which will force the browser to load and cache all the relevant * JavaScript code needed to do a real bake. - * + * * This will stop baking taking a long time when the CyberChef browser tab has been unfocused for a * long time and the browser has swapped out all its memory. - * + * * The output will not be modified (hence "silent" bake). - * + * * This will only actually execute the recipe if auto-bake is enabled, otherwise it will just load * the recipe, ingredients and dish. * * @param {Object[]} recipe_config - The recipe configuration object * @returns {number} The time it took to run the silent bake in milliseconds. */ -Chef.prototype.silent_bake = function(recipe_config) { - var start_time = new Date().getTime(), - recipe = new Recipe(recipe_config), - dish = new Dish("", Dish.STRING); - - try { - recipe.execute(dish); - } catch(err) { +Chef.prototype.silent_bake = function (recipe_config) { + let start_time = new Date().getTime(), + recipe = new Recipe(recipe_config), + dish = new Dish('', Dish.STRING); + + try { + recipe.execute(dish); + } catch (err) { // Suppress all errors - } - return new Date().getTime() - start_time; + } + return new Date().getTime() - start_time; }; diff --git a/src/js/core/Dish.js b/src/js/core/Dish.js index c69ebef3..37e531cb 100755 --- a/src/js/core/Dish.js +++ b/src/js/core/Dish.js @@ -9,9 +9,9 @@ * @param {byte_array|string|number} value - The value of the input data. * @param {number} type - The data type of value, see Dish enums. */ -var Dish = function(value, type) { - this.value = value || typeof value == "string" ? value : null; - this.type = type || Dish.BYTE_ARRAY; +const Dish = function (value, type) { + this.value = value || typeof value === 'string' ? value : null; + this.type = type || Dish.BYTE_ARRAY; }; @@ -48,23 +48,23 @@ Dish.HTML = 3; * @param {string} type_str - The name of the data type. * @returns {number} The data type enum value. */ -Dish.type_enum = function(type_str) { - switch (type_str) { - case "byte_array": - case "Byte array": - return Dish.BYTE_ARRAY; - case "string": - case "String": - return Dish.STRING; - case "number": - case "Number": - return Dish.NUMBER; - case "html": - case "HTML": - return Dish.HTML; - default: - throw "Invalid data type string. No matching enum."; - } +Dish.type_enum = function (type_str) { + switch (type_str) { + case 'byte_array': + case 'Byte array': + return Dish.BYTE_ARRAY; + case 'string': + case 'String': + return Dish.STRING; + case 'number': + case 'Number': + return Dish.NUMBER; + case 'html': + case 'HTML': + return Dish.HTML; + default: + throw 'Invalid data type string. No matching enum.'; + } }; @@ -75,19 +75,19 @@ Dish.type_enum = function(type_str) { * @param {string} type_enum - The enum value of the data type. * @returns {number} The data type as a string. */ -Dish.enum_lookup = function(type_enum) { - switch (type_enum) { - case Dish.BYTE_ARRAY: - return "byte_array"; - case Dish.STRING: - return "string"; - case Dish.NUMBER: - return "number"; - case Dish.HTML: - return "html"; - default: - throw "Invalid data type enum. No matching type."; - } +Dish.enum_lookup = function (type_enum) { + switch (type_enum) { + case Dish.BYTE_ARRAY: + return 'byte_array'; + case Dish.STRING: + return 'string'; + case Dish.NUMBER: + return 'number'; + case Dish.HTML: + return 'html'; + default: + throw 'Invalid data type enum. No matching type.'; + } }; @@ -97,14 +97,14 @@ Dish.enum_lookup = function(type_enum) { * @param {byte_array|string|number} value - The value of the input data. * @param {number} type - The data type of value, see Dish enums. */ -Dish.prototype.set = function(value, type) { - this.value = value; - this.type = type; - - if (!this.valid()) { - var sample = Utils.truncate(JSON.stringify(this.value), 13); - throw "Data is not a valid " + Dish.enum_lookup(type) + ": " + sample; - } +Dish.prototype.set = function (value, type) { + this.value = value; + this.type = type; + + if (!this.valid()) { + const sample = Utils.truncate(JSON.stringify(this.value), 13); + throw `Data is not a valid ${Dish.enum_lookup(type)}: ${sample}`; + } }; @@ -114,11 +114,11 @@ Dish.prototype.set = function(value, type) { * @param {number} type - The data type of value, see Dish enums. * @returns {byte_array|string|number} The value of the output data. */ -Dish.prototype.get = function(type) { - if (this.type != type) { - this.translate(type); - } - return this.value; +Dish.prototype.get = function (type) { + if (this.type != type) { + this.translate(type); + } + return this.value; }; @@ -127,39 +127,39 @@ Dish.prototype.get = function(type) { * * @param {number} to_type - The data type of value, see Dish enums. */ -Dish.prototype.translate = function(to_type) { +Dish.prototype.translate = function (to_type) { // Convert data to intermediate byte_array type - switch (this.type) { - case Dish.STRING: - this.value = this.value ? Utils.str_to_byte_array(this.value) : []; - this.type = Dish.BYTE_ARRAY; - break; - case Dish.NUMBER: - this.value = typeof this.value == "number" ? Utils.str_to_byte_array(this.value.toString()) : []; - this.type = Dish.BYTE_ARRAY; - break; - case Dish.HTML: - this.value = this.value ? Utils.str_to_byte_array(Utils.strip_html_tags(this.value, true)) : []; - this.type = Dish.BYTE_ARRAY; - break; - default: - break; - } - + switch (this.type) { + case Dish.STRING: + this.value = this.value ? Utils.str_to_byte_array(this.value) : []; + this.type = Dish.BYTE_ARRAY; + break; + case Dish.NUMBER: + this.value = typeof this.value === 'number' ? Utils.str_to_byte_array(this.value.toString()) : []; + this.type = Dish.BYTE_ARRAY; + break; + case Dish.HTML: + this.value = this.value ? Utils.str_to_byte_array(Utils.strip_html_tags(this.value, true)) : []; + this.type = Dish.BYTE_ARRAY; + break; + default: + break; + } + // Convert from byte_array to to_type - switch (to_type) { - case Dish.STRING: - case Dish.HTML: - this.value = this.value ? Utils.byte_array_to_utf8(this.value) : ""; - this.type = Dish.STRING; - break; - case Dish.NUMBER: - this.value = this.value ? parseFloat(Utils.byte_array_to_utf8(this.value)) : 0; - this.type = Dish.NUMBER; - break; - default: - break; - } + switch (to_type) { + case Dish.STRING: + case Dish.HTML: + this.value = this.value ? Utils.byte_array_to_utf8(this.value) : ''; + this.type = Dish.STRING; + break; + case Dish.NUMBER: + this.value = this.value ? parseFloat(Utils.byte_array_to_utf8(this.value)) : 0; + this.type = Dish.NUMBER; + break; + default: + break; + } }; @@ -169,34 +169,34 @@ Dish.prototype.translate = function(to_type) { * * @returns {boolean} Whether the data is valid or not. */ -Dish.prototype.valid = function() { - switch (this.type) { - case Dish.BYTE_ARRAY: - if (!(this.value instanceof Array)) { - return false; - } - +Dish.prototype.valid = function () { + switch (this.type) { + case Dish.BYTE_ARRAY: + if (!(this.value instanceof Array)) { + return false; + } + // Check that every value is a number between 0 - 255 - for (var i = 0; i < this.value.length; i++) { - if (typeof this.value[i] != "number" || + for (let i = 0; i < this.value.length; i++) { + if (typeof this.value[i] !== 'number' || this.value[i] < 0 || this.value[i] > 255) { - return false; - } - } - return true; - case Dish.STRING: - case Dish.HTML: - if (typeof this.value == "string") { - return true; - } - return false; - case Dish.NUMBER: - if (typeof this.value == "number") { - return true; - } - return false; - default: - return false; - } + return false; + } + } + return true; + case Dish.STRING: + case Dish.HTML: + if (typeof this.value === 'string') { + return true; + } + return false; + case Dish.NUMBER: + if (typeof this.value === 'number') { + return true; + } + return false; + default: + return false; + } }; diff --git a/src/js/core/FlowControl.js b/src/js/core/FlowControl.js index 51af24a0..1824c1f0 100755 --- a/src/js/core/FlowControl.js +++ b/src/js/core/FlowControl.js @@ -7,19 +7,19 @@ * * @namespace */ -var FlowControl = { +const FlowControl = { /** * @constant * @default */ - FORK_DELIM: "\\n", + FORK_DELIM: '\\n', /** * @constant * @default */ - MERGE_DELIM: "\\n", - + MERGE_DELIM: '\\n', + /** * Fork operation. * @@ -29,49 +29,50 @@ var FlowControl = { * @param {Operation[]} state.op_list - The list of operations in the recipe. * @returns {Object} The updated state of the recipe. */ - run_fork: function(state) { - var op_list = state.op_list, - input_type = op_list[state.progress].input_type, - output_type = op_list[state.progress].output_type, - input = state.dish.get(input_type), - ings = op_list[state.progress].get_ing_values(), - split_delim = ings[0], - merge_delim = ings[1], - sub_op_list = [], - inputs = []; - - if (input) - inputs = input.split(split_delim); - + run_fork(state) { + let op_list = state.op_list, + input_type = op_list[state.progress].input_type, + output_type = op_list[state.progress].output_type, + input = state.dish.get(input_type), + ings = op_list[state.progress].get_ing_values(), + split_delim = ings[0], + merge_delim = ings[1], + sub_op_list = [], + inputs = []; + + if (input) { + inputs = input.split(split_delim); + } + // Create sub_op_list for each tranche to operate on // (all remaining operations unless we encounter a Merge) - for (var i = state.progress + 1; i < op_list.length; i++) { - if (op_list[i].name == "Merge" && !op_list[i].is_disabled()) { - break; - } else { - sub_op_list.push(op_list[i]); - } - } - - var recipe = new Recipe(), - output = "", - progress; - - recipe.add_operations(sub_op_list); - + for (var i = state.progress + 1; i < op_list.length; i++) { + if (op_list[i].name == 'Merge' && !op_list[i].is_disabled()) { + break; + } else { + sub_op_list.push(op_list[i]); + } + } + + let recipe = new Recipe(), + output = '', + progress; + + recipe.add_operations(sub_op_list); + // Run recipe over each tranche - for (i = 0; i < inputs.length; i++) { - var dish = new Dish(inputs[i], input_type); - progress = recipe.execute(dish, 0); - output += dish.get(output_type) + merge_delim; - } - - state.dish.set(output, output_type); - state.progress += progress; - return state; - }, - - + for (i = 0; i < inputs.length; i++) { + const dish = new Dish(inputs[i], input_type); + progress = recipe.execute(dish, 0); + output += dish.get(output_type) + merge_delim; + } + + state.dish.set(output, output_type); + state.progress += progress; + return state; + }, + + /** * Merge operation. * @@ -81,24 +82,24 @@ var FlowControl = { * @param {Operation[]} state.op_list - The list of operations in the recipe. * @returns {Object} The updated state of the recipe. */ - run_merge: function(state) { + run_merge(state) { // No need to actually do anything here. The fork operation will // merge when it sees this operation. - return state; - }, - - + return state; + }, + + /** * @constant * @default */ - JUMP_NUM: 0, + JUMP_NUM: 0, /** * @constant * @default */ - MAX_JUMPS: 10, - + MAX_JUMPS: 10, + /** * Jump operation. * @@ -109,21 +110,21 @@ var FlowControl = { * @param {number} state.num_jumps - The number of jumps taken so far. * @returns {Object} The updated state of the recipe. */ - run_jump: function(state) { - var ings = state.op_list[state.progress].get_ing_values(), - jump_num = ings[0], - max_jumps = ings[1]; - - if (state.num_jumps >= max_jumps) { - throw "Reached maximum jumps, sorry!"; - } - - state.progress += jump_num; - state.num_jumps++; - return state; - }, - - + run_jump(state) { + let ings = state.op_list[state.progress].get_ing_values(), + jump_num = ings[0], + max_jumps = ings[1]; + + if (state.num_jumps >= max_jumps) { + throw 'Reached maximum jumps, sorry!'; + } + + state.progress += jump_num; + state.num_jumps++; + return state; + }, + + /** * Conditional Jump operation. * @@ -134,26 +135,26 @@ var FlowControl = { * @param {number} state.num_jumps - The number of jumps taken so far. * @returns {Object} The updated state of the recipe. */ - run_cond_jump: function(state) { - var ings = state.op_list[state.progress].get_ing_values(), - dish = state.dish, - regex_str = ings[0], - jump_num = ings[1], - max_jumps = ings[2]; - - if (state.num_jumps >= max_jumps) { - throw "Reached maximum jumps, sorry!"; - } - - if (regex_str !== "" && dish.get(Dish.STRING).search(regex_str) > -1) { - state.progress += jump_num; - state.num_jumps++; - } - - return state; - }, - - + run_cond_jump(state) { + let ings = state.op_list[state.progress].get_ing_values(), + dish = state.dish, + regex_str = ings[0], + jump_num = ings[1], + max_jumps = ings[2]; + + if (state.num_jumps >= max_jumps) { + throw 'Reached maximum jumps, sorry!'; + } + + if (regex_str !== '' && dish.get(Dish.STRING).search(regex_str) > -1) { + state.progress += jump_num; + state.num_jumps++; + } + + return state; + }, + + /** * Return operation. * @@ -163,9 +164,9 @@ var FlowControl = { * @param {Operation[]} state.op_list - The list of operations in the recipe. * @returns {Object} The updated state of the recipe. */ - run_return: function(state) { - state.progress = state.op_list.length; - return state; - }, - + run_return(state) { + state.progress = state.op_list.length; + return state; + }, + }; diff --git a/src/js/core/Ingredient.js b/src/js/core/Ingredient.js index df551b6f..534d6ca9 100755 --- a/src/js/core/Ingredient.js +++ b/src/js/core/Ingredient.js @@ -8,14 +8,14 @@ * @class * @param {Object} ingredient_config */ -var Ingredient = function(ingredient_config) { - this.name = ""; - this.type = ""; - this.value = null; - - if (ingredient_config) { - this._parse_config(ingredient_config); - } +const Ingredient = function (ingredient_config) { + this.name = ''; + this.type = ''; + this.value = null; + + if (ingredient_config) { + this._parse_config(ingredient_config); + } }; @@ -25,9 +25,9 @@ var Ingredient = function(ingredient_config) { * @private * @param {Object} ingredient_config */ -Ingredient.prototype._parse_config = function(ingredient_config) { - this.name = ingredient_config.name; - this.type = ingredient_config.type; +Ingredient.prototype._parse_config = function (ingredient_config) { + this.name = ingredient_config.name; + this.type = ingredient_config.type; }; @@ -36,8 +36,8 @@ Ingredient.prototype._parse_config = function(ingredient_config) { * * @returns {*} */ -Ingredient.prototype.get_config = function() { - return this.value; +Ingredient.prototype.get_config = function () { + return this.value; }; @@ -46,8 +46,8 @@ Ingredient.prototype.get_config = function() { * * @param {*} value */ -Ingredient.prototype.set_value = function(value) { - this.value = Ingredient.prepare(value, this.type); +Ingredient.prototype.set_value = function (value) { + this.value = Ingredient.prepare(value, this.type); }; @@ -59,28 +59,28 @@ Ingredient.prototype.set_value = function(value) { * @param {*} data * @param {string} type - The name of the data type. */ -Ingredient.prepare = function(data, type) { - switch (type) { - case "binary_string": - case "binary_short_string": - case "editable_option": - return Utils.parse_escaped_chars(data); - case "byte_array": - if (typeof data == "string") { - data = data.replace(/\s+/g, ''); - return Utils.hex_to_byte_array(data); - } else { - return data; - } - break; - case "number": - var number = parseFloat(data); - if (isNaN(number)) { - var sample = Utils.truncate(data.toString(), 10); - throw "Invalid ingredient value. Not a number: " + sample; - } - return number; - default: - return data; - } +Ingredient.prepare = function (data, type) { + switch (type) { + case 'binary_string': + case 'binary_short_string': + case 'editable_option': + return Utils.parse_escaped_chars(data); + case 'byte_array': + if (typeof data === 'string') { + data = data.replace(/\s+/g, ''); + return Utils.hex_to_byte_array(data); + } else { + return data; + } + break; + case 'number': + var number = parseFloat(data); + if (isNaN(number)) { + const sample = Utils.truncate(data.toString(), 10); + throw `Invalid ingredient value. Not a number: ${sample}`; + } + return number; + default: + return data; + } }; diff --git a/src/js/core/Operation.js b/src/js/core/Operation.js index 26a1e279..9c6bd150 100755 --- a/src/js/core/Operation.js +++ b/src/js/core/Operation.js @@ -9,21 +9,21 @@ * @param {string} operation_name * @param {Object} operation_config */ -var Operation = function(operation_name, operation_config) { - this.name = operation_name; - this.description = ""; - this.input_type = -1; - this.output_type = -1; - this.run = null; - this.highlight = null; - this.highlight_reverse = null; - this.breakpoint = false; - this.disabled = false; - this.ing_list = []; - - if (operation_config) { - this._parse_config(operation_config); - } +const Operation = function (operation_name, operation_config) { + this.name = operation_name; + this.description = ''; + this.input_type = -1; + this.output_type = -1; + this.run = null; + this.highlight = null; + this.highlight_reverse = null; + this.breakpoint = false; + this.disabled = false; + this.ing_list = []; + + if (operation_config) { + this._parse_config(operation_config); + } }; @@ -33,20 +33,20 @@ var Operation = function(operation_name, operation_config) { * @private * @param {Object} operation_config */ -Operation.prototype._parse_config = function(operation_config) { - this.description = operation_config.description; - this.input_type = Dish.type_enum(operation_config.input_type); - this.output_type = Dish.type_enum(operation_config.output_type); - this.run = operation_config.run; - this.highlight = operation_config.highlight; - this.highlight_reverse = operation_config.highlight_reverse; - this.flow_control = operation_config.flow_control; +Operation.prototype._parse_config = function (operation_config) { + this.description = operation_config.description; + this.input_type = Dish.type_enum(operation_config.input_type); + this.output_type = Dish.type_enum(operation_config.output_type); + this.run = operation_config.run; + this.highlight = operation_config.highlight; + this.highlight_reverse = operation_config.highlight_reverse; + this.flow_control = operation_config.flow_control; - for (var a = 0; a < operation_config.args.length; a++) { - var ingredient_config = operation_config.args[a]; - var ingredient = new Ingredient(ingredient_config); - this.add_ingredient(ingredient); - } + for (let a = 0; a < operation_config.args.length; a++) { + const ingredient_config = operation_config.args[a]; + const ingredient = new Ingredient(ingredient_config); + this.add_ingredient(ingredient); + } }; @@ -55,19 +55,19 @@ Operation.prototype._parse_config = function(operation_config) { * * @returns {Object} */ -Operation.prototype.get_config = function() { - var ingredient_config = []; - - for (var o = 0; o < this.ing_list.length; o++) { - ingredient_config.push(this.ing_list[o].get_config()); - } - - var operation_config = { - "op": this.name, - "args": ingredient_config - }; - - return operation_config; +Operation.prototype.get_config = function () { + const ingredient_config = []; + + for (let o = 0; o < this.ing_list.length; o++) { + ingredient_config.push(this.ing_list[o].get_config()); + } + + const operation_config = { + op: this.name, + args: ingredient_config, + }; + + return operation_config; }; @@ -76,8 +76,8 @@ Operation.prototype.get_config = function() { * * @param {Ingredient} ingredient */ -Operation.prototype.add_ingredient = function(ingredient) { - this.ing_list.push(ingredient); +Operation.prototype.add_ingredient = function (ingredient) { + this.ing_list.push(ingredient); }; @@ -86,10 +86,10 @@ Operation.prototype.add_ingredient = function(ingredient) { * * @param {Object[]} ing_values */ -Operation.prototype.set_ing_values = function(ing_values) { - for (var i = 0; i < ing_values.length; i++) { - this.ing_list[i].set_value(ing_values[i]); - } +Operation.prototype.set_ing_values = function (ing_values) { + for (let i = 0; i < ing_values.length; i++) { + this.ing_list[i].set_value(ing_values[i]); + } }; @@ -98,12 +98,12 @@ Operation.prototype.set_ing_values = function(ing_values) { * * @returns {Object[]} */ -Operation.prototype.get_ing_values = function() { - var ing_values = []; - for (var i = 0; i < this.ing_list.length; i++) { - ing_values.push(this.ing_list[i].value); - } - return ing_values; +Operation.prototype.get_ing_values = function () { + const ing_values = []; + for (let i = 0; i < this.ing_list.length; i++) { + ing_values.push(this.ing_list[i].value); + } + return ing_values; }; @@ -112,8 +112,8 @@ Operation.prototype.get_ing_values = function() { * * @param {boolean} value */ -Operation.prototype.set_breakpoint = function(value) { - this.breakpoint = !!value; +Operation.prototype.set_breakpoint = function (value) { + this.breakpoint = !!value; }; @@ -122,8 +122,8 @@ Operation.prototype.set_breakpoint = function(value) { * * @returns {boolean} */ -Operation.prototype.is_breakpoint = function() { - return this.breakpoint; +Operation.prototype.is_breakpoint = function () { + return this.breakpoint; }; @@ -132,8 +132,8 @@ Operation.prototype.is_breakpoint = function() { * * @param {boolean} value */ -Operation.prototype.set_disabled = function(value) { - this.disabled = !!value; +Operation.prototype.set_disabled = function (value) { + this.disabled = !!value; }; @@ -142,8 +142,8 @@ Operation.prototype.set_disabled = function(value) { * * @returns {boolean} */ -Operation.prototype.is_disabled = function() { - return this.disabled; +Operation.prototype.is_disabled = function () { + return this.disabled; }; @@ -152,6 +152,6 @@ Operation.prototype.is_disabled = function() { * * @returns {boolean} */ -Operation.prototype.is_flow_control = function() { - return this.flow_control; +Operation.prototype.is_flow_control = function () { + return this.flow_control; }; diff --git a/src/js/core/Recipe.js b/src/js/core/Recipe.js index b93d7560..a4ba7542 100755 --- a/src/js/core/Recipe.js +++ b/src/js/core/Recipe.js @@ -8,12 +8,12 @@ * @class * @param {Object} recipe_config */ -var Recipe = function(recipe_config) { - this.op_list = []; - - if (recipe_config) { - this._parse_config(recipe_config); - } +const Recipe = function (recipe_config) { + this.op_list = []; + + if (recipe_config) { + this._parse_config(recipe_config); + } }; @@ -23,16 +23,16 @@ var Recipe = function(recipe_config) { * @private * @param {Object} recipe_config */ -Recipe.prototype._parse_config = function(recipe_config) { - for (var c = 0; c < recipe_config.length; c++) { - var operation_name = recipe_config[c].op; - var operation_config = OperationConfig[operation_name]; - var operation = new Operation(operation_name, operation_config); - operation.set_ing_values(recipe_config[c].args); - operation.set_breakpoint(recipe_config[c].breakpoint); - operation.set_disabled(recipe_config[c].disabled); - this.add_operation(operation); - } +Recipe.prototype._parse_config = function (recipe_config) { + for (let c = 0; c < recipe_config.length; c++) { + const operation_name = recipe_config[c].op; + const operation_config = OperationConfig[operation_name]; + const operation = new Operation(operation_name, operation_config); + operation.set_ing_values(recipe_config[c].args); + operation.set_breakpoint(recipe_config[c].breakpoint); + operation.set_disabled(recipe_config[c].disabled); + this.add_operation(operation); + } }; @@ -41,14 +41,14 @@ Recipe.prototype._parse_config = function(recipe_config) { * * @returns {*} */ -Recipe.prototype.get_config = function() { - var recipe_config = []; - - for (var o = 0; o < this.op_list.length; o++) { - recipe_config.push(this.op_list[o].get_config()); - } - - return recipe_config; +Recipe.prototype.get_config = function () { + const recipe_config = []; + + for (let o = 0; o < this.op_list.length; o++) { + recipe_config.push(this.op_list[o].get_config()); + } + + return recipe_config; }; @@ -57,8 +57,8 @@ Recipe.prototype.get_config = function() { * * @param {Operation} operation */ -Recipe.prototype.add_operation = function(operation) { - this.op_list.push(operation); +Recipe.prototype.add_operation = function (operation) { + this.op_list.push(operation); }; @@ -67,8 +67,8 @@ Recipe.prototype.add_operation = function(operation) { * * @param {Operation[]} operations */ -Recipe.prototype.add_operations = function(operations) { - this.op_list = this.op_list.concat(operations); +Recipe.prototype.add_operations = function (operations) { + this.op_list = this.op_list.concat(operations); }; @@ -78,12 +78,12 @@ Recipe.prototype.add_operations = function(operations) { * @param {number} position - The index of the Operation * @param {boolean} value */ -Recipe.prototype.set_breakpoint = function(position, value) { - try { - this.op_list[position].set_breakpoint(value); - } catch (err) { +Recipe.prototype.set_breakpoint = function (position, value) { + try { + this.op_list[position].set_breakpoint(value); + } catch (err) { // Ignore index error - } + } }; @@ -93,10 +93,10 @@ Recipe.prototype.set_breakpoint = function(position, value) { * * @param {number} pos */ -Recipe.prototype.remove_breaks_up_to = function(pos) { - for (var i = 0; i < pos; i++) { - this.op_list[i].set_breakpoint(false); - } +Recipe.prototype.remove_breaks_up_to = function (pos) { + for (let i = 0; i < pos; i++) { + this.op_list[i].set_breakpoint(false); + } }; @@ -105,11 +105,11 @@ Recipe.prototype.remove_breaks_up_to = function(pos) { * * @returns {boolean} */ -Recipe.prototype.contains_flow_control = function() { - for (var i = 0; i < this.op_list.length; i++) { - if (this.op_list[i].is_flow_control()) return true; - } - return false; +Recipe.prototype.contains_flow_control = function () { + for (let i = 0; i < this.op_list.length; i++) { + if (this.op_list[i].is_flow_control()) return true; + } + return false; }; @@ -120,17 +120,17 @@ Recipe.prototype.contains_flow_control = function() { * @param {number} [start_index=0] - The index to start searching from * @returns (number} */ -Recipe.prototype.last_op_index = function(start_index) { - var i = start_index + 1 || 0, - op; - - for (; i < this.op_list.length; i++) { - op = this.op_list[i]; - if (op.is_disabled()) return i-1; - if (op.is_breakpoint()) return i-1; - } - - return i-1; +Recipe.prototype.last_op_index = function (start_index) { + let i = start_index + 1 || 0, + op; + + for (; i < this.op_list.length; i++) { + op = this.op_list[i]; + if (op.is_disabled()) return i - 1; + if (op.is_breakpoint()) return i - 1; + } + + return i - 1; }; @@ -141,56 +141,59 @@ Recipe.prototype.last_op_index = function(start_index) { * @param {number} [start_from=0] - The index of the Operation to start executing from * @returns {number} - The final progress through the recipe */ -Recipe.prototype.execute = function(dish, start_from) { - start_from = start_from || 0; - var op, input, output, num_jumps = 0; - - for (var i = start_from; i < this.op_list.length; i++) { - op = this.op_list[i]; - if (op.is_disabled()) { - continue; - } - if (op.is_breakpoint()) { - return i; - } - - try { - input = dish.get(op.input_type); - - if (op.is_flow_control()) { - // Package up the current state - var state = { - "progress" : i, - "dish" : dish, - "op_list" : this.op_list, - "num_jumps" : num_jumps - }; - - state = op.run(state); - i = state.progress; - num_jumps = state.num_jumps; - } else { - output = op.run(input, op.get_ing_values()); - dish.set(output, op.output_type); - } - } catch (err) { - var e = typeof err == "string" ? { message: err } : err; +Recipe.prototype.execute = function (dish, start_from) { + start_from = start_from || 0; + let op, + input, + output, + num_jumps = 0; - e.progress = i; - e.display_str = op.name + " - "; - if (e.fileName) { - e.display_str += e.name + " in " + e.fileName + - " on line " + e.lineNumber + - ".

Message: " + e.message; - } else { - e.display_str += e.message; - } - - throw e; - } + for (let i = start_from; i < this.op_list.length; i++) { + op = this.op_list[i]; + if (op.is_disabled()) { + continue; } - - return this.op_list.length; + if (op.is_breakpoint()) { + return i; + } + + try { + input = dish.get(op.input_type); + + if (op.is_flow_control()) { + // Package up the current state + let state = { + progress: i, + dish, + op_list: this.op_list, + num_jumps, + }; + + state = op.run(state); + i = state.progress; + num_jumps = state.num_jumps; + } else { + output = op.run(input, op.get_ing_values()); + dish.set(output, op.output_type); + } + } catch (err) { + const e = typeof err === 'string' ? { message: err } : err; + + e.progress = i; + e.display_str = `${op.name} - `; + if (e.fileName) { + e.display_str += `${e.name} in ${e.fileName + } on line ${e.lineNumber + }.

Message: ${e.message}`; + } else { + e.display_str += e.message; + } + + throw e; + } + } + + return this.op_list.length; }; @@ -199,8 +202,8 @@ Recipe.prototype.execute = function(dish, start_from) { * * @returns {string} */ -Recipe.prototype.to_string = function() { - return JSON.stringify(this.get_config()); +Recipe.prototype.to_string = function () { + return JSON.stringify(this.get_config()); }; @@ -209,7 +212,7 @@ Recipe.prototype.to_string = function() { * * @param {string} recipe_str */ -Recipe.prototype.from_string = function(recipe_str) { - var recipe_config = JSON.parse(recipe_str); - this._parse_config(recipe_config); +Recipe.prototype.from_string = function (recipe_str) { + const recipe_config = JSON.parse(recipe_str); + this._parse_config(recipe_config); }; diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js index 2e52517b..41951035 100755 --- a/src/js/core/Utils.js +++ b/src/js/core/Utils.js @@ -9,7 +9,7 @@ * * @namespace */ -var Utils = { +const Utils = { /** * Translates an ordinal into a character. @@ -21,9 +21,9 @@ var Utils = { * // returns 'a' * Utils.chr(97); */ - chr: function(o) { - return String.fromCharCode(o); - }, + chr(o) { + return String.fromCharCode(o); + }, /** @@ -36,9 +36,9 @@ var Utils = { * // returns 97 * Utils.ord('a'); */ - ord: function(c) { - return c.charCodeAt(0); - }, + ord(c) { + return c.charCodeAt(0); + }, /** @@ -62,13 +62,13 @@ var Utils = { * // returns "bcabchello" * Utils.pad_left("hello", 10, "abc"); */ - pad_left: function(str, max, chr) { - chr = chr || "0"; - var start_index = chr.length - (max - str.length); - start_index = start_index < 0 ? 0 : start_index; - return str.length < max ? + pad_left(str, max, chr) { + chr = chr || '0'; + let start_index = chr.length - (max - str.length); + start_index = start_index < 0 ? 0 : start_index; + return str.length < max ? Utils.pad_left(chr.slice(start_index, chr.length) + str, max, chr) : str; - }, + }, /** @@ -86,19 +86,19 @@ var Utils = { * // returns "axxx" * Utils.pad_right("a", 4, "x"); */ - pad_right: function(str, max, chr) { - chr = chr || " "; - return str.length < max ? - Utils.pad_right(str + chr.slice(0, max-str.length), max, chr) : str; - }, + pad_right(str, max, chr) { + chr = chr || ' '; + return str.length < max ? + Utils.pad_right(str + chr.slice(0, max - str.length), max, chr) : str; + }, /** * @alias Utils.pad_left */ - pad: function(str, max, chr) { - return Utils.pad_left(str, max, chr); - }, + pad(str, max, chr) { + return Utils.pad_left(str, max, chr); + }, /** @@ -116,13 +116,13 @@ var Utils = { * // returns "A long s-" * Utils.truncate("A long string", 9, "-"); */ - truncate: function(str, max, suffix) { - suffix = suffix || "..."; - if (str.length > max) { - str = str.slice(0, max - suffix.length) + suffix; - } - return str; - }, + truncate(str, max, suffix) { + suffix = suffix || '...'; + if (str.length > max) { + str = str.slice(0, max - suffix.length) + suffix; + } + return str; + }, /** @@ -139,11 +139,11 @@ var Utils = { * // returns "6e" * Utils.hex(110); */ - hex: function(c, length) { - c = typeof c == "string" ? Utils.ord(c) : c; - length = length || 2; - return Utils.pad(c.toString(16), length); - }, + hex(c, length) { + c = typeof c === 'string' ? Utils.ord(c) : c; + length = length || 2; + return Utils.pad(c.toString(16), length); + }, /** @@ -160,11 +160,11 @@ var Utils = { * // returns "01101110" * Utils.bin(110); */ - bin: function(c, length) { - c = typeof c == "string" ? Utils.ord(c) : c; - length = length || 8; - return Utils.pad(c.toString(2), length); - }, + bin(c, length) { + c = typeof c === 'string' ? Utils.ord(c) : c; + length = length || 8; + return Utils.pad(c.toString(2), length); + }, /** @@ -174,18 +174,18 @@ var Utils = { * @param {boolean} [preserve_ws=false] - Whether or not to print whitespace. * @returns {string} */ - printable: function(str, preserve_ws) { - if (window && window.app && !window.app.options.treat_as_utf8) { - str = Utils.byte_array_to_chars(Utils.str_to_byte_array(str)); - } - - var re = /[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F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D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g; - var ws_re = /[\x09-\x10\x0D\u2028\u2029]/g; - - str = str.replace(re, "."); - if (!preserve_ws) str = str.replace(ws_re, "."); - return str; - }, + printable(str, preserve_ws) { + if (window && window.app && !window.app.options.treat_as_utf8) { + str = Utils.byte_array_to_chars(Utils.str_to_byte_array(str)); + } + + const re = /[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g; + const ws_re = /[\x09-\x10\x0D\u2028\u2029]/g; + + str = str.replace(re, '.'); + if (!preserve_ws) str = str.replace(ws_re, '.'); + return str; + }, /** @@ -201,25 +201,25 @@ var Utils = { * // returns "\n" * Utils.parse_escaped_chars("\\n"); */ - parse_escaped_chars: function(str) { - return str.replace(/(\\)?\\([nrtbf]|x[\da-f]{2})/g, function(m, a, b) { - if (a == "\\") return "\\"+b; - switch (b[0]) { - case "n": - return "\n"; - case "r": - return "\r"; - case "t": - return "\t"; - case "b": - return "\b"; - case "f": - return "\f"; - case "x": - return Utils.chr(parseInt(b.substr(1), 16)); - } - }); - }, + parse_escaped_chars(str) { + return str.replace(/(\\)?\\([nrtbf]|x[\da-f]{2})/g, (m, a, b) => { + if (a == '\\') return `\\${b}`; + switch (b[0]) { + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'x': + return Utils.chr(parseInt(b.substr(1), 16)); + } + }); + }, /** @@ -238,31 +238,31 @@ var Utils = { * // returns ["a", "b", "c", "d", "0", "-", "3"] * Utils.expand_alph_range("a-d0\\-3") */ - expand_alph_range: function(alph_str) { - var alph_arr = []; - - for (var i = 0; i < alph_str.length; i++) { - if (i < alph_str.length - 2 && - alph_str[i+1] == "-" && - alph_str[i] != "\\") { - var start = Utils.ord(alph_str[i]), - end = Utils.ord(alph_str[i+2]); - - for (var j = start; j <= end; j++) { - alph_arr.push(Utils.chr(j)); - } - i += 2; - } else if (i < alph_str.length - 2 && - alph_str[i] == "\\" && - alph_str[i+1] == "-") { - alph_arr.push("-"); - i++; - } else { - alph_arr.push(alph_str[i]); - } + expand_alph_range(alph_str) { + const alph_arr = []; + + for (let i = 0; i < alph_str.length; i++) { + if (i < alph_str.length - 2 && + alph_str[i + 1] == '-' && + alph_str[i] != '\\') { + let start = Utils.ord(alph_str[i]), + end = Utils.ord(alph_str[i + 2]); + + for (let j = start; j <= end; j++) { + alph_arr.push(Utils.chr(j)); } - return alph_arr; - }, + i += 2; + } else if (i < alph_str.length - 2 && + alph_str[i] == '\\' && + alph_str[i + 1] == '-') { + alph_arr.push('-'); + i++; + } else { + alph_arr.push(alph_str[i]); + } + } + return alph_arr; + }, /** @@ -275,16 +275,16 @@ var Utils = { * // returns [0xfe, 0x09, 0xa7] * Utils.hex_to_byte_array("fe09a7"); */ - hex_to_byte_array: function(hex_str) { + hex_to_byte_array(hex_str) { // TODO: Handle errors i.e. input string is not hex - if (!hex_str) return []; - hex_str = hex_str.replace(/\s+/g, ''); - var byte_array = []; - for (var i = 0; i < hex_str.length; i += 2) { - byte_array.push(parseInt(hex_str.substr(i, 2), 16)); - } - return byte_array; - }, + if (!hex_str) return []; + hex_str = hex_str.replace(/\s+/g, ''); + const byte_array = []; + for (let i = 0; i < hex_str.length; i += 2) { + byte_array.push(parseInt(hex_str.substr(i, 2), 16)); + } + return byte_array; + }, /** @@ -297,14 +297,14 @@ var Utils = { * // returns "fe09a7" * Utils.byte_array_to_hex([0xfe, 0x09, 0xa7]); */ - byte_array_to_hex: function(byte_array) { - if (!byte_array) return ""; - var hex_str = ""; - for (var i = 0; i < byte_array.length; i++) { - hex_str += Utils.hex(byte_array[i]) + " "; - } - return hex_str.slice(0, hex_str.length-1); - }, + byte_array_to_hex(byte_array) { + if (!byte_array) return ''; + let hex_str = ''; + for (let i = 0; i < byte_array.length; i++) { + hex_str += `${Utils.hex(byte_array[i])} `; + } + return hex_str.slice(0, hex_str.length - 1); + }, /** @@ -321,17 +321,18 @@ var Utils = { * // returns [228,189,160,229,165,189] * Utils.str_to_byte_array("你好"); */ - str_to_byte_array: function(str) { - var byte_array = new Array(str.length); - var i = str.length, b; - while (i--) { - b = str.charCodeAt(i); - byte_array[i] = b; + str_to_byte_array(str) { + const byte_array = new Array(str.length); + let i = str.length, + b; + while (i--) { + b = str.charCodeAt(i); + byte_array[i] = b; // If any of the bytes are over 255, read as UTF-8 - if (b > 255) return Utils.str_to_utf8_byte_array(str); - } - return byte_array; - }, + if (b > 255) return Utils.str_to_utf8_byte_array(str); + } + return byte_array; + }, /** @@ -347,14 +348,15 @@ var Utils = { * // returns [228,189,160,229,165,189] * Utils.str_to_utf8_byte_array("你好"); */ - str_to_utf8_byte_array: function(str) { - var word_array = CryptoJS.enc.Utf8.parse(str), - byte_array = Utils.word_array_to_byte_array(word_array); + str_to_utf8_byte_array(str) { + let word_array = CryptoJS.enc.Utf8.parse(str), + byte_array = Utils.word_array_to_byte_array(word_array); - if (str.length != word_array.sigBytes) - window.app.options.attempt_highlight = false; - return byte_array; - }, + if (str.length != word_array.sigBytes) { + window.app.options.attempt_highlight = false; + } + return byte_array; + }, /** @@ -370,14 +372,14 @@ var Utils = { * // returns [20320,22909] * Utils.str_to_charcode("你好"); */ - str_to_charcode: function(str) { - var byte_array = new Array(str.length); - var i = str.length; - while (i--) { - byte_array[i] = str.charCodeAt(i); - } - return byte_array; - }, + str_to_charcode(str) { + const byte_array = new Array(str.length); + let i = str.length; + while (i--) { + byte_array[i] = str.charCodeAt(i); + } + return byte_array; + }, /** @@ -393,24 +395,25 @@ var Utils = { * // returns "你好" * Utils.byte_array_to_utf8([228,189,160,229,165,189]); */ - byte_array_to_utf8: function(byte_array) { - try { + byte_array_to_utf8(byte_array) { + try { // Try to output data as UTF-8 string - var words = []; - for (var i = 0; i < byte_array.length; i++) { - words[i >>> 2] |= byte_array[i] << (24 - (i % 4) * 8); - } - var word_array = new CryptoJS.lib.WordArray.init(words, byte_array.length), - str = CryptoJS.enc.Utf8.stringify(word_array); - - if (str.length != word_array.sigBytes) - window.app.options.attempt_highlight = false; - return str; - } catch (err) { + const words = []; + for (let i = 0; i < byte_array.length; i++) { + words[i >>> 2] |= byte_array[i] << (24 - (i % 4) * 8); + } + let word_array = new CryptoJS.lib.WordArray.init(words, byte_array.length), + str = CryptoJS.enc.Utf8.stringify(word_array); + + if (str.length != word_array.sigBytes) { + window.app.options.attempt_highlight = false; + } + return str; + } catch (err) { // If it fails, treat it as ANSI - return Utils.byte_array_to_chars(byte_array); - } - }, + return Utils.byte_array_to_chars(byte_array); + } + }, /** @@ -426,16 +429,16 @@ var Utils = { * // returns "你好" * Utils.byte_array_to_chars([20320,22909]); */ - byte_array_to_chars: function(byte_array) { - if (!byte_array) return ""; - var str = ""; - for (var i = 0; i < byte_array.length;) { - str += String.fromCharCode(byte_array[i++]); - } - return str; - }, - - + byte_array_to_chars(byte_array) { + if (!byte_array) return ''; + let str = ''; + for (let i = 0; i < byte_array.length;) { + str += String.fromCharCode(byte_array[i++]); + } + return str; + }, + + /** * Converts a CryptoJS.lib.WordArray to a byte_array. * @@ -446,18 +449,18 @@ var Utils = { * // returns [84, 101, 115, 116] * Utils.word_array_to_byte_array(CryptoJS.enc.Hex.parse("54657374")); */ - word_array_to_byte_array: function(word_array) { - if (word_array.sigBytes <= 0) return []; - - var words = word_array.words, - byte_array = []; - - for (var i = 0; i < word_array.sigBytes; i++) { - byte_array.push((words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff); - } - - return byte_array; - }, + word_array_to_byte_array(word_array) { + if (word_array.sigBytes <= 0) return []; + + let words = word_array.words, + byte_array = []; + + for (let i = 0; i < word_array.sigBytes; i++) { + byte_array.push((words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff); + } + + return byte_array; + }, /** @@ -465,74 +468,74 @@ var Utils = { * @private * @constant */ - UNIC_WIN1251_MAP: { - 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, - 14: 14, 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, 21: 21, 22: 22, 23: 23, 24: 24, - 25: 25, 26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, - 36: 36, 37: 37, 38: 38, 39: 39, 40: 40, 41: 41, 42: 42, 43: 43, 44: 44, 45: 45, 46: 46, - 47: 47, 48: 48, 49: 49, 50: 50, 51: 51, 52: 52, 53: 53, 54: 54, 55: 55, 56: 56, 57: 57, - 58: 58, 59: 59, 60: 60, 61: 61, 62: 62, 63: 63, 64: 64, 65: 65, 66: 66, 67: 67, 68: 68, - 69: 69, 70: 70, 71: 71, 72: 72, 73: 73, 74: 74, 75: 75, 76: 76, 77: 77, 78: 78, 79: 79, - 80: 80, 81: 81, 82: 82, 83: 83, 84: 84, 85: 85, 86: 86, 87: 87, 88: 88, 89: 89, 90: 90, - 91: 91, 92: 92, 93: 93, 94: 94, 95: 95, 96: 96, 97: 97, 98: 98, 99: 99, 100: 100, 101: 101, - 102: 102, 103: 103, 104: 104, 105: 105, 106: 106, 107: 107, 108: 108, 109: 109, 110: 110, - 111: 111, 112: 112, 113: 113, 114: 114, 115: 115, 116: 116, 117: 117, 118: 118, 119: 119, - 120: 120, 121: 121, 122: 122, 123: 123, 124: 124, 125: 125, 126: 126, 127: 127, 1027: 129, - 8225: 135, 1046: 198, 8222: 132, 1047: 199, 1168: 165, 1048: 200, 1113: 154, 1049: 201, - 1045: 197, 1050: 202, 1028: 170, 160: 160, 1040: 192, 1051: 203, 164: 164, 166: 166, - 167: 167, 169: 169, 171: 171, 172: 172, 173: 173, 174: 174, 1053: 205, 176: 176, 177: 177, - 1114: 156, 181: 181, 182: 182, 183: 183, 8221: 148, 187: 187, 1029: 189, 1056: 208, - 1057: 209, 1058: 210, 8364: 136, 1112: 188, 1115: 158, 1059: 211, 1060: 212, 1030: 178, - 1061: 213, 1062: 214, 1063: 215, 1116: 157, 1064: 216, 1065: 217, 1031: 175, 1066: 218, - 1067: 219, 1068: 220, 1069: 221, 1070: 222, 1032: 163, 8226: 149, 1071: 223, 1072: 224, - 8482: 153, 1073: 225, 8240: 137, 1118: 162, 1074: 226, 1110: 179, 8230: 133, 1075: 227, - 1033: 138, 1076: 228, 1077: 229, 8211: 150, 1078: 230, 1119: 159, 1079: 231, 1042: 194, - 1080: 232, 1034: 140, 1025: 168, 1081: 233, 1082: 234, 8212: 151, 1083: 235, 1169: 180, - 1084: 236, 1052: 204, 1085: 237, 1035: 142, 1086: 238, 1087: 239, 1088: 240, 1089: 241, - 1090: 242, 1036: 141, 1041: 193, 1091: 243, 1092: 244, 8224: 134, 1093: 245, 8470: 185, - 1094: 246, 1054: 206, 1095: 247, 1096: 248, 8249: 139, 1097: 249, 1098: 250, 1044: 196, - 1099: 251, 1111: 191, 1055: 207, 1100: 252, 1038: 161, 8220: 147, 1101: 253, 8250: 155, - 1102: 254, 8216: 145, 1103: 255, 1043: 195, 1105: 184, 1039: 143, 1026: 128, 1106: 144, - 8218: 130, 1107: 131, 8217: 146, 1108: 186, 1109: 190 - }, + UNIC_WIN1251_MAP: { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, + 14: 14, 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, 21: 21, 22: 22, 23: 23, 24: 24, + 25: 25, 26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, + 36: 36, 37: 37, 38: 38, 39: 39, 40: 40, 41: 41, 42: 42, 43: 43, 44: 44, 45: 45, 46: 46, + 47: 47, 48: 48, 49: 49, 50: 50, 51: 51, 52: 52, 53: 53, 54: 54, 55: 55, 56: 56, 57: 57, + 58: 58, 59: 59, 60: 60, 61: 61, 62: 62, 63: 63, 64: 64, 65: 65, 66: 66, 67: 67, 68: 68, + 69: 69, 70: 70, 71: 71, 72: 72, 73: 73, 74: 74, 75: 75, 76: 76, 77: 77, 78: 78, 79: 79, + 80: 80, 81: 81, 82: 82, 83: 83, 84: 84, 85: 85, 86: 86, 87: 87, 88: 88, 89: 89, 90: 90, + 91: 91, 92: 92, 93: 93, 94: 94, 95: 95, 96: 96, 97: 97, 98: 98, 99: 99, 100: 100, 101: 101, + 102: 102, 103: 103, 104: 104, 105: 105, 106: 106, 107: 107, 108: 108, 109: 109, 110: 110, + 111: 111, 112: 112, 113: 113, 114: 114, 115: 115, 116: 116, 117: 117, 118: 118, 119: 119, + 120: 120, 121: 121, 122: 122, 123: 123, 124: 124, 125: 125, 126: 126, 127: 127, 1027: 129, + 8225: 135, 1046: 198, 8222: 132, 1047: 199, 1168: 165, 1048: 200, 1113: 154, 1049: 201, + 1045: 197, 1050: 202, 1028: 170, 160: 160, 1040: 192, 1051: 203, 164: 164, 166: 166, + 167: 167, 169: 169, 171: 171, 172: 172, 173: 173, 174: 174, 1053: 205, 176: 176, 177: 177, + 1114: 156, 181: 181, 182: 182, 183: 183, 8221: 148, 187: 187, 1029: 189, 1056: 208, + 1057: 209, 1058: 210, 8364: 136, 1112: 188, 1115: 158, 1059: 211, 1060: 212, 1030: 178, + 1061: 213, 1062: 214, 1063: 215, 1116: 157, 1064: 216, 1065: 217, 1031: 175, 1066: 218, + 1067: 219, 1068: 220, 1069: 221, 1070: 222, 1032: 163, 8226: 149, 1071: 223, 1072: 224, + 8482: 153, 1073: 225, 8240: 137, 1118: 162, 1074: 226, 1110: 179, 8230: 133, 1075: 227, + 1033: 138, 1076: 228, 1077: 229, 8211: 150, 1078: 230, 1119: 159, 1079: 231, 1042: 194, + 1080: 232, 1034: 140, 1025: 168, 1081: 233, 1082: 234, 8212: 151, 1083: 235, 1169: 180, + 1084: 236, 1052: 204, 1085: 237, 1035: 142, 1086: 238, 1087: 239, 1088: 240, 1089: 241, + 1090: 242, 1036: 141, 1041: 193, 1091: 243, 1092: 244, 8224: 134, 1093: 245, 8470: 185, + 1094: 246, 1054: 206, 1095: 247, 1096: 248, 8249: 139, 1097: 249, 1098: 250, 1044: 196, + 1099: 251, 1111: 191, 1055: 207, 1100: 252, 1038: 161, 8220: 147, 1101: 253, 8250: 155, + 1102: 254, 8216: 145, 1103: 255, 1043: 195, 1105: 184, 1039: 143, 1026: 128, 1106: 144, + 8218: 130, 1107: 131, 8217: 146, 1108: 186, 1109: 190, + }, /** * Mapping of Windows-1251 code points to Unicode * @private * @constant */ - WIN1251_UNIC_MAP: { - 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, - 14: 14, 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, 21: 21, 22: 22, 23: 23, 24: 24, - 25: 25, 26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, - 36: 36, 37: 37, 38: 38, 39: 39, 40: 40, 41: 41, 42: 42, 43: 43, 44: 44, 45: 45, 46: 46, - 47: 47, 48: 48, 49: 49, 50: 50, 51: 51, 52: 52, 53: 53, 54: 54, 55: 55, 56: 56, 57: 57, - 58: 58, 59: 59, 60: 60, 61: 61, 62: 62, 63: 63, 64: 64, 65: 65, 66: 66, 67: 67, 68: 68, - 69: 69, 70: 70, 71: 71, 72: 72, 73: 73, 74: 74, 75: 75, 76: 76, 77: 77, 78: 78, 79: 79, - 80: 80, 81: 81, 82: 82, 83: 83, 84: 84, 85: 85, 86: 86, 87: 87, 88: 88, 89: 89, 90: 90, - 91: 91, 92: 92, 93: 93, 94: 94, 95: 95, 96: 96, 97: 97, 98: 98, 99: 99, 100: 100, 101: 101, - 102: 102, 103: 103, 104: 104, 105: 105, 106: 106, 107: 107, 108: 108, 109: 109, 110: 110, - 111: 111, 112: 112, 113: 113, 114: 114, 115: 115, 116: 116, 117: 117, 118: 118, 119: 119, - 120: 120, 121: 121, 122: 122, 123: 123, 124: 124, 125: 125, 126: 126, 127: 127, 160: 160, - 164: 164, 166: 166, 167: 167, 169: 169, 171: 171, 172: 172, 173: 173, 174: 174, 176: 176, - 177: 177, 181: 181, 182: 182, 183: 183, 187: 187, 168: 1025, 128: 1026, 129: 1027, - 170: 1028, 189: 1029, 178: 1030, 175: 1031, 163: 1032, 138: 1033, 140: 1034, 142: 1035, - 141: 1036, 161: 1038, 143: 1039, 192: 1040, 193: 1041, 194: 1042, 195: 1043, 196: 1044, - 197: 1045, 198: 1046, 199: 1047, 200: 1048, 201: 1049, 202: 1050, 203: 1051, 204: 1052, - 205: 1053, 206: 1054, 207: 1055, 208: 1056, 209: 1057, 210: 1058, 211: 1059, 212: 1060, - 213: 1061, 214: 1062, 215: 1063, 216: 1064, 217: 1065, 218: 1066, 219: 1067, 220: 1068, - 221: 1069, 222: 1070, 223: 1071, 224: 1072, 225: 1073, 226: 1074, 227: 1075, 228: 1076, - 229: 1077, 230: 1078, 231: 1079, 232: 1080, 233: 1081, 234: 1082, 235: 1083, 236: 1084, - 237: 1085, 238: 1086, 239: 1087, 240: 1088, 241: 1089, 242: 1090, 243: 1091, 244: 1092, - 245: 1093, 246: 1094, 247: 1095, 248: 1096, 249: 1097, 250: 1098, 251: 1099, 252: 1100, - 253: 1101, 254: 1102, 255: 1103, 184: 1105, 144: 1106, 131: 1107, 186: 1108, 190: 1109, - 179: 1110, 191: 1111, 188: 1112, 154: 1113, 156: 1114, 158: 1115, 157: 1116, 162: 1118, - 159: 1119, 165: 1168, 180: 1169, 150: 8211, 151: 8212, 145: 8216, 146: 8217, 130: 8218, - 147: 8220, 148: 8221, 132: 8222, 134: 8224, 135: 8225, 149: 8226, 133: 8230, 137: 8240, - 139: 8249, 155: 8250, 136: 8364, 185: 8470, 153: 8482 - }, + WIN1251_UNIC_MAP: { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, + 14: 14, 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, 21: 21, 22: 22, 23: 23, 24: 24, + 25: 25, 26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, + 36: 36, 37: 37, 38: 38, 39: 39, 40: 40, 41: 41, 42: 42, 43: 43, 44: 44, 45: 45, 46: 46, + 47: 47, 48: 48, 49: 49, 50: 50, 51: 51, 52: 52, 53: 53, 54: 54, 55: 55, 56: 56, 57: 57, + 58: 58, 59: 59, 60: 60, 61: 61, 62: 62, 63: 63, 64: 64, 65: 65, 66: 66, 67: 67, 68: 68, + 69: 69, 70: 70, 71: 71, 72: 72, 73: 73, 74: 74, 75: 75, 76: 76, 77: 77, 78: 78, 79: 79, + 80: 80, 81: 81, 82: 82, 83: 83, 84: 84, 85: 85, 86: 86, 87: 87, 88: 88, 89: 89, 90: 90, + 91: 91, 92: 92, 93: 93, 94: 94, 95: 95, 96: 96, 97: 97, 98: 98, 99: 99, 100: 100, 101: 101, + 102: 102, 103: 103, 104: 104, 105: 105, 106: 106, 107: 107, 108: 108, 109: 109, 110: 110, + 111: 111, 112: 112, 113: 113, 114: 114, 115: 115, 116: 116, 117: 117, 118: 118, 119: 119, + 120: 120, 121: 121, 122: 122, 123: 123, 124: 124, 125: 125, 126: 126, 127: 127, 160: 160, + 164: 164, 166: 166, 167: 167, 169: 169, 171: 171, 172: 172, 173: 173, 174: 174, 176: 176, + 177: 177, 181: 181, 182: 182, 183: 183, 187: 187, 168: 1025, 128: 1026, 129: 1027, + 170: 1028, 189: 1029, 178: 1030, 175: 1031, 163: 1032, 138: 1033, 140: 1034, 142: 1035, + 141: 1036, 161: 1038, 143: 1039, 192: 1040, 193: 1041, 194: 1042, 195: 1043, 196: 1044, + 197: 1045, 198: 1046, 199: 1047, 200: 1048, 201: 1049, 202: 1050, 203: 1051, 204: 1052, + 205: 1053, 206: 1054, 207: 1055, 208: 1056, 209: 1057, 210: 1058, 211: 1059, 212: 1060, + 213: 1061, 214: 1062, 215: 1063, 216: 1064, 217: 1065, 218: 1066, 219: 1067, 220: 1068, + 221: 1069, 222: 1070, 223: 1071, 224: 1072, 225: 1073, 226: 1074, 227: 1075, 228: 1076, + 229: 1077, 230: 1078, 231: 1079, 232: 1080, 233: 1081, 234: 1082, 235: 1083, 236: 1084, + 237: 1085, 238: 1086, 239: 1087, 240: 1088, 241: 1089, 242: 1090, 243: 1091, 244: 1092, + 245: 1093, 246: 1094, 247: 1095, 248: 1096, 249: 1097, 250: 1098, 251: 1099, 252: 1100, + 253: 1101, 254: 1102, 255: 1103, 184: 1105, 144: 1106, 131: 1107, 186: 1108, 190: 1109, + 179: 1110, 191: 1111, 188: 1112, 154: 1113, 156: 1114, 158: 1115, 157: 1116, 162: 1118, + 159: 1119, 165: 1168, 180: 1169, 150: 8211, 151: 8212, 145: 8216, 146: 8217, 130: 8218, + 147: 8220, 148: 8221, 132: 8222, 134: 8224, 135: 8225, 149: 8226, 133: 8230, 137: 8240, + 139: 8249, 155: 8250, 136: 8364, 185: 8470, 153: 8482, + }, + - /** * Converts a Unicode string to Windows-1251 encoding * @@ -543,18 +546,19 @@ var Utils = { * // returns "îáíîâëåííàÿ òåõíè÷êà ïî Áîèíãó. îðèãèíàë ó ìåíÿ. çàáåðåòå êîãäà áóäåòå â ÊÈ" * Utils.unicode_to_win1251("обновленная техничка по Боингу. оригинал у меня. заберете когда будете в КИ"); */ - unicode_to_win1251: function(unic_str) { - var res = []; - - for (var i = 0; i < unic_str.length; i++) { - var ord = unic_str.charCodeAt(i); - if (!(ord in Utils.UNIC_WIN1251_MAP)) - throw "Character '" + unic_str.charAt(i) + "' isn't supported by Windows-1251"; - res.push(String.fromCharCode(Utils.UNIC_WIN1251_MAP[ord])); - } - - return res.join(''); - }, + unicode_to_win1251(unic_str) { + const res = []; + + for (let i = 0; i < unic_str.length; i++) { + const ord = unic_str.charCodeAt(i); + if (!(ord in Utils.UNIC_WIN1251_MAP)) { + throw `Character '${unic_str.charAt(i)}' isn't supported by Windows-1251`; + } + res.push(String.fromCharCode(Utils.UNIC_WIN1251_MAP[ord])); + } + + return res.join(''); + }, /** @@ -567,18 +571,19 @@ var Utils = { * // returns "обновленная техничка по Боингу. оригинал у меня. заберете когда будете в КИ" * Utils.unicode_to_win1251("îáíîâëåííàÿ òåõíè÷êà ïî Áîèíãó. îðèãèíàë ó ìåíÿ. çàáåðåòå êîãäà áóäåòå â ÊÈ"); */ - win1251_to_unicode: function(win1251_str) { - var res = []; - - for (var i = 0; i < win1251_str.length; i++) { - var ord = win1251_str.charCodeAt(i); - if (!(ord in Utils.WIN1251_UNIC_MAP)) - throw "Character '" + win1251_str.charAt(i) + "' isn't supported by Windows-1251"; - res.push(String.fromCharCode(Utils.WIN1251_UNIC_MAP[ord])); - } - - return res.join(''); - }, + win1251_to_unicode(win1251_str) { + const res = []; + + for (let i = 0; i < win1251_str.length; i++) { + const ord = win1251_str.charCodeAt(i); + if (!(ord in Utils.WIN1251_UNIC_MAP)) { + throw `Character '${win1251_str.charAt(i)}' isn't supported by Windows-1251`; + } + res.push(String.fromCharCode(Utils.WIN1251_UNIC_MAP[ord])); + } + + return res.join(''); + }, /** @@ -595,42 +600,47 @@ var Utils = { * // returns "SGVsbG8=" * Utils.to_base64("Hello"); */ - to_base64: function(data, alphabet) { - if (!data) return ""; - if (typeof data == "string") { - data = Utils.str_to_byte_array(data); - } - - alphabet = alphabet ? - Utils.expand_alph_range(alphabet).join("") : - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - var output = "", - chr1, chr2, chr3, - enc1, enc2, enc3, enc4, - i = 0; + to_base64(data, alphabet) { + if (!data) return ''; + if (typeof data === 'string') { + data = Utils.str_to_byte_array(data); + } - while (i < data.length) { - chr1 = data[i++]; - chr2 = data[i++]; - chr3 = data[i++]; + alphabet = alphabet ? + Utils.expand_alph_range(alphabet).join('') : + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + let output = '', + chr1, + chr2, + chr3, + enc1, + enc2, + enc3, + enc4, + i = 0; - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; + while (i < data.length) { + chr1 = data[i++]; + chr2 = data[i++]; + chr3 = data[i++]; - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; - output += alphabet.charAt(enc1) + alphabet.charAt(enc2) + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output += alphabet.charAt(enc1) + alphabet.charAt(enc2) + alphabet.charAt(enc3) + alphabet.charAt(enc4); - } + } - return output; - }, + return output; + }, /** @@ -649,55 +659,61 @@ var Utils = { * // returns [72, 101, 108, 108, 111] * Utils.from_base64("SGVsbG8=", null, "byte_array"); */ - from_base64: function(data, alphabet, return_type, remove_non_alph_chars) { - return_type = return_type || "string"; - - if (!data) { - return return_type == "string" ? "" : []; - } - - alphabet = alphabet ? - Utils.expand_alph_range(alphabet).join("") : - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - if (remove_non_alph_chars === undefined) - remove_non_alph_chars = true; - - var output = [], - chr1, chr2, chr3, - enc1, enc2, enc3, enc4, - i = 0; - - if (remove_non_alph_chars) { - var re = new RegExp("[^" + alphabet.replace(/[\[\]\\\-^$]/g, "\\$&") + "]", "g"); - data = data.replace(re, ""); - } + from_base64(data, alphabet, return_type, remove_non_alph_chars) { + return_type = return_type || 'string'; - while (i < data.length) { - enc1 = alphabet.indexOf(data.charAt(i++)); - enc2 = alphabet.indexOf(data.charAt(i++) || "="); - enc3 = alphabet.indexOf(data.charAt(i++) || "="); - enc4 = alphabet.indexOf(data.charAt(i++) || "="); - - enc2 = enc2 == -1 ? 64 : enc2; - enc3 = enc3 == -1 ? 64 : enc3; - enc4 = enc4 == -1 ? 64 : enc4; + if (!data) { + return return_type == 'string' ? '' : []; + } - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; + alphabet = alphabet ? + Utils.expand_alph_range(alphabet).join('') : + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + if (remove_non_alph_chars === undefined) { + remove_non_alph_chars = true; + } - output.push(chr1); + let output = [], + chr1, + chr2, + chr3, + enc1, + enc2, + enc3, + enc4, + i = 0; - if (enc3 != 64) { - output.push(chr2); - } - if (enc4 != 64) { - output.push(chr3); - } - } - - return return_type == "string" ? Utils.byte_array_to_utf8(output) : output; - }, + if (remove_non_alph_chars) { + const re = new RegExp(`[^${alphabet.replace(/[\[\]\\\-^$]/g, '\\$&')}]`, 'g'); + data = data.replace(re, ''); + } + + while (i < data.length) { + enc1 = alphabet.indexOf(data.charAt(i++)); + enc2 = alphabet.indexOf(data.charAt(i++) || '='); + enc3 = alphabet.indexOf(data.charAt(i++) || '='); + enc4 = alphabet.indexOf(data.charAt(i++) || '='); + + enc2 = enc2 == -1 ? 64 : enc2; + enc3 = enc3 == -1 ? 64 : enc3; + enc4 = enc4 == -1 ? 64 : enc4; + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output.push(chr1); + + if (enc3 != 64) { + output.push(chr2); + } + if (enc4 != 64) { + output.push(chr3); + } + } + + return return_type == 'string' ? Utils.byte_array_to_utf8(output) : output; + }, /** @@ -715,28 +731,27 @@ var Utils = { * // returns "0a:14:1e" * Utils.to_hex([10,20,30], ":"); */ - to_hex: function(data, delim, padding) { - if (!data) return ""; - - delim = typeof delim == "string" ? delim : " "; - padding = padding || 2; - var output = ""; - - for (var i = 0; i < data.length; i++) { - output += Utils.pad(data[i].toString(16), padding) + delim; - } - + to_hex(data, delim, padding) { + if (!data) return ''; + + delim = typeof delim === 'string' ? delim : ' '; + padding = padding || 2; + let output = ''; + + for (let i = 0; i < data.length; i++) { + output += Utils.pad(data[i].toString(16), padding) + delim; + } + // Add \x or 0x to beginning - if (delim == "0x") output = "0x" + output; - if (delim == "\\x") output = "\\x" + output; - - if (delim.length) - return output.slice(0, -delim.length); - else - return output; - }, - - + if (delim == '0x') output = `0x${output}`; + if (delim == '\\x') output = `\\x${output}`; + + if (delim.length) { + return output.slice(0, -delim.length); + } else { return output; } + }, + + /** * Convert a byte array into a hex string as efficiently as possible with no options. * @@ -747,18 +762,18 @@ var Utils = { * // returns "0a141e" * Utils.to_hex([10,20,30]); */ - to_hex_fast: function(data) { - if (!data) return ""; - - var output = []; - - for (var i = 0; i < data.length; i++) { - output.push((data[i] >>> 4).toString(16)); - output.push((data[i] & 0x0f).toString(16)); - } - - return output.join(""); - }, + to_hex_fast(data) { + if (!data) return ''; + + const output = []; + + for (let i = 0; i < data.length; i++) { + output.push((data[i] >>> 4).toString(16)); + output.push((data[i] & 0x0f).toString(16)); + } + + return output.join(''); + }, /** @@ -776,22 +791,22 @@ var Utils = { * // returns [10,20,30] * Utils.from_hex("0a:14:1e", "Colon"); */ - from_hex: function(data, delim, byte_len) { - delim = delim || (data.indexOf(" ") >= 0 ? "Space" : "None"); - byte_len = byte_len || 2; - if (delim != "None") { - var delim_regex = Utils.regex_rep[delim]; - data = data.replace(delim_regex, ''); - } - - var output = []; - for (var i = 0; i < data.length; i += byte_len) { - output.push(parseInt(data.substr(i, byte_len), 16)); - } - return output; - }, - - + from_hex(data, delim, byte_len) { + delim = delim || (data.indexOf(' ') >= 0 ? 'Space' : 'None'); + byte_len = byte_len || 2; + if (delim != 'None') { + const delim_regex = Utils.regex_rep[delim]; + data = data.replace(delim_regex, ''); + } + + const output = []; + for (let i = 0; i < data.length; i += byte_len) { + output.push(parseInt(data.substr(i, byte_len), 16)); + } + return output; + }, + + /** * Parses CSV data and returns it as a two dimensional array or strings. * @@ -802,47 +817,46 @@ var Utils = { * // returns [["head1", "head2"], ["data1", "data2"]] * Utils.parse_csv("head1,head2\ndata1,data2"); */ - parse_csv: function(data) { - - var b, - ignore_next = false, - in_string = false, - cell = "", - line = [], - lines = []; - - for (var i = 0; i < data.length; i++) { - b = data[i]; - if (ignore_next) { - cell += b; - ignore_next = false; - } else if (b == "\\") { - cell += b; - ignore_next = true; - } else if (b == "\"" && !in_string) { - in_string = true; - } else if (b == "\"" && in_string) { - in_string = false; - } else if (b == "," && !in_string) { - line.push(cell); - cell = ""; - } else if ((b == "\n" || b == "\r") && !in_string) { - line.push(cell); - cell = ""; - lines.push(line); - line = []; - } else { - cell += b; - } - } - - if (line.length) { - line.push(cell); - lines.push(line); - } - - return lines; - }, + parse_csv(data) { + let b, + ignore_next = false, + in_string = false, + cell = '', + line = [], + lines = []; + + for (let i = 0; i < data.length; i++) { + b = data[i]; + if (ignore_next) { + cell += b; + ignore_next = false; + } else if (b == '\\') { + cell += b; + ignore_next = true; + } else if (b == '"' && !in_string) { + in_string = true; + } else if (b == '"' && in_string) { + in_string = false; + } else if (b == ',' && !in_string) { + line.push(cell); + cell = ''; + } else if ((b == '\n' || b == '\r') && !in_string) { + line.push(cell); + cell = ''; + lines.push(line); + line = []; + } else { + cell += b; + } + } + + if (line.length) { + line.push(cell); + lines.push(line); + } + + return lines; + }, /** @@ -856,12 +870,12 @@ var Utils = { * // returns "Test" * Utils.strip_html_tags("
Test
"); */ - strip_html_tags: function(html_str, remove_script_and_style) { - if (remove_script_and_style) { - html_str = html_str.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gmi, ""); - } - return html_str.replace(/<[^>\n]+>/g, ""); - }, + strip_html_tags(html_str, remove_script_and_style) { + if (remove_script_and_style) { + html_str = html_str.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gmi, ''); + } + return html_str.replace(/<[^>\n]+>/g, ''); + }, /** @@ -874,9 +888,9 @@ var Utils = { * // return "A <script> tag" * Utils.escape_html("A ", - static_section = "", - padding = ""; - - if (input.length < 1) { - return "Please enter a string."; - } - + run_offsets(input, args) { + let alphabet = args[0] || Base64.ALPHABET, + show_variable = args[1], + offset0 = Utils.to_base64(input, alphabet), + offset1 = Utils.to_base64([0].concat(input), alphabet), + offset2 = Utils.to_base64([0, 0].concat(input), alphabet), + len0 = offset0.indexOf('='), + len1 = offset1.indexOf('='), + len2 = offset2.indexOf('='), + script = "", + static_section = '', + padding = ''; + + if (input.length < 1) { + return 'Please enter a string.'; + } + // Highlight offset 0 - if (len0 % 4 == 2) { - static_section = offset0.slice(0, -3); - offset0 = "" + - static_section + "" + - "" + offset0.substr(offset0.length - 3, 1) + "" + - "" + offset0.substr(offset0.length - 2) + ""; - } else if (len0 % 4 == 3) { - static_section = offset0.slice(0, -2); - offset0 = "" + - static_section + "" + - "" + offset0.substr(offset0.length - 2, 1) + "" + - "" + offset0.substr(offset0.length - 1) + ""; - } else { - static_section = offset0; - offset0 = "" + - static_section + ""; - } - - if (!show_variable) { - offset0 = static_section; - } - - + if (len0 % 4 == 2) { + static_section = offset0.slice(0, -3); + offset0 = `${ + static_section}` + + `${offset0.substr(offset0.length - 3, 1)}` + + `${offset0.substr(offset0.length - 2)}`; + } else if (len0 % 4 == 3) { + static_section = offset0.slice(0, -2); + offset0 = `${ + static_section}` + + `${offset0.substr(offset0.length - 2, 1)}` + + `${offset0.substr(offset0.length - 1)}`; + } else { + static_section = offset0; + offset0 = `${ + static_section}`; + } + + if (!show_variable) { + offset0 = static_section; + } + + // Highlight offset 1 - padding = "" + offset1.substr(0, 1) + "" + - "" + offset1.substr(1, 1) + ""; - offset1 = offset1.substr(2); - if (len1 % 4 == 2) { - static_section = offset1.slice(0, -3); - offset1 = padding + "" + - static_section + "" + - "" + offset1.substr(offset1.length - 3, 1) + "" + - "" + offset1.substr(offset1.length - 2) + ""; - } else if (len1 % 4 == 3) { - static_section = offset1.slice(0, -2); - offset1 = padding + "" + - static_section + "" + - "" + offset1.substr(offset1.length - 2, 1) + "" + - "" + offset1.substr(offset1.length - 1) + ""; - } else { - static_section = offset1; - offset1 = padding + "" + - static_section + ""; - } - - if (!show_variable) { - offset1 = static_section; - } - + padding = `${offset1.substr(0, 1)}` + + `${offset1.substr(1, 1)}`; + offset1 = offset1.substr(2); + if (len1 % 4 == 2) { + static_section = offset1.slice(0, -3); + offset1 = `${padding}${ + static_section}` + + `${offset1.substr(offset1.length - 3, 1)}` + + `${offset1.substr(offset1.length - 2)}`; + } else if (len1 % 4 == 3) { + static_section = offset1.slice(0, -2); + offset1 = `${padding}${ + static_section}` + + `${offset1.substr(offset1.length - 2, 1)}` + + `${offset1.substr(offset1.length - 1)}`; + } else { + static_section = offset1; + offset1 = `${padding}${ + static_section}`; + } + + if (!show_variable) { + offset1 = static_section; + } + // Highlight offset 2 - padding = "" + offset2.substr(0, 2) + "" + - "" + offset2.substr(2, 1) + ""; - offset2 = offset2.substr(3); - if (len2 % 4 == 2) { - static_section = offset2.slice(0, -3); - offset2 = padding + "" + - static_section + "" + - "" + offset2.substr(offset2.length - 3, 1) + "" + - "" + offset2.substr(offset2.length - 2) + ""; - } else if (len2 % 4 == 3) { - static_section = offset2.slice(0, -2); - offset2 = padding + "" + - static_section + "" + - "" + offset2.substr(offset2.length - 2, 1) + "" + - "" + offset2.substr(offset2.length - 1) + ""; - } else { - static_section = offset2; - offset2 = padding + "" + - static_section + ""; - } - - if (!show_variable) { - offset2 = static_section; - } - - return (show_variable ? "Characters highlighted in green could change if the input is surrounded by more data." + + padding = `${offset2.substr(0, 2)}` + + `${offset2.substr(2, 1)}`; + offset2 = offset2.substr(3); + if (len2 % 4 == 2) { + static_section = offset2.slice(0, -3); + offset2 = `${padding}${ + static_section}` + + `${offset2.substr(offset2.length - 3, 1)}` + + `${offset2.substr(offset2.length - 2)}`; + } else if (len2 % 4 == 3) { + static_section = offset2.slice(0, -2); + offset2 = `${padding}${ + static_section}` + + `${offset2.substr(offset2.length - 2, 1)}` + + `${offset2.substr(offset2.length - 1)}`; + } else { + static_section = offset2; + offset2 = `${padding}${ + static_section}`; + } + + if (!show_variable) { + offset2 = static_section; + } + + return (show_variable ? `${"Characters highlighted in green could change if the input is surrounded by more data." + "\nCharacters highlighted in red are for padding purposes only." + "\nUnhighlighted characters are static." + - "\nHover over the static sections to see what they decode to on their own.\n" + - "\nOffset 0: " + offset0 + - "\nOffset 1: " + offset1 + - "\nOffset 2: " + offset2 + - script : - offset0 + "\n" + offset1 + "\n" + offset2); - }, - - + '\nHover over the static sections to see what they decode to on their own.\n' + + '\nOffset 0: '}${offset0 + }\nOffset 1: ${offset1 + }\nOffset 2: ${offset2 + }${script}` : + `${offset0}\n${offset1}\n${offset2}`); + }, + + /** * Highlight to Base64 * @@ -317,12 +339,12 @@ var Base64 = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_to: function(pos, args) { - pos[0].start = Math.floor(pos[0].start / 3 * 4); - pos[0].end = Math.ceil(pos[0].end / 3 * 4); - return pos; - }, - + highlight_to(pos, args) { + pos[0].start = Math.floor(pos[0].start / 3 * 4); + pos[0].end = Math.ceil(pos[0].end / 3 * 4); + return pos; + }, + /** * Highlight from Base64 * @@ -332,10 +354,10 @@ var Base64 = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_from: function(pos, args) { - pos[0].start = Math.ceil(pos[0].start / 4 * 3); - pos[0].end = Math.floor(pos[0].end / 4 * 3); - return pos; - }, - + highlight_from(pos, args) { + pos[0].start = Math.ceil(pos[0].start / 4 * 3); + pos[0].end = Math.floor(pos[0].end / 4 * 3); + return pos; + }, + }; diff --git a/src/js/operations/BitwiseOp.js b/src/js/operations/BitwiseOp.js index 1e4e5a1e..2eb02e7e 100755 --- a/src/js/operations/BitwiseOp.js +++ b/src/js/operations/BitwiseOp.js @@ -9,7 +9,7 @@ * * @namespace */ -var BitwiseOp = { +const BitwiseOp = { /** * Runs bitwise operations across the input data. @@ -22,43 +22,43 @@ var BitwiseOp = { * @param {boolean} differential * @returns {byte_array} */ - _bit_op: function (input, key, func, null_preserving, differential) { - if (!key || !key.length) key = [0]; - var result = [], - x = null, - k = null, - o = null; - - for (var i = 0; i < input.length; i++) { - k = key[i % key.length]; - o = input[i]; - x = null_preserving && (o === 0 || o == k) ? o : func(o, k); - result.push(x); - if (differential && !(null_preserving && (o === 0 || o == k))) { - key[i % key.length] = x; - } - } - - return result; - }, - - + _bit_op(input, key, func, null_preserving, differential) { + if (!key || !key.length) key = [0]; + let result = [], + x = null, + k = null, + o = null; + + for (let i = 0; i < input.length; i++) { + k = key[i % key.length]; + o = input[i]; + x = null_preserving && (o === 0 || o == k) ? o : func(o, k); + result.push(x); + if (differential && !(null_preserving && (o === 0 || o == k))) { + key[i % key.length] = x; + } + } + + return result; + }, + + /** * @constant * @default */ - XOR_PRESERVE_NULLS: false, + XOR_PRESERVE_NULLS: false, /** * @constant * @default */ - XOR_DIFFERENTIAL: false, + XOR_DIFFERENTIAL: false, /** * @constant * @default */ - KEY_FORMAT: ["Hex", "Base64", "UTF8", "UTF16", "UTF16LE", "UTF16BE", "Latin1"], - + KEY_FORMAT: ['Hex', 'Base64', 'UTF8', 'UTF16', 'UTF16LE', 'UTF16BE', 'Latin1'], + /** * XOR operation. * @@ -66,43 +66,43 @@ var BitwiseOp = { * @param {Object[]} args * @returns {byte_array} */ - run_xor: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""), - null_preserving = args[1], - differential = args[2]; - - key = Utils.word_array_to_byte_array(key); - - return BitwiseOp._bit_op(input, key, BitwiseOp._xor, null_preserving, differential); - }, - - + run_xor(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''), + null_preserving = args[1], + differential = args[2]; + + key = Utils.word_array_to_byte_array(key); + + return BitwiseOp._bit_op(input, key, BitwiseOp._xor, null_preserving, differential); + }, + + /** * @constant * @default */ - XOR_BRUTE_KEY_LENGTH: ["1", "2"], + XOR_BRUTE_KEY_LENGTH: ['1', '2'], /** * @constant * @default */ - XOR_BRUTE_SAMPLE_LENGTH: 100, + XOR_BRUTE_SAMPLE_LENGTH: 100, /** * @constant * @default */ - XOR_BRUTE_SAMPLE_OFFSET: 0, + XOR_BRUTE_SAMPLE_OFFSET: 0, /** * @constant * @default */ - XOR_BRUTE_PRINT_KEY: true, + XOR_BRUTE_PRINT_KEY: true, /** * @constant * @default */ - XOR_BRUTE_OUTPUT_HEX: false, - + XOR_BRUTE_OUTPUT_HEX: false, + /** * XOR Brute Force operation. * @@ -110,43 +110,44 @@ var BitwiseOp = { * @param {Object[]} args * @returns {string} */ - run_xor_brute: function (input, args) { - var key_length = parseInt(args[0], 10), - sample_length = args[1], - sample_offset = args[2], - null_preserving = args[3], - differential = args[4], - crib = args[5], - print_key = args[6], - output_hex = args[7], - regex; - - var output = "", - result, - result_utf8; - - input = input.slice(sample_offset, sample_offset + sample_length); - - if (crib !== "") { - regex = new RegExp(crib, "im"); - } - - - for (var key = 1, l = Math.pow(256, key_length); key < l; key++) { - result = BitwiseOp._bit_op(input, Utils.hex_to_byte_array(key.toString(16)), BitwiseOp._xor, null_preserving, differential); - result_utf8 = Utils.byte_array_to_utf8(result); - if (crib !== "" && result_utf8.search(regex) === -1) continue; - if (print_key) output += "Key = " + Utils.hex(key, (2*key_length)) + ": "; - if (output_hex) - output += Utils.byte_array_to_hex(result) + "\n"; - else - output += Utils.printable(result_utf8, false) + "\n"; - if (print_key) output += "\n"; - } - return output; - }, - - + run_xor_brute(input, args) { + let key_length = parseInt(args[0], 10), + sample_length = args[1], + sample_offset = args[2], + null_preserving = args[3], + differential = args[4], + crib = args[5], + print_key = args[6], + output_hex = args[7], + regex; + + let output = '', + result, + result_utf8; + + input = input.slice(sample_offset, sample_offset + sample_length); + + if (crib !== '') { + regex = new RegExp(crib, 'im'); + } + + + for (let key = 1, l = Math.pow(256, key_length); key < l; key++) { + result = BitwiseOp._bit_op(input, Utils.hex_to_byte_array(key.toString(16)), BitwiseOp._xor, null_preserving, differential); + result_utf8 = Utils.byte_array_to_utf8(result); + if (crib !== '' && result_utf8.search(regex) === -1) continue; + if (print_key) output += `Key = ${Utils.hex(key, (2 * key_length))}: `; + if (output_hex) { + output += `${Utils.byte_array_to_hex(result)}\n`; + } else { + output += `${Utils.printable(result_utf8, false)}\n`; + } + if (print_key) output += '\n'; + } + return output; + }, + + /** * NOT operation. * @@ -154,11 +155,11 @@ var BitwiseOp = { * @param {Object[]} args * @returns {byte_array} */ - run_not: function (input, args) { - return BitwiseOp._bit_op(input, null, BitwiseOp._not); - }, - - + run_not(input, args) { + return BitwiseOp._bit_op(input, null, BitwiseOp._not); + }, + + /** * AND operation. * @@ -166,14 +167,14 @@ var BitwiseOp = { * @param {Object[]} args * @returns {byte_array} */ - run_and: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""); - key = Utils.word_array_to_byte_array(key); - - return BitwiseOp._bit_op(input, key, BitwiseOp._and); - }, - - + run_and(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''); + key = Utils.word_array_to_byte_array(key); + + return BitwiseOp._bit_op(input, key, BitwiseOp._and); + }, + + /** * OR operation. * @@ -181,14 +182,14 @@ var BitwiseOp = { * @param {Object[]} args * @returns {byte_array} */ - run_or: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""); - key = Utils.word_array_to_byte_array(key); - - return BitwiseOp._bit_op(input, key, BitwiseOp._or); - }, - - + run_or(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''); + key = Utils.word_array_to_byte_array(key); + + return BitwiseOp._bit_op(input, key, BitwiseOp._or); + }, + + /** * ADD operation. * @@ -196,14 +197,14 @@ var BitwiseOp = { * @param {Object[]} args * @returns {byte_array} */ - run_add: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""); - key = Utils.word_array_to_byte_array(key); - - return BitwiseOp._bit_op(input, key, BitwiseOp._add); - }, - - + run_add(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''); + key = Utils.word_array_to_byte_array(key); + + return BitwiseOp._bit_op(input, key, BitwiseOp._add); + }, + + /** * SUB operation. * @@ -211,14 +212,14 @@ var BitwiseOp = { * @param {Object[]} args * @returns {byte_array} */ - run_sub: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""); - key = Utils.word_array_to_byte_array(key); - - return BitwiseOp._bit_op(input, key, BitwiseOp._sub); - }, - - + run_sub(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''); + key = Utils.word_array_to_byte_array(key); + + return BitwiseOp._bit_op(input, key, BitwiseOp._sub); + }, + + /** * XOR bitwise calculation. * @@ -227,11 +228,11 @@ var BitwiseOp = { * @param {number} key * @returns {number} */ - _xor: function (operand, key) { - return operand ^ key; - }, - - + _xor(operand, key) { + return operand ^ key; + }, + + /** * NOT bitwise calculation. * @@ -239,11 +240,11 @@ var BitwiseOp = { * @param {number} operand * @returns {number} */ - _not: function (operand, _) { - return ~operand & 0xff; - }, - - + _not(operand, _) { + return ~operand & 0xff; + }, + + /** * AND bitwise calculation. * @@ -252,11 +253,11 @@ var BitwiseOp = { * @param {number} key * @returns {number} */ - _and: function (operand, key) { - return operand & key; - }, - - + _and(operand, key) { + return operand & key; + }, + + /** * OR bitwise calculation. * @@ -265,11 +266,11 @@ var BitwiseOp = { * @param {number} key * @returns {number} */ - _or: function (operand, key) { - return operand | key; - }, + _or(operand, key) { + return operand | key; + }, + - /** * ADD bitwise calculation. * @@ -278,11 +279,11 @@ var BitwiseOp = { * @param {number} key * @returns {number} */ - _add: function (operand, key) { - return (operand + key) % 256; - }, + _add(operand, key) { + return (operand + key) % 256; + }, + - /** * SUB bitwise calculation. * @@ -291,9 +292,9 @@ var BitwiseOp = { * @param {number} key * @returns {number} */ - _sub: function (operand, key) { - var result = operand - key; - return (result < 0) ? 256 + result : result; - }, + _sub(operand, key) { + const result = operand - key; + return (result < 0) ? 256 + result : result; + }, }; diff --git a/src/js/operations/ByteRepr.js b/src/js/operations/ByteRepr.js index 13a4b8a7..85cbfe6a 100755 --- a/src/js/operations/ByteRepr.js +++ b/src/js/operations/ByteRepr.js @@ -9,24 +9,24 @@ * * @namespace */ -var ByteRepr = { +const ByteRepr = { /** * @constant * @default */ - DELIM_OPTIONS: ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF"], + DELIM_OPTIONS: ['Space', 'Comma', 'Semi-colon', 'Colon', 'Line feed', 'CRLF'], /** * @constant * @default */ - HEX_DELIM_OPTIONS: ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF", "0x", "\\x", "None"], + HEX_DELIM_OPTIONS: ['Space', 'Comma', 'Semi-colon', 'Colon', 'Line feed', 'CRLF', '0x', '\\x', 'None'], /** * @constant * @default */ - BIN_DELIM_OPTIONS: ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF", "None"], - + BIN_DELIM_OPTIONS: ['Space', 'Comma', 'Semi-colon', 'Colon', 'Line feed', 'CRLF', 'None'], + /** * To Hex operation. * @@ -34,12 +34,12 @@ var ByteRepr = { * @param {Object[]} args * @returns {string} */ - run_to_hex: function(input, args) { - var delim = Utils.char_rep[args[0] || "Space"]; - return Utils.to_hex(input, delim, 2); - }, - - + run_to_hex(input, args) { + const delim = Utils.char_rep[args[0] || 'Space']; + return Utils.to_hex(input, delim, 2); + }, + + /** * From Hex operation. * @@ -47,18 +47,18 @@ var ByteRepr = { * @param {Object[]} args * @returns {byte_array} */ - run_from_hex: function(input, args) { - var delim = args[0] || "Space"; - return Utils.from_hex(input, delim, 2); - }, - - + run_from_hex(input, args) { + const delim = args[0] || 'Space'; + return Utils.from_hex(input, delim, 2); + }, + + /** * @constant * @default */ - CHARCODE_BASE: 16, - + CHARCODE_BASE: 16, + /** * To Charcode operation. * @@ -66,40 +66,40 @@ var ByteRepr = { * @param {Object[]} args * @returns {string} */ - run_to_charcode: function(input, args) { - var delim = Utils.char_rep[args[0] || "Space"], - base = args[1], - output = "", - padding = 2, - ordinal; - - if (base < 2 || base > 36) { - throw "Error: Base argument must be between 2 and 36"; - } - - for (var i = 0; i < input.length; i++) { - ordinal = Utils.ord(input[i]); - - if (base == 16) { - if (ordinal < 256) padding = 2; - else if (ordinal < 65536) padding = 4; - else if (ordinal < 16777216) padding = 6; - else if (ordinal < 4294967296) padding = 8; - else padding = 2; - - if (padding > 2) app.options.attempt_highlight = false; - - output += Utils.hex(ordinal, padding) + delim; - } else { - app.options.attempt_highlight = false; - output += ordinal.toString(base) + delim; - } - } - - return output.slice(0, -delim.length); - }, - - + run_to_charcode(input, args) { + let delim = Utils.char_rep[args[0] || 'Space'], + base = args[1], + output = '', + padding = 2, + ordinal; + + if (base < 2 || base > 36) { + throw 'Error: Base argument must be between 2 and 36'; + } + + for (let i = 0; i < input.length; i++) { + ordinal = Utils.ord(input[i]); + + if (base == 16) { + if (ordinal < 256) padding = 2; + else if (ordinal < 65536) padding = 4; + else if (ordinal < 16777216) padding = 6; + else if (ordinal < 4294967296) padding = 8; + else padding = 2; + + if (padding > 2) app.options.attempt_highlight = false; + + output += Utils.hex(ordinal, padding) + delim; + } else { + app.options.attempt_highlight = false; + output += ordinal.toString(base) + delim; + } + } + + return output.slice(0, -delim.length); + }, + + /** * From Charcode operation. * @@ -107,37 +107,37 @@ var ByteRepr = { * @param {Object[]} args * @returns {byte_array} */ - run_from_charcode: function(input, args) { - var delim = Utils.char_rep[args[0] || "Space"], - base = args[1], - bites = input.split(delim), - i = 0; - - if (base < 2 || base > 36) { - throw "Error: Base argument must be between 2 and 36"; - } - - if (base != 16) { - app.options.attempt_highlight = false; - } - - // Split into groups of 2 if the whole string is concatenated and + run_from_charcode(input, args) { + let delim = Utils.char_rep[args[0] || 'Space'], + base = args[1], + bites = input.split(delim), + i = 0; + + if (base < 2 || base > 36) { + throw 'Error: Base argument must be between 2 and 36'; + } + + if (base != 16) { + app.options.attempt_highlight = false; + } + + // Split into groups of 2 if the whole string is concatenated and // too long to be a single character - if (bites.length == 1 && input.length > 17) { - bites = []; - for (i = 0; i < input.length; i += 2) { - bites.push(input.slice(i, i+2)); - } - } - - var latin1 = ""; - for (i = 0; i < bites.length; i++) { - latin1 += Utils.chr(parseInt(bites[i], base)); - } - return Utils.str_to_byte_array(latin1); - }, - - + if (bites.length == 1 && input.length > 17) { + bites = []; + for (i = 0; i < input.length; i += 2) { + bites.push(input.slice(i, i + 2)); + } + } + + let latin1 = ''; + for (i = 0; i < bites.length; i++) { + latin1 += Utils.chr(parseInt(bites[i], base)); + } + return Utils.str_to_byte_array(latin1); + }, + + /** * Highlight to hex * @@ -147,22 +147,22 @@ var ByteRepr = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_to: function(pos, args) { - var delim = Utils.char_rep[args[0] || "Space"], - len = delim == "\r\n" ? 1 : delim.length; - - pos[0].start = pos[0].start * (2 + len); - pos[0].end = pos[0].end * (2 + len) - len; - + highlight_to(pos, args) { + let delim = Utils.char_rep[args[0] || 'Space'], + len = delim == '\r\n' ? 1 : delim.length; + + pos[0].start = pos[0].start * (2 + len); + pos[0].end = pos[0].end * (2 + len) - len; + // 0x and \x are added to the beginning if they are selected, so increment the positions accordingly - if (delim == "0x" || delim == "\\x") { - pos[0].start += 2; - pos[0].end += 2; - } - return pos; - }, - - + if (delim == '0x' || delim == '\\x') { + pos[0].start += 2; + pos[0].end += 2; + } + return pos; + }, + + /** * Highlight to hex * @@ -172,25 +172,25 @@ var ByteRepr = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_from: function(pos, args) { - var delim = Utils.char_rep[args[0] || "Space"], - len = delim == "\r\n" ? 1 : delim.length, - width = len + 2; - + highlight_from(pos, args) { + let delim = Utils.char_rep[args[0] || 'Space'], + len = delim == '\r\n' ? 1 : delim.length, + width = len + 2; + // 0x and \x are added to the beginning if they are selected, so increment the positions accordingly - if (delim == "0x" || delim == "\\x") { - if (pos[0].start > 1) pos[0].start -= 2; - else pos[0].start = 0; - if (pos[0].end > 1) pos[0].end -= 2; - else pos[0].end = 0; - } - - pos[0].start = pos[0].start === 0 ? 0 : Math.round(pos[0].start / width); - pos[0].end = pos[0].end === 0 ? 0 : Math.ceil(pos[0].end / width); - return pos; - }, - - + if (delim == '0x' || delim == '\\x') { + if (pos[0].start > 1) pos[0].start -= 2; + else pos[0].start = 0; + if (pos[0].end > 1) pos[0].end -= 2; + else pos[0].end = 0; + } + + pos[0].start = pos[0].start === 0 ? 0 : Math.round(pos[0].start / width); + pos[0].end = pos[0].end === 0 ? 0 : Math.ceil(pos[0].end / width); + return pos; + }, + + /** * To Decimal operation. * @@ -198,12 +198,12 @@ var ByteRepr = { * @param {Object[]} args * @returns {string} */ - run_to_decimal: function(input, args) { - var delim = Utils.char_rep[args[0]]; - return input.join(delim); - }, - - + run_to_decimal(input, args) { + const delim = Utils.char_rep[args[0]]; + return input.join(delim); + }, + + /** * From Decimal operation. * @@ -211,19 +211,19 @@ var ByteRepr = { * @param {Object[]} args * @returns {byte_array} */ - run_from_decimal: function(input, args) { - var delim = Utils.char_rep[args[0]]; - var byte_str = input.split(delim), output = []; - if (byte_str[byte_str.length-1] === "") - byte_str = byte_str.slice(0, byte_str.length-1); - - for (var i = 0; i < byte_str.length; i++) { - output[i] = parseInt(byte_str[i]); - } - return output; - }, - - + run_from_decimal(input, args) { + const delim = Utils.char_rep[args[0]]; + let byte_str = input.split(delim), + output = []; + if (byte_str[byte_str.length - 1] === '') { byte_str = byte_str.slice(0, byte_str.length - 1); } + + for (let i = 0; i < byte_str.length; i++) { + output[i] = parseInt(byte_str[i]); + } + return output; + }, + + /** * To Binary operation. * @@ -231,23 +231,23 @@ var ByteRepr = { * @param {Object[]} args * @returns {string} */ - run_to_binary: function(input, args) { - var delim = Utils.char_rep[args[0] || "Space"], - output = "", - padding = 8; - - for (var i = 0; i < input.length; i++) { - output += Utils.pad(input[i].toString(2), padding) + delim; - } - - if (delim.length) { - return output.slice(0, -delim.length); - } else { - return output; - } - }, - - + run_to_binary(input, args) { + let delim = Utils.char_rep[args[0] || 'Space'], + output = '', + padding = 8; + + for (let i = 0; i < input.length; i++) { + output += Utils.pad(input[i].toString(2), padding) + delim; + } + + if (delim.length) { + return output.slice(0, -delim.length); + } else { + return output; + } + }, + + /** * From Binary operation. * @@ -255,21 +255,21 @@ var ByteRepr = { * @param {Object[]} args * @returns {byte_array} */ - run_from_binary: function(input, args) { - if (args[0] != "None") { - var delim_regex = Utils.regex_rep[args[0] || "Space"]; - input = input.replace(delim_regex, ''); - } - - var output = []; - var byte_len = 8; - for (var i = 0; i < input.length; i += byte_len) { - output.push(parseInt(input.substr(i, byte_len), 2)); - } - return output; - }, - - + run_from_binary(input, args) { + if (args[0] != 'None') { + const delim_regex = Utils.regex_rep[args[0] || 'Space']; + input = input.replace(delim_regex, ''); + } + + const output = []; + const byte_len = 8; + for (let i = 0; i < input.length; i += byte_len) { + output.push(parseInt(input.substr(i, byte_len), 2)); + } + return output; + }, + + /** * Highlight to binary * @@ -279,14 +279,14 @@ var ByteRepr = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_to_binary: function(pos, args) { - var delim = Utils.char_rep[args[0] || "Space"]; - pos[0].start = pos[0].start * (8 + delim.length); - pos[0].end = pos[0].end * (8 + delim.length) - delim.length; - return pos; - }, - - + highlight_to_binary(pos, args) { + const delim = Utils.char_rep[args[0] || 'Space']; + pos[0].start = pos[0].start * (8 + delim.length); + pos[0].end = pos[0].end * (8 + delim.length) - delim.length; + return pos; + }, + + /** * Highlight from binary * @@ -296,25 +296,25 @@ var ByteRepr = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_from_binary: function(pos, args) { - var delim = Utils.char_rep[args[0] || "Space"]; - pos[0].start = pos[0].start === 0 ? 0 : Math.floor(pos[0].start / (8 + delim.length)); - pos[0].end = pos[0].end === 0 ? 0 : Math.ceil(pos[0].end / (8 + delim.length)); - return pos; - }, - - + highlight_from_binary(pos, args) { + const delim = Utils.char_rep[args[0] || 'Space']; + pos[0].start = pos[0].start === 0 ? 0 : Math.floor(pos[0].start / (8 + delim.length)); + pos[0].end = pos[0].end === 0 ? 0 : Math.ceil(pos[0].end / (8 + delim.length)); + return pos; + }, + + /** * @constant * @default */ - HEX_CONTENT_CONVERT_WHICH: ["Only special chars", "Only special chars including spaces", "All chars"], + HEX_CONTENT_CONVERT_WHICH: ['Only special chars', 'Only special chars including spaces', 'All chars'], /** * @constant * @default */ - HEX_CONTENT_SPACES_BETWEEN_BYTES: false, - + HEX_CONTENT_SPACES_BETWEEN_BYTES: false, + /** * To Hex Content operation. * @@ -322,40 +322,40 @@ var ByteRepr = { * @param {Object[]} args * @returns {string} */ - run_to_hex_content: function(input, args) { - var convert = args[0]; - var spaces = args[1]; - if (convert == "All chars") { - var result = "|" + Utils.to_hex(input) + "|"; - if (!spaces) result = result.replace(/ /g, ""); - return result; + run_to_hex_content(input, args) { + const convert = args[0]; + const spaces = args[1]; + if (convert == 'All chars') { + let result = `|${Utils.to_hex(input)}|`; + if (!spaces) result = result.replace(/ /g, ''); + return result; + } + + let output = '', + in_hex = false, + convert_spaces = convert == 'Only special chars including spaces', + b; + for (let i = 0; i < input.length; i++) { + b = input[i]; + if ((b == 32 && convert_spaces) || (b < 48 && b != 32) || (b > 57 && b < 65) || (b > 90 && b < 97) || b > 122) { + if (!in_hex) { + output += '|'; + in_hex = true; + } else if (spaces) output += ' '; + output += Utils.to_hex([b]); + } else { + if (in_hex) { + output += '|'; + in_hex = false; } - - var output = "", - in_hex = false, - convert_spaces = convert == "Only special chars including spaces", - b; - for (var i = 0; i < input.length; i++) { - b = input[i]; - if ((b == 32 && convert_spaces) || (b < 48 && b != 32) || (b > 57 && b < 65) || (b > 90 && b < 97) || b > 122) { - if (!in_hex) { - output += "|"; - in_hex = true; - } else if (spaces) output += " "; - output += Utils.to_hex([b]); - } else { - if (in_hex) { - output += "|"; - in_hex = false; - } - output += Utils.chr(input[i]); - } - } - if (in_hex) output += "|"; - return output; - }, - - + output += Utils.chr(input[i]); + } + } + if (in_hex) output += '|'; + return output; + }, + + /** * From Hex Content operation. * @@ -363,32 +363,36 @@ var ByteRepr = { * @param {Object[]} args * @returns {byte_array} */ - run_from_hex_content: function(input, args) { - var regex = /\|([a-f\d ]{2,})\|/gi; - var output = [], m, i = 0; - while (!!(m = regex.exec(input))) { + run_from_hex_content(input, args) { + const regex = /\|([a-f\d ]{2,})\|/gi; + let output = [], + m, + i = 0; + while (m = regex.exec(input)) { // Add up to match - for (; i < m.index;) - output.push(Utils.ord(input[i++])); - + for (; i < m.index;) { + output.push(Utils.ord(input[i++])); + } + // Add match - var bytes = Utils.from_hex(m[1]); - if (bytes) { - for (var a = 0; a < bytes.length;) - output.push(bytes[a++]); - } else { + const bytes = Utils.from_hex(m[1]); + if (bytes) { + for (let a = 0; a < bytes.length;) { output.push(bytes[a++]); } + } else { // Not valid hex, print as normal - for (; i < regex.lastIndex;) - output.push(Utils.ord(input[i++])); - } - - i = regex.lastIndex; + for (; i < regex.lastIndex;) { + output.push(Utils.ord(input[i++])); } + } + + i = regex.lastIndex; + } // Add all after final match - for (; i < input.length;) - output.push(Utils.ord(input[i++])); - - return output; - }, + for (; i < input.length;) { + output.push(Utils.ord(input[i++])); + } + + return output; + }, }; diff --git a/src/js/operations/CharEnc.js b/src/js/operations/CharEnc.js index 6085d19a..8f089f6f 100755 --- a/src/js/operations/CharEnc.js +++ b/src/js/operations/CharEnc.js @@ -9,14 +9,14 @@ * * @namespace */ -var CharEnc = { +const CharEnc = { /** * @constant * @default */ - IO_FORMAT: ["UTF8", "UTF16", "UTF16LE", "UTF16BE", "Latin1", "Windows-1251", "Hex", "Base64"], - + IO_FORMAT: ['UTF8', 'UTF16', 'UTF16LE', 'UTF16BE', 'Latin1', 'Windows-1251', 'Hex', 'Base64'], + /** * Text encoding operation. * @@ -24,23 +24,23 @@ var CharEnc = { * @param {Object[]} args * @returns {string} */ - run: function(input, args) { - var input_format = args[0], - output_format = args[1]; - - if (input_format == "Windows-1251") { - input = Utils.win1251_to_unicode(input); - input = CryptoJS.enc.Utf8.parse(input); - } else { - input = Utils.format[input_format].parse(input); - } - - if (output_format == "Windows-1251") { - input = CryptoJS.enc.Utf8.stringify(input); - return Utils.unicode_to_win1251(input); - } else { - return Utils.format[output_format].stringify(input); - } - }, - + run(input, args) { + let input_format = args[0], + output_format = args[1]; + + if (input_format == 'Windows-1251') { + input = Utils.win1251_to_unicode(input); + input = CryptoJS.enc.Utf8.parse(input); + } else { + input = Utils.format[input_format].parse(input); + } + + if (output_format == 'Windows-1251') { + input = CryptoJS.enc.Utf8.stringify(input); + return Utils.unicode_to_win1251(input); + } else { + return Utils.format[output_format].stringify(input); + } + }, + }; diff --git a/src/js/operations/Checksum.js b/src/js/operations/Checksum.js index f0069bad..09372ae7 100755 --- a/src/js/operations/Checksum.js +++ b/src/js/operations/Checksum.js @@ -7,7 +7,7 @@ * * @namespace */ -var Checksum = { +const Checksum = { /** * Fletcher-16 Checksum operation. @@ -16,19 +16,19 @@ var Checksum = { * @param {Object[]} args * @returns {string} */ - run_fletcher16: function(input, args) { - var a = 0, - b = 0; - - for (var i = 0; i < input.length; i++) { - a = (a + input[i]) % 0xff; - b = (b + a) % 0xff; - } - - return Utils.hex(((b << 8) | a) >>> 0, 4); - }, - - + run_fletcher16(input, args) { + let a = 0, + b = 0; + + for (let i = 0; i < input.length; i++) { + a = (a + input[i]) % 0xff; + b = (b + a) % 0xff; + } + + return Utils.hex(((b << 8) | a) >>> 0, 4); + }, + + /** * Adler-32 Checksum operation. * @@ -36,23 +36,23 @@ var Checksum = { * @param {Object[]} args * @returns {string} */ - run_adler32: function(input, args) { - var MOD_ADLER = 65521, - a = 1, - b = 0; - - for (var i = 0; i < input.length; i++) { - a += input[i]; - b += a; - } - - a %= MOD_ADLER; - b %= MOD_ADLER; - - return Utils.hex(((b << 16) | a) >>> 0, 8); - }, - - + run_adler32(input, args) { + let MOD_ADLER = 65521, + a = 1, + b = 0; + + for (let i = 0; i < input.length; i++) { + a += input[i]; + b += a; + } + + a %= MOD_ADLER; + b %= MOD_ADLER; + + return Utils.hex(((b << 16) | a) >>> 0, 8); + }, + + /** * CRC-32 Checksum operation. * @@ -60,18 +60,18 @@ var Checksum = { * @param {Object[]} args * @returns {string} */ - run_crc32: function(input, args) { - var crc_table = window.crc_table || (window.crc_table = Checksum._gen_crc_table()), - crc = 0 ^ (-1); - - for (var i = 0; i < input.length; i++) { - crc = (crc >>> 8) ^ crc_table[(crc ^ input[i]) & 0xff]; - } - - return Utils.hex((crc ^ (-1)) >>> 0); - }, - - + run_crc32(input, args) { + let crc_table = window.crc_table || (window.crc_table = Checksum._gen_crc_table()), + crc = 0 ^ (-1); + + for (let i = 0; i < input.length; i++) { + crc = (crc >>> 8) ^ crc_table[(crc ^ input[i]) & 0xff]; + } + + return Utils.hex((crc ^ (-1)) >>> 0); + }, + + /** * TCP/IP Checksum operation. * @@ -89,42 +89,42 @@ var Checksum = { * Checksum.run_tcp_ip([0x45,0x00,0x01,0x11,0x3f,0x74,0x40,0x00,0x40,0x06, * 0x00,0x00,0xac,0x11,0x00,0x03,0xac,0x11,0x00,0x04]) */ - run_tcp_ip: function(input, args) { - var csum = 0; - - for (var i = 0; i < input.length; i++) { - if(i % 2 === 0) { - csum += (input[i] << 8); - } else { - csum += input[i]; - } - } + run_tcp_ip(input, args) { + let csum = 0; + + for (let i = 0; i < input.length; i++) { + if (i % 2 === 0) { + csum += (input[i] << 8); + } else { + csum += input[i]; + } + } + + csum = (csum >> 16) + (csum & 0xffff); + + return Utils.hex(0xffff - csum); + }, - csum = (csum >> 16) + (csum & 0xffff); - return Utils.hex(0xffff - csum); - }, - - /** * Generates a CRC table for use with CRC checksums. * * @private * @returns {array} */ - _gen_crc_table: function() { - var c, - crc_table = []; - - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); - } - crc_table[n] = c; - } - - return crc_table; - }, + _gen_crc_table() { + let c, + crc_table = []; + + for (let n = 0; n < 256; n++) { + c = n; + for (let k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + crc_table[n] = c; + } + + return crc_table; + }, }; diff --git a/src/js/operations/Cipher.js b/src/js/operations/Cipher.js index 94193546..2d59d48c 100755 --- a/src/js/operations/Cipher.js +++ b/src/js/operations/Cipher.js @@ -9,45 +9,45 @@ * * @namespace */ -var Cipher = { - +const Cipher = { + /** * @constant * @default */ - IO_FORMAT1: ["Hex", "Base64", "UTF8", "UTF16", "UTF16LE", "UTF16BE", "Latin1"], + IO_FORMAT1: ['Hex', 'Base64', 'UTF8', 'UTF16', 'UTF16LE', 'UTF16BE', 'Latin1'], /** * @constant * @default */ - IO_FORMAT2: ["UTF8", "UTF16", "UTF16LE", "UTF16BE", "Latin1", "Hex", "Base64"], + IO_FORMAT2: ['UTF8', 'UTF16', 'UTF16LE', 'UTF16BE', 'Latin1', 'Hex', 'Base64'], /** * @constant * @default */ - IO_FORMAT3: ["Hex", "Base64", "UTF16", "UTF16LE", "UTF16BE", "Latin1"], + IO_FORMAT3: ['Hex', 'Base64', 'UTF16', 'UTF16LE', 'UTF16BE', 'Latin1'], /** * @constant * @default */ - IO_FORMAT4: ["Latin1", "UTF8", "UTF16", "UTF16LE", "UTF16BE", "Hex", "Base64"], + IO_FORMAT4: ['Latin1', 'UTF8', 'UTF16', 'UTF16LE', 'UTF16BE', 'Hex', 'Base64'], /** * @constant * @default */ - MODES: ["CBC", "CFB", "CTR", "OFB", "ECB"], + MODES: ['CBC', 'CFB', 'CTR', 'OFB', 'ECB'], /** * @constant * @default */ - PADDING: ["Pkcs7", "Iso97971", "AnsiX923", "Iso10126", "ZeroPadding", "NoPadding"], + PADDING: ['Pkcs7', 'Iso97971', 'AnsiX923', 'Iso10126', 'ZeroPadding', 'NoPadding'], /** * @constant * @default */ - RESULT_TYPE: ["Show all", "Ciphertext", "Key", "IV", "Salt"], - - + RESULT_TYPE: ['Show all', 'Ciphertext', 'Key', 'IV', 'Salt'], + + /** * Runs encryption operations using the CryptoJS framework. * @@ -57,41 +57,41 @@ var Cipher = { * @param {function} args * @returns {string} */ - _enc: function (algo, input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""), - iv = Utils.format[args[1].option].parse(args[1].string || ""), - salt = Utils.format[args[2].option].parse(args[2].string || ""), - mode = CryptoJS.mode[args[3]], - padding = CryptoJS.pad[args[4]], - result_option = args[5].toLowerCase(), - output_format = args[6]; - - if (iv.sigBytes === 0) { + _enc(algo, input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''), + iv = Utils.format[args[1].option].parse(args[1].string || ''), + salt = Utils.format[args[2].option].parse(args[2].string || ''), + mode = CryptoJS.mode[args[3]], + padding = CryptoJS.pad[args[4]], + result_option = args[5].toLowerCase(), + output_format = args[6]; + + if (iv.sigBytes === 0) { // Use passphrase rather than key. Need to convert it to a string. - key = key.toString(CryptoJS.enc.Latin1); - } - - var encrypted = algo.encrypt(input, key, { - salt: salt.sigBytes > 0 ? salt : false, - iv: iv.sigBytes > 0 ? iv : null, - mode: mode, - padding: padding - }); - - var result = ""; - if (result_option == "show all") { - result += "Key: " + encrypted.key.toString(Utils.format[output_format]); - result += "\nIV: " + encrypted.iv.toString(Utils.format[output_format]); - if (encrypted.salt) result += "\nSalt: " + encrypted.salt.toString(Utils.format[output_format]); - result += "\n\nCiphertext: " + encrypted.ciphertext.toString(Utils.format[output_format]); - } else { - result = encrypted[result_option].toString(Utils.format[output_format]); - } - - return result; - }, - - + key = key.toString(CryptoJS.enc.Latin1); + } + + const encrypted = algo.encrypt(input, key, { + salt: salt.sigBytes > 0 ? salt : false, + iv: iv.sigBytes > 0 ? iv : null, + mode, + padding, + }); + + let result = ''; + if (result_option == 'show all') { + result += `Key: ${encrypted.key.toString(Utils.format[output_format])}`; + result += `\nIV: ${encrypted.iv.toString(Utils.format[output_format])}`; + if (encrypted.salt) result += `\nSalt: ${encrypted.salt.toString(Utils.format[output_format])}`; + result += `\n\nCiphertext: ${encrypted.ciphertext.toString(Utils.format[output_format])}`; + } else { + result = encrypted[result_option].toString(Utils.format[output_format]); + } + + return result; + }, + + /** * Runs decryption operations using the CryptoJS framework. * @@ -101,47 +101,47 @@ var Cipher = { * @param {function} args * @returns {string} */ - _dec: function (algo, input, args) { - var key = Utils.format[args[0].option].parse(args[0].string || ""), - iv = Utils.format[args[1].option].parse(args[1].string || ""), - salt = Utils.format[args[2].option].parse(args[2].string || ""), - mode = CryptoJS.mode[args[3]], - padding = CryptoJS.pad[args[4]], - input_format = args[5], - output_format = args[6]; - + _dec(algo, input, args) { + let key = Utils.format[args[0].option].parse(args[0].string || ''), + iv = Utils.format[args[1].option].parse(args[1].string || ''), + salt = Utils.format[args[2].option].parse(args[2].string || ''), + mode = CryptoJS.mode[args[3]], + padding = CryptoJS.pad[args[4]], + input_format = args[5], + output_format = args[6]; + // The ZeroPadding option causes a crash when the input length is 0 - if (!input.length) { - return "No input"; - } - - var ciphertext = Utils.format[input_format].parse(input); - - if (iv.sigBytes === 0) { + if (!input.length) { + return 'No input'; + } + + const ciphertext = Utils.format[input_format].parse(input); + + if (iv.sigBytes === 0) { // Use passphrase rather than key. Need to convert it to a string. - key = key.toString(CryptoJS.enc.Latin1); - } - - var decrypted = algo.decrypt({ - ciphertext: ciphertext, - salt: salt.sigBytes > 0 ? salt : false - }, key, { - iv: iv.sigBytes > 0 ? iv : null, - mode: mode, - padding: padding - }); - - var result; - try { - result = decrypted.toString(Utils.format[output_format]); - } catch (err) { - result = "Decrypt error: " + err.message; - } - - return result; - }, - - + key = key.toString(CryptoJS.enc.Latin1); + } + + const decrypted = algo.decrypt({ + ciphertext, + salt: salt.sigBytes > 0 ? salt : false, + }, key, { + iv: iv.sigBytes > 0 ? iv : null, + mode, + padding, + }); + + let result; + try { + result = decrypted.toString(Utils.format[output_format]); + } catch (err) { + result = `Decrypt error: ${err.message}`; + } + + return result; + }, + + /** * AES Encrypt operation. * @@ -149,11 +149,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_aes_enc: function (input, args) { - return Cipher._enc(CryptoJS.AES, input, args); - }, - - + run_aes_enc(input, args) { + return Cipher._enc(CryptoJS.AES, input, args); + }, + + /** * AES Decrypt operation. * @@ -161,11 +161,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_aes_dec: function (input, args) { - return Cipher._dec(CryptoJS.AES, input, args); - }, - - + run_aes_dec(input, args) { + return Cipher._dec(CryptoJS.AES, input, args); + }, + + /** * DES Encrypt operation. * @@ -173,11 +173,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_des_enc: function (input, args) { - return Cipher._enc(CryptoJS.DES, input, args); - }, - - + run_des_enc(input, args) { + return Cipher._enc(CryptoJS.DES, input, args); + }, + + /** * DES Decrypt operation. * @@ -185,11 +185,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_des_dec: function (input, args) { - return Cipher._dec(CryptoJS.DES, input, args); - }, - - + run_des_dec(input, args) { + return Cipher._dec(CryptoJS.DES, input, args); + }, + + /** * Triple DES Encrypt operation. * @@ -197,11 +197,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_triple_des_enc: function (input, args) { - return Cipher._enc(CryptoJS.TripleDES, input, args); - }, - - + run_triple_des_enc(input, args) { + return Cipher._enc(CryptoJS.TripleDES, input, args); + }, + + /** * Triple DES Decrypt operation. * @@ -209,11 +209,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_triple_des_dec: function (input, args) { - return Cipher._dec(CryptoJS.TripleDES, input, args); - }, - - + run_triple_des_dec(input, args) { + return Cipher._dec(CryptoJS.TripleDES, input, args); + }, + + /** * Rabbit Encrypt operation. * @@ -221,11 +221,11 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_rabbit_enc: function (input, args) { - return Cipher._enc(CryptoJS.Rabbit, input, args); - }, - - + run_rabbit_enc(input, args) { + return Cipher._enc(CryptoJS.Rabbit, input, args); + }, + + /** * Rabbit Decrypt operation. * @@ -233,22 +233,22 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_rabbit_dec: function (input, args) { - return Cipher._dec(CryptoJS.Rabbit, input, args); - }, - - + run_rabbit_dec(input, args) { + return Cipher._dec(CryptoJS.Rabbit, input, args); + }, + + /** * @constant * @default */ - BLOWFISH_MODES: ["ECB", "CBC", "PCBC", "CFB", "OFB", "CTR"], + BLOWFISH_MODES: ['ECB', 'CBC', 'PCBC', 'CFB', 'OFB', 'CTR'], /** * @constant * @default */ - BLOWFISH_OUTPUT_TYPES: ["Base64", "Hex", "String", "Raw"], - + BLOWFISH_OUTPUT_TYPES: ['Base64', 'Hex', 'String', 'Raw'], + /** * Blowfish Encrypt operation. * @@ -256,23 +256,23 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_blowfish_enc: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string).toString(Utils.format.Latin1), - mode = args[1], - output_format = args[2]; - - if (key.length === 0) return "Enter a key"; - - var enc_hex = blowfish.encrypt(input, key, { - outputType: 1, - cipherMode: Cipher.BLOWFISH_MODES.indexOf(mode) - }), - enc = CryptoJS.enc.Hex.parse(enc_hex); - - return enc.toString(Utils.format[output_format]); - }, - - + run_blowfish_enc(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string).toString(Utils.format.Latin1), + mode = args[1], + output_format = args[2]; + + if (key.length === 0) return 'Enter a key'; + + let enc_hex = blowfish.encrypt(input, key, { + outputType: 1, + cipherMode: Cipher.BLOWFISH_MODES.indexOf(mode), + }), + enc = CryptoJS.enc.Hex.parse(enc_hex); + + return enc.toString(Utils.format[output_format]); + }, + + /** * Blowfish Decrypt operation. * @@ -280,33 +280,33 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_blowfish_dec: function (input, args) { - var key = Utils.format[args[0].option].parse(args[0].string).toString(Utils.format.Latin1), - mode = args[1], - input_format = args[2]; - - if (key.length === 0) return "Enter a key"; - - input = Utils.format[input_format].parse(input); - - return blowfish.decrypt(input.toString(CryptoJS.enc.Base64), key, { - outputType: 0, // This actually means inputType. The library is weird. - cipherMode: Cipher.BLOWFISH_MODES.indexOf(mode) - }); - }, - - + run_blowfish_dec(input, args) { + let key = Utils.format[args[0].option].parse(args[0].string).toString(Utils.format.Latin1), + mode = args[1], + input_format = args[2]; + + if (key.length === 0) return 'Enter a key'; + + input = Utils.format[input_format].parse(input); + + return blowfish.decrypt(input.toString(CryptoJS.enc.Base64), key, { + outputType: 0, // This actually means inputType. The library is weird. + cipherMode: Cipher.BLOWFISH_MODES.indexOf(mode), + }); + }, + + /** * @constant * @default */ - KDF_KEY_SIZE: 256, + KDF_KEY_SIZE: 256, /** * @constant * @default */ - KDF_ITERATIONS: 1, - + KDF_ITERATIONS: 1, + /** * Derive PBKDF2 key operation. * @@ -314,19 +314,19 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_pbkdf2: function (input, args) { - var key_size = args[0] / 32, - iterations = args[1], - salt = CryptoJS.enc.Hex.parse(args[2] || ""), - input_format = args[3], - output_format = args[4], - passphrase = Utils.format[input_format].parse(input), - key = CryptoJS.PBKDF2(passphrase, salt, { keySize: key_size, iterations: iterations }); - - return key.toString(Utils.format[output_format]); - }, - - + run_pbkdf2(input, args) { + let key_size = args[0] / 32, + iterations = args[1], + salt = CryptoJS.enc.Hex.parse(args[2] || ''), + input_format = args[3], + output_format = args[4], + passphrase = Utils.format[input_format].parse(input), + key = CryptoJS.PBKDF2(passphrase, salt, { keySize: key_size, iterations }); + + return key.toString(Utils.format[output_format]); + }, + + /** * Derive EVP key operation. * @@ -334,19 +334,19 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_evpkdf: function (input, args) { - var key_size = args[0] / 32, - iterations = args[1], - salt = CryptoJS.enc.Hex.parse(args[2] || ""), - input_format = args[3], - output_format = args[4], - passphrase = Utils.format[input_format].parse(input), - key = CryptoJS.EvpKDF(passphrase, salt, { keySize: key_size, iterations: iterations }); - - return key.toString(Utils.format[output_format]); - }, - - + run_evpkdf(input, args) { + let key_size = args[0] / 32, + iterations = args[1], + salt = CryptoJS.enc.Hex.parse(args[2] || ''), + input_format = args[3], + output_format = args[4], + passphrase = Utils.format[input_format].parse(input), + key = CryptoJS.EvpKDF(passphrase, salt, { keySize: key_size, iterations }); + + return key.toString(Utils.format[output_format]); + }, + + /** * RC4 operation. * @@ -354,21 +354,21 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_rc4: function (input, args) { - var message = Utils.format[args[1]].parse(input), - passphrase = Utils.format[args[0].option].parse(args[0].string), - encrypted = CryptoJS.RC4.encrypt(message, passphrase); - - return encrypted.ciphertext.toString(Utils.format[args[2]]); - }, - - + run_rc4(input, args) { + let message = Utils.format[args[1]].parse(input), + passphrase = Utils.format[args[0].option].parse(args[0].string), + encrypted = CryptoJS.RC4.encrypt(message, passphrase); + + return encrypted.ciphertext.toString(Utils.format[args[2]]); + }, + + /** * @constant * @default */ - RC4DROP_BYTES: 768, - + RC4DROP_BYTES: 768, + /** * RC4 Drop operation. * @@ -376,22 +376,22 @@ var Cipher = { * @param {Object[]} args * @returns {string} */ - run_rc4drop: function (input, args) { - var message = Utils.format[args[1]].parse(input), - passphrase = Utils.format[args[0].option].parse(args[0].string), - drop = args[3], - encrypted = CryptoJS.RC4Drop.encrypt(message, passphrase, { drop: drop }); - - return encrypted.ciphertext.toString(Utils.format[args[2]]); - }, - + run_rc4drop(input, args) { + let message = Utils.format[args[1]].parse(input), + passphrase = Utils.format[args[0].option].parse(args[0].string), + drop = args[3], + encrypted = CryptoJS.RC4Drop.encrypt(message, passphrase, { drop }); + + return encrypted.ciphertext.toString(Utils.format[args[2]]); + }, + }; /** * Overwriting the CryptoJS OpenSSL key derivation function so that it is possible to not pass a * salt in. - + * @param {string} password - The password to derive from. * @param {number} keySize - The size in words of the key to generate. * @param {number} ivSize - The size in words of the IV to generate. @@ -413,17 +413,17 @@ var Cipher = { CryptoJS.kdf.OpenSSL.execute = function (password, keySize, ivSize, salt) { // Generate random salt if no salt specified and not set to false // This line changed from `if (!salt) {` to the following - if (salt === undefined || salt === null) { - salt = CryptoJS.lib.WordArray.random(64/8); - } + if (salt === undefined || salt === null) { + salt = CryptoJS.lib.WordArray.random(64 / 8); + } // Derive key and IV - var key = CryptoJS.algo.EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + const key = CryptoJS.algo.EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); // Separate key and IV - var iv = CryptoJS.lib.WordArray.create(key.words.slice(keySize), ivSize * 4); - key.sigBytes = keySize * 4; + const iv = CryptoJS.lib.WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; // Return params - return CryptoJS.lib.CipherParams.create({ key: key, iv: iv, salt: salt }); + return CryptoJS.lib.CipherParams.create({ key, iv, salt }); }; diff --git a/src/js/operations/Code.js b/src/js/operations/Code.js index 3b59a9bc..2f0edae8 100755 --- a/src/js/operations/Code.js +++ b/src/js/operations/Code.js @@ -9,19 +9,19 @@ * * @namespace */ -var Code = { - +const Code = { + /** * @constant * @default */ - LANGUAGES: ["default-code", "default-markup", "bash", "bsh", "c", "cc", "coffee", "cpp", "cs", "csh", "cv", "cxx", "cyc", "htm", "html", "in.tag", "java", "javascript", "js", "json", "m", "mxml", "perl", "pl", "pm", "py", "python", "rb", "rc", "rs", "ruby", "rust", "sh", "uq.val", "xhtml", "xml", "xsl"], + LANGUAGES: ['default-code', 'default-markup', 'bash', 'bsh', 'c', 'cc', 'coffee', 'cpp', 'cs', 'csh', 'cv', 'cxx', 'cyc', 'htm', 'html', 'in.tag', 'java', 'javascript', 'js', 'json', 'm', 'mxml', 'perl', 'pl', 'pm', 'py', 'python', 'rb', 'rc', 'rs', 'ruby', 'rust', 'sh', 'uq.val', 'xhtml', 'xml', 'xsl'], /** * @constant * @default */ - LINE_NUMS: false, - + LINE_NUMS: false, + /** * Syntax highlighter operation. * @@ -29,19 +29,19 @@ var Code = { * @param {Object[]} args * @returns {html} */ - run_syntax_highlight: function(input, args) { - var language = args[0], - line_nums = args[1]; - return "" + prettyPrintOne(Utils.escape_html(input), language, line_nums) + ""; - }, - - + run_syntax_highlight(input, args) { + let language = args[0], + line_nums = args[1]; + return `${prettyPrintOne(Utils.escape_html(input), language, line_nums)}`; + }, + + /** * @constant * @default */ - BEAUTIFY_INDENT: "\\t", - + BEAUTIFY_INDENT: '\\t', + /** * XML Beautify operation. * @@ -49,12 +49,12 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_xml_beautify: function(input, args) { - var indent_str = args[0]; - return vkbeautify.xml(input, indent_str); - }, - - + run_xml_beautify(input, args) { + const indent_str = args[0]; + return vkbeautify.xml(input, indent_str); + }, + + /** * JSON Beautify operation. * @@ -62,12 +62,12 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_json_beautify: function(input, args) { - var indent_str = args[0]; - return vkbeautify.json(input, indent_str); - }, - - + run_json_beautify(input, args) { + const indent_str = args[0]; + return vkbeautify.json(input, indent_str); + }, + + /** * CSS Beautify operation. * @@ -75,12 +75,12 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_css_beautify: function(input, args) { - var indent_str = args[0]; - return vkbeautify.css(input, indent_str); - }, - - + run_css_beautify(input, args) { + const indent_str = args[0]; + return vkbeautify.css(input, indent_str); + }, + + /** * SQL Beautify operation. * @@ -88,18 +88,18 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_sql_beautify: function(input, args) { - var indent_str = args[0]; - return vkbeautify.sql(input, indent_str); - }, - - + run_sql_beautify(input, args) { + const indent_str = args[0]; + return vkbeautify.sql(input, indent_str); + }, + + /** * @constant * @default */ - PRESERVE_COMMENTS: false, - + PRESERVE_COMMENTS: false, + /** * XML Minify operation. * @@ -107,12 +107,12 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_xml_minify: function(input, args) { - var preserve_comments = args[0]; - return vkbeautify.xmlmin(input, preserve_comments); - }, - - + run_xml_minify(input, args) { + const preserve_comments = args[0]; + return vkbeautify.xmlmin(input, preserve_comments); + }, + + /** * JSON Minify operation. * @@ -120,11 +120,11 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_json_minify: function(input, args) { - return vkbeautify.jsonmin(input); - }, - - + run_json_minify(input, args) { + return vkbeautify.jsonmin(input); + }, + + /** * CSS Minify operation. * @@ -132,12 +132,12 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_css_minify: function(input, args) { - var preserve_comments = args[0]; - return vkbeautify.cssmin(input, preserve_comments); - }, - - + run_css_minify(input, args) { + const preserve_comments = args[0]; + return vkbeautify.cssmin(input, preserve_comments); + }, + + /** * SQL Minify operation. * @@ -145,11 +145,11 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_sql_minify: function(input, args) { - return vkbeautify.sqlmin(input); - }, - - + run_sql_minify(input, args) { + return vkbeautify.sqlmin(input); + }, + + /** * Generic Code Beautify operation. * @@ -158,10 +158,10 @@ var Code = { * I'm not proud of this code, but seriously, try writing a generic lexer and parser that * correctly generates an AST for multiple different languages. I have tried, and I can tell * you it's pretty much impossible. - * + * * This basically works. That'll have to be good enough. It's not meant to produce working code, * just slightly more readable code. - * + * * Things that don't work: * - For loop formatting * - Do-While loop formatting @@ -173,133 +173,133 @@ var Code = { * @param {Object[]} args * @returns {string} */ - run_generic_beautify: function(input, args) { - var code = input, - t = 0, - preserved_tokens = [], - m; - + run_generic_beautify(input, args) { + let code = input, + t = 0, + preserved_tokens = [], + m; + // Remove strings - var sstrings = /'([^'\\]|\\.)*'/g; - while (!!(m = sstrings.exec(code))) { - code = preserve_token(code, m, t++); - sstrings.lastIndex = m.index; - } - - var dstrings = /"([^"\\]|\\.)*"/g; - while (!!(m = dstrings.exec(code))) { - code = preserve_token(code, m, t++); - dstrings.lastIndex = m.index; - } - + const sstrings = /'([^'\\]|\\.)*'/g; + while (m = sstrings.exec(code)) { + code = preserve_token(code, m, t++); + sstrings.lastIndex = m.index; + } + + const dstrings = /"([^"\\]|\\.)*"/g; + while (m = dstrings.exec(code)) { + code = preserve_token(code, m, t++); + dstrings.lastIndex = m.index; + } + // Remove comments - var scomments = /\/\/[^\n\r]*/g; - while (!!(m = scomments.exec(code))) { - code = preserve_token(code, m, t++); - scomments.lastIndex = m.index; - } - - var mcomments = /\/\*[\s\S]*?\*\//gm; - while (!!(m = mcomments.exec(code))) { - code = preserve_token(code, m, t++); - mcomments.lastIndex = m.index; - } - - var hcomments = /(^|\n)#[^\n\r#]+/g; - while (!!(m = hcomments.exec(code))) { - code = preserve_token(code, m, t++); - hcomments.lastIndex = m.index; - } - + const scomments = /\/\/[^\n\r]*/g; + while (m = scomments.exec(code)) { + code = preserve_token(code, m, t++); + scomments.lastIndex = m.index; + } + + const mcomments = /\/\*[\s\S]*?\*\//gm; + while (m = mcomments.exec(code)) { + code = preserve_token(code, m, t++); + mcomments.lastIndex = m.index; + } + + const hcomments = /(^|\n)#[^\n\r#]+/g; + while (m = hcomments.exec(code)) { + code = preserve_token(code, m, t++); + hcomments.lastIndex = m.index; + } + // Remove regexes - var regexes = /\/.*?[^\\]\/[gim]{0,3}/gi; - while (!!(m = regexes.exec(code))) { - code = preserve_token(code, m, t++); - regexes.lastIndex = m.index; - } - + const regexes = /\/.*?[^\\]\/[gim]{0,3}/gi; + while (m = regexes.exec(code)) { + code = preserve_token(code, m, t++); + regexes.lastIndex = m.index; + } + // Create newlines after ; - code = code.replace(/;/g, ";\n"); - + code = code.replace(/;/g, ';\n'); + // Create newlines after { and around } - code = code.replace(/{/g, "{\n"); - code = code.replace(/}/g, "\n}\n"); - + code = code.replace(/{/g, '{\n'); + code = code.replace(/}/g, '\n}\n'); + // Remove carriage returns - code = code.replace(/\r/g, ""); - + code = code.replace(/\r/g, ''); + // Remove all indentation - code = code.replace(/^\s+/g, ""); - code = code.replace(/\n\s+/g, "\n"); - + code = code.replace(/^\s+/g, ''); + code = code.replace(/\n\s+/g, '\n'); + // Remove trailing spaces - code = code.replace(/\s*$/g, ""); - + code = code.replace(/\s*$/g, ''); + // Remove newlines before { - code = code.replace(/\n{/g, "{"); - + code = code.replace(/\n{/g, '{'); + // Indent - var i = 0, - level = 0; - while (i < code.length) { - switch(code[i]) { - case "{": - level++; - break; - case "\n": - if (i+1 >= code.length) break; - - if (code[i+1] == "}") level--; - var indent = (level >= 0) ? Array(level*4+1).join(" ") : ""; - - code = code.substring(0, i+1) + indent + code.substring(i+1); - if (level > 0) i += level*4; - break; - } - i++; - } + let i = 0, + level = 0; + while (i < code.length) { + switch (code[i]) { + case '{': + level++; + break; + case '\n': + if (i + 1 >= code.length) break; + + if (code[i + 1] == '}') level--; + var indent = (level >= 0) ? Array(level * 4 + 1).join(' ') : ''; + + code = code.substring(0, i + 1) + indent + code.substring(i + 1); + if (level > 0) i += level * 4; + break; + } + i++; + } // Add strategic spaces - code = code.replace(/\s*([!<>=+-/*]?)=\s*/g, " $1= "); - code = code.replace(/\s*<([=]?)\s*/g, " <$1 "); - code = code.replace(/\s*>([=]?)\s*/g, " >$1 "); - code = code.replace(/([^+])\+([^+=])/g, "$1 + $2"); - code = code.replace(/([^-])-([^-=])/g, "$1 - $2"); - code = code.replace(/([^*])\*([^*=])/g, "$1 * $2"); - code = code.replace(/([^/])\/([^/=])/g, "$1 / $2"); - code = code.replace(/\s*,\s*/g, ", "); - code = code.replace(/\s*{/g, " {"); - code = code.replace(/}\n/g, "}\n\n"); - - // Just... don't look at this - code = code.replace(/(if|for|while|with|elif|elseif)\s*\(([^\n]*)\)\s*\n([^{])/gim, "$1 ($2)\n $3"); - code = code.replace(/(if|for|while|with|elif|elseif)\s*\(([^\n]*)\)([^{])/gim, "$1 ($2) $3"); - code = code.replace(/else\s*\n([^{])/gim, "else\n $1"); - code = code.replace(/else\s+([^{])/gim, "else $1"); - - // Remove strategic spaces - code = code.replace(/\s+;/g, ";"); - code = code.replace(/\{\s+\}/g, "{}"); - code = code.replace(/\[\s+\]/g, "[]"); - code = code.replace(/}\s*(else|catch|except|finally|elif|elseif|else if)/gi, "} $1"); - - - // Replace preserved tokens - var ptokens = /###preserved_token(\d+)###/g; - while (!!(m = ptokens.exec(code))) { - var ti = parseInt(m[1]); - code = code.substring(0, m.index) + preserved_tokens[ti] + code.substring(m.index + m[0].length); - ptokens.lastIndex = m.index; - } + code = code.replace(/\s*([!<>=+-/*]?)=\s*/g, ' $1= '); + code = code.replace(/\s*<([=]?)\s*/g, ' <$1 '); + code = code.replace(/\s*>([=]?)\s*/g, ' >$1 '); + code = code.replace(/([^+])\+([^+=])/g, '$1 + $2'); + code = code.replace(/([^-])-([^-=])/g, '$1 - $2'); + code = code.replace(/([^*])\*([^*=])/g, '$1 * $2'); + code = code.replace(/([^/])\/([^/=])/g, '$1 / $2'); + code = code.replace(/\s*,\s*/g, ', '); + code = code.replace(/\s*{/g, ' {'); + code = code.replace(/}\n/g, '}\n\n'); - return code; - - function preserve_token(str, match, t) { - preserved_tokens[t] = match[0]; - return str.substring(0, match.index) + - "###preserved_token" + t + "###" + - str.substring(match.index + match[0].length); - } - }, + // Just... don't look at this + code = code.replace(/(if|for|while|with|elif|elseif)\s*\(([^\n]*)\)\s*\n([^{])/gim, '$1 ($2)\n $3'); + code = code.replace(/(if|for|while|with|elif|elseif)\s*\(([^\n]*)\)([^{])/gim, '$1 ($2) $3'); + code = code.replace(/else\s*\n([^{])/gim, 'else\n $1'); + code = code.replace(/else\s+([^{])/gim, 'else $1'); + + // Remove strategic spaces + code = code.replace(/\s+;/g, ';'); + code = code.replace(/\{\s+\}/g, '{}'); + code = code.replace(/\[\s+\]/g, '[]'); + code = code.replace(/}\s*(else|catch|except|finally|elif|elseif|else if)/gi, '} $1'); + + + // Replace preserved tokens + const ptokens = /###preserved_token(\d+)###/g; + while (m = ptokens.exec(code)) { + const ti = parseInt(m[1]); + code = code.substring(0, m.index) + preserved_tokens[ti] + code.substring(m.index + m[0].length); + ptokens.lastIndex = m.index; + } + + return code; + + function preserve_token(str, match, t) { + preserved_tokens[t] = match[0]; + return `${str.substring(0, match.index) + }###preserved_token${t}###${ + str.substring(match.index + match[0].length)}`; + } + }, }; diff --git a/src/js/operations/Compress.js b/src/js/operations/Compress.js index b5d5de0f..9a7207e6 100755 --- a/src/js/operations/Compress.js +++ b/src/js/operations/Compress.js @@ -9,38 +9,38 @@ * * @namespace */ -var Compress = { +const Compress = { /** * @constant * @default */ - COMPRESSION_TYPE: ["Dynamic Huffman Coding", "Fixed Huffman Coding", "None (Store)"], + COMPRESSION_TYPE: ['Dynamic Huffman Coding', 'Fixed Huffman Coding', 'None (Store)'], /** * @constant * @default */ - INFLATE_BUFFER_TYPE: ["Adaptive", "Block"], + INFLATE_BUFFER_TYPE: ['Adaptive', 'Block'], /** * @constant * @default */ - COMPRESSION_METHOD: ["Deflate", "None (Store)"], + COMPRESSION_METHOD: ['Deflate', 'None (Store)'], /** * @constant * @default */ - OS: ["MSDOS", "Unix", "Macintosh"], + OS: ['MSDOS', 'Unix', 'Macintosh'], /** * @constant * @default */ - RAW_COMPRESSION_TYPE_LOOKUP: { - "Fixed Huffman Coding" : Zlib.RawDeflate.CompressionType.FIXED, - "Dynamic Huffman Coding" : Zlib.RawDeflate.CompressionType.DYNAMIC, - "None (Store)" : Zlib.RawDeflate.CompressionType.NONE, - }, - + RAW_COMPRESSION_TYPE_LOOKUP: { + 'Fixed Huffman Coding': Zlib.RawDeflate.CompressionType.FIXED, + 'Dynamic Huffman Coding': Zlib.RawDeflate.CompressionType.DYNAMIC, + 'None (Store)': Zlib.RawDeflate.CompressionType.NONE, + }, + /** * Raw Deflate operation. * @@ -48,43 +48,43 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_raw_deflate: function(input, args) { - var deflate = new Zlib.RawDeflate(input, { - compressionType: Compress.RAW_COMPRESSION_TYPE_LOOKUP[args[0]] - }); - return Array.prototype.slice.call(deflate.compress()); - }, - - + run_raw_deflate(input, args) { + const deflate = new Zlib.RawDeflate(input, { + compressionType: Compress.RAW_COMPRESSION_TYPE_LOOKUP[args[0]], + }); + return Array.prototype.slice.call(deflate.compress()); + }, + + /** * @constant * @default */ - INFLATE_INDEX: 0, + INFLATE_INDEX: 0, /** * @constant * @default */ - INFLATE_BUFFER_SIZE: 0, + INFLATE_BUFFER_SIZE: 0, /** * @constant * @default */ - INFLATE_RESIZE: false, + INFLATE_RESIZE: false, /** * @constant * @default */ - INFLATE_VERIFY: false, + INFLATE_VERIFY: false, /** * @constant * @default */ - RAW_BUFFER_TYPE_LOOKUP: { - "Adaptive" : Zlib.RawInflate.BufferType.ADAPTIVE, - "Block" : Zlib.RawInflate.BufferType.BLOCK, - }, - + RAW_BUFFER_TYPE_LOOKUP: { + Adaptive: Zlib.RawInflate.BufferType.ADAPTIVE, + Block: Zlib.RawInflate.BufferType.BLOCK, + }, + /** * Raw Inflate operation. * @@ -92,51 +92,51 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_raw_inflate: function(input, args) { + run_raw_inflate(input, args) { // Deal with character encoding issues - input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input)); - var inflate = new Zlib.RawInflate(input, { - index: args[0], - bufferSize: args[1], - bufferType: Compress.RAW_BUFFER_TYPE_LOOKUP[args[2]], - resize: args[3], - verify: args[4] - }), - result = Array.prototype.slice.call(inflate.decompress()); - + input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input)); + let inflate = new Zlib.RawInflate(input, { + index: args[0], + bufferSize: args[1], + bufferType: Compress.RAW_BUFFER_TYPE_LOOKUP[args[2]], + resize: args[3], + verify: args[4], + }), + result = Array.prototype.slice.call(inflate.decompress()); + // Raw Inflate somethimes messes up and returns nonsense like this: // ]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]... // e.g. Input data of [8b, 1d, dc, 44] // Look for the first two square brackets: - if (result.length > 158 && result[0] == 93 && result[5] == 93) { + if (result.length > 158 && result[0] == 93 && result[5] == 93) { // If the first two square brackets are there, check that the others // are also there. If they are, throw an error. If not, continue. - var valid = false; - for (var i = 0; i < 155; i += 5) { - if (result[i] != 93) { - valid = true; - } - } - - if (!valid) { - throw "Error: Unable to inflate data"; - } + let valid = false; + for (let i = 0; i < 155; i += 5) { + if (result[i] != 93) { + valid = true; } + } + + if (!valid) { + throw 'Error: Unable to inflate data'; + } + } // Trust me, this is the easiest way... - return result; - }, - - + return result; + }, + + /** * @constant * @default */ - ZLIB_COMPRESSION_TYPE_LOOKUP: { - "Fixed Huffman Coding" : Zlib.Deflate.CompressionType.FIXED, - "Dynamic Huffman Coding" : Zlib.Deflate.CompressionType.DYNAMIC, - "None (Store)" : Zlib.Deflate.CompressionType.NONE, - }, - + ZLIB_COMPRESSION_TYPE_LOOKUP: { + 'Fixed Huffman Coding': Zlib.Deflate.CompressionType.FIXED, + 'Dynamic Huffman Coding': Zlib.Deflate.CompressionType.DYNAMIC, + 'None (Store)': Zlib.Deflate.CompressionType.NONE, + }, + /** * Zlib Deflate operation. * @@ -144,23 +144,23 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_zlib_deflate: function(input, args) { - var deflate = new Zlib.Deflate(input, { - compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[0]] - }); - return Array.prototype.slice.call(deflate.compress()); - }, - - + run_zlib_deflate(input, args) { + const deflate = new Zlib.Deflate(input, { + compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[0]], + }); + return Array.prototype.slice.call(deflate.compress()); + }, + + /** * @constant * @default */ - ZLIB_BUFFER_TYPE_LOOKUP: { - "Adaptive" : Zlib.Inflate.BufferType.ADAPTIVE, - "Block" : Zlib.Inflate.BufferType.BLOCK, - }, - + ZLIB_BUFFER_TYPE_LOOKUP: { + Adaptive: Zlib.Inflate.BufferType.ADAPTIVE, + Block: Zlib.Inflate.BufferType.BLOCK, + }, + /** * Zlib Inflate operation. * @@ -168,26 +168,26 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_zlib_inflate: function(input, args) { + run_zlib_inflate(input, args) { // Deal with character encoding issues - input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input)); - var inflate = new Zlib.Inflate(input, { - index: args[0], - bufferSize: args[1], - bufferType: Compress.ZLIB_BUFFER_TYPE_LOOKUP[args[2]], - resize: args[3], - verify: args[4] - }); - return Array.prototype.slice.call(inflate.decompress()); - }, - - + input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input)); + const inflate = new Zlib.Inflate(input, { + index: args[0], + bufferSize: args[1], + bufferType: Compress.ZLIB_BUFFER_TYPE_LOOKUP[args[2]], + resize: args[3], + verify: args[4], + }); + return Array.prototype.slice.call(inflate.decompress()); + }, + + /** * @constant * @default */ - GZIP_CHECKSUM: false, - + GZIP_CHECKSUM: false, + /** * Gzip operation. * @@ -195,32 +195,32 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_gzip: function(input, args) { - var filename = args[1], - comment = args[2], - options = { - deflateOptions: { - compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[0]] - }, - flags: { - fhcrc: args[3] - } - }; - - if (filename.length) { - options.flags.fname = true; - options.filename = filename; - } - if (comment.length) { - options.flags.fcommenct = true; - options.comment = comment; - } - - var gzip = new Zlib.Gzip(input, options); - return Array.prototype.slice.call(gzip.compress()); - }, - - + run_gzip(input, args) { + let filename = args[1], + comment = args[2], + options = { + deflateOptions: { + compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[0]], + }, + flags: { + fhcrc: args[3], + }, + }; + + if (filename.length) { + options.flags.fname = true; + options.filename = filename; + } + if (comment.length) { + options.flags.fcommenct = true; + options.comment = comment; + } + + const gzip = new Zlib.Gzip(input, options); + return Array.prototype.slice.call(gzip.compress()); + }, + + /** * Gunzip operation. * @@ -228,37 +228,37 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_gunzip: function(input, args) { + run_gunzip(input, args) { // Deal with character encoding issues - input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input)); - var gunzip = new Zlib.Gunzip(input); - return Array.prototype.slice.call(gunzip.decompress()); - }, - - + input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input)); + const gunzip = new Zlib.Gunzip(input); + return Array.prototype.slice.call(gunzip.decompress()); + }, + + /** * @constant * @default */ - PKZIP_FILENAME: "file.txt", + PKZIP_FILENAME: 'file.txt', /** * @constant * @default */ - ZIP_COMPRESSION_METHOD_LOOKUP: { - "Deflate" : Zlib.Zip.CompressionMethod.DEFLATE, - "None (Store)" : Zlib.Zip.CompressionMethod.STORE - }, + ZIP_COMPRESSION_METHOD_LOOKUP: { + Deflate: Zlib.Zip.CompressionMethod.DEFLATE, + 'None (Store)': Zlib.Zip.CompressionMethod.STORE, + }, /** * @constant * @default */ - ZIP_OS_LOOKUP: { - "MSDOS" : Zlib.Zip.OperatingSystem.MSDOS, - "Unix" : Zlib.Zip.OperatingSystem.UNIX, - "Macintosh" : Zlib.Zip.OperatingSystem.MACINTOSH - }, - + ZIP_OS_LOOKUP: { + MSDOS: Zlib.Zip.OperatingSystem.MSDOS, + Unix: Zlib.Zip.OperatingSystem.UNIX, + Macintosh: Zlib.Zip.OperatingSystem.MACINTOSH, + }, + /** * Zip operation. * @@ -266,32 +266,31 @@ var Compress = { * @param {Object[]} args * @returns {byte_array} */ - run_pkzip: function(input, args) { - var password = Utils.str_to_byte_array(args[2]), - options = { - filename: Utils.str_to_byte_array(args[0]), - comment: Utils.str_to_byte_array(args[1]), - compressionMethod: Compress.ZIP_COMPRESSION_METHOD_LOOKUP[args[3]], - os: Compress.ZIP_OS_LOOKUP[args[4]], - deflateOption: { - compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[5]] - }, - }, - zip = new Zlib.Zip(); - - if (password.length) - zip.setPassword(password); - zip.addFile(input, options); - return Array.prototype.slice.call(zip.compress()); - }, - - + run_pkzip(input, args) { + let password = Utils.str_to_byte_array(args[2]), + options = { + filename: Utils.str_to_byte_array(args[0]), + comment: Utils.str_to_byte_array(args[1]), + compressionMethod: Compress.ZIP_COMPRESSION_METHOD_LOOKUP[args[3]], + os: Compress.ZIP_OS_LOOKUP[args[4]], + deflateOption: { + compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[5]], + }, + }, + zip = new Zlib.Zip(); + + if (password.length) { zip.setPassword(password); } + zip.addFile(input, options); + return Array.prototype.slice.call(zip.compress()); + }, + + /** * @constant * @default */ - PKUNZIP_VERIFY: false, - + PKUNZIP_VERIFY: false, + /** * Unzip operation. * @@ -299,36 +298,36 @@ var Compress = { * @param {Object[]} args * @returns {string} */ - run_pkunzip: function(input, args) { - var options = { - password: Utils.str_to_byte_array(args[0]), - verify: args[1] - }, - file = "", - unzip = new Zlib.Unzip(input, options), - filenames = unzip.getFilenames(), - output = "
" + filenames.length + " file(s) found
\n"; - - output += "
"; - - window.uzip = unzip; - for (var i = 0; i < filenames.length; i++) { - file = Utils.byte_array_to_utf8(unzip.decompress(filenames[i])); - output += "
" + - "" + - "
" + - "
" + - Utils.escape_html(file) + "
"; - } - - return output + "
"; - }, - - + run_pkunzip(input, args) { + let options = { + password: Utils.str_to_byte_array(args[0]), + verify: args[1], + }, + file = '', + unzip = new Zlib.Unzip(input, options), + filenames = unzip.getFilenames(), + output = `
${filenames.length} file(s) found
\n`; + + output += "
"; + + window.uzip = unzip; + for (let i = 0; i < filenames.length; i++) { + file = Utils.byte_array_to_utf8(unzip.decompress(filenames[i])); + output += `${"
" + + "` + + `
` + + `
${ + Utils.escape_html(file)}
`; + } + + return `${output}
`; + }, + + /** * Bzip2 Decompress operation. * @@ -336,14 +335,14 @@ var Compress = { * @param {Object[]} args * @returns {string} */ - run_bzip2_decompress: function(input, args) { - var compressed = new Uint8Array(input), - bzip2_reader, - plain = ""; - - bzip2_reader = bzip2.array(compressed); - plain = bzip2.simple(bzip2_reader); - return plain; - }, - + run_bzip2_decompress(input, args) { + let compressed = new Uint8Array(input), + bzip2_reader, + plain = ''; + + bzip2_reader = bzip2.array(compressed); + plain = bzip2.simple(bzip2_reader); + return plain; + }, + }; diff --git a/src/js/operations/Convert.js b/src/js/operations/Convert.js index e47ca684..97861721 100755 --- a/src/js/operations/Convert.js +++ b/src/js/operations/Convert.js @@ -7,56 +7,56 @@ * * @namespace */ -var Convert = { +const Convert = { /** * @constant * @default */ - DISTANCE_UNITS: [ - "[Metric]", "Nanometres (nm)", "Micrometres (µm)", "Millimetres (mm)", "Centimetres (cm)", "Metres (m)", "Kilometers (km)", "[/Metric]", - "[Imperial]", "Thou (th)", "Inches (in)", "Feet (ft)", "Yards (yd)", "Chains (ch)", "Furlongs (fur)", "Miles (mi)", "Leagues (lea)", "[/Imperial]", - "[Maritime]", "Fathoms (ftm)", "Cables", "Nautical miles", "[/Maritime]", - "[Comparisons]", "Cars (4m)", "Buses (8.4m)", "American football fields (91m)", "Football pitches (105m)", "[/Comparisons]", - "[Astronomical]", "Earth-to-Moons", "Earth's equators", "Astronomical units (au)", "Light-years (ly)", "Parsecs (pc)", "[/Astronomical]", - ], + DISTANCE_UNITS: [ + '[Metric]', 'Nanometres (nm)', 'Micrometres (µm)', 'Millimetres (mm)', 'Centimetres (cm)', 'Metres (m)', 'Kilometers (km)', '[/Metric]', + '[Imperial]', 'Thou (th)', 'Inches (in)', 'Feet (ft)', 'Yards (yd)', 'Chains (ch)', 'Furlongs (fur)', 'Miles (mi)', 'Leagues (lea)', '[/Imperial]', + '[Maritime]', 'Fathoms (ftm)', 'Cables', 'Nautical miles', '[/Maritime]', + '[Comparisons]', 'Cars (4m)', 'Buses (8.4m)', 'American football fields (91m)', 'Football pitches (105m)', '[/Comparisons]', + '[Astronomical]', 'Earth-to-Moons', "Earth's equators", 'Astronomical units (au)', 'Light-years (ly)', 'Parsecs (pc)', '[/Astronomical]', + ], /** * @constant * @default */ - DISTANCE_FACTOR: { // Multiples of a metre - "Nanometres (nm)" : 1e-9, - "Micrometres (µm)" : 1e-6, - "Millimetres (mm)" : 1e-3, - "Centimetres (cm)" : 1e-2, - "Metres (m)" : 1, - "Kilometers (km)" : 1e3, - - "Thou (th)" : 0.0000254, - "Inches (in)" : 0.0254, - "Feet (ft)" : 0.3048, - "Yards (yd)" : 0.9144, - "Chains (ch)" : 20.1168, - "Furlongs (fur)" : 201.168, - "Miles (mi)" : 1609.344, - "Leagues (lea)" : 4828.032, - - "Fathoms (ftm)" : 1.853184, - "Cables" : 185.3184, - "Nautical miles" : 1853.184, - - "Cars (4m)" : 4, - "Buses (8.4m)" : 8.4, - "American football fields (91m)": 91, - "Football pitches (105m)": 105, - - "Earth-to-Moons" : 380000000, - "Earth's equators" : 40075016.686, - "Astronomical units (au)": 149597870700, - "Light-years (ly)" : 9460730472580800, - "Parsecs (pc)" : 3.0856776e16 - }, - + DISTANCE_FACTOR: { // Multiples of a metre + 'Nanometres (nm)': 1e-9, + 'Micrometres (µm)': 1e-6, + 'Millimetres (mm)': 1e-3, + 'Centimetres (cm)': 1e-2, + 'Metres (m)': 1, + 'Kilometers (km)': 1e3, + + 'Thou (th)': 0.0000254, + 'Inches (in)': 0.0254, + 'Feet (ft)': 0.3048, + 'Yards (yd)': 0.9144, + 'Chains (ch)': 20.1168, + 'Furlongs (fur)': 201.168, + 'Miles (mi)': 1609.344, + 'Leagues (lea)': 4828.032, + + 'Fathoms (ftm)': 1.853184, + Cables: 185.3184, + 'Nautical miles': 1853.184, + + 'Cars (4m)': 4, + 'Buses (8.4m)': 8.4, + 'American football fields (91m)': 91, + 'Football pitches (105m)': 105, + + 'Earth-to-Moons': 380000000, + "Earth's equators": 40075016.686, + 'Astronomical units (au)': 149597870700, + 'Light-years (ly)': 9460730472580800, + 'Parsecs (pc)': 3.0856776e16, + }, + /** * Convert distance operation. * @@ -64,80 +64,80 @@ var Convert = { * @param {Object[]} args * @returns {number} */ - run_distance: function (input, args) { - var input_units = args[0], - output_units = args[1]; - - input = input * Convert.DISTANCE_FACTOR[input_units]; - return input / Convert.DISTANCE_FACTOR[output_units]; + run_distance(input, args) { + let input_units = args[0], + output_units = args[1]; + + input *= Convert.DISTANCE_FACTOR[input_units]; + return input / Convert.DISTANCE_FACTOR[output_units]; // TODO Remove rounding errors (e.g. 1.000000000001) - }, - - + }, + + /** * @constant * @default */ - DATA_UNITS: [ - "Bits (b)", "Nibbles", "Octets", "Bytes (B)", - "[Binary bits (2^n)]", "Kibibits (Kib)", "Mebibits (Mib)", "Gibibits (Gib)", "Tebibits (Tib)", "Pebibits (Pib)", "Exbibits (Eib)", "Zebibits (Zib)", "Yobibits (Yib)", "[/Binary bits (2^n)]", - "[Decimal bits (10^n)]", "Decabits", "Hectobits", "Kilobits (kb)", "Megabits (Mb)", "Gigabits (Gb)", "Terabits (Tb)", "Petabits (Pb)", "Exabits (Eb)", "Zettabits (Zb)", "Yottabits (Yb)", "[/Decimal bits (10^n)]", - "[Binary bytes (8 x 2^n)]", "Kibibytes (KiB)", "Mebibytes (MiB)", "Gibibytes (GiB)", "Tebibytes (TiB)", "Pebibytes (PiB)", "Exbibytes (EiB)", "Zebibytes (ZiB)", "Yobibytes (YiB)", "[/Binary bytes (8 x 2^n)]", - "[Decimal bytes (8 x 10^n)]", "Kilobytes (KB)", "Megabytes (MB)", "Gigabytes (GB)", "Terabytes (TB)", "Petabytes (PB)", "Exabytes (EB)", "Zettabytes (ZB)", "Yottabytes (YB)", "[/Decimal bytes (8 x 10^n)]" - ], + DATA_UNITS: [ + 'Bits (b)', 'Nibbles', 'Octets', 'Bytes (B)', + '[Binary bits (2^n)]', 'Kibibits (Kib)', 'Mebibits (Mib)', 'Gibibits (Gib)', 'Tebibits (Tib)', 'Pebibits (Pib)', 'Exbibits (Eib)', 'Zebibits (Zib)', 'Yobibits (Yib)', '[/Binary bits (2^n)]', + '[Decimal bits (10^n)]', 'Decabits', 'Hectobits', 'Kilobits (kb)', 'Megabits (Mb)', 'Gigabits (Gb)', 'Terabits (Tb)', 'Petabits (Pb)', 'Exabits (Eb)', 'Zettabits (Zb)', 'Yottabits (Yb)', '[/Decimal bits (10^n)]', + '[Binary bytes (8 x 2^n)]', 'Kibibytes (KiB)', 'Mebibytes (MiB)', 'Gibibytes (GiB)', 'Tebibytes (TiB)', 'Pebibytes (PiB)', 'Exbibytes (EiB)', 'Zebibytes (ZiB)', 'Yobibytes (YiB)', '[/Binary bytes (8 x 2^n)]', + '[Decimal bytes (8 x 10^n)]', 'Kilobytes (KB)', 'Megabytes (MB)', 'Gigabytes (GB)', 'Terabytes (TB)', 'Petabytes (PB)', 'Exabytes (EB)', 'Zettabytes (ZB)', 'Yottabytes (YB)', '[/Decimal bytes (8 x 10^n)]', + ], /** * @constant * @default */ - DATA_FACTOR: { // Multiples of a bit - "Bits (b)" : 1, - "Nibbles" : 4, - "Octets" : 8, - "Bytes (B)" : 8, - + DATA_FACTOR: { // Multiples of a bit + 'Bits (b)': 1, + Nibbles: 4, + Octets: 8, + 'Bytes (B)': 8, + // Binary bits (2^n) - "Kibibits (Kib)" : 1024, - "Mebibits (Mib)" : 1048576, - "Gibibits (Gib)" : 1073741824, - "Tebibits (Tib)" : 1099511627776, - "Pebibits (Pib)" : 1125899906842624, - "Exbibits (Eib)" : 1152921504606846976, - "Zebibits (Zib)" : 1180591620717411303424, - "Yobibits (Yib)" : 1208925819614629174706176, - + 'Kibibits (Kib)': 1024, + 'Mebibits (Mib)': 1048576, + 'Gibibits (Gib)': 1073741824, + 'Tebibits (Tib)': 1099511627776, + 'Pebibits (Pib)': 1125899906842624, + 'Exbibits (Eib)': 1152921504606846976, + 'Zebibits (Zib)': 1180591620717411303424, + 'Yobibits (Yib)': 1208925819614629174706176, + // Decimal bits (10^n) - "Decabits" : 10, - "Hectobits" : 100, - "Kilobits (Kb)" : 1e3, - "Megabits (Mb)" : 1e6, - "Gigabits (Gb)" : 1e9, - "Terabits (Tb)" : 1e12, - "Petabits (Pb)" : 1e15, - "Exabits (Eb)" : 1e18, - "Zettabits (Zb)" : 1e21, - "Yottabits (Yb)" : 1e24, - + Decabits: 10, + Hectobits: 100, + 'Kilobits (Kb)': 1e3, + 'Megabits (Mb)': 1e6, + 'Gigabits (Gb)': 1e9, + 'Terabits (Tb)': 1e12, + 'Petabits (Pb)': 1e15, + 'Exabits (Eb)': 1e18, + 'Zettabits (Zb)': 1e21, + 'Yottabits (Yb)': 1e24, + // Binary bytes (8 x 2^n) - "Kibibytes (KiB)" : 8192, - "Mebibytes (MiB)" : 8388608, - "Gibibytes (GiB)" : 8589934592, - "Tebibytes (TiB)" : 8796093022208, - "Pebibytes (PiB)" : 9007199254740992, - "Exbibytes (EiB)" : 9223372036854775808, - "Zebibytes (ZiB)" : 9444732965739290427392, - "Yobibytes (YiB)" : 9671406556917033397649408, - + 'Kibibytes (KiB)': 8192, + 'Mebibytes (MiB)': 8388608, + 'Gibibytes (GiB)': 8589934592, + 'Tebibytes (TiB)': 8796093022208, + 'Pebibytes (PiB)': 9007199254740992, + 'Exbibytes (EiB)': 9223372036854775808, + 'Zebibytes (ZiB)': 9444732965739290427392, + 'Yobibytes (YiB)': 9671406556917033397649408, + // Decimal bytes (8 x 10^n) - "Kilobytes (KB)" : 8e3, - "Megabytes (MB)" : 8e6, - "Gigabytes (GB)" : 8e9, - "Terabytes (TB)" : 8e12, - "Petabytes (PB)" : 8e15, - "Exabytes (EB)" : 8e18, - "Zettabytes (ZB)" : 8e21, - "Yottabytes (YB)" : 8e24, - }, - + 'Kilobytes (KB)': 8e3, + 'Megabytes (MB)': 8e6, + 'Gigabytes (GB)': 8e9, + 'Terabytes (TB)': 8e12, + 'Petabytes (PB)': 8e15, + 'Exabytes (EB)': 8e18, + 'Zettabytes (ZB)': 8e21, + 'Yottabytes (YB)': 8e24, + }, + /** * Convert data units operation. * @@ -145,79 +145,79 @@ var Convert = { * @param {Object[]} args * @returns {number} */ - run_data_size: function (input, args) { - var input_units = args[0], - output_units = args[1]; - - input = input * Convert.DATA_FACTOR[input_units]; - return input / Convert.DATA_FACTOR[output_units]; - }, - - + run_data_size(input, args) { + let input_units = args[0], + output_units = args[1]; + + input *= Convert.DATA_FACTOR[input_units]; + return input / Convert.DATA_FACTOR[output_units]; + }, + + /** * @constant * @default */ - AREA_UNITS: [ - "[Metric]", "Square metre (sq m)", "Square kilometre (sq km)", "Centiare (ca)", "Deciare (da)", "Are (a)", "Decare (daa)", "Hectare (ha)", "[/Metric]", - "[Imperial]", "Square inch (sq in)", "Square foot (sq ft)", "Square yard (sq yd)", "Square mile (sq mi)", "Perch (sq per)", "Rood (ro)", "International acre (ac)", "[/Imperial]", - "[US customary units]", "US survey acre (ac)", "US survey square mile (sq mi)", "US survey township", "[/US customary units]", - "[Nuclear physics]", "Yoctobarn (yb)", "Zeptobarn (zb)", "Attobarn (ab)", "Femtobarn (fb)", "Picobarn (pb)", "Nanobarn (nb)", "Microbarn (μb)", "Millibarn (mb)", "Barn (b)", "Kilobarn (kb)", "Megabarn (Mb)", "Outhouse", "Shed", "Planck area", "[/Nuclear physics]", - "[Comparisons]", "Washington D.C.", "Isle of Wight", "Wales", "Texas", "[/Comparisons]", - ], + AREA_UNITS: [ + '[Metric]', 'Square metre (sq m)', 'Square kilometre (sq km)', 'Centiare (ca)', 'Deciare (da)', 'Are (a)', 'Decare (daa)', 'Hectare (ha)', '[/Metric]', + '[Imperial]', 'Square inch (sq in)', 'Square foot (sq ft)', 'Square yard (sq yd)', 'Square mile (sq mi)', 'Perch (sq per)', 'Rood (ro)', 'International acre (ac)', '[/Imperial]', + '[US customary units]', 'US survey acre (ac)', 'US survey square mile (sq mi)', 'US survey township', '[/US customary units]', + '[Nuclear physics]', 'Yoctobarn (yb)', 'Zeptobarn (zb)', 'Attobarn (ab)', 'Femtobarn (fb)', 'Picobarn (pb)', 'Nanobarn (nb)', 'Microbarn (μb)', 'Millibarn (mb)', 'Barn (b)', 'Kilobarn (kb)', 'Megabarn (Mb)', 'Outhouse', 'Shed', 'Planck area', '[/Nuclear physics]', + '[Comparisons]', 'Washington D.C.', 'Isle of Wight', 'Wales', 'Texas', '[/Comparisons]', + ], /** * @constant * @default */ - AREA_FACTOR: { // Multiples of a square metre + AREA_FACTOR: { // Multiples of a square metre // Metric - "Square metre (sq m)" : 1, - "Square kilometre (sq km)" : 1e6, - - "Centiare (ca)" : 1, - "Deciare (da)" : 10, - "Are (a)" : 100, - "Decare (daa)" : 1e3, - "Hectare (ha)" : 1e4, - + 'Square metre (sq m)': 1, + 'Square kilometre (sq km)': 1e6, + + 'Centiare (ca)': 1, + 'Deciare (da)': 10, + 'Are (a)': 100, + 'Decare (daa)': 1e3, + 'Hectare (ha)': 1e4, + // Imperial - "Square inch (sq in)" : 0.00064516, - "Square foot (sq ft)" : 0.09290304, - "Square yard (sq yd)" : 0.83612736, - "Square mile (sq mi)" : 2589988.110336, - "Perch (sq per)" : 42.21, - "Rood (ro)" : 1011, - "International acre (ac)" : 4046.8564224, - + 'Square inch (sq in)': 0.00064516, + 'Square foot (sq ft)': 0.09290304, + 'Square yard (sq yd)': 0.83612736, + 'Square mile (sq mi)': 2589988.110336, + 'Perch (sq per)': 42.21, + 'Rood (ro)': 1011, + 'International acre (ac)': 4046.8564224, + // US customary units - "US survey acre (ac)" : 4046.87261, - "US survey square mile (sq mi)" : 2589998.470305239, - "US survey township" : 93239944.9309886, - + 'US survey acre (ac)': 4046.87261, + 'US survey square mile (sq mi)': 2589998.470305239, + 'US survey township': 93239944.9309886, + // Nuclear physics - "Yoctobarn (yb)" : 1e-52, - "Zeptobarn (zb)" : 1e-49, - "Attobarn (ab)" : 1e-46, - "Femtobarn (fb)" : 1e-43, - "Picobarn (pb)" : 1e-40, - "Nanobarn (nb)" : 1e-37, - "Microbarn (μb)" : 1e-34, - "Millibarn (mb)" : 1e-31, - "Barn (b)" : 1e-28, - "Kilobarn (kb)" : 1e-25, - "Megabarn (Mb)" : 1e-22, - - "Planck area" : 2.6e-70, - "Shed" : 1e-52, - "Outhouse" : 1e-34, - + 'Yoctobarn (yb)': 1e-52, + 'Zeptobarn (zb)': 1e-49, + 'Attobarn (ab)': 1e-46, + 'Femtobarn (fb)': 1e-43, + 'Picobarn (pb)': 1e-40, + 'Nanobarn (nb)': 1e-37, + 'Microbarn (μb)': 1e-34, + 'Millibarn (mb)': 1e-31, + 'Barn (b)': 1e-28, + 'Kilobarn (kb)': 1e-25, + 'Megabarn (Mb)': 1e-22, + + 'Planck area': 2.6e-70, + Shed: 1e-52, + Outhouse: 1e-34, + // Comparisons - "Washington D.C." : 176119191.502848, - "Isle of Wight" : 380000000, - "Wales" : 20779000000, - "Texas" : 696241000000, - }, - + 'Washington D.C.': 176119191.502848, + 'Isle of Wight': 380000000, + Wales: 20779000000, + Texas: 696241000000, + }, + /** * Convert area operation. * @@ -225,110 +225,110 @@ var Convert = { * @param {Object[]} args * @returns {number} */ - run_area: function (input, args) { - var input_units = args[0], - output_units = args[1]; - - input = input * Convert.AREA_FACTOR[input_units]; - return input / Convert.AREA_FACTOR[output_units]; - }, - - + run_area(input, args) { + let input_units = args[0], + output_units = args[1]; + + input *= Convert.AREA_FACTOR[input_units]; + return input / Convert.AREA_FACTOR[output_units]; + }, + + /** * @constant * @default */ - MASS_UNITS: [ - "[Metric]", "Yoctogram (yg)", "Zeptogram (zg)", "Attogram (ag)", "Femtogram (fg)", "Picogram (pg)", "Nanogram (ng)", "Microgram (μg)", "Milligram (mg)", "Centigram (cg)", "Decigram (dg)", "Gram (g)", "Decagram (dag)", "Hectogram (hg)", "Kilogram (kg)", "Megagram (Mg)", "Tonne (t)", "Gigagram (Gg)", "Teragram (Tg)", "Petagram (Pg)", "Exagram (Eg)", "Zettagram (Zg)", "Yottagram (Yg)", "[/Metric]", - "[Imperial Avoirdupois]", "Grain (gr)", "Dram (dr)", "Ounce (oz)", "Pound (lb)", "Nail", "Stone (st)", "Quarter (gr)", "Tod", "US hundredweight (cwt)", "Imperial hundredweight (cwt)", "US ton (t)", "Imperial ton (t)", "[/Imperial Avoirdupois]", - "[Imperial Troy]", "Grain (gr)", "Pennyweight (dwt)", "Troy dram (dr t)", "Troy ounce (oz t)", "Troy pound (lb t)", "Mark", "[/Imperial Troy]", - "[Archaic]", "Wey", "Wool wey", "Suffolk wey", "Wool sack", "Coal sack", "Load", "Last", "Flax or feather last", "Gunpowder last", "Picul", "Rice last", "[/Archaic]", - "[Comparisons]", "Big Ben (14 tonnes)", "Blue whale (180 tonnes)", "International Space Station (417 tonnes)", "Space Shuttle (2,041 tonnes)", "RMS Titanic (52,000 tonnes)", "Great Pyramid of Giza (6,000,000 tonnes)", "Earth's oceans (1.4 yottagrams)", "[/Comparisons]", - "[Astronomical]", "A teaspoon of neutron star (5,500 million tonnes)", "Lunar mass (ML)", "Earth mass (M⊕)", "Jupiter mass (MJ)", "Solar mass (M☉)", "Sagittarius A* (7.5 x 10^36 kgs-ish)", "Milky Way galaxy (1.2 x 10^42 kgs)", "The observable universe (1.45 x 10^53 kgs)", "[/Astronomical]", - ], + MASS_UNITS: [ + '[Metric]', 'Yoctogram (yg)', 'Zeptogram (zg)', 'Attogram (ag)', 'Femtogram (fg)', 'Picogram (pg)', 'Nanogram (ng)', 'Microgram (μg)', 'Milligram (mg)', 'Centigram (cg)', 'Decigram (dg)', 'Gram (g)', 'Decagram (dag)', 'Hectogram (hg)', 'Kilogram (kg)', 'Megagram (Mg)', 'Tonne (t)', 'Gigagram (Gg)', 'Teragram (Tg)', 'Petagram (Pg)', 'Exagram (Eg)', 'Zettagram (Zg)', 'Yottagram (Yg)', '[/Metric]', + '[Imperial Avoirdupois]', 'Grain (gr)', 'Dram (dr)', 'Ounce (oz)', 'Pound (lb)', 'Nail', 'Stone (st)', 'Quarter (gr)', 'Tod', 'US hundredweight (cwt)', 'Imperial hundredweight (cwt)', 'US ton (t)', 'Imperial ton (t)', '[/Imperial Avoirdupois]', + '[Imperial Troy]', 'Grain (gr)', 'Pennyweight (dwt)', 'Troy dram (dr t)', 'Troy ounce (oz t)', 'Troy pound (lb t)', 'Mark', '[/Imperial Troy]', + '[Archaic]', 'Wey', 'Wool wey', 'Suffolk wey', 'Wool sack', 'Coal sack', 'Load', 'Last', 'Flax or feather last', 'Gunpowder last', 'Picul', 'Rice last', '[/Archaic]', + '[Comparisons]', 'Big Ben (14 tonnes)', 'Blue whale (180 tonnes)', 'International Space Station (417 tonnes)', 'Space Shuttle (2,041 tonnes)', 'RMS Titanic (52,000 tonnes)', 'Great Pyramid of Giza (6,000,000 tonnes)', "Earth's oceans (1.4 yottagrams)", '[/Comparisons]', + '[Astronomical]', 'A teaspoon of neutron star (5,500 million tonnes)', 'Lunar mass (ML)', 'Earth mass (M⊕)', 'Jupiter mass (MJ)', 'Solar mass (M☉)', 'Sagittarius A* (7.5 x 10^36 kgs-ish)', 'Milky Way galaxy (1.2 x 10^42 kgs)', 'The observable universe (1.45 x 10^53 kgs)', '[/Astronomical]', + ], /** * @constant * @default */ - MASS_FACTOR: { // Multiples of a gram + MASS_FACTOR: { // Multiples of a gram // Metric - "Yoctogram (yg)" : 1e-24, - "Zeptogram (zg)" : 1e-21, - "Attogram (ag)" : 1e-18, - "Femtogram (fg)" : 1e-15, - "Picogram (pg)" : 1e-12, - "Nanogram (ng)" : 1e-9, - "Microgram (μg)" : 1e-6, - "Milligram (mg)" : 1e-3, - "Centigram (cg)" : 1e-2, - "Decigram (dg)" : 1e-1, - "Gram (g)" : 1, - "Decagram (dag)" : 10, - "Hectogram (hg)" : 100, - "Kilogram (kg)" : 1000, - "Megagram (Mg)" : 1e6, - "Tonne (t)" : 1e6, - "Gigagram (Gg)" : 1e9, - "Teragram (Tg)" : 1e12, - "Petagram (Pg)" : 1e15, - "Exagram (Eg)" : 1e18, - "Zettagram (Zg)" : 1e21, - "Yottagram (Yg)" : 1e24, - + 'Yoctogram (yg)': 1e-24, + 'Zeptogram (zg)': 1e-21, + 'Attogram (ag)': 1e-18, + 'Femtogram (fg)': 1e-15, + 'Picogram (pg)': 1e-12, + 'Nanogram (ng)': 1e-9, + 'Microgram (μg)': 1e-6, + 'Milligram (mg)': 1e-3, + 'Centigram (cg)': 1e-2, + 'Decigram (dg)': 1e-1, + 'Gram (g)': 1, + 'Decagram (dag)': 10, + 'Hectogram (hg)': 100, + 'Kilogram (kg)': 1000, + 'Megagram (Mg)': 1e6, + 'Tonne (t)': 1e6, + 'Gigagram (Gg)': 1e9, + 'Teragram (Tg)': 1e12, + 'Petagram (Pg)': 1e15, + 'Exagram (Eg)': 1e18, + 'Zettagram (Zg)': 1e21, + 'Yottagram (Yg)': 1e24, + // Imperial Avoirdupois - "Grain (gr)" : 64.79891e-3, - "Dram (dr)" : 1.7718451953125, - "Ounce (oz)" : 28.349523125, - "Pound (lb)" : 453.59237, - "Nail" : 3175.14659, - "Stone (st)" : 6.35029318e3, - "Quarter (gr)" : 12700.58636, - "Tod" : 12700.58636, - "US hundredweight (cwt)" : 45.359237e3, - "Imperial hundredweight (cwt)" : 50.80234544e3, - "US ton (t)" : 907.18474e3, - "Imperial ton (t)" : 1016.0469088e3, - + 'Grain (gr)': 64.79891e-3, + 'Dram (dr)': 1.7718451953125, + 'Ounce (oz)': 28.349523125, + 'Pound (lb)': 453.59237, + Nail: 3175.14659, + 'Stone (st)': 6.35029318e3, + 'Quarter (gr)': 12700.58636, + Tod: 12700.58636, + 'US hundredweight (cwt)': 45.359237e3, + 'Imperial hundredweight (cwt)': 50.80234544e3, + 'US ton (t)': 907.18474e3, + 'Imperial ton (t)': 1016.0469088e3, + // Imperial Troy - "Pennyweight (dwt)" : 1.55517384, - "Troy dram (dr t)" : 3.8879346, - "Troy ounce (oz t)" : 31.1034768, - "Troy pound (lb t)" : 373.2417216, - "Mark" : 248.8278144, - + 'Pennyweight (dwt)': 1.55517384, + 'Troy dram (dr t)': 3.8879346, + 'Troy ounce (oz t)': 31.1034768, + 'Troy pound (lb t)': 373.2417216, + Mark: 248.8278144, + // Archaic - "Wey" : 76.5e3, - "Wool wey" : 101.7e3, - "Suffolk wey" : 161.5e3, - "Wool sack" : 153000, - "Coal sack" : 50.80234544e3, - "Load" : 918000, - "Last" : 1836000, - "Flax or feather last" : 770e3, - "Gunpowder last" : 1090e3, - "Picul" : 60.478982e3, - "Rice last" : 1200e3, - + Wey: 76.5e3, + 'Wool wey': 101.7e3, + 'Suffolk wey': 161.5e3, + 'Wool sack': 153000, + 'Coal sack': 50.80234544e3, + Load: 918000, + Last: 1836000, + 'Flax or feather last': 770e3, + 'Gunpowder last': 1090e3, + Picul: 60.478982e3, + 'Rice last': 1200e3, + // Comparisons - "Big Ben (14 tonnes)" : 14e6, - "Blue whale (180 tonnes)" : 180e6, - "International Space Station (417 tonnes)" : 417e6, - "Space Shuttle (2,041 tonnes)" : 2041e6, - "RMS Titanic (52,000 tonnes)" : 52000e6, - "Great Pyramid of Giza (6,000,000 tonnes)" : 6e12, - "Earth's oceans (1.4 yottagrams)" : 1.4e24, - + 'Big Ben (14 tonnes)': 14e6, + 'Blue whale (180 tonnes)': 180e6, + 'International Space Station (417 tonnes)': 417e6, + 'Space Shuttle (2,041 tonnes)': 2041e6, + 'RMS Titanic (52,000 tonnes)': 52000e6, + 'Great Pyramid of Giza (6,000,000 tonnes)': 6e12, + "Earth's oceans (1.4 yottagrams)": 1.4e24, + // Astronomical - "A teaspoon of neutron star (5,500 million tonnes)" : 5.5e15, - "Lunar mass (ML)" : 7.342e25, - "Earth mass (M⊕)" : 5.97219e27, - "Jupiter mass (MJ)" : 1.8981411476999997e30, - "Solar mass (M☉)" : 1.98855e33, - "Sagittarius A* (7.5 x 10^36 kgs-ish)" : 7.5e39, - "Milky Way galaxy (1.2 x 10^42 kgs)" : 1.2e45, - "The observable universe (1.45 x 10^53 kgs)" : 1.45e56, - }, - + 'A teaspoon of neutron star (5,500 million tonnes)': 5.5e15, + 'Lunar mass (ML)': 7.342e25, + 'Earth mass (M⊕)': 5.97219e27, + 'Jupiter mass (MJ)': 1.8981411476999997e30, + 'Solar mass (M☉)': 1.98855e33, + 'Sagittarius A* (7.5 x 10^36 kgs-ish)': 7.5e39, + 'Milky Way galaxy (1.2 x 10^42 kgs)': 1.2e45, + 'The observable universe (1.45 x 10^53 kgs)': 1.45e56, + }, + /** * Convert mass operation. * @@ -336,64 +336,64 @@ var Convert = { * @param {Object[]} args * @returns {number} */ - run_mass: function (input, args) { - var input_units = args[0], - output_units = args[1]; - - input = input * Convert.MASS_FACTOR[input_units]; - return input / Convert.MASS_FACTOR[output_units]; - }, - - + run_mass(input, args) { + let input_units = args[0], + output_units = args[1]; + + input *= Convert.MASS_FACTOR[input_units]; + return input / Convert.MASS_FACTOR[output_units]; + }, + + /** * @constant * @default */ - SPEED_UNITS: [ - "[Metric]", "Metres per second (m/s)", "Kilometres per hour (km/h)", "[/Metric]", - "[Imperial]", "Miles per hour (mph)", "Knots (kn)", "[/Imperial]", - "[Comparisons]", "Human hair growth rate", "Bamboo growth rate", "World's fastest snail", "Usain Bolt's top speed", "Jet airliner cruising speed", "Concorde", "SR-71 Blackbird", "Space Shuttle", "International Space Station", "[/Comparisons]", - "[Scientific]", "Sound in standard atmosphere", "Sound in water", "Lunar escape velocity", "Earth escape velocity", "Earth's solar orbit", "Solar system's Milky Way orbit", "Milky Way relative to the cosmic microwave background", "Solar escape velocity", "Neutron star escape velocity (0.3c)", "Light in a diamond (0.4136c)", "Signal in an optical fibre (0.667c)", "Light (c)", "[/Scientific]", - ], + SPEED_UNITS: [ + '[Metric]', 'Metres per second (m/s)', 'Kilometres per hour (km/h)', '[/Metric]', + '[Imperial]', 'Miles per hour (mph)', 'Knots (kn)', '[/Imperial]', + '[Comparisons]', 'Human hair growth rate', 'Bamboo growth rate', "World's fastest snail", "Usain Bolt's top speed", 'Jet airliner cruising speed', 'Concorde', 'SR-71 Blackbird', 'Space Shuttle', 'International Space Station', '[/Comparisons]', + '[Scientific]', 'Sound in standard atmosphere', 'Sound in water', 'Lunar escape velocity', 'Earth escape velocity', "Earth's solar orbit", "Solar system's Milky Way orbit", 'Milky Way relative to the cosmic microwave background', 'Solar escape velocity', 'Neutron star escape velocity (0.3c)', 'Light in a diamond (0.4136c)', 'Signal in an optical fibre (0.667c)', 'Light (c)', '[/Scientific]', + ], /** * @constant * @default */ - SPEED_FACTOR: { // Multiples of m/s + SPEED_FACTOR: { // Multiples of m/s // Metric - "Metres per second (m/s)" : 1, - "Kilometres per hour (km/h)" : 0.2778, - + 'Metres per second (m/s)': 1, + 'Kilometres per hour (km/h)': 0.2778, + // Imperial - "Miles per hour (mph)" : 0.44704, - "Knots (kn)" : 0.5144, - + 'Miles per hour (mph)': 0.44704, + 'Knots (kn)': 0.5144, + // Comparisons - "Human hair growth rate" : 4.8e-9, - "Bamboo growth rate" : 1.4e-5, - "World's fastest snail" : 0.00275, - "Usain Bolt's top speed" : 12.42, - "Jet airliner cruising speed" : 250, - "Concorde" : 603, - "SR-71 Blackbird" : 981, - "Space Shuttle" : 1400, - "International Space Station" : 7700, - + 'Human hair growth rate': 4.8e-9, + 'Bamboo growth rate': 1.4e-5, + "World's fastest snail": 0.00275, + "Usain Bolt's top speed": 12.42, + 'Jet airliner cruising speed': 250, + Concorde: 603, + 'SR-71 Blackbird': 981, + 'Space Shuttle': 1400, + 'International Space Station': 7700, + // Scientific - "Sound in standard atmosphere" : 340.3, - "Sound in water" : 1500, - "Lunar escape velocity" : 2375, - "Earth escape velocity" : 11200, - "Earth's solar orbit" : 29800, - "Solar system's Milky Way orbit" : 200000, - "Milky Way relative to the cosmic microwave background" : 552000, - "Solar escape velocity" : 617700, - "Neutron star escape velocity (0.3c)" : 100000000, - "Light in a diamond (0.4136c)" : 124000000, - "Signal in an optical fibre (0.667c)" : 200000000, - "Light (c)" : 299792458, - }, - + 'Sound in standard atmosphere': 340.3, + 'Sound in water': 1500, + 'Lunar escape velocity': 2375, + 'Earth escape velocity': 11200, + "Earth's solar orbit": 29800, + "Solar system's Milky Way orbit": 200000, + 'Milky Way relative to the cosmic microwave background': 552000, + 'Solar escape velocity': 617700, + 'Neutron star escape velocity (0.3c)': 100000000, + 'Light in a diamond (0.4136c)': 124000000, + 'Signal in an optical fibre (0.667c)': 200000000, + 'Light (c)': 299792458, + }, + /** * Convert speed operation. * @@ -401,12 +401,12 @@ var Convert = { * @param {Object[]} args * @returns {number} */ - run_speed: function (input, args) { - var input_units = args[0], - output_units = args[1]; - - input = input * Convert.SPEED_FACTOR[input_units]; - return input / Convert.SPEED_FACTOR[output_units]; - }, - + run_speed(input, args) { + let input_units = args[0], + output_units = args[1]; + + input *= Convert.SPEED_FACTOR[input_units]; + return input / Convert.SPEED_FACTOR[output_units]; + }, + }; diff --git a/src/js/operations/DateTime.js b/src/js/operations/DateTime.js index d1f3843a..29b00299 100755 --- a/src/js/operations/DateTime.js +++ b/src/js/operations/DateTime.js @@ -9,14 +9,14 @@ * * @namespace */ -var DateTime = { - +const DateTime = { + /** * @constant * @default */ - UNITS: ["Seconds (s)", "Milliseconds (ms)", "Microseconds (μs)", "Nanoseconds (ns)"], - + UNITS: ['Seconds (s)', 'Milliseconds (ms)', 'Microseconds (μs)', 'Nanoseconds (ns)'], + /** * From UNIX Timestamp operation. * @@ -24,30 +24,30 @@ var DateTime = { * @param {Object[]} args * @returns {string} */ - run_from_unix_timestamp: function(input, args) { - var units = args[0], - d; - - input = parseFloat(input); - - if (units == "Seconds (s)") { - d = moment.unix(input); - return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC"; - } else if (units == "Milliseconds (ms)") { - d = moment(input); - return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss.SSS") + " UTC"; - } else if (units == "Microseconds (μs)") { - d = moment(input / 1000); - return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss.SSS") + " UTC"; - } else if (units == "Nanoseconds (ns)") { - d = moment(input / 1000000); - return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss.SSS") + " UTC"; - } else { - throw "Unrecognised unit"; - } - }, - - + run_from_unix_timestamp(input, args) { + let units = args[0], + d; + + input = parseFloat(input); + + if (units == 'Seconds (s)') { + d = moment.unix(input); + return `${d.tz('UTC').format('ddd D MMMM YYYY HH:mm:ss')} UTC`; + } else if (units == 'Milliseconds (ms)') { + d = moment(input); + return `${d.tz('UTC').format('ddd D MMMM YYYY HH:mm:ss.SSS')} UTC`; + } else if (units == 'Microseconds (μs)') { + d = moment(input / 1000); + return `${d.tz('UTC').format('ddd D MMMM YYYY HH:mm:ss.SSS')} UTC`; + } else if (units == 'Nanoseconds (ns)') { + d = moment(input / 1000000); + return `${d.tz('UTC').format('ddd D MMMM YYYY HH:mm:ss.SSS')} UTC`; + } else { + throw 'Unrecognised unit'; + } + }, + + /** * To UNIX Timestamp operation. * @@ -55,74 +55,74 @@ var DateTime = { * @param {Object[]} args * @returns {number} */ - run_to_unix_timestamp: function(input, args) { - var units = args[0], - d = moment(input); - - if (units == "Seconds (s)") { - return d.unix(); - } else if (units == "Milliseconds (ms)") { - return d.valueOf(); - } else if (units == "Microseconds (μs)") { - return d.valueOf() * 1000; - } else if (units == "Nanoseconds (ns)") { - return d.valueOf() * 1000000; - } else { - throw "Unrecognised unit"; - } + run_to_unix_timestamp(input, args) { + let units = args[0], + d = moment(input); + + if (units == 'Seconds (s)') { + return d.unix(); + } else if (units == 'Milliseconds (ms)') { + return d.valueOf(); + } else if (units == 'Microseconds (μs)') { + return d.valueOf() * 1000; + } else if (units == 'Nanoseconds (ns)') { + return d.valueOf() * 1000000; + } else { + throw 'Unrecognised unit'; + } + }, + + + /** + * @constant + * @default + */ + DATETIME_FORMATS: [ + { + name: 'Standard date and time', + value: 'DD/MM/YYYY HH:mm:ss', }, - - + { + name: 'American-style date and time', + value: 'MM/DD/YYYY HH:mm:ss', + }, + { + name: 'International date and time', + value: 'YYYY-MM-DD HH:mm:ss', + }, + { + name: 'Verbose date and time', + value: 'dddd Do MMMM YYYY HH:mm:ss Z z', + }, + { + name: 'UNIX timestamp (seconds)', + value: 'X', + }, + { + name: 'UNIX timestamp offset (milliseconds)', + value: 'x', + }, + { + name: 'Automatic', + value: '', + }, + ], /** * @constant * @default */ - DATETIME_FORMATS: [ - { - name: "Standard date and time", - value: "DD/MM/YYYY HH:mm:ss" - }, - { - name: "American-style date and time", - value: "MM/DD/YYYY HH:mm:ss" - }, - { - name: "International date and time", - value: "YYYY-MM-DD HH:mm:ss" - }, - { - name: "Verbose date and time", - value: "dddd Do MMMM YYYY HH:mm:ss Z z" - }, - { - name: "UNIX timestamp (seconds)", - value: "X" - }, - { - name: "UNIX timestamp offset (milliseconds)", - value: "x" - }, - { - name: "Automatic", - value: "" - }, - ], + INPUT_FORMAT_STRING: 'DD/MM/YYYY HH:mm:ss', /** * @constant * @default */ - INPUT_FORMAT_STRING: "DD/MM/YYYY HH:mm:ss", + OUTPUT_FORMAT_STRING: 'dddd Do MMMM YYYY HH:mm:ss Z z', /** * @constant * @default */ - OUTPUT_FORMAT_STRING: "dddd Do MMMM YYYY HH:mm:ss Z z", - /** - * @constant - * @default - */ - TIMEZONES: ["UTC"].concat(moment.tz.names()), - + TIMEZONES: ['UTC'].concat(moment.tz.names()), + /** * Translate DateTime Format operation. * @@ -130,24 +130,24 @@ var DateTime = { * @param {Object[]} args * @returns {html} */ - run_translate_format: function(input, args) { - var input_format = args[1], - input_timezone = args[2], - output_format = args[3], - output_timezone = args[4], - date; + run_translate_format(input, args) { + let input_format = args[1], + input_timezone = args[2], + output_format = args[3], + output_timezone = args[4], + date; + + try { + date = moment.tz(input, input_format, input_timezone); + if (!date || date.format() == 'Invalid date') throw Error; + } catch (err) { + return `Invalid format.\n\n${DateTime.FORMAT_EXAMPLES}`; + } + + return date.tz(output_timezone).format(output_format); + }, + - try { - date = moment.tz(input, input_format, input_timezone); - if (!date || date.format() == "Invalid date") throw Error; - } catch(err) { - return "Invalid format.\n\n" + DateTime.FORMAT_EXAMPLES; - } - - return date.tz(output_timezone).format(output_format); - }, - - /** * Parse DateTime operation. * @@ -155,39 +155,39 @@ var DateTime = { * @param {Object[]} args * @returns {html} */ - run_parse: function(input, args) { - var input_format = args[1], - input_timezone = args[2], - date, - output = ""; - - try { - date = moment.tz(input, input_format, input_timezone); - if (!date || date.format() == "Invalid date") throw Error; - } catch(err) { - return "Invalid format.\n\n" + DateTime.FORMAT_EXAMPLES; - } - - output += "Date: " + date.format("dddd Do MMMM YYYY") + - "\nTime: " + date.format("HH:mm:ss") + - "\nPeriod: " + date.format("A") + - "\nTimezone: " + date.format("z") + - "\nUTC offset: " + date.format("ZZ") + - "\n\nDaylight Saving Time: " + date.isDST() + - "\nLeap year: " + date.isLeapYear() + - "\nDays in this month: " + date.daysInMonth() + - "\n\nDay of year: " + date.dayOfYear() + - "\nWeek number: " + date.weekYear() + - "\nQuarter: " + date.quarter(); - - return output; - }, - - + run_parse(input, args) { + let input_format = args[1], + input_timezone = args[2], + date, + output = ''; + + try { + date = moment.tz(input, input_format, input_timezone); + if (!date || date.format() == 'Invalid date') throw Error; + } catch (err) { + return `Invalid format.\n\n${DateTime.FORMAT_EXAMPLES}`; + } + + output += `Date: ${date.format('dddd Do MMMM YYYY') + }\nTime: ${date.format('HH:mm:ss') + }\nPeriod: ${date.format('A') + }\nTimezone: ${date.format('z') + }\nUTC offset: ${date.format('ZZ') + }\n\nDaylight Saving Time: ${date.isDST() + }\nLeap year: ${date.isLeapYear() + }\nDays in this month: ${date.daysInMonth() + }\n\nDay of year: ${date.dayOfYear() + }\nWeek number: ${date.weekYear() + }\nQuarter: ${date.quarter()}`; + + return output; + }, + + /** * @constant */ - FORMAT_EXAMPLES: "Format string tokens:\n\n\ + FORMAT_EXAMPLES: "Format string tokens:\n\n\ \ \ \ @@ -450,5 +450,5 @@ var DateTime = { \
", - + }; diff --git a/src/js/operations/Endian.js b/src/js/operations/Endian.js index 13ce1ce6..ae852983 100755 --- a/src/js/operations/Endian.js +++ b/src/js/operations/Endian.js @@ -7,24 +7,24 @@ * * @namespace */ -var Endian = { - +const Endian = { + /** * @constant * @default */ - DATA_FORMAT: ["Hex", "Raw"], + DATA_FORMAT: ['Hex', 'Raw'], /** * @constant * @default */ - WORD_LENGTH: 4, + WORD_LENGTH: 4, /** * @constant * @default */ - PAD_INCOMPLETE_WORDS: true, - + PAD_INCOMPLETE_WORDS: true, + /** * Swap endianness operation. * @@ -32,63 +32,63 @@ var Endian = { * @param {Object[]} args * @returns {string} */ - run_swap_endianness: function(input, args) { - var data_format = args[0], - word_length = args[1], - pad_incomplete_words = args[2], - data = [], - result = [], - words = [], - i = 0, - j = 0; - - if (word_length <= 0) { - return "Word length must be greater than 0"; - } - + run_swap_endianness(input, args) { + let data_format = args[0], + word_length = args[1], + pad_incomplete_words = args[2], + data = [], + result = [], + words = [], + i = 0, + j = 0; + + if (word_length <= 0) { + return 'Word length must be greater than 0'; + } + // Convert input to raw data based on specified data format - switch (data_format) { - case "Hex": - data = Utils.from_hex(input); - break; - case "Raw": - data = Utils.str_to_byte_array(input); - break; - default: - data = input; - } - + switch (data_format) { + case 'Hex': + data = Utils.from_hex(input); + break; + case 'Raw': + data = Utils.str_to_byte_array(input); + break; + default: + data = input; + } + // Split up into words - for (i = 0; i < data.length; i += word_length) { - var word = data.slice(i, i + word_length); - + for (i = 0; i < data.length; i += word_length) { + const word = data.slice(i, i + word_length); + // Pad word if too short - if (pad_incomplete_words && word.length < word_length){ - for (j = word.length; j < word_length; j++) { - word.push(0); - } - } - - words.push(word); + if (pad_incomplete_words && word.length < word_length) { + for (j = word.length; j < word_length; j++) { + word.push(0); } - + } + + words.push(word); + } + // Swap endianness and flatten - for (i = 0; i < words.length; i++) { - j = words[i].length; - while (j--) { - result.push(words[i][j]); - } - } - + for (i = 0; i < words.length; i++) { + j = words[i].length; + while (j--) { + result.push(words[i][j]); + } + } + // Convert data back to specified data format - switch (data_format) { - case "Hex": - return Utils.to_hex(result); - case "Raw": - return Utils.byte_array_to_utf8(result); - default: - return result; - } - }, - + switch (data_format) { + case 'Hex': + return Utils.to_hex(result); + case 'Raw': + return Utils.byte_array_to_utf8(result); + default: + return result; + } + }, + }; diff --git a/src/js/operations/Entropy.js b/src/js/operations/Entropy.js index cec9b3a1..b22f8dd9 100755 --- a/src/js/operations/Entropy.js +++ b/src/js/operations/Entropy.js @@ -7,14 +7,14 @@ * * @namespace */ -var Entropy = { - +const Entropy = { + /** * @constant * @default */ - CHUNK_SIZE: 1000, - + CHUNK_SIZE: 1000, + /** * Entropy operation. * @@ -22,21 +22,21 @@ var Entropy = { * @param {Object[]} args * @returns {html} */ - run_entropy: function(input, args) { - var chunk_size = args[0], - output = "", - entropy = Entropy._calc_entropy(input); - - output += "Shannon entropy: " + entropy + "\n" + - "

\n" + - "- 0 represents no randomness (i.e. all the bytes in the data have the same value) whereas 8, the maximum, represents a completely random string.\n" + - "- Standard English text usually falls somewhere between 3.5 and 5.\n" + - "- Properly encrypted or compressed data of a reasonable length should have an entropy of over 7.5.\n\n" + - "The following results show the entropy of chunks of the input data. Chunks with particularly high entropy could suggest encrypted or compressed sections.\n\n" + - "
"; - - var chunk_entropy = 0; - if (chunk_size !== 0) { - for (var i = 0; i < input.length; i += chunk_size) { - chunk_entropy = Entropy._calc_entropy(input.slice(i, i+chunk_size)); - output += "Bytes " + i + " to " + (i+chunk_size) + ": " + chunk_entropy + "\n"; - } - } else { - output += "Chunk size cannot be 0."; - } - - return output; - }, - - + `; + + let chunk_entropy = 0; + if (chunk_size !== 0) { + for (let i = 0; i < input.length; i += chunk_size) { + chunk_entropy = Entropy._calc_entropy(input.slice(i, i + chunk_size)); + output += `Bytes ${i} to ${i + chunk_size}: ${chunk_entropy}\n`; + } + } else { + output += 'Chunk size cannot be 0.'; + } + + return output; + }, + + /** * @constant * @default */ - FREQ_ZEROS: false, - + FREQ_ZEROS: false, + /** * Frequency distribution operation. * @@ -82,60 +82,60 @@ var Entropy = { * @param {Object[]} args * @returns {html} */ - run_freq_distrib: function (input, args) { - if (!input.length) return "No data"; - - var distrib = new Array(256), - percentages = new Array(256), - len = input.length, - show_zeroes = args[0]; - + run_freq_distrib(input, args) { + if (!input.length) return 'No data'; + + let distrib = new Array(256), + percentages = new Array(256), + len = input.length, + show_zeroes = args[0]; + // Initialise distrib to 0 - for (var i = 0; i < 256; i++) { - distrib[i] = 0; - } - + for (var i = 0; i < 256; i++) { + distrib[i] = 0; + } + // Count bytes - for (i = 0; i < len; i++) { - distrib[input[i]]++; - } - + for (i = 0; i < len; i++) { + distrib[input[i]]++; + } + // Calculate percentages - var repr = 0; - for (i = 0; i < 256; i++) { - if (distrib[i] > 0) repr++; - percentages[i] = distrib[i] / len * 100; - } - + let repr = 0; + for (i = 0; i < 256; i++) { + if (distrib[i] > 0) repr++; + percentages[i] = distrib[i] / len * 100; + } + // Print - var output = "
" + - "Total data length: " + len + - "\nNumber of bytes represented: " + repr + - "\nNumber of bytes not represented: " + (256-repr) + - "\n\nByte Percentage\n" + - ""; - - for (i = 0; i < 256; i++) { - if (distrib[i] || show_zeroes) { - output += " " + Utils.hex(i, 2) + " (" + - Utils.pad_right(percentages[i].toFixed(2).replace(".00", "") + "%)", 8) + - Array(Math.ceil(percentages[i])+1).join("|") + "\n"; - } - } - - return output; - }, - - + `; + + for (i = 0; i < 256; i++) { + if (distrib[i] || show_zeroes) { + output += ` ${Utils.hex(i, 2)} (${ + Utils.pad_right(`${percentages[i].toFixed(2).replace('.00', '')}%)`, 8) + }${Array(Math.ceil(percentages[i]) + 1).join('|')}\n`; + } + } + + return output; + }, + + /** * Calculates the Shannon entropy for a given chunk of data. * @@ -143,24 +143,24 @@ var Entropy = { * @param {byte_array} data * @returns {number} */ - _calc_entropy: function(data) { - var prob = [], - uniques = data.unique(), - str = Utils.byte_array_to_chars(data); - - for (var i = 0; i < uniques.length; i++) { - prob.push(str.count(Utils.chr(uniques[i])) / data.length); - } - - var entropy = 0, - p; - - for (i = 0; i < prob.length; i++) { - p = prob[i]; - entropy += p * Math.log(p) / Math.log(2); - } - - return -entropy; - }, + _calc_entropy(data) { + let prob = [], + uniques = data.unique(), + str = Utils.byte_array_to_chars(data); + + for (var i = 0; i < uniques.length; i++) { + prob.push(str.count(Utils.chr(uniques[i])) / data.length); + } + + let entropy = 0, + p; + + for (i = 0; i < prob.length; i++) { + p = prob[i]; + entropy += p * Math.log(p) / Math.log(2); + } + + return -entropy; + }, }; diff --git a/src/js/operations/Extract.js b/src/js/operations/Extract.js index fdab5591..f381c58e 100755 --- a/src/js/operations/Extract.js +++ b/src/js/operations/Extract.js @@ -7,7 +7,7 @@ * * @namespace */ -var Extract = { +const Extract = { /** * Runs search operations across the input data using refular expressions. @@ -20,36 +20,38 @@ var Extract = { * @param {boolean} include_total - Whether or not to include the total number of results * @returns {string} */ - _search: function(input, search_regex, remove_regex, include_total) { - var output = "", - total = 0, - match; - - while (!!(match = search_regex.exec(input))) { - if (remove_regex && remove_regex.test(match[0])) - continue; - total++; - output += match[0] + "\n"; - } - - if (include_total) - output = "Total found: " + total + "\n\n" + output; - - return output; - }, + _search(input, search_regex, remove_regex, include_total) { + let output = '', + total = 0, + match; + + while (match = search_regex.exec(input)) { + if (remove_regex && remove_regex.test(match[0])) { + continue; + } + total++; + output += `${match[0]}\n`; + } + + if (include_total) { + output = `Total found: ${total}\n\n${output}`; + } + + return output; + }, /** * @constant * @default */ - MIN_STRING_LEN: 3, + MIN_STRING_LEN: 3, /** * @constant * @default */ - DISPLAY_TOTAL: false, - + DISPLAY_TOTAL: false, + /** * Strings operation. * @@ -57,32 +59,32 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_strings: function(input, args) { - var min_len = args[0] || Extract.MIN_STRING_LEN, - display_total = args[1], - strings = "[A-Z\\d/\\-:.,_$%'\"()<>= !\\[\\]{}@]", - regex = new RegExp(strings + "{" + min_len + ",}", "ig"); - - return Extract._search(input, regex, null, display_total); - }, - - + run_strings(input, args) { + let min_len = args[0] || Extract.MIN_STRING_LEN, + display_total = args[1], + strings = "[A-Z\\d/\\-:.,_$%'\"()<>= !\\[\\]{}@]", + regex = new RegExp(`${strings}{${min_len},}`, 'ig'); + + return Extract._search(input, regex, null, display_total); + }, + + /** * @constant * @default */ - INCLUDE_IPV4: true, + INCLUDE_IPV4: true, /** * @constant * @default */ - INCLUDE_IPV6: false, + INCLUDE_IPV6: false, /** * @constant * @default */ - REMOVE_LOCAL: false, - + REMOVE_LOCAL: false, + /** * Extract IP addresses operation. * @@ -90,44 +92,44 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_ip: function(input, args) { - var include_ipv4 = args[0], - include_ipv6 = args[1], - remove_local = args[2], - display_total = args[3], - ipv4 = "(?:(?:\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d|\\d)(?:\\/\\d{1,2})?", - ipv6 = "((?=.*::)(?!.*::.+::)(::)?([\\dA-F]{1,4}:(:|\\b)|){5}|([\\dA-F]{1,4}:){6})((([\\dA-F]{1,4}((?!\\3)::|:\\b|(?![\\dA-F])))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})", - ips = ""; - - if (include_ipv4 && include_ipv6) { - ips = ipv4 + "|" + ipv6; - } else if (include_ipv4) { - ips = ipv4; - } else if (include_ipv6) { - ips = ipv6; - } - - if (ips) { - var regex = new RegExp(ips, "ig"); - - if (remove_local) { - var ten = "10\\..+", - oneninetwo = "192\\.168\\..+", - oneseventwo = "172\\.(?:1[6-9]|2\\d|3[01])\\..+", - onetwoseven = "127\\..+", - remove_regex = new RegExp("^(?:" + ten + "|" + oneninetwo + - "|" + oneseventwo + "|" + onetwoseven + ")"); - - return Extract._search(input, regex, remove_regex, display_total); - } else { - return Extract._search(input, regex, null, display_total); - } - } else { - return ""; - } - }, - - + run_ip(input, args) { + let include_ipv4 = args[0], + include_ipv6 = args[1], + remove_local = args[2], + display_total = args[3], + ipv4 = '(?:(?:\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d|\\d)(?:\\/\\d{1,2})?', + ipv6 = '((?=.*::)(?!.*::.+::)(::)?([\\dA-F]{1,4}:(:|\\b)|){5}|([\\dA-F]{1,4}:){6})((([\\dA-F]{1,4}((?!\\3)::|:\\b|(?![\\dA-F])))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})', + ips = ''; + + if (include_ipv4 && include_ipv6) { + ips = `${ipv4}|${ipv6}`; + } else if (include_ipv4) { + ips = ipv4; + } else if (include_ipv6) { + ips = ipv6; + } + + if (ips) { + const regex = new RegExp(ips, 'ig'); + + if (remove_local) { + let ten = '10\\..+', + oneninetwo = '192\\.168\\..+', + oneseventwo = '172\\.(?:1[6-9]|2\\d|3[01])\\..+', + onetwoseven = '127\\..+', + remove_regex = new RegExp(`^(?:${ten}|${oneninetwo + }|${oneseventwo}|${onetwoseven})`); + + return Extract._search(input, regex, remove_regex, display_total); + } else { + return Extract._search(input, regex, null, display_total); + } + } else { + return ''; + } + }, + + /** * Extract email addresses operation. * @@ -135,14 +137,14 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_email: function(input, args) { - var display_total = args[0], - regex = /\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}/ig; - - return Extract._search(input, regex, null, display_total); - }, - - + run_email(input, args) { + let display_total = args[0], + regex = /\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}/ig; + + return Extract._search(input, regex, null, display_total); + }, + + /** * Extract MAC addresses operation. * @@ -150,14 +152,14 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_mac: function(input, args) { - var display_total = args[0], - regex = /[A-F\d]{2}(?:[:-][A-F\d]{2}){5}/ig; - - return Extract._search(input, regex, null, display_total); - }, - - + run_mac(input, args) { + let display_total = args[0], + regex = /[A-F\d]{2}(?:[:-][A-F\d]{2}){5}/ig; + + return Extract._search(input, regex, null, display_total); + }, + + /** * Extract URLs operation. * @@ -165,20 +167,20 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_urls: function(input, args) { - var display_total = args[0], - protocol = "[A-Z]+://", - hostname = "[-\\w]+(?:\\.\\w[-\\w]*)+", - port = ":\\d+", - path = "/[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]*"; - - path += "(?:[.!,?]+[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]+)*"; - var regex = new RegExp(protocol + hostname + "(?:" + port + - ")?(?:" + path + ")?", "ig"); - return Extract._search(input, regex, null, display_total); - }, - - + run_urls(input, args) { + let display_total = args[0], + protocol = '[A-Z]+://', + hostname = '[-\\w]+(?:\\.\\w[-\\w]*)+', + port = ':\\d+', + path = "/[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]*"; + + path += "(?:[.!,?]+[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]+)*"; + const regex = new RegExp(`${protocol + hostname}(?:${port + })?(?:${path})?`, 'ig'); + return Extract._search(input, regex, null, display_total); + }, + + /** * Extract domains operation. * @@ -186,28 +188,28 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_domains: function(input, args) { - var display_total = args[0], - protocol = "https?://", - hostname = "[-\\w\\.]+", - tld = "\\.(?:com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+", - regex = new RegExp("(?:" + protocol + ")?" + hostname + tld, "ig"); - - return Extract._search(input, regex, null, display_total); - }, - - + run_domains(input, args) { + let display_total = args[0], + protocol = 'https?://', + hostname = '[-\\w\\.]+', + tld = '\\.(?:com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+', + regex = new RegExp(`(?:${protocol})?${hostname}${tld}`, 'ig'); + + return Extract._search(input, regex, null, display_total); + }, + + /** * @constant * @default */ - INCLUDE_WIN_PATH: true, + INCLUDE_WIN_PATH: true, /** * @constant * @default */ - INCLUDE_UNIX_PATH: true, - + INCLUDE_UNIX_PATH: true, + /** * Extract file paths operation. * @@ -215,35 +217,35 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_file_paths: function(input, args) { - var include_win_path = args[0], - include_unix_path = args[1], - display_total = args[2], - win_drive = "[A-Z]:\\\\", - win_name = "[A-Z\\d][A-Z\\d\\- '_\\(\\)]{0,61}", - win_ext = "[A-Z\\d]{1,6}", - win_path = win_drive + "(?:" + win_name + "\\\\?)*" + win_name + - "(?:\\." + win_ext + ")?", - unix_path = "(?:/[A-Z\\d.][A-Z\\d\\-.]{0,61})+", - file_paths = ""; - - if (include_win_path && include_unix_path) { - file_paths = win_path + "|" + unix_path; - } else if (include_win_path) { - file_paths = win_path; - } else if (include_unix_path) { - file_paths = unix_path; - } - - if (file_paths) { - var regex = new RegExp(file_paths, "ig"); - return Extract._search(input, regex, null, display_total); - } else { - return ""; - } - }, - - + run_file_paths(input, args) { + let include_win_path = args[0], + include_unix_path = args[1], + display_total = args[2], + win_drive = '[A-Z]:\\\\', + win_name = "[A-Z\\d][A-Z\\d\\- '_\\(\\)]{0,61}", + win_ext = '[A-Z\\d]{1,6}', + win_path = `${win_drive}(?:${win_name}\\\\?)*${win_name + }(?:\\.${win_ext})?`, + unix_path = '(?:/[A-Z\\d.][A-Z\\d\\-.]{0,61})+', + file_paths = ''; + + if (include_win_path && include_unix_path) { + file_paths = `${win_path}|${unix_path}`; + } else if (include_win_path) { + file_paths = win_path; + } else if (include_unix_path) { + file_paths = unix_path; + } + + if (file_paths) { + const regex = new RegExp(file_paths, 'ig'); + return Extract._search(input, regex, null, display_total); + } else { + return ''; + } + }, + + /** * Extract dates operation. * @@ -251,17 +253,17 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_dates: function(input, args) { - var display_total = args[0], - date1 = "(?:19|20)\\d\\d[- /.](?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])", // yyyy-mm-dd - date2 = "(?:0[1-9]|[12][0-9]|3[01])[- /.](?:0[1-9]|1[012])[- /.](?:19|20)\\d\\d", // dd/mm/yyyy - date3 = "(?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])[- /.](?:19|20)\\d\\d", // mm/dd/yyyy - regex = new RegExp(date1 + "|" + date2 + "|" + date3, "ig"); - - return Extract._search(input, regex, null, display_total); - }, - - + run_dates(input, args) { + let display_total = args[0], + date1 = '(?:19|20)\\d\\d[- /.](?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])', // yyyy-mm-dd + date2 = '(?:0[1-9]|[12][0-9]|3[01])[- /.](?:0[1-9]|1[012])[- /.](?:19|20)\\d\\d', // dd/mm/yyyy + date3 = '(?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])[- /.](?:19|20)\\d\\d', // mm/dd/yyyy + regex = new RegExp(`${date1}|${date2}|${date3}`, 'ig'); + + return Extract._search(input, regex, null, display_total); + }, + + /** * Extract all identifiers operation. * @@ -269,29 +271,29 @@ var Extract = { * @param {Object[]} args * @returns {string} */ - run_all_idents: function(input, args) { - var output = ""; - output += "IP addresses\n"; - output += Extract.run_ip(input, [true, true, false]); - - output += "\nEmail addresses\n"; - output += Extract.run_email(input, []); - - output += "\nMAC addresses\n"; - output += Extract.run_mac(input, []); - - output += "\nURLs\n"; - output += Extract.run_urls(input, []); - - output += "\nDomain names\n"; - output += Extract.run_domains(input, []); - - output += "\nFile paths\n"; - output += Extract.run_file_paths(input, [true, true]); - - output += "\nDates\n"; - output += Extract.run_dates(input, []); - return output; - }, - + run_all_idents(input, args) { + let output = ''; + output += 'IP addresses\n'; + output += Extract.run_ip(input, [true, true, false]); + + output += '\nEmail addresses\n'; + output += Extract.run_email(input, []); + + output += '\nMAC addresses\n'; + output += Extract.run_mac(input, []); + + output += '\nURLs\n'; + output += Extract.run_urls(input, []); + + output += '\nDomain names\n'; + output += Extract.run_domains(input, []); + + output += '\nFile paths\n'; + output += Extract.run_file_paths(input, [true, true]); + + output += '\nDates\n'; + output += Extract.run_dates(input, []); + return output; + }, + }; diff --git a/src/js/operations/FileType.js b/src/js/operations/FileType.js index bf48906e..f98f0566 100755 --- a/src/js/operations/FileType.js +++ b/src/js/operations/FileType.js @@ -7,7 +7,7 @@ * * @namespace */ -var FileType = { +const FileType = { /** * Detect File Type operation. @@ -16,30 +16,30 @@ var FileType = { * @param {Object[]} args * @returns {string} */ - run_detect: function(input, args) { - var type = FileType._magic_type(input); - - if (!type) { - return "Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?"; - } else { - var output = "File extension: " + type.ext + "\n" + - "MIME type: " + type.mime; - - if (type.desc && type.desc.length) { - output += "\nDescription: " + type.desc; - } - - return output; - } - }, - - + run_detect(input, args) { + const type = FileType._magic_type(input); + + if (!type) { + return 'Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?'; + } else { + let output = `File extension: ${type.ext}\n` + + `MIME type: ${type.mime}`; + + if (type.desc && type.desc.length) { + output += `\nDescription: ${type.desc}`; + } + + return output; + } + }, + + /** * @constant * @default */ - IGNORE_COMMON_BYTE_SEQUENCES: true, - + IGNORE_COMMON_BYTE_SEQUENCES: true, + /** * Scan for Embedded Files operation. * @@ -47,50 +47,50 @@ var FileType = { * @param {Object[]} args * @returns {string} */ - run_scan_for_embedded_files: function(input, args) { - var output = "Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n", - type, - ignore_common = args[0], - common_exts = ["ico", "ttf", ""], - num_found = 0, - num_common_found = 0; - - for (var i = 0; i < input.length; i++) { - type = FileType._magic_type(input.slice(i)); - if (type) { - if (ignore_common && common_exts.indexOf(type.ext) > -1) { - num_common_found++; - continue; - } - num_found++; - output += "\nOffset " + i + " (0x" + Utils.hex(i) + "):\n" + - " File extension: " + type.ext + "\n" + - " MIME type: " + type.mime + "\n"; - - if (type.desc && type.desc.length) { - output += " Description: " + type.desc + "\n"; - } - } + run_scan_for_embedded_files(input, args) { + let output = "Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n", + type, + ignore_common = args[0], + common_exts = ['ico', 'ttf', ''], + num_found = 0, + num_common_found = 0; + + for (let i = 0; i < input.length; i++) { + type = FileType._magic_type(input.slice(i)); + if (type) { + if (ignore_common && common_exts.indexOf(type.ext) > -1) { + num_common_found++; + continue; } - - if (num_found === 0) { - output += "\nNo embedded files were found."; + num_found++; + output += `\nOffset ${i} (0x${Utils.hex(i)}):\n` + + ` File extension: ${type.ext}\n` + + ` MIME type: ${type.mime}\n`; + + if (type.desc && type.desc.length) { + output += ` Description: ${type.desc}\n`; } - - if (num_common_found > 0) { - output += "\n\n" + num_common_found; - output += num_common_found == 1 ? - " file type was detected that has a common byte sequence. This is likely to be a false positive." : - " file types were detected that have common byte sequences. These are likely to be false positives."; - output += " Run this operation with the 'Ignore common byte sequences' option unchecked to see details."; - } - - return output; - }, - - + } + } + + if (num_found === 0) { + output += '\nNo embedded files were found.'; + } + + if (num_common_found > 0) { + output += `\n\n${num_common_found}`; + output += num_common_found == 1 ? + ' file type was detected that has a common byte sequence. This is likely to be a false positive.' : + ' file types were detected that have common byte sequences. These are likely to be false positives.'; + output += " Run this operation with the 'Ignore common byte sequences' option unchecked to see details."; + } + + return output; + }, + + /** - * Given a buffer, detects magic byte sequences at specific positions and returns the + * Given a buffer, detects magic byte sequences at specific positions and returns the * extension and mime type. * * @private @@ -100,427 +100,427 @@ var FileType = { * @returns {string} type.mime - Mime type * @returns {string} [type.desc] - Description */ - _magic_type: function (buf) { - if (!(buf && buf.length > 1)) { - return null; - } + _magic_type(buf) { + if (!(buf && buf.length > 1)) { + return null; + } - if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) { - return { - ext: 'jpg', - mime: 'image/jpeg' - }; - } + if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) { + return { + ext: 'jpg', + mime: 'image/jpeg', + }; + } - if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) { - return { - ext: 'png', - mime: 'image/png' - }; - } + if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) { + return { + ext: 'png', + mime: 'image/png', + }; + } - if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) { - return { - ext: 'gif', - mime: 'image/gif' - }; - } + if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) { + return { + ext: 'gif', + mime: 'image/gif', + }; + } - if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) { - return { - ext: 'webp', - mime: 'image/webp' - }; - } + if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) { + return { + ext: 'webp', + mime: 'image/webp', + }; + } // needs to be before `tif` check - if (((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52) { - return { - ext: 'cr2', - mime: 'image/x-canon-cr2' - }; - } + if (((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52) { + return { + ext: 'cr2', + mime: 'image/x-canon-cr2', + }; + } - if ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) { - return { - ext: 'tif', - mime: 'image/tiff' - }; - } + if ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) { + return { + ext: 'tif', + mime: 'image/tiff', + }; + } - if (buf[0] === 0x42 && buf[1] === 0x4D) { - return { - ext: 'bmp', - mime: 'image/bmp' - }; - } + if (buf[0] === 0x42 && buf[1] === 0x4D) { + return { + ext: 'bmp', + mime: 'image/bmp', + }; + } - if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) { - return { - ext: 'jxr', - mime: 'image/vnd.ms-photo' - }; - } + if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) { + return { + ext: 'jxr', + mime: 'image/vnd.ms-photo', + }; + } - if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) { - return { - ext: 'psd', - mime: 'image/vnd.adobe.photoshop' - }; - } + if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) { + return { + ext: 'psd', + mime: 'image/vnd.adobe.photoshop', + }; + } // needs to be before `zip` check - if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && buf[57] === 0x70) { - return { - ext: 'epub', - mime: 'application/epub+zip' - }; - } + if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && buf[57] === 0x70) { + return { + ext: 'epub', + mime: 'application/epub+zip', + }; + } - if (buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)) { - return { - ext: 'zip', - mime: 'application/zip' - }; - } + if (buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)) { + return { + ext: 'zip', + mime: 'application/zip', + }; + } - if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) { - return { - ext: 'tar', - mime: 'application/x-tar' - }; - } + if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) { + return { + ext: 'tar', + mime: 'application/x-tar', + }; + } - if (buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && (buf[6] === 0x0 || buf[6] === 0x1)) { - return { - ext: 'rar', - mime: 'application/x-rar-compressed' - }; - } + if (buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && (buf[6] === 0x0 || buf[6] === 0x1)) { + return { + ext: 'rar', + mime: 'application/x-rar-compressed', + }; + } - if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) { - return { - ext: 'gz', - mime: 'application/gzip' - }; - } + if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) { + return { + ext: 'gz', + mime: 'application/gzip', + }; + } - if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) { - return { - ext: 'bz2', - mime: 'application/x-bzip2' - }; - } + if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) { + return { + ext: 'bz2', + mime: 'application/x-bzip2', + }; + } - if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) { - return { - ext: '7z', - mime: 'application/x-7z-compressed' - }; - } + if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) { + return { + ext: '7z', + mime: 'application/x-7z-compressed', + }; + } - if (buf[0] === 0x78 && buf[1] === 0x01) { - return { - ext: 'dmg', - mime: 'application/x-apple-diskimage' - }; - } + if (buf[0] === 0x78 && buf[1] === 0x01) { + return { + ext: 'dmg', + mime: 'application/x-apple-diskimage', + }; + } - if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) || (buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) || (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D)) { - return { - ext: 'mp4', - mime: 'video/mp4' - }; - } + if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) || (buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) || (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D)) { + return { + ext: 'mp4', + mime: 'video/mp4', + }; + } - if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56)) { - return { - ext: 'm4v', - mime: 'video/x-m4v' - }; - } + if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56)) { + return { + ext: 'm4v', + mime: 'video/x-m4v', + }; + } - if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) { - return { - ext: 'mid', - mime: 'audio/midi' - }; - } + if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) { + return { + ext: 'mid', + mime: 'audio/midi', + }; + } // needs to be before the `webm` check - if (buf[31] === 0x6D && buf[32] === 0x61 && buf[33] === 0x74 && buf[34] === 0x72 && buf[35] === 0x6f && buf[36] === 0x73 && buf[37] === 0x6B && buf[38] === 0x61) { - return { - ext: 'mkv', - mime: 'video/x-matroska' - }; - } + if (buf[31] === 0x6D && buf[32] === 0x61 && buf[33] === 0x74 && buf[34] === 0x72 && buf[35] === 0x6f && buf[36] === 0x73 && buf[37] === 0x6B && buf[38] === 0x61) { + return { + ext: 'mkv', + mime: 'video/x-matroska', + }; + } - if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) { - return { - ext: 'webm', - mime: 'video/webm' - }; - } + if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) { + return { + ext: 'webm', + mime: 'video/webm', + }; + } - if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) { - return { - ext: 'mov', - mime: 'video/quicktime' - }; - } + if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) { + return { + ext: 'mov', + mime: 'video/quicktime', + }; + } - if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && buf[10] === 0x49) { - return { - ext: 'avi', - mime: 'video/x-msvideo' - }; - } + if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && buf[10] === 0x49) { + return { + ext: 'avi', + mime: 'video/x-msvideo', + }; + } - if (buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9) { - return { - ext: 'wmv', - mime: 'video/x-ms-wmv' - }; - } + if (buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9) { + return { + ext: 'wmv', + mime: 'video/x-ms-wmv', + }; + } - if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') { - return { - ext: 'mpg', - mime: 'video/mpeg' - }; - } + if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') { + return { + ext: 'mpg', + mime: 'video/mpeg', + }; + } - if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) { - return { - ext: 'mp3', - mime: 'audio/mpeg' - }; - } + if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) { + return { + ext: 'mp3', + mime: 'audio/mpeg', + }; + } - if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20)) { - return { - ext: 'm4a', - mime: 'audio/m4a' - }; - } + if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20)) { + return { + ext: 'm4a', + mime: 'audio/m4a', + }; + } - if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) { - return { - ext: 'ogg', - mime: 'audio/ogg' - }; - } + if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) { + return { + ext: 'ogg', + mime: 'audio/ogg', + }; + } - if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) { - return { - ext: 'flac', - mime: 'audio/x-flac' - }; - } + if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) { + return { + ext: 'flac', + mime: 'audio/x-flac', + }; + } - if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) { - return { - ext: 'wav', - mime: 'audio/x-wav' - }; - } + if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) { + return { + ext: 'wav', + mime: 'audio/x-wav', + }; + } - if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) { - return { - ext: 'amr', - mime: 'audio/amr' - }; - } + if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) { + return { + ext: 'amr', + mime: 'audio/amr', + }; + } - if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) { - return { - ext: 'pdf', - mime: 'application/pdf' - }; - } + if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) { + return { + ext: 'pdf', + mime: 'application/pdf', + }; + } - if (buf[0] === 0x4D && buf[1] === 0x5A) { - return { - ext: 'exe', - mime: 'application/x-msdownload' - }; - } + if (buf[0] === 0x4D && buf[1] === 0x5A) { + return { + ext: 'exe', + mime: 'application/x-msdownload', + }; + } - if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) { - return { - ext: 'swf', - mime: 'application/x-shockwave-flash' - }; - } + if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) { + return { + ext: 'swf', + mime: 'application/x-shockwave-flash', + }; + } - if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) { - return { - ext: 'rtf', - mime: 'application/rtf' - }; - } + if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) { + return { + ext: 'rtf', + mime: 'application/rtf', + }; + } - if (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) { - return { - ext: 'woff', - mime: 'application/font-woff' - }; - } + if (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) { + return { + ext: 'woff', + mime: 'application/font-woff', + }; + } - if (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) { - return { - ext: 'woff2', - mime: 'application/font-woff' - }; - } + if (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) { + return { + ext: 'woff2', + mime: 'application/font-woff', + }; + } - if (buf[34] === 0x4C && buf[35] === 0x50 && ((buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x01) || (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x00) || (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02))) { - return { - ext: 'eot', - mime: 'application/octet-stream' - }; - } + if (buf[34] === 0x4C && buf[35] === 0x50 && ((buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x01) || (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x00) || (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02))) { + return { + ext: 'eot', + mime: 'application/octet-stream', + }; + } - if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) { - return { - ext: 'ttf', - mime: 'application/font-sfnt' - }; - } + if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) { + return { + ext: 'ttf', + mime: 'application/font-sfnt', + }; + } - if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) { - return { - ext: 'otf', - mime: 'application/font-sfnt' - }; - } + if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) { + return { + ext: 'otf', + mime: 'application/font-sfnt', + }; + } - if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) { - return { - ext: 'ico', - mime: 'image/x-icon' - }; - } + if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) { + return { + ext: 'ico', + mime: 'image/x-icon', + }; + } - if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) { - return { - ext: 'flv', - mime: 'video/x-flv' - }; - } + if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) { + return { + ext: 'flv', + mime: 'video/x-flv', + }; + } - if (buf[0] === 0x25 && buf[1] === 0x21) { - return { - ext: 'ps', - mime: 'application/postscript' - }; - } + if (buf[0] === 0x25 && buf[1] === 0x21) { + return { + ext: 'ps', + mime: 'application/postscript', + }; + } - if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) { - return { - ext: 'xz', - mime: 'application/x-xz' - }; - } + if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) { + return { + ext: 'xz', + mime: 'application/x-xz', + }; + } + + if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) { + return { + ext: 'sqlite', + mime: 'application/x-sqlite3', + }; + } - if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) { - return { - ext: 'sqlite', - mime: 'application/x-sqlite3' - }; - } - // Added by n1474335 [n1474335@gmail.com] from here on // ################################################################## // - if ((buf[0] === 0x1F && buf[1] === 0x9D) || (buf[0] === 0x1F && buf[1] === 0xA0)) { - return { - ext: 'z, tar.z', - mime: 'application/x-gtar' - }; - } - - if (buf[0] === 0x7F && buf[1] === 0x45 && buf[2] === 0x4C && buf[3] === 0x46) { - return { - ext: 'none, axf, bin, elf, o, prx, puff, so', - mime: 'application/x-executable', - desc: 'Executable and Linkable Format file. No standard file extension.' - }; - } - - if (buf[0] === 0xCA && buf[1] === 0xFE && buf[2] === 0xBA && buf[3] === 0xBE) { - return { - ext: 'class', - mime: 'application/java-vm' - }; - } - - if (buf[0] === 0xEF && buf[1] === 0xBB && buf[2] === 0xBF) { - return { - ext: 'txt', - mime: 'text/plain', - desc: 'UTF-8 encoded Unicode byte order mark detected, commonly but not exclusively seen in text files.' - }; - } - + if ((buf[0] === 0x1F && buf[1] === 0x9D) || (buf[0] === 0x1F && buf[1] === 0xA0)) { + return { + ext: 'z, tar.z', + mime: 'application/x-gtar', + }; + } + + if (buf[0] === 0x7F && buf[1] === 0x45 && buf[2] === 0x4C && buf[3] === 0x46) { + return { + ext: 'none, axf, bin, elf, o, prx, puff, so', + mime: 'application/x-executable', + desc: 'Executable and Linkable Format file. No standard file extension.', + }; + } + + if (buf[0] === 0xCA && buf[1] === 0xFE && buf[2] === 0xBA && buf[3] === 0xBE) { + return { + ext: 'class', + mime: 'application/java-vm', + }; + } + + if (buf[0] === 0xEF && buf[1] === 0xBB && buf[2] === 0xBF) { + return { + ext: 'txt', + mime: 'text/plain', + desc: 'UTF-8 encoded Unicode byte order mark detected, commonly but not exclusively seen in text files.', + }; + } + // Must be before Little-endian UTF-16 BOM - if (buf[0] === 0xFF && buf[1] === 0xFE && buf[2] === 0x00 && buf[3] === 0x00) { - return { - ext: '', - mime: '', - desc: 'Little-endian UTF-32 encoded Unicode byte order mark detected.' - }; - } - - if (buf[0] === 0xFF && buf[1] === 0xFE) { - return { - ext: '', - mime: '', - desc: 'Little-endian UTF-16 encoded Unicode byte order mark detected.' - }; - } - - if ((buf[0x8001] === 0x43 && buf[0x8002] === 0x44 && buf[0x8003] === 0x30 && buf[0x8004] === 0x30 && buf[0x8005] === 0x31) || + if (buf[0] === 0xFF && buf[1] === 0xFE && buf[2] === 0x00 && buf[3] === 0x00) { + return { + ext: '', + mime: '', + desc: 'Little-endian UTF-32 encoded Unicode byte order mark detected.', + }; + } + + if (buf[0] === 0xFF && buf[1] === 0xFE) { + return { + ext: '', + mime: '', + desc: 'Little-endian UTF-16 encoded Unicode byte order mark detected.', + }; + } + + if ((buf[0x8001] === 0x43 && buf[0x8002] === 0x44 && buf[0x8003] === 0x30 && buf[0x8004] === 0x30 && buf[0x8005] === 0x31) || (buf[0x8801] === 0x43 && buf[0x8802] === 0x44 && buf[0x8803] === 0x30 && buf[0x8804] === 0x30 && buf[0x8805] === 0x31) || (buf[0x9001] === 0x43 && buf[0x9002] === 0x44 && buf[0x9003] === 0x30 && buf[0x9004] === 0x30 && buf[0x9005] === 0x31)) { - return { - ext: 'iso', - mime: 'application/octet-stream', - desc: 'ISO 9660 CD/DVD image file' - }; - } - - if (buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && buf[6] === 0x1A && buf[7] === 0xE1) { - return { - ext: 'doc, xls, ppt', - mime: 'application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint', - desc: 'Microsoft Office documents' - }; - } - - if (buf[0] === 0x64 && buf[1] === 0x65 && buf[2] === 0x78 && buf[3] === 0x0A && buf[4] === 0x30 && buf[5] === 0x33 && buf[6] === 0x35 && buf[7] === 0x00) { - return { - ext: 'dex', - mime: 'application/octet-stream', - desc: 'Dalvik Executable (Android)' - }; - } - - if (buf[0] === 0x4B && buf[1] === 0x44 && buf[2] === 0x4D) { - return { - ext: 'vmdk', - mime: 'application/vmdk, application/x-virtualbox-vmdk' - }; - } - - if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] == 0x34) { - return { - ext: 'crx', - mime: 'application/crx', - desc: 'Google Chrome extension or packaged app' - }; - } + return { + ext: 'iso', + mime: 'application/octet-stream', + desc: 'ISO 9660 CD/DVD image file', + }; + } - return null; - }, + if (buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && buf[6] === 0x1A && buf[7] === 0xE1) { + return { + ext: 'doc, xls, ppt', + mime: 'application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint', + desc: 'Microsoft Office documents', + }; + } + + if (buf[0] === 0x64 && buf[1] === 0x65 && buf[2] === 0x78 && buf[3] === 0x0A && buf[4] === 0x30 && buf[5] === 0x33 && buf[6] === 0x35 && buf[7] === 0x00) { + return { + ext: 'dex', + mime: 'application/octet-stream', + desc: 'Dalvik Executable (Android)', + }; + } + + if (buf[0] === 0x4B && buf[1] === 0x44 && buf[2] === 0x4D) { + return { + ext: 'vmdk', + mime: 'application/vmdk, application/x-virtualbox-vmdk', + }; + } + + if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] == 0x34) { + return { + ext: 'crx', + mime: 'application/crx', + desc: 'Google Chrome extension or packaged app', + }; + } + + return null; + }, }; diff --git a/src/js/operations/HTML.js b/src/js/operations/HTML.js index 80b3b700..f9a72358 100755 --- a/src/js/operations/HTML.js +++ b/src/js/operations/HTML.js @@ -7,19 +7,19 @@ * * @namespace */ -var HTML = { +const HTML = { /** * @constant * @default */ - CONVERT_ALL: false, + CONVERT_ALL: false, /** * @constant * @default */ - CONVERT_OPTIONS: ["Named entities where possible", "Numeric entities", "Hex entities"], - + CONVERT_OPTIONS: ['Named entities where possible', 'Numeric entities', 'Hex entities'], + /** * To HTML Entity operation. * @@ -27,45 +27,45 @@ var HTML = { * @param {Object[]} args * @returns {string} */ - run_to_entity: function(input, args) { - var convert_all = args[0], - numeric = args[1] == "Numeric entities", - hexa = args[1] == "Hex entities"; - - var charcodes = Utils.str_to_charcode(input); - var output = ""; - - for (var i = 0; i < charcodes.length; i++) { - if (convert_all && numeric) { - output += "&#" + charcodes[i] + ";"; - } else if (convert_all && hexa) { - output += "&#x" + Utils.hex(charcodes[i]) + ";"; - } else if (convert_all) { - output += HTML._byte_to_entity[charcodes[i]] || "&#" + charcodes[i] + ";"; - } else if (numeric) { - if (charcodes[i] > 255 || HTML._byte_to_entity.hasOwnProperty(charcodes[i])) { - output += "&#" + charcodes[i] + ";"; - } else { - output += Utils.chr(charcodes[i]); - } - } else if (hexa) { - if (charcodes[i] > 255 || HTML._byte_to_entity.hasOwnProperty(charcodes[i])) { - output += "&#x" + Utils.hex(charcodes[i]) + ";"; - } else { - output += Utils.chr(charcodes[i]); - } - } else { - output += HTML._byte_to_entity[charcodes[i]] || ( + run_to_entity(input, args) { + let convert_all = args[0], + numeric = args[1] == 'Numeric entities', + hexa = args[1] == 'Hex entities'; + + const charcodes = Utils.str_to_charcode(input); + let output = ''; + + for (let i = 0; i < charcodes.length; i++) { + if (convert_all && numeric) { + output += `&#${charcodes[i]};`; + } else if (convert_all && hexa) { + output += `&#x${Utils.hex(charcodes[i])};`; + } else if (convert_all) { + output += HTML._byte_to_entity[charcodes[i]] || `&#${charcodes[i]};`; + } else if (numeric) { + if (charcodes[i] > 255 || HTML._byte_to_entity.hasOwnProperty(charcodes[i])) { + output += `&#${charcodes[i]};`; + } else { + output += Utils.chr(charcodes[i]); + } + } else if (hexa) { + if (charcodes[i] > 255 || HTML._byte_to_entity.hasOwnProperty(charcodes[i])) { + output += `&#x${Utils.hex(charcodes[i])};`; + } else { + output += Utils.chr(charcodes[i]); + } + } else { + output += HTML._byte_to_entity[charcodes[i]] || ( charcodes[i] > 255 ? - "&#" + charcodes[i] + ";" : + `&#${charcodes[i]};` : Utils.chr(charcodes[i]) ); - } - } - return output; - }, - - + } + } + return output; + }, + + /** * From HTML Entity operation. * @@ -73,56 +73,57 @@ var HTML = { * @param {Object[]} args * @returns {string} */ - run_from_entity: function(input, args) { - var regex = /&(#?x?[a-zA-Z0-9]{1,8});/g, - output = "", - m, - i = 0; - - while (!!(m = regex.exec(input))) { + run_from_entity(input, args) { + let regex = /&(#?x?[a-zA-Z0-9]{1,8});/g, + output = '', + m, + i = 0; + + while (m = regex.exec(input)) { // Add up to match - for (; i < m.index;) - output += input[i++]; - + for (; i < m.index;) { + output += input[i++]; + } + // Add match - var bite = HTML._entity_to_byte[m[1]]; - if (bite) { - output += Utils.chr(bite); - } else if (!bite && m[1][0] == "#" && m[1].length > 1 && /^#\d{1,5}$/.test(m[1])) { + const bite = HTML._entity_to_byte[m[1]]; + if (bite) { + output += Utils.chr(bite); + } else if (!bite && m[1][0] == '#' && m[1].length > 1 && /^#\d{1,5}$/.test(m[1])) { // Numeric entity (e.g. ) - var num = m[1].slice(1,m[1].length); - output += Utils.chr(parseInt(num, 10)); - } else if (!bite && m[1][0] == "#" && m[1].length > 3 && /^#x[\dA-F]{2,8}$/i.test(m[1])) { + const num = m[1].slice(1, m[1].length); + output += Utils.chr(parseInt(num, 10)); + } else if (!bite && m[1][0] == '#' && m[1].length > 3 && /^#x[\dA-F]{2,8}$/i.test(m[1])) { // Hex entity (e.g. :) - var hex = m[1].slice(2,m[1].length); - output += Utils.chr(parseInt(hex, 16)); - } else { + const hex = m[1].slice(2, m[1].length); + output += Utils.chr(parseInt(hex, 16)); + } else { // Not a valid entity, print as normal - for (; i < regex.lastIndex;) - output += input[i++]; - } - - i = regex.lastIndex; - } + for (; i < regex.lastIndex;) { output += input[i++]; } + } + + i = regex.lastIndex; + } // Add all after final match - for (; i < input.length;) - output += input[i++]; - - return output; - }, - - + for (; i < input.length;) { + output += input[i++]; + } + + return output; + }, + + /** * @constant * @default */ - REMOVE_INDENTATION: true, + REMOVE_INDENTATION: true, /** * @constant * @default */ - REMOVE_LINE_BREAKS: true, - + REMOVE_LINE_BREAKS: true, + /** * Strip HTML tags operation. * @@ -130,25 +131,25 @@ var HTML = { * @param {Object[]} args * @returns {string} */ - run_strip_tags: function(input, args) { - var remove_indentation = args[0], - remove_line_breaks = args[1]; - - input = Utils.strip_html_tags(input); - - if (remove_indentation) { - input = input.replace(/\n[ \f\t]+/g, "\n"); - } - - if (remove_line_breaks) { - input = input.replace(/^\s*\n/, "") // first line - .replace(/(\n\s*){2,}/g, "\n"); // all others - } - - return input; - }, - - + run_strip_tags(input, args) { + let remove_indentation = args[0], + remove_line_breaks = args[1]; + + input = Utils.strip_html_tags(input); + + if (remove_indentation) { + input = input.replace(/\n[ \f\t]+/g, '\n'); + } + + if (remove_line_breaks) { + input = input.replace(/^\s*\n/, '') // first line + .replace(/(\n\s*){2,}/g, '\n'); // all others + } + + return input; + }, + + /** * Parse colour code operation. * @@ -156,81 +157,84 @@ var HTML = { * @param {Object[]} args * @returns {html} */ - run_parse_colour_code: function(input, args) { - var m = null, - r = 0, g = 0, b = 0, a = 1; - - // Read in the input - if (!!(m = input.match(/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i))) { - // Hex - #d9edf7 - r = parseInt(m[1], 16); - g = parseInt(m[2], 16); - b = parseInt(m[3], 16); - } else if (!!(m = input.match(/rgba?\((\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?)(?:,\s?(\d(?:\.\d+)?))?\)/i))) { - // RGB or RGBA - rgb(217,237,247) or rgba(217,237,247,1) - r = parseFloat(m[1]); - g = parseFloat(m[2]); - b = parseFloat(m[3]); - a = m[4] ? parseFloat(m[4]) : 1; - } else if (!!(m = input.match(/hsla?\((\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?)%,\s?(\d{1,3}(?:\.\d+)?)%(?:,\s?(\d(?:\.\d+)?))?\)/i))) { - // HSL or HSLA - hsl(200, 65%, 91%) or hsla(200, 65%, 91%, 1) - var h_ = parseFloat(m[1]) / 360, - s_ = parseFloat(m[2]) / 100, - l_ = parseFloat(m[3]) / 100, - rgb_ = HTML._hsl_to_rgb(h_, s_, l_); - - r = rgb_[0]; - g = rgb_[1]; - b = rgb_[2]; - a = m[4] ? parseFloat(m[4]) : 1; - } else if (!!(m = input.match(/cmyk\((\d(?:\.\d+)?),\s?(\d(?:\.\d+)?),\s?(\d(?:\.\d+)?),\s?(\d(?:\.\d+)?)\)/i))) { - // CMYK - cmyk(0.12, 0.04, 0.00, 0.03) - var c_ = parseFloat(m[1]), - m_ = parseFloat(m[2]), - y_ = parseFloat(m[3]), - k_ = parseFloat(m[4]); + run_parse_colour_code(input, args) { + var m = null, + r = 0, + g = 0, + b = 0, + a = 1; + + // Read in the input + if (m = input.match(/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i)) { + // Hex - #d9edf7 + r = parseInt(m[1], 16); + g = parseInt(m[2], 16); + b = parseInt(m[3], 16); + } else if (m = input.match(/rgba?\((\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?)(?:,\s?(\d(?:\.\d+)?))?\)/i)) { + // RGB or RGBA - rgb(217,237,247) or rgba(217,237,247,1) + r = parseFloat(m[1]); + g = parseFloat(m[2]); + b = parseFloat(m[3]); + a = m[4] ? parseFloat(m[4]) : 1; + } else if (m = input.match(/hsla?\((\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?)%,\s?(\d{1,3}(?:\.\d+)?)%(?:,\s?(\d(?:\.\d+)?))?\)/i)) { + // HSL or HSLA - hsl(200, 65%, 91%) or hsla(200, 65%, 91%, 1) + let h_ = parseFloat(m[1]) / 360, + s_ = parseFloat(m[2]) / 100, + l_ = parseFloat(m[3]) / 100, + rgb_ = HTML._hsl_to_rgb(h_, s_, l_); + + r = rgb_[0]; + g = rgb_[1]; + b = rgb_[2]; + a = m[4] ? parseFloat(m[4]) : 1; + } else if (m = input.match(/cmyk\((\d(?:\.\d+)?),\s?(\d(?:\.\d+)?),\s?(\d(?:\.\d+)?),\s?(\d(?:\.\d+)?)\)/i)) { + // CMYK - cmyk(0.12, 0.04, 0.00, 0.03) + let c_ = parseFloat(m[1]), + m_ = parseFloat(m[2]), + y_ = parseFloat(m[3]), + k_ = parseFloat(m[4]); + + r = Math.round(255 * (1 - c_) * (1 - k_)); + g = Math.round(255 * (1 - m_) * (1 - k_)); + b = Math.round(255 * (1 - y_) * (1 - k_)); + } + + var hsl_ = HTML._rgb_to_hsl(r, g, b), + h = Math.round(hsl_[0] * 360), + s = Math.round(hsl_[1] * 100), + l = Math.round(hsl_[2] * 100), + k = 1 - Math.max(r / 255, g / 255, b / 255), + c = (1 - r / 255 - k) / (1 - k), + m = (1 - g / 255 - k) / (1 - k), // jshint ignore:line + y = (1 - b / 255 - k) / (1 - k); + + c = isNaN(c) ? '0' : c.toFixed(2); + m = isNaN(m) ? '0' : m.toFixed(2); + y = isNaN(y) ? '0' : y.toFixed(2); + k = k.toFixed(2); + + let hex = `#${ + Utils.pad_left(Math.round(r).toString(16), 2) + }${Utils.pad_left(Math.round(g).toString(16), 2) + }${Utils.pad_left(Math.round(b).toString(16), 2)}`, + rgb = `rgb(${r}, ${g}, ${b})`, + rgba = `rgba(${r}, ${g}, ${b}, ${a})`, + hsl = `hsl(${h}, ${s}%, ${l}%)`, + hsla = `hsla(${h}, ${s}%, ${l}%, ${a})`, + cmyk = `cmyk(${c}, ${m}, ${y}, ${k})`; - r = Math.round(255 * (1 - c_) * (1 - k_)); - g = Math.round(255 * (1 - m_) * (1 - k_)); - b = Math.round(255 * (1 - y_) * (1 - k_)); - } - - var hsl_ = HTML._rgb_to_hsl(r, g, b), - h = Math.round(hsl_[0] * 360), - s = Math.round(hsl_[1] * 100), - l = Math.round(hsl_[2] * 100), - k = 1 - Math.max(r/255, g/255, b/255), - c = (1 - r/255 - k) / (1 - k), - m = (1 - g/255 - k) / (1 - k), // jshint ignore:line - y = (1 - b/255 - k) / (1 - k); - - c = isNaN(c) ? "0" : c.toFixed(2); - m = isNaN(m) ? "0" : m.toFixed(2); - y = isNaN(y) ? "0" : y.toFixed(2); - k = k.toFixed(2); - - var hex = "#" + - Utils.pad_left(Math.round(r).toString(16), 2) + - Utils.pad_left(Math.round(g).toString(16), 2) + - Utils.pad_left(Math.round(b).toString(16), 2), - rgb = "rgb(" + r + ", " + g + ", " + b + ")", - rgba = "rgba(" + r + ", " + g + ", " + b + ", " + a + ")", - hsl = "hsl(" + h + ", " + s + "%, " + l + "%)", - hsla = "hsla(" + h + ", " + s + "%, " + l + "%, " + a + ")", - cmyk = "cmyk(" + c + ", " + m + ", " + y + ", " + k + ")"; - // Generate output - return "
" + - "Hex: " + hex + "\n" + - "RGB: " + rgb + "\n" + - "RGBA: " + rgba + "\n" + - "HSL: " + hsl + "\n" + - "HSLA: " + hsla + "\n" + - "CMYK: " + cmyk + - ""; - }, - - - + `; + }, + + /** * Converts an HSL color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. @@ -258,32 +261,34 @@ var HTML = { * @param {number} l - The lightness * @return {Array} The RGB representation */ - _hsl_to_rgb: function(h, s, l){ - var r, g, b; + _hsl_to_rgb(h, s, l) { + let r, + g, + b; - if (s === 0){ - r = g = b = l; // achromatic - } else { - var hue2rgb = function hue2rgb(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1/6) return p + (q - p) * 6 * t; - if (t < 1/2) return q; - if (t < 2/3) return p + (q - p) * (2/3 - t) * 6; - return p; - }; + if (s === 0) { + r = g = b = l; // achromatic + } else { + const hue2rgb = function hue2rgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; + }; + + const q = l < 0.5 ? l * (1 + s) : l + s - l * s; + const p = 2 * l - q; + r = hue2rgb(p, q, h + 1 / 3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1 / 3); + } + + return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)]; + }, - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hue2rgb(p, q, h + 1/3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - 1/3); - } - return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)]; - }, - - /** * Converts an RGB color value to HSL. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. @@ -298,554 +303,556 @@ var HTML = { * @param {number} b - The blue color value * @return {Array} The HSL representation */ - _rgb_to_hsl: function(r, g, b) { - r /= 255; g /= 255; b /= 255; - var max = Math.max(r, g, b), - min = Math.min(r, g, b), - h, s, l = (max + min) / 2; + _rgb_to_hsl(r, g, b) { + r /= 255; g /= 255; b /= 255; + let max = Math.max(r, g, b), + min = Math.min(r, g, b), + h, + s, + l = (max + min) / 2; + + if (max === min) { + h = s = 0; // achromatic + } else { + const d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + switch (max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + h /= 6; + } + + return [h, s, l]; + }, - if (max === min) { - h = s = 0; // achromatic - } else { - var d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch(max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return [h, s, l]; - }, - - /** * Lookup table to translate byte values to their HTML entity codes. * * @private * @constant */ - _byte_to_entity: { - 34 : """, - 38 : "&", - 39 : "'", - 60 : "<", - 62 : ">", - 160 : " ", - 161 : "¡", - 162 : "¢", - 163 : "£", - 164 : "¤", - 165 : "¥", - 166 : "¦", - 167 : "§", - 168 : "¨", - 169 : "©", - 170 : "ª", - 171 : "«", - 172 : "¬", - 173 : "­", - 174 : "®", - 175 : "¯", - 176 : "°", - 177 : "±", - 178 : "²", - 179 : "³", - 180 : "´", - 181 : "µ", - 182 : "¶", - 183 : "·", - 184 : "¸", - 185 : "¹", - 186 : "º", - 187 : "»", - 188 : "¼", - 189 : "½", - 190 : "¾", - 191 : "¿", - 192 : "À", - 193 : "Á", - 194 : "Â", - 195 : "Ã", - 196 : "Ä", - 197 : "Å", - 198 : "Æ", - 199 : "Ç", - 200 : "È", - 201 : "É", - 202 : "Ê", - 203 : "Ë", - 204 : "Ì", - 205 : "Í", - 206 : "Î", - 207 : "Ï", - 208 : "Ð", - 209 : "Ñ", - 210 : "Ò", - 211 : "Ó", - 212 : "Ô", - 213 : "Õ", - 214 : "Ö", - 215 : "×", - 216 : "Ø", - 217 : "Ù", - 218 : "Ú", - 219 : "Û", - 220 : "Ü", - 221 : "Ý", - 222 : "Þ", - 223 : "ß", - 224 : "à", - 225 : "á", - 226 : "â", - 227 : "ã", - 228 : "ä", - 229 : "å", - 230 : "æ", - 231 : "ç", - 232 : "è", - 233 : "é", - 234 : "ê", - 235 : "ë", - 236 : "ì", - 237 : "í", - 238 : "î", - 239 : "ï", - 240 : "ð", - 241 : "ñ", - 242 : "ò", - 243 : "ó", - 244 : "ô", - 245 : "õ", - 246 : "ö", - 247 : "÷", - 248 : "ø", - 249 : "ù", - 250 : "ú", - 251 : "û", - 252 : "ü", - 253 : "ý", - 254 : "þ", - 255 : "ÿ", - 338 : "Œ", - 339 : "œ", - 352 : "Š", - 353 : "š", - 376 : "Ÿ", - 402 : "ƒ", - 710 : "ˆ", - 732 : "˜", - 913 : "Α", - 914 : "Β", - 915 : "Γ", - 916 : "Δ", - 917 : "Ε", - 918 : "Ζ", - 919 : "Η", - 920 : "Θ", - 921 : "Ι", - 922 : "Κ", - 923 : "Λ", - 924 : "Μ", - 925 : "Ν", - 926 : "Ξ", - 927 : "Ο", - 928 : "Π", - 929 : "Ρ", - 931 : "Σ", - 932 : "Τ", - 933 : "Υ", - 934 : "Φ", - 935 : "Χ", - 936 : "Ψ", - 937 : "Ω", - 945 : "α", - 946 : "β", - 947 : "γ", - 948 : "δ", - 949 : "ε", - 950 : "ζ", - 951 : "η", - 952 : "θ", - 953 : "ι", - 954 : "κ", - 955 : "λ", - 956 : "μ", - 957 : "ν", - 958 : "ξ", - 959 : "ο", - 960 : "π", - 961 : "ρ", - 962 : "ς", - 963 : "σ", - 964 : "τ", - 965 : "υ", - 966 : "φ", - 967 : "χ", - 968 : "ψ", - 969 : "ω", - 977 : "ϑ", - 978 : "ϒ", - 982 : "ϖ", - 8194 : " ", - 8195 : " ", - 8201 : " ", - 8204 : "‌", - 8205 : "‍", - 8206 : "‎", - 8207 : "‏", - 8211 : "–", - 8212 : "—", - 8216 : "‘", - 8217 : "’", - 8218 : "‚", - 8220 : "“", - 8221 : "”", - 8222 : "„", - 8224 : "†", - 8225 : "‡", - 8226 : "•", - 8230 : "…", - 8240 : "‰", - 8242 : "′", - 8243 : "″", - 8249 : "‹", - 8250 : "›", - 8254 : "‾", - 8260 : "⁄", - 8364 : "€", - 8465 : "ℑ", - 8472 : "℘", - 8476 : "ℜ", - 8482 : "™", - 8501 : "ℵ", - 8592 : "←", - 8593 : "↑", - 8594 : "→", - 8595 : "↓", - 8596 : "↔", - 8629 : "↵", - 8656 : "⇐", - 8657 : "⇑", - 8658 : "⇒", - 8659 : "⇓", - 8660 : "⇔", - 8704 : "∀", - 8706 : "∂", - 8707 : "∃", - 8709 : "∅", - 8711 : "∇", - 8712 : "∈", - 8713 : "∉", - 8715 : "∋", - 8719 : "∏", - 8721 : "∑", - 8722 : "−", - 8727 : "∗", - 8730 : "√", - 8733 : "∝", - 8734 : "∞", - 8736 : "∠", - 8743 : "∧", - 8744 : "∨", - 8745 : "∩", - 8746 : "∪", - 8747 : "∫", - 8756 : "∴", - 8764 : "∼", - 8773 : "≅", - 8776 : "≈", - 8800 : "≠", - 8801 : "≡", - 8804 : "≤", - 8805 : "≥", - 8834 : "⊂", - 8835 : "⊃", - 8836 : "⊄", - 8838 : "⊆", - 8839 : "⊇", - 8853 : "⊕", - 8855 : "⊗", - 8869 : "⊥", - 8901 : "⋅", - 8942 : "⋮", - 8968 : "⌈", - 8969 : "⌉", - 8970 : "⌊", - 8971 : "⌋", - 9001 : "⟨", - 9002 : "⟩", - 9674 : "◊", - 9824 : "♠", - 9827 : "♣", - 9829 : "♥", - 9830 : "♦", - }, - - + _byte_to_entity: { + 34: '"', + 38: '&', + 39: ''', + 60: '<', + 62: '>', + 160: ' ', + 161: '¡', + 162: '¢', + 163: '£', + 164: '¤', + 165: '¥', + 166: '¦', + 167: '§', + 168: '¨', + 169: '©', + 170: 'ª', + 171: '«', + 172: '¬', + 173: '­', + 174: '®', + 175: '¯', + 176: '°', + 177: '±', + 178: '²', + 179: '³', + 180: '´', + 181: 'µ', + 182: '¶', + 183: '·', + 184: '¸', + 185: '¹', + 186: 'º', + 187: '»', + 188: '¼', + 189: '½', + 190: '¾', + 191: '¿', + 192: 'À', + 193: 'Á', + 194: 'Â', + 195: 'Ã', + 196: 'Ä', + 197: 'Å', + 198: 'Æ', + 199: 'Ç', + 200: 'È', + 201: 'É', + 202: 'Ê', + 203: 'Ë', + 204: 'Ì', + 205: 'Í', + 206: 'Î', + 207: 'Ï', + 208: 'Ð', + 209: 'Ñ', + 210: 'Ò', + 211: 'Ó', + 212: 'Ô', + 213: 'Õ', + 214: 'Ö', + 215: '×', + 216: 'Ø', + 217: 'Ù', + 218: 'Ú', + 219: 'Û', + 220: 'Ü', + 221: 'Ý', + 222: 'Þ', + 223: 'ß', + 224: 'à', + 225: 'á', + 226: 'â', + 227: 'ã', + 228: 'ä', + 229: 'å', + 230: 'æ', + 231: 'ç', + 232: 'è', + 233: 'é', + 234: 'ê', + 235: 'ë', + 236: 'ì', + 237: 'í', + 238: 'î', + 239: 'ï', + 240: 'ð', + 241: 'ñ', + 242: 'ò', + 243: 'ó', + 244: 'ô', + 245: 'õ', + 246: 'ö', + 247: '÷', + 248: 'ø', + 249: 'ù', + 250: 'ú', + 251: 'û', + 252: 'ü', + 253: 'ý', + 254: 'þ', + 255: 'ÿ', + 338: 'Œ', + 339: 'œ', + 352: 'Š', + 353: 'š', + 376: 'Ÿ', + 402: 'ƒ', + 710: 'ˆ', + 732: '˜', + 913: 'Α', + 914: 'Β', + 915: 'Γ', + 916: 'Δ', + 917: 'Ε', + 918: 'Ζ', + 919: 'Η', + 920: 'Θ', + 921: 'Ι', + 922: 'Κ', + 923: 'Λ', + 924: 'Μ', + 925: 'Ν', + 926: 'Ξ', + 927: 'Ο', + 928: 'Π', + 929: 'Ρ', + 931: 'Σ', + 932: 'Τ', + 933: 'Υ', + 934: 'Φ', + 935: 'Χ', + 936: 'Ψ', + 937: 'Ω', + 945: 'α', + 946: 'β', + 947: 'γ', + 948: 'δ', + 949: 'ε', + 950: 'ζ', + 951: 'η', + 952: 'θ', + 953: 'ι', + 954: 'κ', + 955: 'λ', + 956: 'μ', + 957: 'ν', + 958: 'ξ', + 959: 'ο', + 960: 'π', + 961: 'ρ', + 962: 'ς', + 963: 'σ', + 964: 'τ', + 965: 'υ', + 966: 'φ', + 967: 'χ', + 968: 'ψ', + 969: 'ω', + 977: 'ϑ', + 978: 'ϒ', + 982: 'ϖ', + 8194: ' ', + 8195: ' ', + 8201: ' ', + 8204: '‌', + 8205: '‍', + 8206: '‎', + 8207: '‏', + 8211: '–', + 8212: '—', + 8216: '‘', + 8217: '’', + 8218: '‚', + 8220: '“', + 8221: '”', + 8222: '„', + 8224: '†', + 8225: '‡', + 8226: '•', + 8230: '…', + 8240: '‰', + 8242: '′', + 8243: '″', + 8249: '‹', + 8250: '›', + 8254: '‾', + 8260: '⁄', + 8364: '€', + 8465: 'ℑ', + 8472: '℘', + 8476: 'ℜ', + 8482: '™', + 8501: 'ℵ', + 8592: '←', + 8593: '↑', + 8594: '→', + 8595: '↓', + 8596: '↔', + 8629: '↵', + 8656: '⇐', + 8657: '⇑', + 8658: '⇒', + 8659: '⇓', + 8660: '⇔', + 8704: '∀', + 8706: '∂', + 8707: '∃', + 8709: '∅', + 8711: '∇', + 8712: '∈', + 8713: '∉', + 8715: '∋', + 8719: '∏', + 8721: '∑', + 8722: '−', + 8727: '∗', + 8730: '√', + 8733: '∝', + 8734: '∞', + 8736: '∠', + 8743: '∧', + 8744: '∨', + 8745: '∩', + 8746: '∪', + 8747: '∫', + 8756: '∴', + 8764: '∼', + 8773: '≅', + 8776: '≈', + 8800: '≠', + 8801: '≡', + 8804: '≤', + 8805: '≥', + 8834: '⊂', + 8835: '⊃', + 8836: '⊄', + 8838: '⊆', + 8839: '⊇', + 8853: '⊕', + 8855: '⊗', + 8869: '⊥', + 8901: '⋅', + 8942: '⋮', + 8968: '⌈', + 8969: '⌉', + 8970: '⌊', + 8971: '⌋', + 9001: '⟨', + 9002: '⟩', + 9674: '◊', + 9824: '♠', + 9827: '♣', + 9829: '♥', + 9830: '♦', + }, + + /** * Lookup table to translate HTML entity codes to their byte values. * * @private * @constant */ - _entity_to_byte : { - "quot" : 34, - "amp" : 38, - "apos" : 39, - "lt" : 60, - "gt" : 62, - "nbsp" : 160, - "iexcl" : 161, - "cent" : 162, - "pound" : 163, - "curren" : 164, - "yen" : 165, - "brvbar" : 166, - "sect" : 167, - "uml" : 168, - "copy" : 169, - "ordf" : 170, - "laquo" : 171, - "not" : 172, - "shy" : 173, - "reg" : 174, - "macr" : 175, - "deg" : 176, - "plusmn" : 177, - "sup2" : 178, - "sup3" : 179, - "acute" : 180, - "micro" : 181, - "para" : 182, - "middot" : 183, - "cedil" : 184, - "sup1" : 185, - "ordm" : 186, - "raquo" : 187, - "frac14" : 188, - "frac12" : 189, - "frac34" : 190, - "iquest" : 191, - "Agrave" : 192, - "Aacute" : 193, - "Acirc" : 194, - "Atilde" : 195, - "Auml" : 196, - "Aring" : 197, - "AElig" : 198, - "Ccedil" : 199, - "Egrave" : 200, - "Eacute" : 201, - "Ecirc" : 202, - "Euml" : 203, - "Igrave" : 204, - "Iacute" : 205, - "Icirc" : 206, - "Iuml" : 207, - "ETH" : 208, - "Ntilde" : 209, - "Ograve" : 210, - "Oacute" : 211, - "Ocirc" : 212, - "Otilde" : 213, - "Ouml" : 214, - "times" : 215, - "Oslash" : 216, - "Ugrave" : 217, - "Uacute" : 218, - "Ucirc" : 219, - "Uuml" : 220, - "Yacute" : 221, - "THORN" : 222, - "szlig" : 223, - "agrave" : 224, - "aacute" : 225, - "acirc" : 226, - "atilde" : 227, - "auml" : 228, - "aring" : 229, - "aelig" : 230, - "ccedil" : 231, - "egrave" : 232, - "eacute" : 233, - "ecirc" : 234, - "euml" : 235, - "igrave" : 236, - "iacute" : 237, - "icirc" : 238, - "iuml" : 239, - "eth" : 240, - "ntilde" : 241, - "ograve" : 242, - "oacute" : 243, - "ocirc" : 244, - "otilde" : 245, - "ouml" : 246, - "divide" : 247, - "oslash" : 248, - "ugrave" : 249, - "uacute" : 250, - "ucirc" : 251, - "uuml" : 252, - "yacute" : 253, - "thorn" : 254, - "yuml" : 255, - "OElig" : 338, - "oelig" : 339, - "Scaron" : 352, - "scaron" : 353, - "Yuml" : 376, - "fnof" : 402, - "circ" : 710, - "tilde" : 732, - "Alpha" : 913, - "Beta" : 914, - "Gamma" : 915, - "Delta" : 916, - "Epsilon" : 917, - "Zeta" : 918, - "Eta" : 919, - "Theta" : 920, - "Iota" : 921, - "Kappa" : 922, - "Lambda" : 923, - "Mu" : 924, - "Nu" : 925, - "Xi" : 926, - "Omicron" : 927, - "Pi" : 928, - "Rho" : 929, - "Sigma" : 931, - "Tau" : 932, - "Upsilon" : 933, - "Phi" : 934, - "Chi" : 935, - "Psi" : 936, - "Omega" : 937, - "alpha" : 945, - "beta" : 946, - "gamma" : 947, - "delta" : 948, - "epsilon" : 949, - "zeta" : 950, - "eta" : 951, - "theta" : 952, - "iota" : 953, - "kappa" : 954, - "lambda" : 955, - "mu" : 956, - "nu" : 957, - "xi" : 958, - "omicron" : 959, - "pi" : 960, - "rho" : 961, - "sigmaf" : 962, - "sigma" : 963, - "tau" : 964, - "upsilon" : 965, - "phi" : 966, - "chi" : 967, - "psi" : 968, - "omega" : 969, - "thetasym" : 977, - "upsih" : 978, - "piv" : 982, - "ensp" : 8194, - "emsp" : 8195, - "thinsp" : 8201, - "zwnj" : 8204, - "zwj" : 8205, - "lrm" : 8206, - "rlm" : 8207, - "ndash" : 8211, - "mdash" : 8212, - "lsquo" : 8216, - "rsquo" : 8217, - "sbquo" : 8218, - "ldquo" : 8220, - "rdquo" : 8221, - "bdquo" : 8222, - "dagger" : 8224, - "Dagger" : 8225, - "bull" : 8226, - "hellip" : 8230, - "permil" : 8240, - "prime" : 8242, - "Prime" : 8243, - "lsaquo" : 8249, - "rsaquo" : 8250, - "oline" : 8254, - "frasl" : 8260, - "euro" : 8364, - "image" : 8465, - "weierp" : 8472, - "real" : 8476, - "trade" : 8482, - "alefsym" : 8501, - "larr" : 8592, - "uarr" : 8593, - "rarr" : 8594, - "darr" : 8595, - "harr" : 8596, - "crarr" : 8629, - "lArr" : 8656, - "uArr" : 8657, - "rArr" : 8658, - "dArr" : 8659, - "hArr" : 8660, - "forall" : 8704, - "part" : 8706, - "exist" : 8707, - "empty" : 8709, - "nabla" : 8711, - "isin" : 8712, - "notin" : 8713, - "ni" : 8715, - "prod" : 8719, - "sum" : 8721, - "minus" : 8722, - "lowast" : 8727, - "radic" : 8730, - "prop" : 8733, - "infin" : 8734, - "ang" : 8736, - "and" : 8743, - "or" : 8744, - "cap" : 8745, - "cup" : 8746, - "int" : 8747, - "there4" : 8756, - "sim" : 8764, - "cong" : 8773, - "asymp" : 8776, - "ne" : 8800, - "equiv" : 8801, - "le" : 8804, - "ge" : 8805, - "sub" : 8834, - "sup" : 8835, - "nsub" : 8836, - "sube" : 8838, - "supe" : 8839, - "oplus" : 8853, - "otimes" : 8855, - "perp" : 8869, - "sdot" : 8901, - "vellip" : 8942, - "lceil" : 8968, - "rceil" : 8969, - "lfloor" : 8970, - "rfloor" : 8971, - "lang" : 9001, - "rang" : 9002, - "loz" : 9674, - "spades" : 9824, - "clubs" : 9827, - "hearts" : 9829, - "diams" : 9830, - }, + _entity_to_byte: { + quot: 34, + amp: 38, + apos: 39, + lt: 60, + gt: 62, + nbsp: 160, + iexcl: 161, + cent: 162, + pound: 163, + curren: 164, + yen: 165, + brvbar: 166, + sect: 167, + uml: 168, + copy: 169, + ordf: 170, + laquo: 171, + not: 172, + shy: 173, + reg: 174, + macr: 175, + deg: 176, + plusmn: 177, + sup2: 178, + sup3: 179, + acute: 180, + micro: 181, + para: 182, + middot: 183, + cedil: 184, + sup1: 185, + ordm: 186, + raquo: 187, + frac14: 188, + frac12: 189, + frac34: 190, + iquest: 191, + Agrave: 192, + Aacute: 193, + Acirc: 194, + Atilde: 195, + Auml: 196, + Aring: 197, + AElig: 198, + Ccedil: 199, + Egrave: 200, + Eacute: 201, + Ecirc: 202, + Euml: 203, + Igrave: 204, + Iacute: 205, + Icirc: 206, + Iuml: 207, + ETH: 208, + Ntilde: 209, + Ograve: 210, + Oacute: 211, + Ocirc: 212, + Otilde: 213, + Ouml: 214, + times: 215, + Oslash: 216, + Ugrave: 217, + Uacute: 218, + Ucirc: 219, + Uuml: 220, + Yacute: 221, + THORN: 222, + szlig: 223, + agrave: 224, + aacute: 225, + acirc: 226, + atilde: 227, + auml: 228, + aring: 229, + aelig: 230, + ccedil: 231, + egrave: 232, + eacute: 233, + ecirc: 234, + euml: 235, + igrave: 236, + iacute: 237, + icirc: 238, + iuml: 239, + eth: 240, + ntilde: 241, + ograve: 242, + oacute: 243, + ocirc: 244, + otilde: 245, + ouml: 246, + divide: 247, + oslash: 248, + ugrave: 249, + uacute: 250, + ucirc: 251, + uuml: 252, + yacute: 253, + thorn: 254, + yuml: 255, + OElig: 338, + oelig: 339, + Scaron: 352, + scaron: 353, + Yuml: 376, + fnof: 402, + circ: 710, + tilde: 732, + Alpha: 913, + Beta: 914, + Gamma: 915, + Delta: 916, + Epsilon: 917, + Zeta: 918, + Eta: 919, + Theta: 920, + Iota: 921, + Kappa: 922, + Lambda: 923, + Mu: 924, + Nu: 925, + Xi: 926, + Omicron: 927, + Pi: 928, + Rho: 929, + Sigma: 931, + Tau: 932, + Upsilon: 933, + Phi: 934, + Chi: 935, + Psi: 936, + Omega: 937, + alpha: 945, + beta: 946, + gamma: 947, + delta: 948, + epsilon: 949, + zeta: 950, + eta: 951, + theta: 952, + iota: 953, + kappa: 954, + lambda: 955, + mu: 956, + nu: 957, + xi: 958, + omicron: 959, + pi: 960, + rho: 961, + sigmaf: 962, + sigma: 963, + tau: 964, + upsilon: 965, + phi: 966, + chi: 967, + psi: 968, + omega: 969, + thetasym: 977, + upsih: 978, + piv: 982, + ensp: 8194, + emsp: 8195, + thinsp: 8201, + zwnj: 8204, + zwj: 8205, + lrm: 8206, + rlm: 8207, + ndash: 8211, + mdash: 8212, + lsquo: 8216, + rsquo: 8217, + sbquo: 8218, + ldquo: 8220, + rdquo: 8221, + bdquo: 8222, + dagger: 8224, + Dagger: 8225, + bull: 8226, + hellip: 8230, + permil: 8240, + prime: 8242, + Prime: 8243, + lsaquo: 8249, + rsaquo: 8250, + oline: 8254, + frasl: 8260, + euro: 8364, + image: 8465, + weierp: 8472, + real: 8476, + trade: 8482, + alefsym: 8501, + larr: 8592, + uarr: 8593, + rarr: 8594, + darr: 8595, + harr: 8596, + crarr: 8629, + lArr: 8656, + uArr: 8657, + rArr: 8658, + dArr: 8659, + hArr: 8660, + forall: 8704, + part: 8706, + exist: 8707, + empty: 8709, + nabla: 8711, + isin: 8712, + notin: 8713, + ni: 8715, + prod: 8719, + sum: 8721, + minus: 8722, + lowast: 8727, + radic: 8730, + prop: 8733, + infin: 8734, + ang: 8736, + and: 8743, + or: 8744, + cap: 8745, + cup: 8746, + int: 8747, + there4: 8756, + sim: 8764, + cong: 8773, + asymp: 8776, + ne: 8800, + equiv: 8801, + le: 8804, + ge: 8805, + sub: 8834, + sup: 8835, + nsub: 8836, + sube: 8838, + supe: 8839, + oplus: 8853, + otimes: 8855, + perp: 8869, + sdot: 8901, + vellip: 8942, + lceil: 8968, + rceil: 8969, + lfloor: 8970, + rfloor: 8971, + lang: 9001, + rang: 9002, + loz: 9674, + spades: 9824, + clubs: 9827, + hearts: 9829, + diams: 9830, + }, }; diff --git a/src/js/operations/HTTP.js b/src/js/operations/HTTP.js index 5b3dcf2d..3dd80143 100755 --- a/src/js/operations/HTTP.js +++ b/src/js/operations/HTTP.js @@ -9,8 +9,8 @@ * * @namespace */ -var HTTP = { - +const HTTP = { + /** * Strip HTTP headers operation. * @@ -18,14 +18,14 @@ var HTTP = { * @param {Object[]} args * @returns {string} */ - run_strip_headers: function(input, args) { - var header_end = input.indexOf("\r\n\r\n") + - (header_end < 0) ? input.indexOf("\n\n") + 2 : header_end + 4; - - return (header_end < 2) ? input : input.slice(header_end, input.length); - }, - - + run_strip_headers(input, args) { + const header_end = input.indexOf('\r\n\r\n') + + (header_end < 0) ? input.indexOf('\n\n') + 2 : header_end + 4; + + return (header_end < 2) ? input : input.slice(header_end, input.length); + }, + + /** * Parse User Agent operation. * @@ -33,21 +33,21 @@ var HTTP = { * @param {Object[]} args * @returns {string} */ - run_parse_user_agent: function(input, args) { - var ua = UAS_parser.parse(input); - - return "Type: " + ua.type + "\n" + - "Family: " + ua.uaFamily + "\n" + - "Name: " + ua.uaName + "\n" + - "URL: " + ua.uaUrl + "\n" + - "Company: " + ua.uaCompany + "\n" + - "Company URL: " + ua.uaCompanyUrl + "\n\n" + - "OS Family: " + ua.osFamily + "\n" + - "OS Name: " + ua.osName + "\n" + - "OS URL: " + ua.osUrl + "\n" + - "OS Company: " + ua.osCompany + "\n" + - "OS Company URL: " + ua.osCompanyUrl + "\n" + - "Device Type: " + ua.deviceType + "\n"; - }, + run_parse_user_agent(input, args) { + const ua = UAS_parser.parse(input); + + return `Type: ${ua.type}\n` + + `Family: ${ua.uaFamily}\n` + + `Name: ${ua.uaName}\n` + + `URL: ${ua.uaUrl}\n` + + `Company: ${ua.uaCompany}\n` + + `Company URL: ${ua.uaCompanyUrl}\n\n` + + `OS Family: ${ua.osFamily}\n` + + `OS Name: ${ua.osName}\n` + + `OS URL: ${ua.osUrl}\n` + + `OS Company: ${ua.osCompany}\n` + + `OS Company URL: ${ua.osCompanyUrl}\n` + + `Device Type: ${ua.deviceType}\n`; + }, }; diff --git a/src/js/operations/Hash.js b/src/js/operations/Hash.js index 983d2bff..0211a018 100755 --- a/src/js/operations/Hash.js +++ b/src/js/operations/Hash.js @@ -9,8 +9,8 @@ * * @namespace */ -var Hash = { - +const Hash = { + /** * MD5 operation. * @@ -18,12 +18,12 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_md5: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); // Cast to WordArray - return CryptoJS.MD5(input).toString(CryptoJS.enc.Hex); - }, - - + run_md5(input, args) { + input = CryptoJS.enc.Latin1.parse(input); // Cast to WordArray + return CryptoJS.MD5(input).toString(CryptoJS.enc.Hex); + }, + + /** * SHA1 operation. * @@ -31,12 +31,12 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_sha1: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - return CryptoJS.SHA1(input).toString(CryptoJS.enc.Hex); - }, + run_sha1(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + return CryptoJS.SHA1(input).toString(CryptoJS.enc.Hex); + }, + - /** * SHA224 operation. * @@ -44,12 +44,12 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_sha224: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - return CryptoJS.SHA224(input).toString(CryptoJS.enc.Hex); - }, - - + run_sha224(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + return CryptoJS.SHA224(input).toString(CryptoJS.enc.Hex); + }, + + /** * SHA256 operation. * @@ -57,12 +57,12 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_sha256: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - return CryptoJS.SHA256(input).toString(CryptoJS.enc.Hex); - }, - - + run_sha256(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + return CryptoJS.SHA256(input).toString(CryptoJS.enc.Hex); + }, + + /** * SHA384 operation. * @@ -70,12 +70,12 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_sha384: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - return CryptoJS.SHA384(input).toString(CryptoJS.enc.Hex); - }, - - + run_sha384(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + return CryptoJS.SHA384(input).toString(CryptoJS.enc.Hex); + }, + + /** * SHA512 operation. * @@ -83,18 +83,18 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_sha512: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - return CryptoJS.SHA512(input).toString(CryptoJS.enc.Hex); - }, - - + run_sha512(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + return CryptoJS.SHA512(input).toString(CryptoJS.enc.Hex); + }, + + /** * @constant * @default */ - SHA3_LENGTH: ["512", "384", "256", "224"], - + SHA3_LENGTH: ['512', '384', '256', '224'], + /** * SHA3 operation. * @@ -102,16 +102,16 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_sha3: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - var sha3_length = args[0], - options = { - outputLength: parseInt(sha3_length, 10) - }; - return CryptoJS.SHA3(input, options).toString(CryptoJS.enc.Hex); - }, - - + run_sha3(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + let sha3_length = args[0], + options = { + outputLength: parseInt(sha3_length, 10), + }; + return CryptoJS.SHA3(input, options).toString(CryptoJS.enc.Hex); + }, + + /** * RIPEMD-160 operation. * @@ -119,18 +119,18 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_ripemd160: function (input, args) { - input = CryptoJS.enc.Latin1.parse(input); - return CryptoJS.RIPEMD160(input).toString(CryptoJS.enc.Hex); - }, + run_ripemd160(input, args) { + input = CryptoJS.enc.Latin1.parse(input); + return CryptoJS.RIPEMD160(input).toString(CryptoJS.enc.Hex); + }, + - /** * @constant * @default */ - HMAC_FUNCTIONS: ["MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512", "SHA3", "RIPEMD-160"], - + HMAC_FUNCTIONS: ['MD5', 'SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512', 'SHA3', 'RIPEMD-160'], + /** * HMAC operation. * @@ -138,23 +138,23 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_hmac: function (input, args) { - var hash_func = args[1]; - input = CryptoJS.enc.Latin1.parse(input); - var execute = { - "MD5": CryptoJS.HmacMD5(input, args[0]), - "SHA1": CryptoJS.HmacSHA1(input, args[0]), - "SHA224": CryptoJS.HmacSHA224(input, args[0]), - "SHA256": CryptoJS.HmacSHA256(input, args[0]), - "SHA384": CryptoJS.HmacSHA384(input, args[0]), - "SHA512": CryptoJS.HmacSHA512(input, args[0]), - "SHA3": CryptoJS.HmacSHA3(input, args[0]), - "RIPEMD-160": CryptoJS.HmacRIPEMD160(input, args[0]), - }; - return execute[hash_func].toString(CryptoJS.enc.Hex); - }, - - + run_hmac(input, args) { + const hash_func = args[1]; + input = CryptoJS.enc.Latin1.parse(input); + const execute = { + MD5: CryptoJS.HmacMD5(input, args[0]), + SHA1: CryptoJS.HmacSHA1(input, args[0]), + SHA224: CryptoJS.HmacSHA224(input, args[0]), + SHA256: CryptoJS.HmacSHA256(input, args[0]), + SHA384: CryptoJS.HmacSHA384(input, args[0]), + SHA512: CryptoJS.HmacSHA512(input, args[0]), + SHA3: CryptoJS.HmacSHA3(input, args[0]), + 'RIPEMD-160': CryptoJS.HmacRIPEMD160(input, args[0]), + }; + return execute[hash_func].toString(CryptoJS.enc.Hex); + }, + + /** * Generate all hashes operation. * @@ -162,28 +162,28 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_all: function (input, args) { - var byte_array = Utils.str_to_byte_array(input), - output = "MD5: " + Hash.run_md5(input, []) + - "\nSHA1: " + Hash.run_sha1(input, []) + - "\nSHA2 224: " + Hash.run_sha224(input, []) + - "\nSHA2 256: " + Hash.run_sha256(input, []) + - "\nSHA2 384: " + Hash.run_sha384(input, []) + - "\nSHA2 512: " + Hash.run_sha512(input, []) + - "\nSHA3 224: " + Hash.run_sha3(input, ["224"]) + - "\nSHA3 256: " + Hash.run_sha3(input, ["256"]) + - "\nSHA3 384: " + Hash.run_sha3(input, ["384"]) + - "\nSHA3 512: " + Hash.run_sha3(input, ["512"]) + - "\nRIPEMD-160: " + Hash.run_ripemd160(input, []) + - "\n\nChecksums:" + - "\nFletcher-16: " + Checksum.run_fletcher16(byte_array, []) + - "\nAdler-32: " + Checksum.run_adler32(byte_array, []) + - "\nCRC-32: " + Checksum.run_crc32(byte_array, []); - - return output; - }, - - + run_all(input, args) { + let byte_array = Utils.str_to_byte_array(input), + output = `MD5: ${Hash.run_md5(input, []) + }\nSHA1: ${Hash.run_sha1(input, []) + }\nSHA2 224: ${Hash.run_sha224(input, []) + }\nSHA2 256: ${Hash.run_sha256(input, []) + }\nSHA2 384: ${Hash.run_sha384(input, []) + }\nSHA2 512: ${Hash.run_sha512(input, []) + }\nSHA3 224: ${Hash.run_sha3(input, ['224']) + }\nSHA3 256: ${Hash.run_sha3(input, ['256']) + }\nSHA3 384: ${Hash.run_sha3(input, ['384']) + }\nSHA3 512: ${Hash.run_sha3(input, ['512']) + }\nRIPEMD-160: ${Hash.run_ripemd160(input, []) + }\n\nChecksums:` + + `\nFletcher-16: ${Checksum.run_fletcher16(byte_array, []) + }\nAdler-32: ${Checksum.run_adler32(byte_array, []) + }\nCRC-32: ${Checksum.run_crc32(byte_array, [])}`; + + return output; + }, + + /** * Analyse hash operation. * @@ -191,151 +191,151 @@ var Hash = { * @param {Object[]} args * @returns {string} */ - run_analyse: function(input, args) { - input = input.replace(/\s/g, ""); - - var output = "", - byte_length = input.length / 2, - bit_length = byte_length * 8, - possible_hash_functions = []; - - if (!/^[a-f0-9]+$/i.test(input)) { - return "Invalid hash"; - } - - output += "Hash length: " + input.length + "\n" + - "Byte length: " + byte_length + "\n" + - "Bit length: " + bit_length + "\n\n" + - "Based on the length, this hash could have been generated by one of the following hashing functions:\n"; - - switch (bit_length) { - case 4: - possible_hash_functions = [ - "Fletcher-4", - "Luhn algorithm", - "Verhoeff algorithm", - ]; - break; - case 8: - possible_hash_functions = [ - "Fletcher-8", - ]; - break; - case 16: - possible_hash_functions = [ - "BSD checksum", - "CRC-16", - "SYSV checksum", - "Fletcher-16" - ]; - break; - case 32: - possible_hash_functions = [ - "CRC-32", - "Fletcher-32", - "Adler-32", - ]; - break; - case 64: - possible_hash_functions = [ - "CRC-64", - "RIPEMD-64", - "SipHash", - ]; - break; - case 128: - possible_hash_functions = [ - "MD5", - "MD4", - "MD2", - "HAVAL-128", - "RIPEMD-128", - "Snefru", - "Tiger-128", - ]; - break; - case 160: - possible_hash_functions = [ - "SHA-1", - "SHA-0", - "FSB-160", - "HAS-160", - "HAVAL-160", - "RIPEMD-160", - "Tiger-160", - ]; - break; - case 192: - possible_hash_functions = [ - "Tiger", - "HAVAL-192", - ]; - break; - case 224: - possible_hash_functions = [ - "SHA-224", - "SHA3-224", - "ECOH-224", - "FSB-224", - "HAVAL-224", - ]; - break; - case 256: - possible_hash_functions = [ - "SHA-256", - "SHA3-256", - "BLAKE-256", - "ECOH-256", - "FSB-256", - "GOST", - "Grøstl-256", - "HAVAL-256", - "PANAMA", - "RIPEMD-256", - "Snefru", - ]; - break; - case 320: - possible_hash_functions = [ - "RIPEMD-320", - ]; - break; - case 384: - possible_hash_functions = [ - "SHA-384", - "SHA3-384", - "ECOH-384", - "FSB-384", - ]; - break; - case 512: - possible_hash_functions = [ - "SHA-512", - "SHA3-512", - "BLAKE-512", - "ECOH-512", - "FSB-512", - "Grøstl-512", - "JH", - "MD6", - "Spectral Hash", - "SWIFFT", - "Whirlpool", - ]; - break; - case 1024: - possible_hash_functions = [ - "Fowler-Noll-Vo", - ]; - break; - default: - possible_hash_functions = [ - "Unknown" - ]; - break; - } - - return output + possible_hash_functions.join("\n"); - }, - + run_analyse(input, args) { + input = input.replace(/\s/g, ''); + + let output = '', + byte_length = input.length / 2, + bit_length = byte_length * 8, + possible_hash_functions = []; + + if (!/^[a-f0-9]+$/i.test(input)) { + return 'Invalid hash'; + } + + output += `Hash length: ${input.length}\n` + + `Byte length: ${byte_length}\n` + + `Bit length: ${bit_length}\n\n` + + 'Based on the length, this hash could have been generated by one of the following hashing functions:\n'; + + switch (bit_length) { + case 4: + possible_hash_functions = [ + 'Fletcher-4', + 'Luhn algorithm', + 'Verhoeff algorithm', + ]; + break; + case 8: + possible_hash_functions = [ + 'Fletcher-8', + ]; + break; + case 16: + possible_hash_functions = [ + 'BSD checksum', + 'CRC-16', + 'SYSV checksum', + 'Fletcher-16', + ]; + break; + case 32: + possible_hash_functions = [ + 'CRC-32', + 'Fletcher-32', + 'Adler-32', + ]; + break; + case 64: + possible_hash_functions = [ + 'CRC-64', + 'RIPEMD-64', + 'SipHash', + ]; + break; + case 128: + possible_hash_functions = [ + 'MD5', + 'MD4', + 'MD2', + 'HAVAL-128', + 'RIPEMD-128', + 'Snefru', + 'Tiger-128', + ]; + break; + case 160: + possible_hash_functions = [ + 'SHA-1', + 'SHA-0', + 'FSB-160', + 'HAS-160', + 'HAVAL-160', + 'RIPEMD-160', + 'Tiger-160', + ]; + break; + case 192: + possible_hash_functions = [ + 'Tiger', + 'HAVAL-192', + ]; + break; + case 224: + possible_hash_functions = [ + 'SHA-224', + 'SHA3-224', + 'ECOH-224', + 'FSB-224', + 'HAVAL-224', + ]; + break; + case 256: + possible_hash_functions = [ + 'SHA-256', + 'SHA3-256', + 'BLAKE-256', + 'ECOH-256', + 'FSB-256', + 'GOST', + 'Grøstl-256', + 'HAVAL-256', + 'PANAMA', + 'RIPEMD-256', + 'Snefru', + ]; + break; + case 320: + possible_hash_functions = [ + 'RIPEMD-320', + ]; + break; + case 384: + possible_hash_functions = [ + 'SHA-384', + 'SHA3-384', + 'ECOH-384', + 'FSB-384', + ]; + break; + case 512: + possible_hash_functions = [ + 'SHA-512', + 'SHA3-512', + 'BLAKE-512', + 'ECOH-512', + 'FSB-512', + 'Grøstl-512', + 'JH', + 'MD6', + 'Spectral Hash', + 'SWIFFT', + 'Whirlpool', + ]; + break; + case 1024: + possible_hash_functions = [ + 'Fowler-Noll-Vo', + ]; + break; + default: + possible_hash_functions = [ + 'Unknown', + ]; + break; + } + + return output + possible_hash_functions.join('\n'); + }, + }; diff --git a/src/js/operations/Hexdump.js b/src/js/operations/Hexdump.js index 7132ed8a..0deeac9e 100755 --- a/src/js/operations/Hexdump.js +++ b/src/js/operations/Hexdump.js @@ -9,24 +9,24 @@ * * @namespace */ -var Hexdump = { +const Hexdump = { /** * @constant * @default */ - WIDTH: 16, + WIDTH: 16, /** * @constant * @default */ - UPPER_CASE: false, + UPPER_CASE: false, /** * @constant * @default */ - INCLUDE_FINAL_LENGTH: false, - + INCLUDE_FINAL_LENGTH: false, + /** * To Hexdump operation. * @@ -34,39 +34,40 @@ var Hexdump = { * @param {Object[]} args * @returns {string} */ - run_to: function(input, args) { - var length = args[0] || Hexdump.WIDTH; - var upper_case = args[1]; - var include_final_length = args[2]; - - var output = "", padding = 2; - for (var i = 0; i < input.length; i += length) { - var buff = input.slice(i, i+length); - var hexa = ""; - for (var j = 0; j < buff.length; j++) { - hexa += Utils.hex(buff[j], padding) + " "; - } - - var line_no = Utils.hex(i, 8); - - if (upper_case) { - hexa = hexa.toUpperCase(); - line_no = line_no.toUpperCase(); - } - - output += line_no + " " + - Utils.pad_right(hexa, (length*(padding+1))) + - " |" + Utils.pad_right(Utils.printable(Utils.byte_array_to_chars(buff)), buff.length) + "|\n"; - - if (include_final_length && i+buff.length == input.length) { - output += Utils.hex(i+buff.length, 8) + "\n"; - } - } - - return output.slice(0, -1); - }, - - + run_to(input, args) { + const length = args[0] || Hexdump.WIDTH; + const upper_case = args[1]; + const include_final_length = args[2]; + + let output = '', + padding = 2; + for (let i = 0; i < input.length; i += length) { + const buff = input.slice(i, i + length); + let hexa = ''; + for (let j = 0; j < buff.length; j++) { + hexa += `${Utils.hex(buff[j], padding)} `; + } + + let line_no = Utils.hex(i, 8); + + if (upper_case) { + hexa = hexa.toUpperCase(); + line_no = line_no.toUpperCase(); + } + + output += `${line_no} ${ + Utils.pad_right(hexa, (length * (padding + 1))) + } |${Utils.pad_right(Utils.printable(Utils.byte_array_to_chars(buff)), buff.length)}|\n`; + + if (include_final_length && i + buff.length == input.length) { + output += `${Utils.hex(i + buff.length, 8)}\n`; + } + } + + return output.slice(0, -1); + }, + + /** * From Hexdump operation. * @@ -74,28 +75,29 @@ var Hexdump = { * @param {Object[]} args * @returns {byte_array} */ - run_from: function(input, args) { - var output = [], - regex = /^\s*(?:[\dA-F]{4,16}:?)?\s*((?:[\dA-F]{2}\s){1,8}(?:\s|[\dA-F]{2}-)(?:[\dA-F]{2}\s){1,8}|(?:[\dA-F]{2}\s|[\dA-F]{4}\s)+)/igm, - block, line; - - while (!!(block = regex.exec(input))) { - line = Utils.from_hex(block[1].replace(/-/g, " ")); - for (var i = 0; i < line.length; i++) { - output.push(line[i]); - } - } + run_from(input, args) { + let output = [], + regex = /^\s*(?:[\dA-F]{4,16}:?)?\s*((?:[\dA-F]{2}\s){1,8}(?:\s|[\dA-F]{2}-)(?:[\dA-F]{2}\s){1,8}|(?:[\dA-F]{2}\s|[\dA-F]{4}\s)+)/igm, + block, + line; + + while (block = regex.exec(input)) { + line = Utils.from_hex(block[1].replace(/-/g, ' ')); + for (let i = 0; i < line.length; i++) { + output.push(line[i]); + } + } // Is this a CyberChef hexdump or is it from a different tool? - var width = input.indexOf("\n"); - var w = (width - 13) / 4; + const width = input.indexOf('\n'); + const w = (width - 13) / 4; // w should be the specified width of the hexdump and therefore a round number - if (Math.floor(w) != w || input.indexOf("\r") != -1 || output.indexOf(13) != -1) { - app.options.attempt_highlight = false; - } - return output; - }, - - + if (Math.floor(w) != w || input.indexOf('\r') != -1 || output.indexOf(13) != -1) { + app.options.attempt_highlight = false; + } + return output; + }, + + /** * Highlight to hexdump * @@ -105,55 +107,56 @@ var Hexdump = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_to: function(pos, args) { + highlight_to(pos, args) { // Calculate overall selection - var w = args[0] || 16, - width = 14 + (w*4), - line = Math.floor(pos[0].start / w), - offset = pos[0].start % w, - start = 0, - end = 0; - - pos[0].start = line*width + 10 + offset*3; - - line = Math.floor(pos[0].end / w); - offset = pos[0].end % w; - if (offset === 0) { line--; offset = w; } - pos[0].end = line*width + 10 + offset*3 - 1; - + let w = args[0] || 16, + width = 14 + (w * 4), + line = Math.floor(pos[0].start / w), + offset = pos[0].start % w, + start = 0, + end = 0; + + pos[0].start = line * width + 10 + offset * 3; + + line = Math.floor(pos[0].end / w); + offset = pos[0].end % w; + if (offset === 0) { line--; offset = w; } + pos[0].end = line * width + 10 + offset * 3 - 1; + // Set up multiple selections for bytes - var start_line_num = Math.floor(pos[0].start / width); - var end_line_num = Math.floor(pos[0].end / width); - - if (start_line_num == end_line_num) { - pos.push(pos[0]); - } else { - start = pos[0].start; - end = (start_line_num+1) * width - w - 5; - pos.push({ start: start, end: end }); - while (end < pos[0].end) { - start_line_num++; - start = start_line_num * width + 10; - end = (start_line_num+1) * width - w - 5; - if (end > pos[0].end) end = pos[0].end; - pos.push({ start: start, end: end }); - } - } - + let start_line_num = Math.floor(pos[0].start / width); + const end_line_num = Math.floor(pos[0].end / width); + + if (start_line_num == end_line_num) { + pos.push(pos[0]); + } else { + start = pos[0].start; + end = (start_line_num + 1) * width - w - 5; + pos.push({ start, end }); + while (end < pos[0].end) { + start_line_num++; + start = start_line_num * width + 10; + end = (start_line_num + 1) * width - w - 5; + if (end > pos[0].end) end = pos[0].end; + pos.push({ start, end }); + } + } + // Set up multiple selections for ASCII - var len = pos.length, line_num = 0; - start = 0; - end = 0; - for (var i = 1; i < len; i++) { - line_num = Math.floor(pos[i].start / width); - start = (((pos[i].start - (line_num * width)) - 10) / 3) + (width - w -2) + (line_num * width); - end = (((pos[i].end + 1 - (line_num * width)) - 10) / 3) + (width - w -2) + (line_num * width); - pos.push({ start: start, end: end }); - } - return pos; - }, - - + let len = pos.length, + line_num = 0; + start = 0; + end = 0; + for (let i = 1; i < len; i++) { + line_num = Math.floor(pos[i].start / width); + start = (((pos[i].start - (line_num * width)) - 10) / 3) + (width - w - 2) + (line_num * width); + end = (((pos[i].end + 1 - (line_num * width)) - 10) / 3) + (width - w - 2) + (line_num * width); + pos.push({ start, end }); + } + return pos; + }, + + /** * Highlight from hexdump * @@ -163,33 +166,33 @@ var Hexdump = { * @param {Object[]} args * @returns {Object[]} pos */ - highlight_from: function(pos, args) { - var w = args[0] || 16; - var width = 14 + (w*4); - - var line = Math.floor(pos[0].start / width); - var offset = pos[0].start % width; - - if (offset < 10) { // In line number section - pos[0].start = line*w; - } else if (offset > 10+(w*3)) { // In ASCII section - pos[0].start = (line+1)*w; - } else { // In byte section - pos[0].start = line*w + Math.floor((offset-10)/3); - } - - line = Math.floor(pos[0].end / width); - offset = pos[0].end % width; - - if (offset < 10) { // In line number section - pos[0].end = line*w; - } else if (offset > 10+(w*3)) { // In ASCII section - pos[0].end = (line+1)*w; - } else { // In byte section - pos[0].end = line*w + Math.ceil((offset-10)/3); - } - - return pos; - }, - + highlight_from(pos, args) { + const w = args[0] || 16; + const width = 14 + (w * 4); + + let line = Math.floor(pos[0].start / width); + let offset = pos[0].start % width; + + if (offset < 10) { // In line number section + pos[0].start = line * w; + } else if (offset > 10 + (w * 3)) { // In ASCII section + pos[0].start = (line + 1) * w; + } else { // In byte section + pos[0].start = line * w + Math.floor((offset - 10) / 3); + } + + line = Math.floor(pos[0].end / width); + offset = pos[0].end % width; + + if (offset < 10) { // In line number section + pos[0].end = line * w; + } else if (offset > 10 + (w * 3)) { // In ASCII section + pos[0].end = (line + 1) * w; + } else { // In byte section + pos[0].end = line * w + Math.ceil((offset - 10) / 3); + } + + return pos; + }, + }; diff --git a/src/js/operations/IP.js b/src/js/operations/IP.js index 6a86df00..8f3701c0 100755 --- a/src/js/operations/IP.js +++ b/src/js/operations/IP.js @@ -9,24 +9,24 @@ * * @namespace */ -var IP = { +const IP = { /** * @constant * @default */ - INCLUDE_NETWORK_INFO: true, + INCLUDE_NETWORK_INFO: true, /** * @constant * @default */ - ENUMERATE_ADDRESSES: true, + ENUMERATE_ADDRESSES: true, /** * @constant * @default */ - ALLOW_LARGE_LIST: false, - + ALLOW_LARGE_LIST: false, + /** * Parse IP range operation. * @@ -34,43 +34,43 @@ var IP = { * @param {Object[]} args * @returns {string} */ - run_parse_ip_range: function (input, args) { - var include_network_info = args[0], - enumerate_addresses = args[1], - allow_large_list = args[2]; - + run_parse_ip_range(input, args) { + let include_network_info = args[0], + enumerate_addresses = args[1], + allow_large_list = args[2]; + // Check what type of input we are looking at - var ipv4_cidr_regex = /^\s*((?:\d{1,3}\.){3}\d{1,3})\/(\d\d?)\s*$/, - ipv4_range_regex = /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*-\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/, - ipv6_cidr_regex = /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\/(\d\d?\d?)\s*$/i, - ipv6_range_regex = /^\s*(((?=.*::)(?!.*::[^-]+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*-\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\17)::|:\b|(?![\dA-F])))|(?!\16\17)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i, - match; - - if (!!(match = ipv4_cidr_regex.exec(input))) { - return IP._ipv4_cidr_range(match, include_network_info, enumerate_addresses, allow_large_list); - } else if (!!(match = ipv4_range_regex.exec(input))) { - return IP._ipv4_hyphenated_range(match, include_network_info, enumerate_addresses, allow_large_list); - } else if (!!(match = ipv6_cidr_regex.exec(input))) { - return IP._ipv6_cidr_range(match, include_network_info); - } else if (!!(match = ipv6_range_regex.exec(input))) { - return IP._ipv6_hyphenated_range(match, include_network_info); - } else { - return "Invalid input.\n\nEnter either a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0). IPv6 also supported."; - } - }, - - + let ipv4_cidr_regex = /^\s*((?:\d{1,3}\.){3}\d{1,3})\/(\d\d?)\s*$/, + ipv4_range_regex = /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*-\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/, + ipv6_cidr_regex = /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\/(\d\d?\d?)\s*$/i, + ipv6_range_regex = /^\s*(((?=.*::)(?!.*::[^-]+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*-\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\17)::|:\b|(?![\dA-F])))|(?!\16\17)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i, + match; + + if (match = ipv4_cidr_regex.exec(input)) { + return IP._ipv4_cidr_range(match, include_network_info, enumerate_addresses, allow_large_list); + } else if (match = ipv4_range_regex.exec(input)) { + return IP._ipv4_hyphenated_range(match, include_network_info, enumerate_addresses, allow_large_list); + } else if (match = ipv6_cidr_regex.exec(input)) { + return IP._ipv6_cidr_range(match, include_network_info); + } else if (match = ipv6_range_regex.exec(input)) { + return IP._ipv6_hyphenated_range(match, include_network_info); + } else { + return 'Invalid input.\n\nEnter either a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0). IPv6 also supported.'; + } + }, + + /** * @constant * @default */ - IPv4_REGEX: /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/, + IPv4_REGEX: /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/, /** * @constant * @default */ - IPv6_REGEX: /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i, - + IPv6_REGEX: /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i, + /** * Parse IPv6 address operation. * @@ -78,150 +78,150 @@ var IP = { * @param {Object[]} args * @returns {string} */ - run_parse_ipv6: function (input, args) { - var match, - output = ""; - - if (!!(match = IP.IPv6_REGEX.exec(input))) { - var ipv6 = IP._str_to_ipv6(match[1]), - longhand = IP._ipv6_to_str(ipv6), - shorthand = IP._ipv6_to_str(ipv6, true); - - output += "Longhand: " + longhand + "\nShorthand: " + shorthand + "\n"; - + run_parse_ipv6(input, args) { + let match, + output = ''; + + if (match = IP.IPv6_REGEX.exec(input)) { + let ipv6 = IP._str_to_ipv6(match[1]), + longhand = IP._ipv6_to_str(ipv6), + shorthand = IP._ipv6_to_str(ipv6, true); + + output += `Longhand: ${longhand}\nShorthand: ${shorthand}\n`; + // Detect reserved addresses - if (shorthand == "::") { + if (shorthand == '::') { // Unspecified address - output += "\nUnspecified address corresponding to 0.0.0.0/32 in IPv4."; - output += "\nUnspecified address range: ::/128"; - } else if (shorthand == "::1") { + output += '\nUnspecified address corresponding to 0.0.0.0/32 in IPv4.'; + output += '\nUnspecified address range: ::/128'; + } else if (shorthand == '::1') { // Loopback address - output += "\nLoopback address to the local host corresponding to 127.0.0.1/8 in IPv4."; - output += "\nLoopback addresses range: ::1/128"; - } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 && + output += '\nLoopback address to the local host corresponding to 127.0.0.1/8 in IPv4.'; + output += '\nLoopback addresses range: ::1/128'; + } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 && ipv6[3] === 0 && ipv6[4] === 0 && ipv6[5] === 0xffff) { // IPv4-mapped IPv6 address - output += "\nIPv4-mapped IPv6 address detected. IPv6 clients will be handled natively by default, and IPv4 clients appear as IPv6 clients at their IPv4-mapped IPv6 address."; - output += "\nMapped IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]); - output += "\nIPv4-mapped IPv6 addresses range: ::ffff:0:0/96"; - } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 && + output += '\nIPv4-mapped IPv6 address detected. IPv6 clients will be handled natively by default, and IPv4 clients appear as IPv6 clients at their IPv4-mapped IPv6 address.'; + output += `\nMapped IPv4 address: ${IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7])}`; + output += '\nIPv4-mapped IPv6 addresses range: ::ffff:0:0/96'; + } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 && ipv6[3] === 0 && ipv6[4] === 0xffff && ipv6[5] === 0) { // IPv4-translated address - output += "\nIPv4-translated address detected. Used by Stateless IP/ICMP Translation (SIIT). See RFCs 6145 and 6052 for more details."; - output += "\nTranslated IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]); - output += "\nIPv4-translated addresses range: ::ffff:0:0:0/96"; - } else if (ipv6[0] === 0x100) { + output += '\nIPv4-translated address detected. Used by Stateless IP/ICMP Translation (SIIT). See RFCs 6145 and 6052 for more details.'; + output += `\nTranslated IPv4 address: ${IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7])}`; + output += '\nIPv4-translated addresses range: ::ffff:0:0:0/96'; + } else if (ipv6[0] === 0x100) { // Discard prefix per RFC 6666 - output += "\nDiscard prefix detected. This is used when forwarding traffic to a sinkhole router to mitigate the effects of a denial-of-service attack. See RFC 6666 for more details."; - output += "\nDiscard range: 100::/64"; - } else if (ipv6[0] === 0x64 && ipv6[1] === 0xff9b && ipv6[2] === 0 && + output += '\nDiscard prefix detected. This is used when forwarding traffic to a sinkhole router to mitigate the effects of a denial-of-service attack. See RFC 6666 for more details.'; + output += '\nDiscard range: 100::/64'; + } else if (ipv6[0] === 0x64 && ipv6[1] === 0xff9b && ipv6[2] === 0 && ipv6[3] === 0 && ipv6[4] === 0 && ipv6[5] === 0) { // IPv4/IPv6 translation per RFC 6052 - output += "\n'Well-Known' prefix for IPv4/IPv6 translation detected. See RFC 6052 for more details."; - output += "\nTranslated IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]); - output += "\n'Well-Known prefix range: 64:ff9b::/96"; - } else if (ipv6[0] === 0x2001 && ipv6[1] === 0) { + output += "\n'Well-Known' prefix for IPv4/IPv6 translation detected. See RFC 6052 for more details."; + output += `\nTranslated IPv4 address: ${IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7])}`; + output += "\n'Well-Known prefix range: 64:ff9b::/96"; + } else if (ipv6[0] === 0x2001 && ipv6[1] === 0) { // Teredo tunneling - output += "\nTeredo tunneling IPv6 address detected\n"; - var server_ipv4 = (ipv6[2] << 16) + ipv6[3], - udp_port = (~ipv6[5]) & 0xffff, - client_ipv4 = ~((ipv6[6] << 16) + ipv6[7]), - flag_cone = (ipv6[4] >>> 15) & 1, - flag_r = (ipv6[4] >>> 14) & 1, - flag_random1 = (ipv6[4] >>> 10) & 15, - flag_ug = (ipv6[4] >>> 8) & 3, - flag_random2 = ipv6[4] & 255; - - output += "\nServer IPv4 address: " + IP._ipv4_to_str(server_ipv4) + - "\nClient IPv4 address: " + IP._ipv4_to_str(client_ipv4) + - "\nClient UDP port: " + udp_port + - "\nFlags:" + - "\n\tCone: " + flag_cone; - - if (flag_cone) { - output += " (Client is behind a cone NAT)"; - } else { - output += " (Client is not behind a cone NAT)"; - } - - output += "\n\tR: " + flag_r; - - if (flag_r) { - output += " Error: This flag should be set to 0. See RFC 5991 and RFC 4380."; - } - - output += "\n\tRandom1: " + Utils.bin(flag_random1, 4) + - "\n\tUG: " + Utils.bin(flag_ug, 2); - - if (flag_ug) { - output += " Error: This flag should be set to 00. See RFC 4380."; - } - - output += "\n\tRandom2: " + Utils.bin(flag_random2, 8); - - if (!flag_r && !flag_ug && flag_random1 && flag_random2) { - output += "\n\nThis is a valid Teredo address which complies with RFC 4380 and RFC 5991."; - } else if (!flag_r && !flag_ug) { - output += "\n\nThis is a valid Teredo address which complies with RFC 4380, however it does not comply with RFC 5991 (Teredo Security Updates) as there are no randomised bits in the flag field."; - } else { - output += "\n\nThis is an invalid Teredo address."; - } - output += "\n\nTeredo prefix range: 2001::/32"; - } else if (ipv6[0] === 0x2001 && ipv6[1] === 0x2 && ipv6[2] === 0) { + output += '\nTeredo tunneling IPv6 address detected\n'; + let server_ipv4 = (ipv6[2] << 16) + ipv6[3], + udp_port = (~ipv6[5]) & 0xffff, + client_ipv4 = ~((ipv6[6] << 16) + ipv6[7]), + flag_cone = (ipv6[4] >>> 15) & 1, + flag_r = (ipv6[4] >>> 14) & 1, + flag_random1 = (ipv6[4] >>> 10) & 15, + flag_ug = (ipv6[4] >>> 8) & 3, + flag_random2 = ipv6[4] & 255; + + output += `\nServer IPv4 address: ${IP._ipv4_to_str(server_ipv4) + }\nClient IPv4 address: ${IP._ipv4_to_str(client_ipv4) + }\nClient UDP port: ${udp_port + }\nFlags:` + + `\n\tCone: ${flag_cone}`; + + if (flag_cone) { + output += ' (Client is behind a cone NAT)'; + } else { + output += ' (Client is not behind a cone NAT)'; + } + + output += `\n\tR: ${flag_r}`; + + if (flag_r) { + output += ' Error: This flag should be set to 0. See RFC 5991 and RFC 4380.'; + } + + output += `\n\tRandom1: ${Utils.bin(flag_random1, 4) + }\n\tUG: ${Utils.bin(flag_ug, 2)}`; + + if (flag_ug) { + output += ' Error: This flag should be set to 00. See RFC 4380.'; + } + + output += `\n\tRandom2: ${Utils.bin(flag_random2, 8)}`; + + if (!flag_r && !flag_ug && flag_random1 && flag_random2) { + output += '\n\nThis is a valid Teredo address which complies with RFC 4380 and RFC 5991.'; + } else if (!flag_r && !flag_ug) { + output += '\n\nThis is a valid Teredo address which complies with RFC 4380, however it does not comply with RFC 5991 (Teredo Security Updates) as there are no randomised bits in the flag field.'; + } else { + output += '\n\nThis is an invalid Teredo address.'; + } + output += '\n\nTeredo prefix range: 2001::/32'; + } else if (ipv6[0] === 0x2001 && ipv6[1] === 0x2 && ipv6[2] === 0) { // Benchmarking - output += "\nAssigned to the Benchmarking Methodology Working Group (BMWG) for benchmarking IPv6. Corresponds to 198.18.0.0/15 for benchmarking IPv4. See RFC 5180 for more details."; - output += "\nBMWG range: 2001:2::/48"; - } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x10 && ipv6[1] <= 0x1f) { + output += '\nAssigned to the Benchmarking Methodology Working Group (BMWG) for benchmarking IPv6. Corresponds to 198.18.0.0/15 for benchmarking IPv4. See RFC 5180 for more details.'; + output += '\nBMWG range: 2001:2::/48'; + } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x10 && ipv6[1] <= 0x1f) { // ORCHIDv1 - output += "\nDeprecated, previously ORCHIDv1 (Overlay Routable Cryptographic Hash Identifiers).\nORCHIDv1 range: 2001:10::/28\nORCHIDv2 now uses 2001:20::/28."; - } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x20 && ipv6[1] <= 0x2f) { + output += '\nDeprecated, previously ORCHIDv1 (Overlay Routable Cryptographic Hash Identifiers).\nORCHIDv1 range: 2001:10::/28\nORCHIDv2 now uses 2001:20::/28.'; + } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x20 && ipv6[1] <= 0x2f) { // ORCHIDv2 - output += "\nORCHIDv2 (Overlay Routable Cryptographic Hash Identifiers).\nThese are non-routed IPv6 addresses used for Cryptographic Hash Identifiers."; - output += "\nORCHIDv2 range: 2001:20::/28"; + output += '\nORCHIDv2 (Overlay Routable Cryptographic Hash Identifiers).\nThese are non-routed IPv6 addresses used for Cryptographic Hash Identifiers.'; + output += '\nORCHIDv2 range: 2001:20::/28'; } else if (ipv6[0] == 0x2001 && ipv6[1] == 0xdb8) { // Documentation - output += "\nThis is a documentation IPv6 address. This range should be used whenever an example IPv6 address is given or to model networking scenarios. Corresponds to 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 in IPv4."; - output += "\nDocumentation range: 2001:db8::/32"; + output += '\nThis is a documentation IPv6 address. This range should be used whenever an example IPv6 address is given or to model networking scenarios. Corresponds to 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 in IPv4.'; + output += '\nDocumentation range: 2001:db8::/32'; } else if (ipv6[0] == 0x2002) { // 6to4 - output += "\n6to4 transition IPv6 address detected. See RFC 3056 for more details." + - "\n6to4 prefix range: 2002::/16"; - - var v4_addr = IP._ipv4_to_str((ipv6[1] << 16) + ipv6[2]), - sla_id = ipv6[3], - interface_id_str = ipv6[4].toString(16) + ipv6[5].toString(16) + ipv6[6].toString(16) + ipv6[7].toString(16), - interface_id = new BigInteger(interface_id_str, 16); - - output += "\n\nEncapsulated IPv4 address: " + v4_addr + - "\nSLA ID: " + sla_id + - "\nInterface ID (base 16): " + interface_id_str + - "\nInterface ID (base 10): " + interface_id.toString(); + output += '\n6to4 transition IPv6 address detected. See RFC 3056 for more details.' + + '\n6to4 prefix range: 2002::/16'; + + let v4_addr = IP._ipv4_to_str((ipv6[1] << 16) + ipv6[2]), + sla_id = ipv6[3], + interface_id_str = ipv6[4].toString(16) + ipv6[5].toString(16) + ipv6[6].toString(16) + ipv6[7].toString(16), + interface_id = new BigInteger(interface_id_str, 16); + + output += `\n\nEncapsulated IPv4 address: ${v4_addr + }\nSLA ID: ${sla_id + }\nInterface ID (base 16): ${interface_id_str + }\nInterface ID (base 10): ${interface_id.toString()}`; } else if (ipv6[0] >= 0xfc00 && ipv6[0] <= 0xfdff) { // Unique local address - output += "\nThis is a unique local address comparable to the IPv4 private addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See RFC 4193 for more details."; - output += "\nUnique local addresses range: fc00::/7"; + output += '\nThis is a unique local address comparable to the IPv4 private addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See RFC 4193 for more details.'; + output += '\nUnique local addresses range: fc00::/7'; } else if (ipv6[0] >= 0xfe80 && ipv6[0] <= 0xfebf) { // Link-local address - output += "\nThis is a link-local address comparable to the auto-configuration addresses 169.254.0.0/16 in IPv4."; - output += "\nLink-local addresses range: fe80::/10"; + output += '\nThis is a link-local address comparable to the auto-configuration addresses 169.254.0.0/16 in IPv4.'; + output += '\nLink-local addresses range: fe80::/10'; } else if (ipv6[0] >= 0xff00) { // Multicast - output += "\nThis is a reserved multicast address."; - output += "\nMulticast addresses range: ff00::/8"; + output += '\nThis is a reserved multicast address.'; + output += '\nMulticast addresses range: ff00::/8'; } - } else { - return "Invalid IPv6 address"; - } - return output; - }, - - + } else { + return 'Invalid IPv6 address'; + } + return output; + }, + + /** * @constant * @default */ - IP_FORMAT_LIST: ["Dotted Decimal", "Decimal", "Hex"], - + IP_FORMAT_LIST: ['Dotted Decimal', 'Decimal', 'Hex'], + /** * Change IP format operation. * @@ -229,90 +229,90 @@ var IP = { * @param {Object[]} args * @returns {string} */ - run_change_ip_format: function(input, args) { - var in_format = args[0], - out_format = args[1], - lines = input.split("\n"), - output = "", - j = 0; - - - for (var i = 0; i < lines.length; i++) { - if (lines[i] === "") continue; - var ba_ip = []; - - if (in_format == out_format) { - output += lines[i] + "\n"; - continue; - } - + run_change_ip_format(input, args) { + let in_format = args[0], + out_format = args[1], + lines = input.split('\n'), + output = '', + j = 0; + + + for (let i = 0; i < lines.length; i++) { + if (lines[i] === '') continue; + let ba_ip = []; + + if (in_format == out_format) { + output += `${lines[i]}\n`; + continue; + } + // Convert to byte array IP from input format - switch (in_format) { - case "Dotted Decimal": - var octets = lines[i].split("."); - for (j = 0; j < octets.length; j++) { - ba_ip.push(parseInt(octets[j], 10)); - } - break; - case "Decimal": - var decimal = lines[i].toString(); - ba_ip.push(decimal >> 24 & 255); - ba_ip.push(decimal >> 16 & 255); - ba_ip.push(decimal >> 8 & 255); - ba_ip.push(decimal & 255); - break; - case "Hex": - ba_ip = Utils.hex_to_byte_array(lines[i]); - break; - default: - throw "Unsupported input IP format"; - } - + switch (in_format) { + case 'Dotted Decimal': + var octets = lines[i].split('.'); + for (j = 0; j < octets.length; j++) { + ba_ip.push(parseInt(octets[j], 10)); + } + break; + case 'Decimal': + var decimal = lines[i].toString(); + ba_ip.push(decimal >> 24 & 255); + ba_ip.push(decimal >> 16 & 255); + ba_ip.push(decimal >> 8 & 255); + ba_ip.push(decimal & 255); + break; + case 'Hex': + ba_ip = Utils.hex_to_byte_array(lines[i]); + break; + default: + throw 'Unsupported input IP format'; + } + // Convert byte array IP to output format - switch (out_format) { - case "Dotted Decimal": - var dd_ip = ""; - for (j = 0; j < ba_ip.length; j++) { - dd_ip += ba_ip[j] + "."; - } - output += dd_ip.slice(0, dd_ip.length-1) + "\n"; - break; - case "Decimal": - var dec_ip = ((ba_ip[0] << 24) | (ba_ip[1] << 16) | (ba_ip[2] << 8) | ba_ip[3]) >>> 0; - output += dec_ip.toString() + "\n"; - break; - case "Hex": - var hex_ip = ""; - for (j = 0; j < ba_ip.length; j++) { - hex_ip += Utils.hex(ba_ip[j]); - } - output += hex_ip + "\n"; - break; - default: - throw "Unsupported output IP format"; - } - } - - return output.slice(0, output.length-1); - }, - - + switch (out_format) { + case 'Dotted Decimal': + var dd_ip = ''; + for (j = 0; j < ba_ip.length; j++) { + dd_ip += `${ba_ip[j]}.`; + } + output += `${dd_ip.slice(0, dd_ip.length - 1)}\n`; + break; + case 'Decimal': + var dec_ip = ((ba_ip[0] << 24) | (ba_ip[1] << 16) | (ba_ip[2] << 8) | ba_ip[3]) >>> 0; + output += `${dec_ip.toString()}\n`; + break; + case 'Hex': + var hex_ip = ''; + for (j = 0; j < ba_ip.length; j++) { + hex_ip += Utils.hex(ba_ip[j]); + } + output += `${hex_ip}\n`; + break; + default: + throw 'Unsupported output IP format'; + } + } + + return output.slice(0, output.length - 1); + }, + + /** * @constant * @default */ - DELIM_OPTIONS: ["Line feed", "CRLF", "Space", "Comma", "Semi-colon"], + DELIM_OPTIONS: ['Line feed', 'CRLF', 'Space', 'Comma', 'Semi-colon'], /** * @constant * @default */ - GROUP_CIDR: 24, + GROUP_CIDR: 24, /** * @constant * @default */ - GROUP_ONLY_SUBNET: false, - + GROUP_ONLY_SUBNET: false, + /** * Group IP addresses operation. * @@ -320,94 +320,94 @@ var IP = { * @param {Object[]} args * @returns {string} */ - run_group_ips: function(input, args) { - var delim = Utils.char_rep[args[0]], - cidr = args[1], - only_subnets = args[2], - ipv4_mask = cidr < 32 ? ~(0xFFFFFFFF >>> cidr) : 0xFFFFFFFF, - ipv6_mask = IP._gen_ipv6_mask(cidr), - ips = input.split(delim), - ipv4_networks = {}, - ipv6_networks = {}, - match = null, - output = "", - ip = null, - network = null, - network_str = ""; - - if (cidr < 0 || cidr > 127) { - return "CIDR must be less than 32 for IPv4 or 128 for IPv6"; - } - + run_group_ips(input, args) { + let delim = Utils.char_rep[args[0]], + cidr = args[1], + only_subnets = args[2], + ipv4_mask = cidr < 32 ? ~(0xFFFFFFFF >>> cidr) : 0xFFFFFFFF, + ipv6_mask = IP._gen_ipv6_mask(cidr), + ips = input.split(delim), + ipv4_networks = {}, + ipv6_networks = {}, + match = null, + output = '', + ip = null, + network = null, + network_str = ''; + + if (cidr < 0 || cidr > 127) { + return 'CIDR must be less than 32 for IPv4 or 128 for IPv6'; + } + // Parse all IPs and add to network dictionary - for (var i = 0; i < ips.length; i++) { - if (!!(match = IP.IPv4_REGEX.exec(ips[i]))) { - ip = IP._str_to_ipv4(match[1]) >>> 0; - network = ip & ipv4_mask; - - if (ipv4_networks.hasOwnProperty(network)) { - ipv4_networks[network].push(ip); - } else { - ipv4_networks[network] = [ip]; - } - } else if (!!(match = IP.IPv6_REGEX.exec(ips[i]))) { - ip = IP._str_to_ipv6(match[1]); - network = []; - network_str = ""; - - for (var j = 0; j < 8; j++) { - network.push(ip[j] & ipv6_mask[j]); - } - - network_str = IP._ipv6_to_str(network, true); - - if (ipv6_networks.hasOwnProperty(network_str)) { - ipv6_networks[network_str].push(ip); - } else { - ipv6_networks[network_str] = [ip]; - } - } + for (var i = 0; i < ips.length; i++) { + if (match = IP.IPv4_REGEX.exec(ips[i])) { + ip = IP._str_to_ipv4(match[1]) >>> 0; + network = ip & ipv4_mask; + + if (ipv4_networks.hasOwnProperty(network)) { + ipv4_networks[network].push(ip); + } else { + ipv4_networks[network] = [ip]; } - - // Sort IPv4 network dictionaries and print - for (network in ipv4_networks) { - ipv4_networks[network] = ipv4_networks[network].sort(); - - output += IP._ipv4_to_str(network) + "/" + cidr + "\n"; - - if (!only_subnets) { - for (i = 0; i < ipv4_networks[network].length; i++) { - output += " " + IP._ipv4_to_str(ipv4_networks[network][i]) + "\n"; - } - output += "\n"; - } - } - - // Sort IPv6 network dictionaries and print - for (network_str in ipv6_networks) { - //ipv6_networks[network_str] = ipv6_networks[network_str].sort(); TODO - - output += network_str + "/" + cidr + "\n"; - - if (!only_subnets) { - for (i = 0; i < ipv6_networks[network_str].length; i++) { - output += " " + IP._ipv6_to_str(ipv6_networks[network_str][i], true) + "\n"; - } - output += "\n"; - } + } else if (match = IP.IPv6_REGEX.exec(ips[i])) { + ip = IP._str_to_ipv6(match[1]); + network = []; + network_str = ''; + + for (let j = 0; j < 8; j++) { + network.push(ip[j] & ipv6_mask[j]); } - return output; - }, - - + network_str = IP._ipv6_to_str(network, true); + + if (ipv6_networks.hasOwnProperty(network_str)) { + ipv6_networks[network_str].push(ip); + } else { + ipv6_networks[network_str] = [ip]; + } + } + } + + // Sort IPv4 network dictionaries and print + for (network in ipv4_networks) { + ipv4_networks[network] = ipv4_networks[network].sort(); + + output += `${IP._ipv4_to_str(network)}/${cidr}\n`; + + if (!only_subnets) { + for (i = 0; i < ipv4_networks[network].length; i++) { + output += ` ${IP._ipv4_to_str(ipv4_networks[network][i])}\n`; + } + output += '\n'; + } + } + + // Sort IPv6 network dictionaries and print + for (network_str in ipv6_networks) { + // ipv6_networks[network_str] = ipv6_networks[network_str].sort(); TODO + + output += `${network_str}/${cidr}\n`; + + if (!only_subnets) { + for (i = 0; i < ipv6_networks[network_str].length; i++) { + output += ` ${IP._ipv6_to_str(ipv6_networks[network_str][i], true)}\n`; + } + output += '\n'; + } + } + + return output; + }, + + /** * @constant * @default * @private */ - _LARGE_RANGE_ERROR: "The specified range contains more than 65,536 addresses. Running this query could crash your browser. If you want to run it, select the \"Allow large queries\" option. You are advised to turn off \"Auto Bake\" whilst editing large ranges.", - + _LARGE_RANGE_ERROR: 'The specified range contains more than 65,536 addresses. Running this query could crash your browser. If you want to run it, select the "Allow large queries" option. You are advised to turn off "Auto Bake" whilst editing large ranges.', + /** * Parses an IPv4 CIDR range (e.g. 192.168.0.0/24) and displays information about it. * @@ -418,38 +418,38 @@ var IP = { * @param {boolean} allow_large_list * @returns {string} */ - _ipv4_cidr_range: function(cidr, include_network_info, enumerate_addresses, allow_large_list) { - var output = "", - network = IP._str_to_ipv4(cidr[1]), - cidr_range = parseInt(cidr[2], 10); - - if (cidr_range < 0 || cidr_range > 31) { - return "IPv4 CIDR must be less than 32"; - } - - var mask = ~(0xFFFFFFFF >>> cidr_range), - ip1 = network & mask, - ip2 = ip1 | ~mask; - - if (include_network_info) { - output += "Network: " + IP._ipv4_to_str(network) + "\n"; - output += "CIDR: " + cidr_range + "\n"; - output += "Mask: " + IP._ipv4_to_str(mask) + "\n"; - output += "Range: " + IP._ipv4_to_str(ip1) + " - " + IP._ipv4_to_str(ip2) + "\n"; - output += "Total addresses in range: " + (((ip2 - ip1) >>> 0) + 1) + "\n\n"; - } - - if (enumerate_addresses) { - if (cidr_range >= 16 || allow_large_list) { - output += IP._generate_ipv4_range(ip1, ip2).join("\n"); - } else { - output += IP._LARGE_RANGE_ERROR; - } - } - return output; - }, - - + _ipv4_cidr_range(cidr, include_network_info, enumerate_addresses, allow_large_list) { + let output = '', + network = IP._str_to_ipv4(cidr[1]), + cidr_range = parseInt(cidr[2], 10); + + if (cidr_range < 0 || cidr_range > 31) { + return 'IPv4 CIDR must be less than 32'; + } + + let mask = ~(0xFFFFFFFF >>> cidr_range), + ip1 = network & mask, + ip2 = ip1 | ~mask; + + if (include_network_info) { + output += `Network: ${IP._ipv4_to_str(network)}\n`; + output += `CIDR: ${cidr_range}\n`; + output += `Mask: ${IP._ipv4_to_str(mask)}\n`; + output += `Range: ${IP._ipv4_to_str(ip1)} - ${IP._ipv4_to_str(ip2)}\n`; + output += `Total addresses in range: ${((ip2 - ip1) >>> 0) + 1}\n\n`; + } + + if (enumerate_addresses) { + if (cidr_range >= 16 || allow_large_list) { + output += IP._generate_ipv4_range(ip1, ip2).join('\n'); + } else { + output += IP._LARGE_RANGE_ERROR; + } + } + return output; + }, + + /** * Parses an IPv6 CIDR range (e.g. ff00::/48) and displays information about it. * @@ -458,46 +458,46 @@ var IP = { * @param {boolean} include_network_info * @returns {string} */ - _ipv6_cidr_range: function(cidr, include_network_info) { - var output = "", - network = IP._str_to_ipv6(cidr[1]), - cidr_range = parseInt(cidr[cidr.length-1], 10); - - if (cidr_range < 0 || cidr_range > 127) { - return "IPv6 CIDR must be less than 128"; - } - - var mask = IP._gen_ipv6_mask(cidr_range), - ip1 = new Array(8), - ip2 = new Array(8), - total_diff = "", - total = new Array(128); - - for (var i = 0; i < 8; i++) { - ip1[i] = network[i] & mask[i]; - ip2[i] = ip1[i] | (~mask[i] & 0x0000FFFF); - total_diff = (ip2[i] - ip1[i]).toString(2); - - if (total_diff != "0") { - for (var n = 0; n < total_diff.length; n++) { - total[i*16 + 16-(total_diff.length-n)] = total_diff[n]; - } - } - } + _ipv6_cidr_range(cidr, include_network_info) { + let output = '', + network = IP._str_to_ipv6(cidr[1]), + cidr_range = parseInt(cidr[cidr.length - 1], 10); - if (include_network_info) { - output += "Network: " + IP._ipv6_to_str(network) + "\n"; - output += "Shorthand: " + IP._ipv6_to_str(network, true) + "\n"; - output += "CIDR: " + cidr_range + "\n"; - output += "Mask: " + IP._ipv6_to_str(mask) + "\n"; - output += "Range: " + IP._ipv6_to_str(ip1) + " - " + IP._ipv6_to_str(ip2) + "\n"; - output += "Total addresses in range: " + (parseInt(total.join(""), 2) + 1) + "\n\n"; + if (cidr_range < 0 || cidr_range > 127) { + return 'IPv6 CIDR must be less than 128'; + } + + let mask = IP._gen_ipv6_mask(cidr_range), + ip1 = new Array(8), + ip2 = new Array(8), + total_diff = '', + total = new Array(128); + + for (let i = 0; i < 8; i++) { + ip1[i] = network[i] & mask[i]; + ip2[i] = ip1[i] | (~mask[i] & 0x0000FFFF); + total_diff = (ip2[i] - ip1[i]).toString(2); + + if (total_diff != '0') { + for (let n = 0; n < total_diff.length; n++) { + total[i * 16 + 16 - (total_diff.length - n)] = total_diff[n]; } - - return output; - }, - - + } + } + + if (include_network_info) { + output += `Network: ${IP._ipv6_to_str(network)}\n`; + output += `Shorthand: ${IP._ipv6_to_str(network, true)}\n`; + output += `CIDR: ${cidr_range}\n`; + output += `Mask: ${IP._ipv6_to_str(mask)}\n`; + output += `Range: ${IP._ipv6_to_str(ip1)} - ${IP._ipv6_to_str(ip2)}\n`; + output += `Total addresses in range: ${parseInt(total.join(''), 2) + 1}\n\n`; + } + + return output; + }, + + /** * Generates an IPv6 subnet mask given a CIDR value. * @@ -505,24 +505,24 @@ var IP = { * @param {number} cidr * @returns {number[]} */ - _gen_ipv6_mask: function(cidr) { - var mask = new Array(8), - shift; - - for (var i = 0; i < 8; i++) { - if (cidr > ((i+1)*16)) { - mask[i] = 0x0000FFFF; - } else { - shift = cidr-(i*16); - if (shift < 0) shift = 0; - mask[i] = ~((0x0000FFFF >>> shift) | 0xFFFF0000); - } - } - - return mask; - }, - - + _gen_ipv6_mask(cidr) { + let mask = new Array(8), + shift; + + for (let i = 0; i < 8; i++) { + if (cidr > ((i + 1) * 16)) { + mask[i] = 0x0000FFFF; + } else { + shift = cidr - (i * 16); + if (shift < 0) shift = 0; + mask[i] = ~((0x0000FFFF >>> shift) | 0xFFFF0000); + } + } + + return mask; + }, + + /** * Parses an IPv4 hyphenated range (e.g. 192.168.0.0 - 192.168.0.255) and displays information * about it. @@ -534,49 +534,49 @@ var IP = { * @param {boolean} allow_large_list * @returns {string} */ - _ipv4_hyphenated_range: function(range, include_network_info, enumerate_addresses, allow_large_list) { - var output = "", - ip1 = IP._str_to_ipv4(range[1]), - ip2 = IP._str_to_ipv4(range[2]); - + _ipv4_hyphenated_range(range, include_network_info, enumerate_addresses, allow_large_list) { + let output = '', + ip1 = IP._str_to_ipv4(range[1]), + ip2 = IP._str_to_ipv4(range[2]); + // Calculate mask - var diff = ip1 ^ ip2, - cidr = 32, - mask = 0; - - while (diff !== 0) { - diff >>= 1; - cidr--; - mask = (mask << 1) | 1; - } - - mask = ~mask >>> 0; - var network = ip1 & mask, - sub_ip1 = network & mask, - sub_ip2 = sub_ip1 | ~mask; - - if (include_network_info) { - output += "Minimum subnet required to hold this range:\n"; - output += "\tNetwork: " + IP._ipv4_to_str(network) + "\n"; - output += "\tCIDR: " + cidr + "\n"; - output += "\tMask: " + IP._ipv4_to_str(mask) + "\n"; - output += "\tSubnet range: " + IP._ipv4_to_str(sub_ip1) + " - " + IP._ipv4_to_str(sub_ip2) + "\n"; - output += "\tTotal addresses in subnet: " + (((sub_ip2 - sub_ip1) >>> 0) + 1) + "\n\n"; - output += "Range: " + IP._ipv4_to_str(ip1) + " - " + IP._ipv4_to_str(ip2) + "\n"; - output += "Total addresses in range: " + (((ip2 - ip1) >>> 0) + 1) + "\n\n"; - } - - if (enumerate_addresses) { - if (((ip2 - ip1) >>> 0) <= 65536 || allow_large_list) { - output += IP._generate_ipv4_range(ip1, ip2).join("\n"); - } else { - output += IP._LARGE_RANGE_ERROR; - } - } - return output; - }, - - + let diff = ip1 ^ ip2, + cidr = 32, + mask = 0; + + while (diff !== 0) { + diff >>= 1; + cidr--; + mask = (mask << 1) | 1; + } + + mask = ~mask >>> 0; + let network = ip1 & mask, + sub_ip1 = network & mask, + sub_ip2 = sub_ip1 | ~mask; + + if (include_network_info) { + output += 'Minimum subnet required to hold this range:\n'; + output += `\tNetwork: ${IP._ipv4_to_str(network)}\n`; + output += `\tCIDR: ${cidr}\n`; + output += `\tMask: ${IP._ipv4_to_str(mask)}\n`; + output += `\tSubnet range: ${IP._ipv4_to_str(sub_ip1)} - ${IP._ipv4_to_str(sub_ip2)}\n`; + output += `\tTotal addresses in subnet: ${((sub_ip2 - sub_ip1) >>> 0) + 1}\n\n`; + output += `Range: ${IP._ipv4_to_str(ip1)} - ${IP._ipv4_to_str(ip2)}\n`; + output += `Total addresses in range: ${((ip2 - ip1) >>> 0) + 1}\n\n`; + } + + if (enumerate_addresses) { + if (((ip2 - ip1) >>> 0) <= 65536 || allow_large_list) { + output += IP._generate_ipv4_range(ip1, ip2).join('\n'); + } else { + output += IP._LARGE_RANGE_ERROR; + } + } + return output; + }, + + /** * Parses an IPv6 hyphenated range (e.g. ff00:: - ffff::) and displays information about it. * @@ -585,37 +585,38 @@ var IP = { * @param {boolean} include_network_info * @returns {string} */ - _ipv6_hyphenated_range: function(range, include_network_info) { - var output = "", - ip1 = IP._str_to_ipv6(range[1]), - ip2 = IP._str_to_ipv6(range[14]); - - var t = "", - total = new Array(128); - + _ipv6_hyphenated_range(range, include_network_info) { + let output = '', + ip1 = IP._str_to_ipv6(range[1]), + ip2 = IP._str_to_ipv6(range[14]); + + let t = '', + total = new Array(128); + // Initialise total array to "0" - for (var i = 0; i < 128; i++) - total[i] = "0"; - - for (i = 0; i < 8; i++) { - t = (ip2[i] - ip1[i]).toString(2); - if (t != "0") { - for (var n = 0; n < t.length; n++) { - total[i*16 + 16-(t.length-n)] = t[n]; - } - } + for (var i = 0; i < 128; i++) { + total[i] = '0'; + } + + for (i = 0; i < 8; i++) { + t = (ip2[i] - ip1[i]).toString(2); + if (t != '0') { + for (let n = 0; n < t.length; n++) { + total[i * 16 + 16 - (t.length - n)] = t[n]; } - - if (include_network_info) { - output += "Range: " + IP._ipv6_to_str(ip1) + " - " + IP._ipv6_to_str(ip2) + "\n"; - output += "Shorthand range: " + IP._ipv6_to_str(ip1, true) + " - " + IP._ipv6_to_str(ip2, true) + "\n"; - output += "Total addresses in range: " + (parseInt(total.join(""), 2) + 1) + "\n\n"; - } - - return output; - }, - - + } + } + + if (include_network_info) { + output += `Range: ${IP._ipv6_to_str(ip1)} - ${IP._ipv6_to_str(ip2)}\n`; + output += `Shorthand range: ${IP._ipv6_to_str(ip1, true)} - ${IP._ipv6_to_str(ip2, true)}\n`; + output += `Total addresses in range: ${parseInt(total.join(''), 2) + 1}\n\n`; + } + + return output; + }, + + /** * Converts an IPv4 address from string format to numerical format. * @@ -627,33 +628,31 @@ var IP = { * // returns 168427520 * IP._str_to_ipv4("10.10.0.0"); */ - _str_to_ipv4: function (ip_str) { - var blocks = ip_str.split("."), - num_blocks = parse_blocks(blocks), - result = 0; - - result += num_blocks[0] << 24; - result += num_blocks[1] << 16; - result += num_blocks[2] << 8; - result += num_blocks[3]; - - return result; - - function parse_blocks(blocks) { - if (blocks.length != 4) - throw "More than 4 blocks."; - - var num_blocks = []; - for (var i = 0; i < 4; i++) { - num_blocks[i] = parseInt(blocks[i], 10); - if (num_blocks[i] < 0 || num_blocks[i] > 255) - throw "Block out of range."; - } - return num_blocks; - } - }, - - + _str_to_ipv4(ip_str) { + let blocks = ip_str.split('.'), + num_blocks = parse_blocks(blocks), + result = 0; + + result += num_blocks[0] << 24; + result += num_blocks[1] << 16; + result += num_blocks[2] << 8; + result += num_blocks[3]; + + return result; + + function parse_blocks(blocks) { + if (blocks.length != 4) { throw 'More than 4 blocks.'; } + + const num_blocks = []; + for (let i = 0; i < 4; i++) { + num_blocks[i] = parseInt(blocks[i], 10); + if (num_blocks[i] < 0 || num_blocks[i] > 255) { throw 'Block out of range.'; } + } + return num_blocks; + } + }, + + /** * Converts an IPv4 address from numerical format to string format. * @@ -665,16 +664,16 @@ var IP = { * // returns "10.10.0.0" * IP._ipv4_to_str(168427520); */ - _ipv4_to_str: function(ip_int) { - var blockA = (ip_int >> 24) & 255, - blockB = (ip_int >> 16) & 255, - blockC = (ip_int >> 8) & 255, - blockD = ip_int & 255; - - return blockA + "." + blockB + "." + blockC + "." + blockD; - }, - - + _ipv4_to_str(ip_int) { + let blockA = (ip_int >> 24) & 255, + blockB = (ip_int >> 16) & 255, + blockC = (ip_int >> 8) & 255, + blockD = ip_int & 255; + + return `${blockA}.${blockB}.${blockC}.${blockD}`; + }, + + /** * Converts an IPv6 address from string format to numerical array format. * @@ -686,37 +685,39 @@ var IP = { * // returns [65280, 0, 0, 0, 0, 0, 4369, 8738] * IP._str_to_ipv6("ff00::1111:2222"); */ - _str_to_ipv6: function(ip_str) { - var blocks = ip_str.split(":"), - num_blocks = parse_blocks(blocks), - j = 0, - ipv6 = new Array(8); - - for (var i = 0; i < 8; i++) { - if (isNaN(num_blocks[j])) { - ipv6[i] = 0; - if (i == (8-num_blocks.slice(j).length)) j++; - } else { - ipv6[i] = num_blocks[j]; - j++; - } + _str_to_ipv6(ip_str) { + let blocks = ip_str.split(':'), + num_blocks = parse_blocks(blocks), + j = 0, + ipv6 = new Array(8); + + for (let i = 0; i < 8; i++) { + if (isNaN(num_blocks[j])) { + ipv6[i] = 0; + if (i == (8 - num_blocks.slice(j).length)) j++; + } else { + ipv6[i] = num_blocks[j]; + j++; + } + } + return ipv6; + + function parse_blocks(blocks) { + if (blocks.length < 3 || blocks.length > 8) { + throw 'Badly formatted IPv6 address.'; + } + const num_blocks = []; + for (let i = 0; i < blocks.length; i++) { + num_blocks[i] = parseInt(blocks[i], 16); + if (num_blocks[i] < 0 || num_blocks[i] > 65535) { + throw 'Block out of range.'; } - return ipv6; - - function parse_blocks(blocks) { - if (blocks.length < 3 || blocks.length > 8) - throw "Badly formatted IPv6 address."; - var num_blocks = []; - for (var i = 0; i < blocks.length; i++) { - num_blocks[i] = parseInt(blocks[i], 16); - if (num_blocks[i] < 0 || num_blocks[i] > 65535) - throw "Block out of range."; - } - return num_blocks; - } - }, - - + } + return num_blocks; + } + }, + + /** * Converts an IPv6 address from numerical array format to string format. * @@ -732,49 +733,50 @@ var IP = { * // returns "ff00:0000:0000:0000:0000:0000:1111:2222" * IP._ipv6_to_str([65280, 0, 0, 0, 0, 0, 4369, 8738], false); */ - _ipv6_to_str: function(ipv6, compact) { - var output = "", - skips = 0, - i = 0; - - if (compact) { - var start = -1, - end = -1, - s = 0, - e = -1; - - for (i = 0; i < 8; i++) { - if (ipv6[i] === 0 && e === (i-1)) { - e = i; - } else if (ipv6[i] === 0) { - s = i; e = i; - } - if (e >= 0 && (e-s) > (end - start)) { - start = s; - end = e; - } - } - - for (i = 0; i < 8; i++) { - if (i != start) { - output += Utils.hex(ipv6[i],1) + ":"; - } else { - output += ":"; - i = end; - if (end === 7) output += ":"; - } - } - if (output[0] === ":") - output = ":" + output; - } else { - for (i = 0; i < 8; i++) { - output += Utils.hex(ipv6[i],4) + ":"; - } + _ipv6_to_str(ipv6, compact) { + let output = '', + skips = 0, + i = 0; + + if (compact) { + let start = -1, + end = -1, + s = 0, + e = -1; + + for (i = 0; i < 8; i++) { + if (ipv6[i] === 0 && e === (i - 1)) { + e = i; + } else if (ipv6[i] === 0) { + s = i; e = i; } - return output.slice(0,output.length-1); - }, - - + if (e >= 0 && (e - s) > (end - start)) { + start = s; + end = e; + } + } + + for (i = 0; i < 8; i++) { + if (i != start) { + output += `${Utils.hex(ipv6[i], 1)}:`; + } else { + output += ':'; + i = end; + if (end === 7) output += ':'; + } + } + if (output[0] === ':') { + output = `:${output}`; + } + } else { + for (i = 0; i < 8; i++) { + output += `${Utils.hex(ipv6[i], 4)}:`; + } + } + return output.slice(0, output.length - 1); + }, + + /** * Generates a list of IPv4 addresses in string format between two given numerical values. * @@ -787,16 +789,16 @@ var IP = { * // returns ["0.0.0.1", "0.0.0.2", "0.0.0.3"] * IP._generate_ipv4_range(1, 3); */ - _generate_ipv4_range: function(ip, end_ip) { - var range = []; - if (end_ip >= ip) { - for (; ip <= end_ip; ip++) { - range.push(IP._ipv4_to_str(ip)); - } - } else { - range[0] = "Second IP address smaller than first."; - } - return range; - }, + _generate_ipv4_range(ip, end_ip) { + const range = []; + if (end_ip >= ip) { + for (; ip <= end_ip; ip++) { + range.push(IP._ipv4_to_str(ip)); + } + } else { + range[0] = 'Second IP address smaller than first.'; + } + return range; + }, }; diff --git a/src/js/operations/JS.js b/src/js/operations/JS.js index 076c6321..03f38a1d 100755 --- a/src/js/operations/JS.js +++ b/src/js/operations/JS.js @@ -9,34 +9,34 @@ * * @namespace */ -var JS = { - +const JS = { + /** * @constant * @default */ - PARSE_LOC: false, + PARSE_LOC: false, /** * @constant * @default */ - PARSE_RANGE: false, + PARSE_RANGE: false, /** * @constant * @default */ - PARSE_TOKENS: false, + PARSE_TOKENS: false, /** * @constant * @default */ - PARSE_COMMENT: false, + PARSE_COMMENT: false, /** * @constant * @default */ - PARSE_TOLERANT: false, - + PARSE_TOLERANT: false, + /** * JavaScript Parser operation. * @@ -44,47 +44,47 @@ var JS = { * @param {Object[]} args * @returns {string} */ - run_parse: function (input, args) { - var parse_loc = args[0], - parse_range = args[1], - parse_tokens = args[2], - parse_comment = args[3], - parse_tolerant = args[4], - result = {}, - options = { - loc: parse_loc, - range: parse_range, - tokens: parse_tokens, - comment: parse_comment, - tolerant: parse_tolerant - }; - - result = esprima.parse(input, options); - return JSON.stringify(result, null, 2); - }, - - + run_parse(input, args) { + let parse_loc = args[0], + parse_range = args[1], + parse_tokens = args[2], + parse_comment = args[3], + parse_tolerant = args[4], + result = {}, + options = { + loc: parse_loc, + range: parse_range, + tokens: parse_tokens, + comment: parse_comment, + tolerant: parse_tolerant, + }; + + result = esprima.parse(input, options); + return JSON.stringify(result, null, 2); + }, + + /** * @constant * @default */ - BEAUTIFY_INDENT: "\\t", + BEAUTIFY_INDENT: '\\t', /** * @constant * @default */ - BEAUTIFY_QUOTES: ["Auto", "Single", "Double"], + BEAUTIFY_QUOTES: ['Auto', 'Single', 'Double'], /** * @constant * @default */ - BEAUTIFY_SEMICOLONS: true, + BEAUTIFY_SEMICOLONS: true, /** * @constant * @default */ - BEAUTIFY_COMMENT: true, - + BEAUTIFY_COMMENT: true, + /** * JavaScript Beautify operation. * @@ -92,44 +92,45 @@ var JS = { * @param {Object[]} args * @returns {string} */ - run_beautify: function(input, args) { - var beautify_indent = args[0] || JS.BEAUTIFY_INDENT, - quotes = args[1].toLowerCase(), - beautify_semicolons = args[2], - beautify_comment = args[3], - result = "", - AST; - - try { - AST = esprima.parse(input, { - range: true, - tokens: true, - comment: true - }); - - var options = { - format: { - indent: { - style: beautify_indent - }, - quotes: quotes, - semicolons: beautify_semicolons, - }, - comment: beautify_comment - }; - - if (options.comment) - AST = escodegen.attachComments(AST, AST.comments, AST.tokens); - - result = escodegen.generate(AST, options); - } catch(e) { + run_beautify(input, args) { + let beautify_indent = args[0] || JS.BEAUTIFY_INDENT, + quotes = args[1].toLowerCase(), + beautify_semicolons = args[2], + beautify_comment = args[3], + result = '', + AST; + + try { + AST = esprima.parse(input, { + range: true, + tokens: true, + comment: true, + }); + + const options = { + format: { + indent: { + style: beautify_indent, + }, + quotes, + semicolons: beautify_semicolons, + }, + comment: beautify_comment, + }; + + if (options.comment) { + AST = escodegen.attachComments(AST, AST.comments, AST.tokens); + } + + result = escodegen.generate(AST, options); + } catch (e) { // Leave original error so the user can see the detail - throw "Unable to parse JavaScript.
" + e.message; - } - return result; - }, - - + throw `Unable to parse JavaScript.
${e.message}`; + } + return result; + }, + + /** * JavaScript Minify operation. * @@ -137,23 +138,23 @@ var JS = { * @param {Object[]} args * @returns {string} */ - run_minify: function(input, args) { - var result = "", - AST = esprima.parse(input), - optimised_AST = esmangle.optimize(AST, null), - mangled_AST = esmangle.mangle(optimised_AST); - - result = escodegen.generate(mangled_AST, { - format: { - renumber: true, - hexadecimal: true, - escapeless: true, - compact: true, - semicolons: false, - parentheses: false - } - }); - return result; - }, + run_minify(input, args) { + let result = '', + AST = esprima.parse(input), + optimised_AST = esmangle.optimize(AST, null), + mangled_AST = esmangle.mangle(optimised_AST); + + result = escodegen.generate(mangled_AST, { + format: { + renumber: true, + hexadecimal: true, + escapeless: true, + compact: true, + semicolons: false, + parentheses: false, + }, + }); + return result; + }, }; diff --git a/src/js/operations/MAC.js b/src/js/operations/MAC.js index 5a800b91..91b97b27 100755 --- a/src/js/operations/MAC.js +++ b/src/js/operations/MAC.js @@ -7,33 +7,33 @@ * * @namespace */ -var MAC = { +const MAC = { /** * @constant * @default */ - OUTPUT_CASE: ["Both", "Upper only", "Lower only"], + OUTPUT_CASE: ['Both', 'Upper only', 'Lower only'], /** * @constant * @default */ - NO_DELIM: true, + NO_DELIM: true, /** * @constant * @default */ - DASH_DELIM: true, + DASH_DELIM: true, /** * @constant * @default */ - COLON_DELIM: true, + COLON_DELIM: true, /** * @constant * @default */ - CISCO_STYLE: false, + CISCO_STYLE: false, /** * Format MAC addresses operation. @@ -42,47 +42,47 @@ var MAC = { * @param {Object[]} args * @returns {string} */ - run_format: function(input, args) { - if (!input) return ""; - - var output_case = args[0], - no_delim = args[1], - dash_delim = args[2], - colon_delim = args[3], - cisco_style = args[4], - output_list = [], - macs = input.toLowerCase().split(/[,\s\r\n]+/); + run_format(input, args) { + if (!input) return ''; - macs.forEach(function(mac) { - var cleanMac = mac.replace(/[:.-]+/g, ''), - macHyphen = cleanMac.replace(/(.{2}(?=.))/g, '$1-'), - macColon = cleanMac.replace(/(.{2}(?=.))/g, '$1:'), - macCisco = cleanMac.replace(/(.{4}(?=.))/g, '$1.'); - - if (output_case == "Lower only") { - if (no_delim) output_list.push(cleanMac); - if (dash_delim) output_list.push(macHyphen); - if (colon_delim) output_list.push(macColon); - if (cisco_style) output_list.push(macCisco); - } else if (output_case == "Upper only") { - if (no_delim) output_list.push(cleanMac.toUpperCase()); - if (dash_delim) output_list.push(macHyphen.toUpperCase()); - if (colon_delim) output_list.push(macColon.toUpperCase()); - if (cisco_style) output_list.push(macCisco.toUpperCase()); - } else { - if (no_delim) output_list.push(cleanMac, cleanMac.toUpperCase()); - if (dash_delim) output_list.push(macHyphen, macHyphen.toUpperCase()); - if (colon_delim) output_list.push(macColon, macColon.toUpperCase()); - if (cisco_style) output_list.push(macCisco, macCisco.toUpperCase()); - } - - output_list.push( - "" // Empty line to delimit groups + let output_case = args[0], + no_delim = args[1], + dash_delim = args[2], + colon_delim = args[3], + cisco_style = args[4], + output_list = [], + macs = input.toLowerCase().split(/[,\s\r\n]+/); + + macs.forEach((mac) => { + let cleanMac = mac.replace(/[:.-]+/g, ''), + macHyphen = cleanMac.replace(/(.{2}(?=.))/g, '$1-'), + macColon = cleanMac.replace(/(.{2}(?=.))/g, '$1:'), + macCisco = cleanMac.replace(/(.{4}(?=.))/g, '$1.'); + + if (output_case == 'Lower only') { + if (no_delim) output_list.push(cleanMac); + if (dash_delim) output_list.push(macHyphen); + if (colon_delim) output_list.push(macColon); + if (cisco_style) output_list.push(macCisco); + } else if (output_case == 'Upper only') { + if (no_delim) output_list.push(cleanMac.toUpperCase()); + if (dash_delim) output_list.push(macHyphen.toUpperCase()); + if (colon_delim) output_list.push(macColon.toUpperCase()); + if (cisco_style) output_list.push(macCisco.toUpperCase()); + } else { + if (no_delim) output_list.push(cleanMac, cleanMac.toUpperCase()); + if (dash_delim) output_list.push(macHyphen, macHyphen.toUpperCase()); + if (colon_delim) output_list.push(macColon, macColon.toUpperCase()); + if (cisco_style) output_list.push(macCisco, macCisco.toUpperCase()); + } + + output_list.push( + '', // Empty line to delimit groups ); - }); + }); // Return the data as a string - return output_list.join('\n'); - }, + return output_list.join('\n'); + }, }; diff --git a/src/js/operations/Numberwang.js b/src/js/operations/Numberwang.js index a178b0b8..c7555489 100755 --- a/src/js/operations/Numberwang.js +++ b/src/js/operations/Numberwang.js @@ -4,7 +4,7 @@ * @author Unknown Male 282 * @namespace */ -var Numberwang = { +const Numberwang = { /** * Numberwang operation. Remain indoors. @@ -13,15 +13,15 @@ var Numberwang = { * @param {Object[]} args * @returns {string} */ - run: function(input, args) { - if (!input) return "Let's play Wangernumb!"; - var match = input.match(/\d+/); - if (match) { - return match[0] + "! That's Numberwang!"; - } else { + run(input, args) { + if (!input) return "Let's play Wangernumb!"; + const match = input.match(/\d+/); + if (match) { + return `${match[0]}! That's Numberwang!`; + } else { // That's a bad miss! - return "Sorry, that's not Numberwang. Let's rotate the board!"; - } - }, - + return "Sorry, that's not Numberwang. Let's rotate the board!"; + } + }, + }; diff --git a/src/js/operations/OS.js b/src/js/operations/OS.js index 90d24810..1a4228c9 100755 --- a/src/js/operations/OS.js +++ b/src/js/operations/OS.js @@ -7,7 +7,7 @@ * * @namespace */ -var OS = { +const OS = { /** * Parse UNIX file permissions operation. @@ -16,184 +16,184 @@ var OS = { * @param {Object[]} args * @returns {string} */ - run_parse_unix_perms: function(input, args) { - var perms = { - d : false, // directory - sl : false, // symbolic link - np : false, // named pipe - s : false, // socket - cd : false, // character device - bd : false, // block device - dr : false, // door - sb : false, // sticky bit - su : false, // setuid - sg : false, // setgid - ru : false, // read user - wu : false, // write user - eu : false, // execute user - rg : false, // read group - wg : false, // write group - eg : false, // execute group - ro : false, // read other - wo : false, // write other - eo : false // execute other - }, - d = 0, - u = 0, - g = 0, - o = 0, - output = "", - octal = null, - textual = null; - - if (input.search(/\s*[0-7]{1,4}\s*/i) === 0) { - // Input is octal - octal = input.match(/\s*([0-7]{1,4})\s*/i)[1]; + run_parse_unix_perms(input, args) { + let perms = { + d: false, // directory + sl: false, // symbolic link + np: false, // named pipe + s: false, // socket + cd: false, // character device + bd: false, // block device + dr: false, // door + sb: false, // sticky bit + su: false, // setuid + sg: false, // setgid + ru: false, // read user + wu: false, // write user + eu: false, // execute user + rg: false, // read group + wg: false, // write group + eg: false, // execute group + ro: false, // read other + wo: false, // write other + eo: false, // execute other + }, + d = 0, + u = 0, + g = 0, + o = 0, + output = '', + octal = null, + textual = null; - if (octal.length == 4) { - d = parseInt(octal[0], 8); - u = parseInt(octal[1], 8); - g = parseInt(octal[2], 8); - o = parseInt(octal[3], 8); - } else { - if (octal.length > 0) u = parseInt(octal[0], 8); - if (octal.length > 1) g = parseInt(octal[1], 8); - if (octal.length > 2) o = parseInt(octal[2], 8); - } - - perms.su = d >> 2 & 0x1; - perms.sg = d >> 1 & 0x1; - perms.sb = d & 0x1; - - perms.ru = u >> 2 & 0x1; - perms.wu = u >> 1 & 0x1; - perms.eu = u & 0x1; - - perms.rg = g >> 2 & 0x1; - perms.wg = g >> 1 & 0x1; - perms.eg = g & 0x1; - - perms.ro = o >> 2 & 0x1; - perms.wo = o >> 1 & 0x1; - perms.eo = o & 0x1; - } else if (input.search(/\s*[dlpcbDrwxsStT-]{1,10}\s*/) === 0) { + if (input.search(/\s*[0-7]{1,4}\s*/i) === 0) { + // Input is octal + octal = input.match(/\s*([0-7]{1,4})\s*/i)[1]; + + if (octal.length == 4) { + d = parseInt(octal[0], 8); + u = parseInt(octal[1], 8); + g = parseInt(octal[2], 8); + o = parseInt(octal[3], 8); + } else { + if (octal.length > 0) u = parseInt(octal[0], 8); + if (octal.length > 1) g = parseInt(octal[1], 8); + if (octal.length > 2) o = parseInt(octal[2], 8); + } + + perms.su = d >> 2 & 0x1; + perms.sg = d >> 1 & 0x1; + perms.sb = d & 0x1; + + perms.ru = u >> 2 & 0x1; + perms.wu = u >> 1 & 0x1; + perms.eu = u & 0x1; + + perms.rg = g >> 2 & 0x1; + perms.wg = g >> 1 & 0x1; + perms.eg = g & 0x1; + + perms.ro = o >> 2 & 0x1; + perms.wo = o >> 1 & 0x1; + perms.eo = o & 0x1; + } else if (input.search(/\s*[dlpcbDrwxsStT-]{1,10}\s*/) === 0) { // Input is textual - textual = input.match(/\s*([dlpcbDrwxsStT-]{1,10})\s*/)[1]; - - switch (textual[0]) { - case "d": - perms.d = true; - break; - case "l": - perms.sl = true; - break; - case "p": - perms.np = true; - break; - case "s": - perms.s = true; - break; - case "c": - perms.cd = true; - break; - case "b": - perms.bd = true; - break; - case "D": - perms.dr = true; - break; - } - - if (textual.length > 1) perms.ru = textual[1] == "r"; - if (textual.length > 2) perms.wu = textual[2] == "w"; - if (textual.length > 3) { - switch (textual[3]) { - case "x": - perms.eu = true; - break; - case "s": - perms.eu = true; - perms.su = true; - break; - case "S": - perms.su = true; - break; - } - } - - if (textual.length > 4) perms.rg = textual[4] == "r"; - if (textual.length > 5) perms.wg = textual[5] == "w"; - if (textual.length > 6) { - switch (textual[6]) { - case "x": - perms.eg = true; - break; - case "s": - perms.eg = true; - perms.sg = true; - break; - case "S": - perms.sg = true; - break; - } - } - - if (textual.length > 7) perms.ro = textual[7] == "r"; - if (textual.length > 8) perms.wo = textual[8] == "w"; - if (textual.length > 9) { - switch (textual[9]) { - case "x": - perms.eo = true; - break; - case "t": - perms.eo = true; - perms.sb = true; - break; - case "T": - perms.sb = true; - break; - } - } - } else { - return "Invalid input format.\nPlease enter the permissions in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format."; + textual = input.match(/\s*([dlpcbDrwxsStT-]{1,10})\s*/)[1]; + + switch (textual[0]) { + case 'd': + perms.d = true; + break; + case 'l': + perms.sl = true; + break; + case 'p': + perms.np = true; + break; + case 's': + perms.s = true; + break; + case 'c': + perms.cd = true; + break; + case 'b': + perms.bd = true; + break; + case 'D': + perms.dr = true; + break; + } + + if (textual.length > 1) perms.ru = textual[1] == 'r'; + if (textual.length > 2) perms.wu = textual[2] == 'w'; + if (textual.length > 3) { + switch (textual[3]) { + case 'x': + perms.eu = true; + break; + case 's': + perms.eu = true; + perms.su = true; + break; + case 'S': + perms.su = true; + break; } - - output += "Textual representation: " + OS._perms_to_str(perms); - output += "\nOctal representation: " + OS._perms_to_octal(perms); - + } + + if (textual.length > 4) perms.rg = textual[4] == 'r'; + if (textual.length > 5) perms.wg = textual[5] == 'w'; + if (textual.length > 6) { + switch (textual[6]) { + case 'x': + perms.eg = true; + break; + case 's': + perms.eg = true; + perms.sg = true; + break; + case 'S': + perms.sg = true; + break; + } + } + + if (textual.length > 7) perms.ro = textual[7] == 'r'; + if (textual.length > 8) perms.wo = textual[8] == 'w'; + if (textual.length > 9) { + switch (textual[9]) { + case 'x': + perms.eo = true; + break; + case 't': + perms.eo = true; + perms.sb = true; + break; + case 'T': + perms.sb = true; + break; + } + } + } else { + return 'Invalid input format.\nPlease enter the permissions in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.'; + } + + output += `Textual representation: ${OS._perms_to_str(perms)}`; + output += `\nOctal representation: ${OS._perms_to_octal(perms)}`; + // File type - if (textual) { - output += "\nFile type: " + OS._ft_from_perms(perms); - } - + if (textual) { + output += `\nFile type: ${OS._ft_from_perms(perms)}`; + } + // setuid, setgid - if (perms.su) { - output += "\nThe setuid flag is set"; - } - if (perms.sg) { - output += "\nThe setgid flag is set"; - } - + if (perms.su) { + output += '\nThe setuid flag is set'; + } + if (perms.sg) { + output += '\nThe setgid flag is set'; + } + // sticky bit - if (perms.sb) { - output += "\nThe sticky bit is set"; - } - + if (perms.sb) { + output += '\nThe sticky bit is set'; + } + // Permission matrix - output += "\n\n +---------+-------+-------+-------+\n" + - " | | User | Group | Other |\n" + - " +---------+-------+-------+-------+\n" + - " | Read | " + (perms.ru ? "X" : " ") + " | " + (perms.rg ? "X" : " ") + " | " + (perms.ro ? "X" : " ") + " |\n" + - " +---------+-------+-------+-------+\n" + - " | Write | " + (perms.wu ? "X" : " ") + " | " + (perms.wg ? "X" : " ") + " | " + (perms.wo ? "X" : " ") + " |\n" + - " +---------+-------+-------+-------+\n" + - " | Execute | " + (perms.eu ? "X" : " ") + " | " + (perms.eg ? "X" : " ") + " | " + (perms.eo ? "X" : " ") + " |\n" + - " +---------+-------+-------+-------+\n"; - - return output; - }, - - + output += `${'\n\n +---------+-------+-------+-------+\n' + + ' | | User | Group | Other |\n' + + ' +---------+-------+-------+-------+\n' + + ' | Read | '}${perms.ru ? 'X' : ' '} | ${perms.rg ? 'X' : ' '} | ${perms.ro ? 'X' : ' '} |\n` + + ' +---------+-------+-------+-------+\n' + + ` | Write | ${perms.wu ? 'X' : ' '} | ${perms.wg ? 'X' : ' '} | ${perms.wo ? 'X' : ' '} |\n` + + ' +---------+-------+-------+-------+\n' + + ` | Execute | ${perms.eu ? 'X' : ' '} | ${perms.eg ? 'X' : ' '} | ${perms.eo ? 'X' : ' '} |\n` + + ' +---------+-------+-------+-------+\n'; + + return output; + }, + + /** * Given a permissions object dictionary, generates a textual permissions string. * @@ -201,60 +201,60 @@ var OS = { * @param {Object} perms * @returns {string} */ - _perms_to_str: function(perms) { - var str = "", - type = "-"; - - if (perms.d) type = "d"; - if (perms.sl) type = "l"; - if (perms.np) type = "p"; - if (perms.s) type = "s"; - if (perms.cd) type = "c"; - if (perms.bd) type = "b"; - if (perms.dr) type = "D"; - - str = type; - - str += perms.ru ? "r" : "-"; - str += perms.wu ? "w" : "-"; - if (perms.eu && perms.su) { - str += "s"; - } else if (perms.su) { - str += "S"; - } else if (perms.eu) { - str += "x"; - } else { - str += "-"; - } - - str += perms.rg ? "r" : "-"; - str += perms.wg ? "w" : "-"; - if (perms.eg && perms.sg) { - str += "s"; - } else if (perms.sg) { - str += "S"; - } else if (perms.eg) { - str += "x"; - } else { - str += "-"; - } - - str += perms.ro ? "r" : "-"; - str += perms.wo ? "w" : "-"; - if (perms.eo && perms.sb) { - str += "t"; - } else if (perms.sb) { - str += "T"; - } else if (perms.eo) { - str += "x"; - } else { - str += "-"; - } - - return str; - }, - - + _perms_to_str(perms) { + let str = '', + type = '-'; + + if (perms.d) type = 'd'; + if (perms.sl) type = 'l'; + if (perms.np) type = 'p'; + if (perms.s) type = 's'; + if (perms.cd) type = 'c'; + if (perms.bd) type = 'b'; + if (perms.dr) type = 'D'; + + str = type; + + str += perms.ru ? 'r' : '-'; + str += perms.wu ? 'w' : '-'; + if (perms.eu && perms.su) { + str += 's'; + } else if (perms.su) { + str += 'S'; + } else if (perms.eu) { + str += 'x'; + } else { + str += '-'; + } + + str += perms.rg ? 'r' : '-'; + str += perms.wg ? 'w' : '-'; + if (perms.eg && perms.sg) { + str += 's'; + } else if (perms.sg) { + str += 'S'; + } else if (perms.eg) { + str += 'x'; + } else { + str += '-'; + } + + str += perms.ro ? 'r' : '-'; + str += perms.wo ? 'w' : '-'; + if (perms.eo && perms.sb) { + str += 't'; + } else if (perms.sb) { + str += 'T'; + } else if (perms.eo) { + str += 'x'; + } else { + str += '-'; + } + + return str; + }, + + /** * Given a permissions object dictionary, generates an octal permissions string. * @@ -262,32 +262,32 @@ var OS = { * @param {Object} perms * @returns {string} */ - _perms_to_octal: function(perms) { - var d = 0, - u = 0, - g = 0, - o = 0; - - if (perms.su) d += 4; - if (perms.sg) d += 2; - if (perms.sb) d += 1; - - if (perms.ru) u += 4; - if (perms.wu) u += 2; - if (perms.eu) u += 1; - - if (perms.rg) g += 4; - if (perms.wg) g += 2; - if (perms.eg) g += 1; - - if (perms.ro) o += 4; - if (perms.wo) o += 2; - if (perms.eo) o += 1; - - return d.toString() + u.toString() + g.toString() + o.toString(); - }, - - + _perms_to_octal(perms) { + let d = 0, + u = 0, + g = 0, + o = 0; + + if (perms.su) d += 4; + if (perms.sg) d += 2; + if (perms.sb) d += 1; + + if (perms.ru) u += 4; + if (perms.wu) u += 2; + if (perms.eu) u += 1; + + if (perms.rg) g += 4; + if (perms.wg) g += 2; + if (perms.eg) g += 1; + + if (perms.ro) o += 4; + if (perms.wo) o += 2; + if (perms.eo) o += 1; + + return d.toString() + u.toString() + g.toString() + o.toString(); + }, + + /** * Given a permissions object dictionary, returns the file type. * @@ -295,15 +295,15 @@ var OS = { * @param {Object} perms * @returns {string} */ - _ft_from_perms: function(perms) { - if (perms.d) return "Directory"; - if (perms.sl) return "Symbolic link"; - if (perms.np) return "Named pipe"; - if (perms.s) return "Socket"; - if (perms.cd) return "Character device"; - if (perms.bd) return "Block device"; - if (perms.dr) return "Door"; - return "Regular file"; - }, - + _ft_from_perms(perms) { + if (perms.d) return 'Directory'; + if (perms.sl) return 'Symbolic link'; + if (perms.np) return 'Named pipe'; + if (perms.s) return 'Socket'; + if (perms.cd) return 'Character device'; + if (perms.bd) return 'Block device'; + if (perms.dr) return 'Door'; + return 'Regular file'; + }, + }; diff --git a/src/js/operations/PublicKey.js b/src/js/operations/PublicKey.js index 7b7cae62..32b06155 100755 --- a/src/js/operations/PublicKey.js +++ b/src/js/operations/PublicKey.js @@ -9,14 +9,14 @@ * * @namespace */ -var PublicKey = { - +const PublicKey = { + /** * @constant * @default */ - X509_INPUT_FORMAT: ["PEM", "DER Hex", "Base64", "Raw"], - + X509_INPUT_FORMAT: ['PEM', 'DER Hex', 'Base64', 'Raw'], + /** * Parse X.509 certificate operation. * @@ -24,150 +24,150 @@ var PublicKey = { * @param {Object[]} args * @returns {string} */ - run_parse_x509: function (input, args) { - var cert = new X509(), - input_format = args[0]; - - if (!input.length) { - return "No input"; - } - - switch (input_format) { - case "DER Hex": - input = input.replace(/\s/g, ""); - cert.hex = input; - cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(input, "CERTIFICATE"); - break; - case "PEM": - cert.hex = X509.pemToHex(input); - cert.pem = input; - break; - case "Base64": - cert.hex = Utils.to_hex(Utils.from_base64(input, null, "byte_array"), ""); - cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, "CERTIFICATE"); - break; - case "Raw": - cert.hex = Utils.to_hex(Utils.str_to_byte_array(input), ""); - cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, "CERTIFICATE"); - break; - default: - throw "Undefined input format"; - } - - var version = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 0, 0]), - sn = cert.getSerialNumberHex(), - algorithm = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 2, 0]))), - issuer = cert.getIssuerString(), - not_before = cert.getNotBefore(), - not_after = cert.getNotAfter(), - subject = cert.getSubjectString(), - pk_algorithm = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 6, 0, 0]))), - pk = X509.getPublicKeyFromCertPEM(cert.pem), - pk_fields = [], - pk_str = "", - cert_sig_alg = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [1, 0]))), - cert_sig = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [2]).substr(2), - sig_str = "", - extensions = ASN1HEX.dump(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 7])); - - // Public Key fields - if (pk.type == "EC") { // ECDSA - pk_fields.push({ - key: "Curve Name", - value: pk.curveName - }); - pk_fields.push({ - key: "Length", - value: (((new BigInteger(pk.pubKeyHex, 16)).bitLength()-3) /2) + " bits" - }); - pk_fields.push({ - key: "pub", - value: PublicKey._format_byte_str(pk.pubKeyHex, 16, 18) - }); - } else if (pk.type == "DSA") { // DSA - pk_fields.push({ - key: "pub", - value: PublicKey._format_byte_str(pk.y.toString(16), 16, 18) - }); - pk_fields.push({ - key: "P", - value: PublicKey._format_byte_str(pk.p.toString(16), 16, 18) - }); - pk_fields.push({ - key: "Q", - value: PublicKey._format_byte_str(pk.q.toString(16), 16, 18) - }); - pk_fields.push({ - key: "G", - value: PublicKey._format_byte_str(pk.g.toString(16), 16, 18) - }); - } else if (pk.e) { // RSA - pk_fields.push({ - key: "Length", - value: pk.n.bitLength() + " bits" - }); - pk_fields.push({ - key: "Modulus", - value: PublicKey._format_byte_str(pk.n.toString(16), 16, 18) - }); - pk_fields.push({ - key: "Exponent", - value: pk.e + " (0x" + pk.e.toString(16) + ")" - }); - } else { - pk_fields.push({ - key: "Error", - value: "Unknown Public Key type" - }); - } - - // Signature fields - if (ASN1HEX.dump(cert_sig).indexOf("SEQUENCE") === 0) { // DSA or ECDSA - sig_str = " r: " + PublicKey._format_byte_str(ASN1HEX.getDecendantHexVByNthList(cert_sig, 0, [0]), 16, 18) + "\n" + - " s: " + PublicKey._format_byte_str(ASN1HEX.getDecendantHexVByNthList(cert_sig, 0, [1]), 16, 18) + "\n"; - } else { // RSA - sig_str = " Signature: " + PublicKey._format_byte_str(cert_sig, 16, 18) + "\n"; - } - - // Format Public Key fields - for (var i = 0; i < pk_fields.length; i++) { - pk_str += " " + pk_fields[i].key + ":" + - Utils.pad_left( - pk_fields[i].value + "\n", - 18 - (pk_fields[i].key.length + 3) + pk_fields[i].value.length + 1, - " " - ); - } - - var issuer_str = PublicKey._format_dn_str(issuer, 2), - nb_date = PublicKey._format_date(not_before), - na_date = PublicKey._format_date(not_after), - subject_str = PublicKey._format_dn_str(subject, 2), - cert_sig_str = PublicKey._format_byte_str(cert_sig, 16, 18); - - var output = "Version: " + (parseInt(version, 16) + 1) + " (0x" + version + ")\n" + - "Serial number: " + new BigInteger(sn, 16).toString() + " (0x" + sn + ")\n" + - "Algorithm ID: " + algorithm + "\n" + - "Validity\n" + - " Not Before: " + nb_date + " (dd-mm-yy hh:mm:ss) (" + not_before + ")\n" + - " Not After: " + na_date + " (dd-mm-yy hh:mm:ss) (" + not_after + ")\n" + - "Issuer\n" + - issuer_str + - "Subject\n" + - subject_str + - "Public Key\n" + - " Algorithm: " + pk_algorithm + "\n" + - pk_str + - "Certificate Signature\n" + - " Algorithm: " + cert_sig_alg + "\n" + - sig_str + - "\nExtensions (parsed ASN.1)\n" + - extensions; - - return output; - }, + run_parse_x509(input, args) { + let cert = new X509(), + input_format = args[0]; + + if (!input.length) { + return 'No input'; + } + + switch (input_format) { + case 'DER Hex': + input = input.replace(/\s/g, ''); + cert.hex = input; + cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(input, 'CERTIFICATE'); + break; + case 'PEM': + cert.hex = X509.pemToHex(input); + cert.pem = input; + break; + case 'Base64': + cert.hex = Utils.to_hex(Utils.from_base64(input, null, 'byte_array'), ''); + cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, 'CERTIFICATE'); + break; + case 'Raw': + cert.hex = Utils.to_hex(Utils.str_to_byte_array(input), ''); + cert.pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(cert.hex, 'CERTIFICATE'); + break; + default: + throw 'Undefined input format'; + } + + let version = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 0, 0]), + sn = cert.getSerialNumberHex(), + algorithm = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 2, 0]))), + issuer = cert.getIssuerString(), + not_before = cert.getNotBefore(), + not_after = cert.getNotAfter(), + subject = cert.getSubjectString(), + pk_algorithm = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 6, 0, 0]))), + pk = X509.getPublicKeyFromCertPEM(cert.pem), + pk_fields = [], + pk_str = '', + cert_sig_alg = KJUR.asn1.x509.OID.oid2name(KJUR.asn1.ASN1Util.oidHexToInt(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [1, 0]))), + cert_sig = ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [2]).substr(2), + sig_str = '', + extensions = ASN1HEX.dump(ASN1HEX.getDecendantHexVByNthList(cert.hex, 0, [0, 7])); + + // Public Key fields + if (pk.type == 'EC') { // ECDSA + pk_fields.push({ + key: 'Curve Name', + value: pk.curveName, + }); + pk_fields.push({ + key: 'Length', + value: `${((new BigInteger(pk.pubKeyHex, 16)).bitLength() - 3) / 2} bits`, + }); + pk_fields.push({ + key: 'pub', + value: PublicKey._format_byte_str(pk.pubKeyHex, 16, 18), + }); + } else if (pk.type == 'DSA') { // DSA + pk_fields.push({ + key: 'pub', + value: PublicKey._format_byte_str(pk.y.toString(16), 16, 18), + }); + pk_fields.push({ + key: 'P', + value: PublicKey._format_byte_str(pk.p.toString(16), 16, 18), + }); + pk_fields.push({ + key: 'Q', + value: PublicKey._format_byte_str(pk.q.toString(16), 16, 18), + }); + pk_fields.push({ + key: 'G', + value: PublicKey._format_byte_str(pk.g.toString(16), 16, 18), + }); + } else if (pk.e) { // RSA + pk_fields.push({ + key: 'Length', + value: `${pk.n.bitLength()} bits`, + }); + pk_fields.push({ + key: 'Modulus', + value: PublicKey._format_byte_str(pk.n.toString(16), 16, 18), + }); + pk_fields.push({ + key: 'Exponent', + value: `${pk.e} (0x${pk.e.toString(16)})`, + }); + } else { + pk_fields.push({ + key: 'Error', + value: 'Unknown Public Key type', + }); + } + + // Signature fields + if (ASN1HEX.dump(cert_sig).indexOf('SEQUENCE') === 0) { // DSA or ECDSA + sig_str = ` r: ${PublicKey._format_byte_str(ASN1HEX.getDecendantHexVByNthList(cert_sig, 0, [0]), 16, 18)}\n` + + ` s: ${PublicKey._format_byte_str(ASN1HEX.getDecendantHexVByNthList(cert_sig, 0, [1]), 16, 18)}\n`; + } else { // RSA + sig_str = ` Signature: ${PublicKey._format_byte_str(cert_sig, 16, 18)}\n`; + } + + // Format Public Key fields + for (let i = 0; i < pk_fields.length; i++) { + pk_str += ` ${pk_fields[i].key}:${ + Utils.pad_left( + `${pk_fields[i].value}\n`, + 18 - (pk_fields[i].key.length + 3) + pk_fields[i].value.length + 1, + ' ', + )}`; + } + + let issuer_str = PublicKey._format_dn_str(issuer, 2), + nb_date = PublicKey._format_date(not_before), + na_date = PublicKey._format_date(not_after), + subject_str = PublicKey._format_dn_str(subject, 2), + cert_sig_str = PublicKey._format_byte_str(cert_sig, 16, 18); + + const output = `Version: ${parseInt(version, 16) + 1} (0x${version})\n` + + `Serial number: ${new BigInteger(sn, 16).toString()} (0x${sn})\n` + + `Algorithm ID: ${algorithm}\n` + + 'Validity\n' + + ` Not Before: ${nb_date} (dd-mm-yy hh:mm:ss) (${not_before})\n` + + ` Not After: ${na_date} (dd-mm-yy hh:mm:ss) (${not_after})\n` + + `Issuer\n${ + issuer_str + }Subject\n${ + subject_str + }Public Key\n` + + ` Algorithm: ${pk_algorithm}\n${ + pk_str + }Certificate Signature\n` + + ` Algorithm: ${cert_sig_alg}\n${ + sig_str + }\nExtensions (parsed ASN.1)\n${ + extensions}`; + + return output; + }, + - /** * PEM to Hex operation. * @@ -175,25 +175,25 @@ var PublicKey = { * @param {Object[]} args * @returns {string} */ - run_pem_to_hex: function(input, args) { - if (input.indexOf("-----BEGIN") < 0) { + run_pem_to_hex(input, args) { + if (input.indexOf('-----BEGIN') < 0) { // Add header so that the KEYUTIL function works - input = "-----BEGIN CERTIFICATE-----" + input; - } - if (input.indexOf("-----END") < 0) { + input = `-----BEGIN CERTIFICATE-----${input}`; + } + if (input.indexOf('-----END') < 0) { // Add footer so that the KEYUTIL function works - input = input + "-----END CERTIFICATE-----"; - } - return KEYUTIL.getHexFromPEM(input); - }, - - + input = `${input}-----END CERTIFICATE-----`; + } + return KEYUTIL.getHexFromPEM(input); + }, + + /** * @constant * @default */ - PEM_HEADER_STRING: "CERTIFICATE", - + PEM_HEADER_STRING: 'CERTIFICATE', + /** * Hex to PEM operation. * @@ -201,11 +201,11 @@ var PublicKey = { * @param {Object[]} args * @returns {string} */ - run_hex_to_pem: function(input, args) { - return KJUR.asn1.ASN1Util.getPEMStringFromHex(input.replace(/\s/g, ""), args[0]); - }, - - + run_hex_to_pem(input, args) { + return KJUR.asn1.ASN1Util.getPEMStringFromHex(input.replace(/\s/g, ''), args[0]); + }, + + /** * Hex to Object Identifier operation. * @@ -213,11 +213,11 @@ var PublicKey = { * @param {Object[]} args * @returns {string} */ - run_hex_to_object_identifier: function(input, args) { - return KJUR.asn1.ASN1Util.oidHexToInt(input.replace(/\s/g, "")); - }, - - + run_hex_to_object_identifier(input, args) { + return KJUR.asn1.ASN1Util.oidHexToInt(input.replace(/\s/g, '')); + }, + + /** * Object Identifier to Hex operation. * @@ -225,17 +225,17 @@ var PublicKey = { * @param {Object[]} args * @returns {string} */ - run_object_identifier_to_hex: function(input, args) { - return KJUR.asn1.ASN1Util.oidIntToHex(input); - }, - - + run_object_identifier_to_hex(input, args) { + return KJUR.asn1.ASN1Util.oidIntToHex(input); + }, + + /** * @constant * @default */ - ASN1_TRUNCATE_LENGTH: 32, - + ASN1_TRUNCATE_LENGTH: 32, + /** * Parse ASN.1 hex string operation. * @@ -243,15 +243,15 @@ var PublicKey = { * @param {Object[]} args * @returns {string} */ - run_parse_asn1_hex_string: function(input, args) { - var truncate_len = args[1], - index = args[0]; - return ASN1HEX.dump(input.replace(/\s/g, ""), { - "ommit_long_octet": truncate_len - }, index); - }, - - + run_parse_asn1_hex_string(input, args) { + let truncate_len = args[1], + index = args[0]; + return ASN1HEX.dump(input.replace(/\s/g, ''), { + ommit_long_octet: truncate_len, + }, index); + }, + + /** * Formats Distinguished Name (DN) strings. * @@ -260,36 +260,36 @@ var PublicKey = { * @param {number} indent * @returns {string} */ - _format_dn_str: function(dn_str, indent) { - var output = "", - fields = dn_str.split(",/|"), - max_key_len = 0, - key, - value, - str; - - for (var i = 0; i < fields.length; i++) { - if (!fields[i].length) continue; - - key = fields[i].split("=")[0]; - - max_key_len = key.length > max_key_len ? key.length : max_key_len; - } - - for (i = 0; i < fields.length; i++) { - if (!fields[i].length) continue; - - key = fields[i].split("=")[0]; - value = fields[i].split("=")[1]; - str = Utils.pad_right(key, max_key_len) + " = " + value + "\n"; - - output += Utils.pad_left(str, indent + str.length, " "); - } - - return output; - }, - - + _format_dn_str(dn_str, indent) { + let output = '', + fields = dn_str.split(',/|'), + max_key_len = 0, + key, + value, + str; + + for (var i = 0; i < fields.length; i++) { + if (!fields[i].length) continue; + + key = fields[i].split('=')[0]; + + max_key_len = key.length > max_key_len ? key.length : max_key_len; + } + + for (i = 0; i < fields.length; i++) { + if (!fields[i].length) continue; + + key = fields[i].split('=')[0]; + value = fields[i].split('=')[1]; + str = `${Utils.pad_right(key, max_key_len)} = ${value}\n`; + + output += Utils.pad_left(str, indent + str.length, ' '); + } + + return output; + }, + + /** * Formats byte strings by adding line breaks and delimiters. * @@ -299,24 +299,24 @@ var PublicKey = { * @param {number} indent * @returns {string} */ - _format_byte_str: function(byte_str, length, indent) { - byte_str = Utils.to_hex(Utils.from_hex(byte_str), ":"); - length = length * 3; - var output = ""; - - for (var i = 0; i < byte_str.length; i += length) { - var str = byte_str.slice(i, i + length) + "\n"; - if (i === 0) { - output += str; - } else { - output += Utils.pad_left(str, indent + str.length, " "); - } - } - - return output.slice(0, output.length-1); - }, - - + _format_byte_str(byte_str, length, indent) { + byte_str = Utils.to_hex(Utils.from_hex(byte_str), ':'); + length *= 3; + let output = ''; + + for (let i = 0; i < byte_str.length; i += length) { + const str = `${byte_str.slice(i, i + length)}\n`; + if (i === 0) { + output += str; + } else { + output += Utils.pad_left(str, indent + str.length, ' '); + } + } + + return output.slice(0, output.length - 1); + }, + + /** * Formats dates. * @@ -324,15 +324,15 @@ var PublicKey = { * @param {string} date_str * @returns {string} */ - _format_date: function(date_str) { - return date_str[4] + date_str[5] + "/" + - date_str[2] + date_str[3] + "/" + - date_str[0] + date_str[1] + " " + - date_str[6] + date_str[7] + ":" + - date_str[8] + date_str[9] + ":" + - date_str[10] + date_str[11]; - }, - + _format_date(date_str) { + return `${date_str[4] + date_str[5]}/${ + date_str[2]}${date_str[3]}/${ + date_str[0]}${date_str[1]} ${ + date_str[6]}${date_str[7]}:${ + date_str[8]}${date_str[9]}:${ + date_str[10]}${date_str[11]}`; + }, + }; @@ -343,14 +343,14 @@ var PublicKey = { * @param {string} hDN - Hex DN string * @returns {string} */ -X509.hex2dn = function(hDN) { - var s = ""; - var a = ASN1HEX.getPosArrayOfChildren_AtObj(hDN, 0); - for (var i = 0; i < a.length; i++) { - var hRDN = ASN1HEX.getHexOfTLV_AtObj(hDN, a[i]); - s = s + ",/|" + X509.hex2rdn(hRDN); - } - return s; +X509.hex2dn = function (hDN) { + let s = ''; + const a = ASN1HEX.getPosArrayOfChildren_AtObj(hDN, 0); + for (let i = 0; i < a.length; i++) { + const hRDN = ASN1HEX.getHexOfTLV_AtObj(hDN, a[i]); + s = `${s},/|${X509.hex2rdn(hRDN)}`; + } + return s; }; @@ -363,17 +363,17 @@ X509.hex2dn = function(hDN) { * @constant */ X509.DN_ATTRHEX = { - '0603550403' : 'commonName', - '0603550404' : 'surname', - '0603550406' : 'countryName', - '0603550407' : 'localityName', - '0603550408' : 'stateOrProvinceName', - '0603550409' : 'streetAddress', - '060355040a' : 'organizationName', - '060355040b' : 'organizationalUnitName', - '060355040c' : 'title', - '0603550414' : 'telephoneNumber', - '060355042a' : 'givenName', + '0603550403': 'commonName', + '0603550404': 'surname', + '0603550406': 'countryName', + '0603550407': 'localityName', + '0603550408': 'stateOrProvinceName', + '0603550409': 'streetAddress', + '060355040a': 'organizationName', + '060355040b': 'organizationalUnitName', + '060355040c': 'title', + '0603550414': 'telephoneNumber', + '060355042a': 'givenName', // '0603551d0e' : 'id-ce-subjectKeyIdentifier', // '0603551d0f' : 'id-ce-keyUsage', // '0603551d11' : 'id-ce-subjectAltName', @@ -391,460 +391,460 @@ X509.DN_ATTRHEX = { // '06032a8648ce380403' : 'id-dsa-with-sha-1', // '06032b06010505070302' : 'id_kp_clientAuth', // '06032b06010505070304' : 'id_kp_securityemail', - '06032b06010505070201' : 'id_certificatePolicies', - '06036086480186f8420101' : 'netscape-cert-type', - '06036086480186f8420102' : 'netscape-base-url', - '06036086480186f8420103' : 'netscape-revocation-url', - '06036086480186f8420104' : 'netscape-ca-revocation-url', - '06036086480186f8420107' : 'netscape-cert-renewal-url', - '06036086480186f8420108' : 'netscape-ca-policy-url', - '06036086480186f842010c' : 'netscape-ssl-server-name', - '06036086480186f842010d' : 'netscape-comment', - '0603604c010201' : 'A1', - '0603604c010203' : 'A3', - '0603604c01020110' : 'Certification Practice Statement pointer', - '0603604c010301' : 'Dados do cert parte 1', - '0603604c010305' : 'Dados do cert parte 2', - '0603604c010306' : 'Dados do cert parte 3', - '06030992268993f22c640119' : 'domainComponent', - '06032a24a0f2a07d01010a' : 'Signet pilot', - '06032a24a0f2a07d01010b' : 'Signet intraNet', - '06032a24a0f2a07d010102' : 'Signet personal', - '06032a24a0f2a07d010114' : 'Signet securityPolicy', - '06032a24a0f2a07d010103' : 'Signet business', - '06032a24a0f2a07d010104' : 'Signet legal', - '06032a24a497a35301640101' : 'Certificates Australia policyIdentifier', - '06032a85702201' : 'seis-cp', - '06032a8570220101' : 'SEIS certificatePolicy-s10', - '06032a85702202' : 'SEIS pe', - '06032a85702203' : 'SEIS at', - '06032a8570220301' : 'SEIS at-personalIdentifier', - '06032a8648ce380201' : 'holdinstruction-none', - '06032a8648ce380202' : 'holdinstruction-callissuer', - '06032a8648ce380203' : 'holdinstruction-reject', - '06032a8648ce380401' : 'dsa', - '06032a8648ce380403' : 'dsaWithSha1', - '06032a8648ce3d01' : 'fieldType', - '06032a8648ce3d0101' : 'prime-field', - '06032a8648ce3d0102' : 'characteristic-two-field', - '06032a8648ce3d010201' : 'ecPublicKey', - '06032a8648ce3d010203' : 'characteristic-two-basis', - '06032a8648ce3d01020301' : 'onBasis', - '06032a8648ce3d01020302' : 'tpBasis', - '06032a8648ce3d01020303' : 'ppBasis', - '06032a8648ce3d02' : 'publicKeyType', - '06032a8648ce3d0201' : 'ecPublicKey', - '06032a8648ce3e0201' : 'dhPublicNumber', - '06032a864886f67d07' : 'nsn', - '06032a864886f67d0741' : 'nsn-ce', - '06032a864886f67d074100' : 'entrustVersInfo', - '06032a864886f67d0742' : 'nsn-alg', - '06032a864886f67d07420a' : 'cast5CBC', - '06032a864886f67d07420b' : 'cast5MAC', - '06032a864886f67d07420c' : 'pbeWithMD5AndCAST5-CBC', - '06032a864886f67d07420d' : 'passwordBasedMac', - '06032a864886f67d074203' : 'cast3CBC', - '06032a864886f67d0743' : 'nsn-oc', - '06032a864886f67d074300' : 'entrustUser', - '06032a864886f67d0744' : 'nsn-at', - '06032a864886f67d074400' : 'entrustCAInfo', - '06032a864886f67d07440a' : 'attributeCertificate', - '06032a864886f70d0101' : 'pkcs-1', - '06032a864886f70d010101' : 'rsaEncryption', - '06032a864886f70d010102' : 'md2withRSAEncryption', - '06032a864886f70d010103' : 'md4withRSAEncryption', - '06032a864886f70d010104' : 'md5withRSAEncryption', - '06032a864886f70d010105' : 'sha1withRSAEncryption', - '06032a864886f70d010106' : 'rsaOAEPEncryptionSET', - '06032a864886f70d010910020b' : 'SMIMEEncryptionKeyPreference', - '06032a864886f70d010c' : 'pkcs-12', - '06032a864886f70d010c01' : 'pkcs-12-PbeIds', - '06032a864886f70d010c0101' : 'pbeWithSHAAnd128BitRC4', - '06032a864886f70d010c0102' : 'pbeWithSHAAnd40BitRC4', - '06032a864886f70d010c0103' : 'pbeWithSHAAnd3-KeyTripleDES-CBC', - '06032a864886f70d010c0104' : 'pbeWithSHAAnd2-KeyTripleDES-CBC', - '06032a864886f70d010c0105' : 'pbeWithSHAAnd128BitRC2-CBC', - '06032a864886f70d010c0106' : 'pbeWithSHAAnd40BitRC2-CBC', - '06032a864886f70d010c0a' : 'pkcs-12Version1', - '06032a864886f70d010c0a01' : 'pkcs-12BadIds', - '06032a864886f70d010c0a0101' : 'pkcs-12-keyBag', - '06032a864886f70d010c0a0102' : 'pkcs-12-pkcs-8ShroudedKeyBag', - '06032a864886f70d010c0a0103' : 'pkcs-12-certBag', - '06032a864886f70d010c0a0104' : 'pkcs-12-crlBag', - '06032a864886f70d010c0a0105' : 'pkcs-12-secretBag', - '06032a864886f70d010c0a0106' : 'pkcs-12-safeContentsBag', - '06032a864886f70d010c02' : 'pkcs-12-ESPVKID', - '06032a864886f70d010c0201' : 'pkcs-12-PKCS8KeyShrouding', - '06032a864886f70d010c03' : 'pkcs-12-BagIds', - '06032a864886f70d010c0301' : 'pkcs-12-keyBagId', - '06032a864886f70d010c0302' : 'pkcs-12-certAndCRLBagId', - '06032a864886f70d010c0303' : 'pkcs-12-secretBagId', - '06032a864886f70d010c0304' : 'pkcs-12-safeContentsId', - '06032a864886f70d010c0305' : 'pkcs-12-pkcs-8ShroudedKeyBagId', - '06032a864886f70d010c04' : 'pkcs-12-CertBagID', - '06032a864886f70d010c0401' : 'pkcs-12-X509CertCRLBagID', - '06032a864886f70d010c0402' : 'pkcs-12-SDSICertBagID', - '06032a864886f70d010c05' : 'pkcs-12-OID', - '06032a864886f70d010c0501' : 'pkcs-12-PBEID', - '06032a864886f70d010c050101' : 'pkcs-12-PBEWithSha1And128BitRC4', - '06032a864886f70d010c050102' : 'pkcs-12-PBEWithSha1And40BitRC4', - '06032a864886f70d010c050103' : 'pkcs-12-PBEWithSha1AndTripleDESCBC', - '06032a864886f70d010c050104' : 'pkcs-12-PBEWithSha1And128BitRC2CBC', - '06032a864886f70d010c050105' : 'pkcs-12-PBEWithSha1And40BitRC2CBC', - '06032a864886f70d010c050106' : 'pkcs-12-PBEWithSha1AndRC4', - '06032a864886f70d010c050107' : 'pkcs-12-PBEWithSha1AndRC2CBC', - '06032a864886f70d010c0502' : 'pkcs-12-EnvelopingID', - '06032a864886f70d010c050201' : 'pkcs-12-RSAEncryptionWith128BitRC4', - '06032a864886f70d010c050202' : 'pkcs-12-RSAEncryptionWith40BitRC4', - '06032a864886f70d010c050203' : 'pkcs-12-RSAEncryptionWithTripleDES', - '06032a864886f70d010c0503' : 'pkcs-12-SignatureID', - '06032a864886f70d010c050301' : 'pkcs-12-RSASignatureWithSHA1Digest', - '06032a864886f70d0103' : 'pkcs-3', - '06032a864886f70d010301' : 'dhKeyAgreement', - '06032a864886f70d0105' : 'pkcs-5', - '06032a864886f70d010501' : 'pbeWithMD2AndDES-CBC', - '06032a864886f70d01050a' : 'pbeWithSHAAndDES-CBC', - '06032a864886f70d010503' : 'pbeWithMD5AndDES-CBC', - '06032a864886f70d010504' : 'pbeWithMD2AndRC2-CBC', - '06032a864886f70d010506' : 'pbeWithMD5AndRC2-CBC', - '06032a864886f70d010509' : 'pbeWithMD5AndXOR', - '06032a864886f70d0107' : 'pkcs-7', - '06032a864886f70d010701' : 'data', - '06032a864886f70d010702' : 'signedData', - '06032a864886f70d010703' : 'envelopedData', - '06032a864886f70d010704' : 'signedAndEnvelopedData', - '06032a864886f70d010705' : 'digestData', - '06032a864886f70d010706' : 'encryptedData', - '06032a864886f70d010707' : 'dataWithAttributes', - '06032a864886f70d010708' : 'encryptedPrivateKeyInfo', - '06032a864886f70d0109' : 'pkcs-9', - '06032a864886f70d010901' : 'emailAddress', - '06032a864886f70d01090a' : 'issuerAndSerialNumber', - '06032a864886f70d01090b' : 'passwordCheck', - '06032a864886f70d01090c' : 'publicKey', - '06032a864886f70d01090d' : 'signingDescription', - '06032a864886f70d01090e' : 'extensionReq', - '06032a864886f70d01090f' : 'sMIMECapabilities', - '06032a864886f70d01090f01' : 'preferSignedData', - '06032a864886f70d01090f02' : 'canNotDecryptAny', - '06032a864886f70d01090f03' : 'receiptRequest', - '06032a864886f70d01090f04' : 'receipt', - '06032a864886f70d01090f05' : 'contentHints', - '06032a864886f70d01090f06' : 'mlExpansionHistory', - '06032a864886f70d010910' : 'id-sMIME', - '06032a864886f70d01091000' : 'id-mod', - '06032a864886f70d0109100001' : 'id-mod-cms', - '06032a864886f70d0109100002' : 'id-mod-ess', - '06032a864886f70d01091001' : 'id-ct', - '06032a864886f70d0109100101' : 'id-ct-receipt', - '06032a864886f70d01091002' : 'id-aa', - '06032a864886f70d0109100201' : 'id-aa-receiptRequest', - '06032a864886f70d0109100202' : 'id-aa-securityLabel', - '06032a864886f70d0109100203' : 'id-aa-mlExpandHistory', - '06032a864886f70d0109100204' : 'id-aa-contentHint', - '06032a864886f70d010902' : 'unstructuredName', - '06032a864886f70d010914' : 'friendlyName', - '06032a864886f70d010915' : 'localKeyID', - '06032a864886f70d010916' : 'certTypes', - '06032a864886f70d01091601' : 'x509Certificate', - '06032a864886f70d01091602' : 'sdsiCertificate', - '06032a864886f70d010917' : 'crlTypes', - '06032a864886f70d01091701' : 'x509Crl', - '06032a864886f70d010903' : 'contentType', - '06032a864886f70d010904' : 'messageDigest', - '06032a864886f70d010905' : 'signingTime', - '06032a864886f70d010906' : 'countersignature', - '06032a864886f70d010907' : 'challengePassword', - '06032a864886f70d010908' : 'unstructuredAddress', - '06032a864886f70d010909' : 'extendedCertificateAttributes', - '06032a864886f70d02' : 'digestAlgorithm', - '06032a864886f70d0202' : 'md2', - '06032a864886f70d0204' : 'md4', - '06032a864886f70d0205' : 'md5', - '06032a864886f70d03' : 'encryptionAlgorithm', - '06032a864886f70d030a' : 'desCDMF', - '06032a864886f70d0302' : 'rc2CBC', - '06032a864886f70d0303' : 'rc2ECB', - '06032a864886f70d0304' : 'rc4', - '06032a864886f70d0305' : 'rc4WithMAC', - '06032a864886f70d0306' : 'DESX-CBC', - '06032a864886f70d0307' : 'DES-EDE3-CBC', - '06032a864886f70d0308' : 'RC5CBC', - '06032a864886f70d0309' : 'RC5-CBCPad', - '06032a864886f7140403' : 'microsoftExcel', - '06032a864886f7140404' : 'titledWithOID', - '06032a864886f7140405' : 'microsoftPowerPoint', - '06032b81051086480954' : 'x9-84', - '06032b8105108648095400' : 'x9-84-Module', - '06032b810510864809540001' : 'x9-84-Biometrics', - '06032b810510864809540002' : 'x9-84-CMS', - '06032b810510864809540003' : 'x9-84-Identifiers', - '06032b8105108648095401' : 'biometric', - '06032b810510864809540100' : 'id-unknown-Type', - '06032b810510864809540101' : 'id-body-Odor', - '06032b81051086480954010a' : 'id-palm', - '06032b81051086480954010b' : 'id-retina', - '06032b81051086480954010c' : 'id-signature', - '06032b81051086480954010d' : 'id-speech-Pattern', - '06032b81051086480954010e' : 'id-thermal-Image', - '06032b81051086480954010f' : 'id-vein-Pattern', - '06032b810510864809540110' : 'id-thermal-Face-Image', - '06032b810510864809540111' : 'id-thermal-Hand-Image', - '06032b810510864809540112' : 'id-lip-Movement', - '06032b810510864809540113' : 'id-gait', - '06032b810510864809540102' : 'id-dna', - '06032b810510864809540103' : 'id-ear-Shape', - '06032b810510864809540104' : 'id-facial-Features', - '06032b810510864809540105' : 'id-finger-Image', - '06032b810510864809540106' : 'id-finger-Geometry', - '06032b810510864809540107' : 'id-hand-Geometry', - '06032b810510864809540108' : 'id-iris-Features', - '06032b810510864809540109' : 'id-keystroke-Dynamics', - '06032b8105108648095402' : 'processing-algorithm', - '06032b8105108648095403' : 'matching-method', - '06032b8105108648095404' : 'format-Owner', - '06032b810510864809540400' : 'cbeff-Owner', - '06032b810510864809540401' : 'ibia-Owner', - '06032b81051086480954040101' : 'id-ibia-SAFLINK', - '06032b8105108648095404010a' : 'id-ibia-SecuGen', - '06032b8105108648095404010b' : 'id-ibia-PreciseBiometric', - '06032b8105108648095404010c' : 'id-ibia-Identix', - '06032b8105108648095404010d' : 'id-ibia-DERMALOG', - '06032b8105108648095404010e' : 'id-ibia-LOGICO', - '06032b8105108648095404010f' : 'id-ibia-NIST', - '06032b81051086480954040110' : 'id-ibia-A3Vision', - '06032b81051086480954040111' : 'id-ibia-NEC', - '06032b81051086480954040112' : 'id-ibia-STMicroelectronics', - '06032b81051086480954040102' : 'id-ibia-Bioscrypt', - '06032b81051086480954040103' : 'id-ibia-Visionics', - '06032b81051086480954040104' : 'id-ibia-InfineonTechnologiesAG', - '06032b81051086480954040105' : 'id-ibia-IridianTechnologies', - '06032b81051086480954040106' : 'id-ibia-Veridicom', - '06032b81051086480954040107' : 'id-ibia-CyberSIGN', - '06032b81051086480954040108' : 'id-ibia-eCryp.', - '06032b81051086480954040109' : 'id-ibia-FingerprintCardsAB', - '06032b810510864809540402' : 'x9-Owner', - '06032b0e021a05' : 'sha', - '06032b0e03020101' : 'rsa', - '06032b0e03020a' : 'desMAC', - '06032b0e03020b' : 'rsaSignature', - '06032b0e03020c' : 'dsa', - '06032b0e03020d' : 'dsaWithSHA', - '06032b0e03020e' : 'mdc2WithRSASignature', - '06032b0e03020f' : 'shaWithRSASignature', - '06032b0e030210' : 'dhWithCommonModulus', - '06032b0e030211' : 'desEDE', - '06032b0e030212' : 'sha', - '06032b0e030213' : 'mdc-2', - '06032b0e030202' : 'md4WitRSA', - '06032b0e03020201' : 'sqmod-N', - '06032b0e030214' : 'dsaCommon', - '06032b0e030215' : 'dsaCommonWithSHA', - '06032b0e030216' : 'rsaKeyTransport', - '06032b0e030217' : 'keyed-hash-seal', - '06032b0e030218' : 'md2WithRSASignature', - '06032b0e030219' : 'md5WithRSASignature', - '06032b0e03021a' : 'sha1', - '06032b0e03021b' : 'dsaWithSHA1', - '06032b0e03021c' : 'dsaWithCommonSHA1', - '06032b0e03021d' : 'sha-1WithRSAEncryption', - '06032b0e030203' : 'md5WithRSA', - '06032b0e03020301' : 'sqmod-NwithRSA', - '06032b0e030204' : 'md4WithRSAEncryption', - '06032b0e030206' : 'desECB', - '06032b0e030207' : 'desCBC', - '06032b0e030208' : 'desOFB', - '06032b0e030209' : 'desCFB', - '06032b0e030301' : 'simple-strong-auth-mechanism', - '06032b0e07020101' : 'ElGamal', - '06032b0e07020301' : 'md2WithRSA', - '06032b0e07020302' : 'md2WithElGamal', - '06032b2403' : 'algorithm', - '06032b240301' : 'encryptionAlgorithm', - '06032b24030101' : 'des', - '06032b240301010101' : 'desECBPad', - '06032b24030101010101' : 'desECBPadISO', - '06032b240301010201' : 'desCBCPad', - '06032b24030101020101' : 'desCBCPadISO', - '06032b24030102' : 'idea', - '06032b2403010201' : 'ideaECB', - '06032b240301020101' : 'ideaECBPad', - '06032b24030102010101' : 'ideaECBPadISO', - '06032b2403010202' : 'ideaCBC', - '06032b240301020201' : 'ideaCBCPad', - '06032b24030102020101' : 'ideaCBCPadISO', - '06032b2403010203' : 'ideaOFB', - '06032b2403010204' : 'ideaCFB', - '06032b24030103' : 'des-3', - '06032b240301030101' : 'des-3ECBPad', - '06032b24030103010101' : 'des-3ECBPadISO', - '06032b240301030201' : 'des-3CBCPad', - '06032b24030103020101' : 'des-3CBCPadISO', - '06032b240302' : 'hashAlgorithm', - '06032b24030201' : 'ripemd160', - '06032b24030202' : 'ripemd128', - '06032b24030203' : 'ripemd256', - '06032b24030204' : 'mdc2singleLength', - '06032b24030205' : 'mdc2doubleLength', - '06032b240303' : 'signatureAlgorithm', - '06032b24030301' : 'rsa', - '06032b2403030101' : 'rsaMitSHA-1', - '06032b2403030102' : 'rsaMitRIPEMD160', - '06032b24030302' : 'ellipticCurve', - '06032b240304' : 'signatureScheme', - '06032b24030401' : 'iso9796-1', - '06032b2403040201' : 'iso9796-2', - '06032b2403040202' : 'iso9796-2rsa', - '06032b2404' : 'attribute', - '06032b2405' : 'policy', - '06032b2406' : 'api', - '06032b240601' : 'manufacturerSpecific', - '06032b240602' : 'functionalitySpecific', - '06032b2407' : 'api', - '06032b240701' : 'keyAgreement', - '06032b240702' : 'keyTransport', - '06032b06010401927c0a0101' : 'UNINETT policyIdentifier', - '06032b0601040195180a' : 'ICE-TEL policyIdentifier', - '06032b0601040197552001' : 'cryptlibEnvelope', - '06032b0601040197552002' : 'cryptlibPrivateKey', - '060a2b060104018237' : 'Microsoft OID', - '060a2b0601040182370a' : 'Crypto 2.0', - '060a2b0601040182370a01' : 'certTrustList', - '060a2b0601040182370a0101' : 'szOID_SORTED_CTL', - '060a2b0601040182370a0a' : 'Microsoft CMC OIDs', - '060a2b0601040182370a0a01' : 'szOID_CMC_ADD_ATTRIBUTES', - '060a2b0601040182370a0b' : 'Microsoft certificate property OIDs', - '060a2b0601040182370a0b01' : 'szOID_CERT_PROP_ID_PREFIX', - '060a2b0601040182370a0c' : 'CryptUI', - '060a2b0601040182370a0c01' : 'szOID_ANY_APPLICATION_POLICY', - '060a2b0601040182370a02' : 'nextUpdateLocation', - '060a2b0601040182370a0301' : 'certTrustListSigning', - '060a2b0601040182370a030a' : 'szOID_KP_QUALIFIED_SUBORDINATION', - '060a2b0601040182370a030b' : 'szOID_KP_KEY_RECOVERY', - '060a2b0601040182370a030c' : 'szOID_KP_DOCUMENT_SIGNING', - '060a2b0601040182370a0302' : 'timeStampSigning', - '060a2b0601040182370a0303' : 'serverGatedCrypto', - '060a2b0601040182370a030301' : 'szOID_SERIALIZED', - '060a2b0601040182370a0304' : 'encryptedFileSystem', - '060a2b0601040182370a030401' : 'szOID_EFS_RECOVERY', - '060a2b0601040182370a0305' : 'szOID_WHQL_CRYPTO', - '060a2b0601040182370a0306' : 'szOID_NT5_CRYPTO', - '060a2b0601040182370a0307' : 'szOID_OEM_WHQL_CRYPTO', - '060a2b0601040182370a0308' : 'szOID_EMBEDDED_NT_CRYPTO', - '060a2b0601040182370a0309' : 'szOID_ROOT_LIST_SIGNER', - '060a2b0601040182370a0401' : 'yesnoTrustAttr', - '060a2b0601040182370a0501' : 'szOID_DRM', - '060a2b0601040182370a0502' : 'szOID_DRM_INDIVIDUALIZATION', - '060a2b0601040182370a0601' : 'szOID_LICENSES', - '060a2b0601040182370a0602' : 'szOID_LICENSE_SERVER', - '060a2b0601040182370a07' : 'szOID_MICROSOFT_RDN_PREFIX', - '060a2b0601040182370a0701' : 'szOID_KEYID_RDN', - '060a2b0601040182370a0801' : 'szOID_REMOVE_CERTIFICATE', - '060a2b0601040182370a0901' : 'szOID_CROSS_CERT_DIST_POINTS', - '060a2b0601040182370c' : 'Catalog', - '060a2b0601040182370c0101' : 'szOID_CATALOG_LIST', - '060a2b0601040182370c0102' : 'szOID_CATALOG_LIST_MEMBER', - '060a2b0601040182370c0201' : 'CAT_NAMEVALUE_OBJID', - '060a2b0601040182370c0202' : 'CAT_MEMBERINFO_OBJID', - '060a2b0601040182370d' : 'Microsoft PKCS10 OIDs', - '060a2b0601040182370d01' : 'szOID_RENEWAL_CERTIFICATE', - '060a2b0601040182370d0201' : 'szOID_ENROLLMENT_NAME_VALUE_PAIR', - '060a2b0601040182370d0202' : 'szOID_ENROLLMENT_CSP_PROVIDER', - '060a2b0601040182370d0203' : 'OS Version', - '060a2b0601040182370f' : 'Microsoft Java', - '060a2b06010401823710' : 'Microsoft Outlook/Exchange', - '060a2b0601040182371004' : 'Outlook Express', - '060a2b06010401823711' : 'Microsoft PKCS12 attributes', - '060a2b0601040182371101' : 'szOID_LOCAL_MACHINE_KEYSET', - '060a2b06010401823712' : 'Microsoft Hydra', - '060a2b06010401823713' : 'Microsoft ISPU Test', - '060a2b06010401823702' : 'Authenticode', - '060a2b06010401823702010a' : 'spcAgencyInfo', - '060a2b06010401823702010b' : 'spcStatementType', - '060a2b06010401823702010c' : 'spcSpOpusInfo', - '060a2b06010401823702010e' : 'certExtensions', - '060a2b06010401823702010f' : 'spcPelmageData', - '060a2b060104018237020112' : 'SPC_RAW_FILE_DATA_OBJID', - '060a2b060104018237020113' : 'SPC_STRUCTURED_STORAGE_DATA_OBJID', - '060a2b060104018237020114' : 'spcLink', - '060a2b060104018237020115' : 'individualCodeSigning', - '060a2b060104018237020116' : 'commercialCodeSigning', - '060a2b060104018237020119' : 'spcLink', - '060a2b06010401823702011a' : 'spcMinimalCriteriaInfo', - '060a2b06010401823702011b' : 'spcFinancialCriteriaInfo', - '060a2b06010401823702011c' : 'spcLink', - '060a2b06010401823702011d' : 'SPC_HASH_INFO_OBJID', - '060a2b06010401823702011e' : 'SPC_SIPINFO_OBJID', - '060a2b060104018237020104' : 'spcIndirectDataContext', - '060a2b0601040182370202' : 'CTL for Software Publishers Trusted CAs', - '060a2b060104018237020201' : 'szOID_TRUSTED_CODESIGNING_CA_LIST', - '060a2b060104018237020202' : 'szOID_TRUSTED_CLIENT_AUTH_CA_LIST', - '060a2b060104018237020203' : 'szOID_TRUSTED_SERVER_AUTH_CA_LIST', - '060a2b06010401823714' : 'Microsoft Enrollment Infrastructure', - '060a2b0601040182371401' : 'szOID_AUTO_ENROLL_CTL_USAGE', - '060a2b0601040182371402' : 'szOID_ENROLL_CERTTYPE_EXTENSION', - '060a2b060104018237140201' : 'szOID_ENROLLMENT_AGENT', - '060a2b060104018237140202' : 'szOID_KP_SMARTCARD_LOGON', - '060a2b060104018237140203' : 'szOID_NT_PRINCIPAL_NAME', - '060a2b0601040182371403' : 'szOID_CERT_MANIFOLD', - '06092b06010401823715' : 'Microsoft CertSrv Infrastructure', - '06092b0601040182371501' : 'szOID_CERTSRV_CA_VERSION', - '06092b0601040182371514' : 'Client Information', - '060a2b06010401823719' : 'Microsoft Directory Service', - '060a2b0601040182371901' : 'szOID_NTDS_REPLICATION', - '060a2b06010401823703' : 'Time Stamping', - '060a2b060104018237030201' : 'SPC_TIME_STAMP_REQUEST_OBJID', - '060a2b0601040182371e' : 'IIS', - '060a2b0601040182371f' : 'Windows updates and service packs', - '060a2b0601040182371f01' : 'szOID_PRODUCT_UPDATE', - '060a2b06010401823704' : 'Permissions', - '060a2b06010401823728' : 'Fonts', - '060a2b06010401823729' : 'Microsoft Licensing and Registration', - '060a2b0601040182372a' : 'Microsoft Corporate PKI (ITG)', - '060a2b06010401823758' : 'CAPICOM', - '060a2b0601040182375801' : 'szOID_CAPICOM_VERSION', - '060a2b0601040182375802' : 'szOID_CAPICOM_ATTRIBUTE', - '060a2b060104018237580201' : 'szOID_CAPICOM_DOCUMENT_NAME', - '060a2b060104018237580202' : 'szOID_CAPICOM_DOCUMENT_DESCRIPTION', - '060a2b0601040182375803' : 'szOID_CAPICOM_ENCRYPTED_DATA', - '060a2b060104018237580301' : 'szOID_CAPICOM_ENCRYPTED_CONTENT', - '06032b0601050507' : 'pkix', - '06032b060105050701' : 'privateExtension', - '06032b06010505070101' : 'authorityInfoAccess', - '06032b06010505070c02' : 'CMC Data', - '06032b060105050702' : 'policyQualifierIds', + '06032b06010505070201': 'id_certificatePolicies', + '06036086480186f8420101': 'netscape-cert-type', + '06036086480186f8420102': 'netscape-base-url', + '06036086480186f8420103': 'netscape-revocation-url', + '06036086480186f8420104': 'netscape-ca-revocation-url', + '06036086480186f8420107': 'netscape-cert-renewal-url', + '06036086480186f8420108': 'netscape-ca-policy-url', + '06036086480186f842010c': 'netscape-ssl-server-name', + '06036086480186f842010d': 'netscape-comment', + '0603604c010201': 'A1', + '0603604c010203': 'A3', + '0603604c01020110': 'Certification Practice Statement pointer', + '0603604c010301': 'Dados do cert parte 1', + '0603604c010305': 'Dados do cert parte 2', + '0603604c010306': 'Dados do cert parte 3', + '06030992268993f22c640119': 'domainComponent', + '06032a24a0f2a07d01010a': 'Signet pilot', + '06032a24a0f2a07d01010b': 'Signet intraNet', + '06032a24a0f2a07d010102': 'Signet personal', + '06032a24a0f2a07d010114': 'Signet securityPolicy', + '06032a24a0f2a07d010103': 'Signet business', + '06032a24a0f2a07d010104': 'Signet legal', + '06032a24a497a35301640101': 'Certificates Australia policyIdentifier', + '06032a85702201': 'seis-cp', + '06032a8570220101': 'SEIS certificatePolicy-s10', + '06032a85702202': 'SEIS pe', + '06032a85702203': 'SEIS at', + '06032a8570220301': 'SEIS at-personalIdentifier', + '06032a8648ce380201': 'holdinstruction-none', + '06032a8648ce380202': 'holdinstruction-callissuer', + '06032a8648ce380203': 'holdinstruction-reject', + '06032a8648ce380401': 'dsa', + '06032a8648ce380403': 'dsaWithSha1', + '06032a8648ce3d01': 'fieldType', + '06032a8648ce3d0101': 'prime-field', + '06032a8648ce3d0102': 'characteristic-two-field', + '06032a8648ce3d010201': 'ecPublicKey', + '06032a8648ce3d010203': 'characteristic-two-basis', + '06032a8648ce3d01020301': 'onBasis', + '06032a8648ce3d01020302': 'tpBasis', + '06032a8648ce3d01020303': 'ppBasis', + '06032a8648ce3d02': 'publicKeyType', + '06032a8648ce3d0201': 'ecPublicKey', + '06032a8648ce3e0201': 'dhPublicNumber', + '06032a864886f67d07': 'nsn', + '06032a864886f67d0741': 'nsn-ce', + '06032a864886f67d074100': 'entrustVersInfo', + '06032a864886f67d0742': 'nsn-alg', + '06032a864886f67d07420a': 'cast5CBC', + '06032a864886f67d07420b': 'cast5MAC', + '06032a864886f67d07420c': 'pbeWithMD5AndCAST5-CBC', + '06032a864886f67d07420d': 'passwordBasedMac', + '06032a864886f67d074203': 'cast3CBC', + '06032a864886f67d0743': 'nsn-oc', + '06032a864886f67d074300': 'entrustUser', + '06032a864886f67d0744': 'nsn-at', + '06032a864886f67d074400': 'entrustCAInfo', + '06032a864886f67d07440a': 'attributeCertificate', + '06032a864886f70d0101': 'pkcs-1', + '06032a864886f70d010101': 'rsaEncryption', + '06032a864886f70d010102': 'md2withRSAEncryption', + '06032a864886f70d010103': 'md4withRSAEncryption', + '06032a864886f70d010104': 'md5withRSAEncryption', + '06032a864886f70d010105': 'sha1withRSAEncryption', + '06032a864886f70d010106': 'rsaOAEPEncryptionSET', + '06032a864886f70d010910020b': 'SMIMEEncryptionKeyPreference', + '06032a864886f70d010c': 'pkcs-12', + '06032a864886f70d010c01': 'pkcs-12-PbeIds', + '06032a864886f70d010c0101': 'pbeWithSHAAnd128BitRC4', + '06032a864886f70d010c0102': 'pbeWithSHAAnd40BitRC4', + '06032a864886f70d010c0103': 'pbeWithSHAAnd3-KeyTripleDES-CBC', + '06032a864886f70d010c0104': 'pbeWithSHAAnd2-KeyTripleDES-CBC', + '06032a864886f70d010c0105': 'pbeWithSHAAnd128BitRC2-CBC', + '06032a864886f70d010c0106': 'pbeWithSHAAnd40BitRC2-CBC', + '06032a864886f70d010c0a': 'pkcs-12Version1', + '06032a864886f70d010c0a01': 'pkcs-12BadIds', + '06032a864886f70d010c0a0101': 'pkcs-12-keyBag', + '06032a864886f70d010c0a0102': 'pkcs-12-pkcs-8ShroudedKeyBag', + '06032a864886f70d010c0a0103': 'pkcs-12-certBag', + '06032a864886f70d010c0a0104': 'pkcs-12-crlBag', + '06032a864886f70d010c0a0105': 'pkcs-12-secretBag', + '06032a864886f70d010c0a0106': 'pkcs-12-safeContentsBag', + '06032a864886f70d010c02': 'pkcs-12-ESPVKID', + '06032a864886f70d010c0201': 'pkcs-12-PKCS8KeyShrouding', + '06032a864886f70d010c03': 'pkcs-12-BagIds', + '06032a864886f70d010c0301': 'pkcs-12-keyBagId', + '06032a864886f70d010c0302': 'pkcs-12-certAndCRLBagId', + '06032a864886f70d010c0303': 'pkcs-12-secretBagId', + '06032a864886f70d010c0304': 'pkcs-12-safeContentsId', + '06032a864886f70d010c0305': 'pkcs-12-pkcs-8ShroudedKeyBagId', + '06032a864886f70d010c04': 'pkcs-12-CertBagID', + '06032a864886f70d010c0401': 'pkcs-12-X509CertCRLBagID', + '06032a864886f70d010c0402': 'pkcs-12-SDSICertBagID', + '06032a864886f70d010c05': 'pkcs-12-OID', + '06032a864886f70d010c0501': 'pkcs-12-PBEID', + '06032a864886f70d010c050101': 'pkcs-12-PBEWithSha1And128BitRC4', + '06032a864886f70d010c050102': 'pkcs-12-PBEWithSha1And40BitRC4', + '06032a864886f70d010c050103': 'pkcs-12-PBEWithSha1AndTripleDESCBC', + '06032a864886f70d010c050104': 'pkcs-12-PBEWithSha1And128BitRC2CBC', + '06032a864886f70d010c050105': 'pkcs-12-PBEWithSha1And40BitRC2CBC', + '06032a864886f70d010c050106': 'pkcs-12-PBEWithSha1AndRC4', + '06032a864886f70d010c050107': 'pkcs-12-PBEWithSha1AndRC2CBC', + '06032a864886f70d010c0502': 'pkcs-12-EnvelopingID', + '06032a864886f70d010c050201': 'pkcs-12-RSAEncryptionWith128BitRC4', + '06032a864886f70d010c050202': 'pkcs-12-RSAEncryptionWith40BitRC4', + '06032a864886f70d010c050203': 'pkcs-12-RSAEncryptionWithTripleDES', + '06032a864886f70d010c0503': 'pkcs-12-SignatureID', + '06032a864886f70d010c050301': 'pkcs-12-RSASignatureWithSHA1Digest', + '06032a864886f70d0103': 'pkcs-3', + '06032a864886f70d010301': 'dhKeyAgreement', + '06032a864886f70d0105': 'pkcs-5', + '06032a864886f70d010501': 'pbeWithMD2AndDES-CBC', + '06032a864886f70d01050a': 'pbeWithSHAAndDES-CBC', + '06032a864886f70d010503': 'pbeWithMD5AndDES-CBC', + '06032a864886f70d010504': 'pbeWithMD2AndRC2-CBC', + '06032a864886f70d010506': 'pbeWithMD5AndRC2-CBC', + '06032a864886f70d010509': 'pbeWithMD5AndXOR', + '06032a864886f70d0107': 'pkcs-7', + '06032a864886f70d010701': 'data', + '06032a864886f70d010702': 'signedData', + '06032a864886f70d010703': 'envelopedData', + '06032a864886f70d010704': 'signedAndEnvelopedData', + '06032a864886f70d010705': 'digestData', + '06032a864886f70d010706': 'encryptedData', + '06032a864886f70d010707': 'dataWithAttributes', + '06032a864886f70d010708': 'encryptedPrivateKeyInfo', + '06032a864886f70d0109': 'pkcs-9', + '06032a864886f70d010901': 'emailAddress', + '06032a864886f70d01090a': 'issuerAndSerialNumber', + '06032a864886f70d01090b': 'passwordCheck', + '06032a864886f70d01090c': 'publicKey', + '06032a864886f70d01090d': 'signingDescription', + '06032a864886f70d01090e': 'extensionReq', + '06032a864886f70d01090f': 'sMIMECapabilities', + '06032a864886f70d01090f01': 'preferSignedData', + '06032a864886f70d01090f02': 'canNotDecryptAny', + '06032a864886f70d01090f03': 'receiptRequest', + '06032a864886f70d01090f04': 'receipt', + '06032a864886f70d01090f05': 'contentHints', + '06032a864886f70d01090f06': 'mlExpansionHistory', + '06032a864886f70d010910': 'id-sMIME', + '06032a864886f70d01091000': 'id-mod', + '06032a864886f70d0109100001': 'id-mod-cms', + '06032a864886f70d0109100002': 'id-mod-ess', + '06032a864886f70d01091001': 'id-ct', + '06032a864886f70d0109100101': 'id-ct-receipt', + '06032a864886f70d01091002': 'id-aa', + '06032a864886f70d0109100201': 'id-aa-receiptRequest', + '06032a864886f70d0109100202': 'id-aa-securityLabel', + '06032a864886f70d0109100203': 'id-aa-mlExpandHistory', + '06032a864886f70d0109100204': 'id-aa-contentHint', + '06032a864886f70d010902': 'unstructuredName', + '06032a864886f70d010914': 'friendlyName', + '06032a864886f70d010915': 'localKeyID', + '06032a864886f70d010916': 'certTypes', + '06032a864886f70d01091601': 'x509Certificate', + '06032a864886f70d01091602': 'sdsiCertificate', + '06032a864886f70d010917': 'crlTypes', + '06032a864886f70d01091701': 'x509Crl', + '06032a864886f70d010903': 'contentType', + '06032a864886f70d010904': 'messageDigest', + '06032a864886f70d010905': 'signingTime', + '06032a864886f70d010906': 'countersignature', + '06032a864886f70d010907': 'challengePassword', + '06032a864886f70d010908': 'unstructuredAddress', + '06032a864886f70d010909': 'extendedCertificateAttributes', + '06032a864886f70d02': 'digestAlgorithm', + '06032a864886f70d0202': 'md2', + '06032a864886f70d0204': 'md4', + '06032a864886f70d0205': 'md5', + '06032a864886f70d03': 'encryptionAlgorithm', + '06032a864886f70d030a': 'desCDMF', + '06032a864886f70d0302': 'rc2CBC', + '06032a864886f70d0303': 'rc2ECB', + '06032a864886f70d0304': 'rc4', + '06032a864886f70d0305': 'rc4WithMAC', + '06032a864886f70d0306': 'DESX-CBC', + '06032a864886f70d0307': 'DES-EDE3-CBC', + '06032a864886f70d0308': 'RC5CBC', + '06032a864886f70d0309': 'RC5-CBCPad', + '06032a864886f7140403': 'microsoftExcel', + '06032a864886f7140404': 'titledWithOID', + '06032a864886f7140405': 'microsoftPowerPoint', + '06032b81051086480954': 'x9-84', + '06032b8105108648095400': 'x9-84-Module', + '06032b810510864809540001': 'x9-84-Biometrics', + '06032b810510864809540002': 'x9-84-CMS', + '06032b810510864809540003': 'x9-84-Identifiers', + '06032b8105108648095401': 'biometric', + '06032b810510864809540100': 'id-unknown-Type', + '06032b810510864809540101': 'id-body-Odor', + '06032b81051086480954010a': 'id-palm', + '06032b81051086480954010b': 'id-retina', + '06032b81051086480954010c': 'id-signature', + '06032b81051086480954010d': 'id-speech-Pattern', + '06032b81051086480954010e': 'id-thermal-Image', + '06032b81051086480954010f': 'id-vein-Pattern', + '06032b810510864809540110': 'id-thermal-Face-Image', + '06032b810510864809540111': 'id-thermal-Hand-Image', + '06032b810510864809540112': 'id-lip-Movement', + '06032b810510864809540113': 'id-gait', + '06032b810510864809540102': 'id-dna', + '06032b810510864809540103': 'id-ear-Shape', + '06032b810510864809540104': 'id-facial-Features', + '06032b810510864809540105': 'id-finger-Image', + '06032b810510864809540106': 'id-finger-Geometry', + '06032b810510864809540107': 'id-hand-Geometry', + '06032b810510864809540108': 'id-iris-Features', + '06032b810510864809540109': 'id-keystroke-Dynamics', + '06032b8105108648095402': 'processing-algorithm', + '06032b8105108648095403': 'matching-method', + '06032b8105108648095404': 'format-Owner', + '06032b810510864809540400': 'cbeff-Owner', + '06032b810510864809540401': 'ibia-Owner', + '06032b81051086480954040101': 'id-ibia-SAFLINK', + '06032b8105108648095404010a': 'id-ibia-SecuGen', + '06032b8105108648095404010b': 'id-ibia-PreciseBiometric', + '06032b8105108648095404010c': 'id-ibia-Identix', + '06032b8105108648095404010d': 'id-ibia-DERMALOG', + '06032b8105108648095404010e': 'id-ibia-LOGICO', + '06032b8105108648095404010f': 'id-ibia-NIST', + '06032b81051086480954040110': 'id-ibia-A3Vision', + '06032b81051086480954040111': 'id-ibia-NEC', + '06032b81051086480954040112': 'id-ibia-STMicroelectronics', + '06032b81051086480954040102': 'id-ibia-Bioscrypt', + '06032b81051086480954040103': 'id-ibia-Visionics', + '06032b81051086480954040104': 'id-ibia-InfineonTechnologiesAG', + '06032b81051086480954040105': 'id-ibia-IridianTechnologies', + '06032b81051086480954040106': 'id-ibia-Veridicom', + '06032b81051086480954040107': 'id-ibia-CyberSIGN', + '06032b81051086480954040108': 'id-ibia-eCryp.', + '06032b81051086480954040109': 'id-ibia-FingerprintCardsAB', + '06032b810510864809540402': 'x9-Owner', + '06032b0e021a05': 'sha', + '06032b0e03020101': 'rsa', + '06032b0e03020a': 'desMAC', + '06032b0e03020b': 'rsaSignature', + '06032b0e03020c': 'dsa', + '06032b0e03020d': 'dsaWithSHA', + '06032b0e03020e': 'mdc2WithRSASignature', + '06032b0e03020f': 'shaWithRSASignature', + '06032b0e030210': 'dhWithCommonModulus', + '06032b0e030211': 'desEDE', + '06032b0e030212': 'sha', + '06032b0e030213': 'mdc-2', + '06032b0e030202': 'md4WitRSA', + '06032b0e03020201': 'sqmod-N', + '06032b0e030214': 'dsaCommon', + '06032b0e030215': 'dsaCommonWithSHA', + '06032b0e030216': 'rsaKeyTransport', + '06032b0e030217': 'keyed-hash-seal', + '06032b0e030218': 'md2WithRSASignature', + '06032b0e030219': 'md5WithRSASignature', + '06032b0e03021a': 'sha1', + '06032b0e03021b': 'dsaWithSHA1', + '06032b0e03021c': 'dsaWithCommonSHA1', + '06032b0e03021d': 'sha-1WithRSAEncryption', + '06032b0e030203': 'md5WithRSA', + '06032b0e03020301': 'sqmod-NwithRSA', + '06032b0e030204': 'md4WithRSAEncryption', + '06032b0e030206': 'desECB', + '06032b0e030207': 'desCBC', + '06032b0e030208': 'desOFB', + '06032b0e030209': 'desCFB', + '06032b0e030301': 'simple-strong-auth-mechanism', + '06032b0e07020101': 'ElGamal', + '06032b0e07020301': 'md2WithRSA', + '06032b0e07020302': 'md2WithElGamal', + '06032b2403': 'algorithm', + '06032b240301': 'encryptionAlgorithm', + '06032b24030101': 'des', + '06032b240301010101': 'desECBPad', + '06032b24030101010101': 'desECBPadISO', + '06032b240301010201': 'desCBCPad', + '06032b24030101020101': 'desCBCPadISO', + '06032b24030102': 'idea', + '06032b2403010201': 'ideaECB', + '06032b240301020101': 'ideaECBPad', + '06032b24030102010101': 'ideaECBPadISO', + '06032b2403010202': 'ideaCBC', + '06032b240301020201': 'ideaCBCPad', + '06032b24030102020101': 'ideaCBCPadISO', + '06032b2403010203': 'ideaOFB', + '06032b2403010204': 'ideaCFB', + '06032b24030103': 'des-3', + '06032b240301030101': 'des-3ECBPad', + '06032b24030103010101': 'des-3ECBPadISO', + '06032b240301030201': 'des-3CBCPad', + '06032b24030103020101': 'des-3CBCPadISO', + '06032b240302': 'hashAlgorithm', + '06032b24030201': 'ripemd160', + '06032b24030202': 'ripemd128', + '06032b24030203': 'ripemd256', + '06032b24030204': 'mdc2singleLength', + '06032b24030205': 'mdc2doubleLength', + '06032b240303': 'signatureAlgorithm', + '06032b24030301': 'rsa', + '06032b2403030101': 'rsaMitSHA-1', + '06032b2403030102': 'rsaMitRIPEMD160', + '06032b24030302': 'ellipticCurve', + '06032b240304': 'signatureScheme', + '06032b24030401': 'iso9796-1', + '06032b2403040201': 'iso9796-2', + '06032b2403040202': 'iso9796-2rsa', + '06032b2404': 'attribute', + '06032b2405': 'policy', + '06032b2406': 'api', + '06032b240601': 'manufacturerSpecific', + '06032b240602': 'functionalitySpecific', + '06032b2407': 'api', + '06032b240701': 'keyAgreement', + '06032b240702': 'keyTransport', + '06032b06010401927c0a0101': 'UNINETT policyIdentifier', + '06032b0601040195180a': 'ICE-TEL policyIdentifier', + '06032b0601040197552001': 'cryptlibEnvelope', + '06032b0601040197552002': 'cryptlibPrivateKey', + '060a2b060104018237': 'Microsoft OID', + '060a2b0601040182370a': 'Crypto 2.0', + '060a2b0601040182370a01': 'certTrustList', + '060a2b0601040182370a0101': 'szOID_SORTED_CTL', + '060a2b0601040182370a0a': 'Microsoft CMC OIDs', + '060a2b0601040182370a0a01': 'szOID_CMC_ADD_ATTRIBUTES', + '060a2b0601040182370a0b': 'Microsoft certificate property OIDs', + '060a2b0601040182370a0b01': 'szOID_CERT_PROP_ID_PREFIX', + '060a2b0601040182370a0c': 'CryptUI', + '060a2b0601040182370a0c01': 'szOID_ANY_APPLICATION_POLICY', + '060a2b0601040182370a02': 'nextUpdateLocation', + '060a2b0601040182370a0301': 'certTrustListSigning', + '060a2b0601040182370a030a': 'szOID_KP_QUALIFIED_SUBORDINATION', + '060a2b0601040182370a030b': 'szOID_KP_KEY_RECOVERY', + '060a2b0601040182370a030c': 'szOID_KP_DOCUMENT_SIGNING', + '060a2b0601040182370a0302': 'timeStampSigning', + '060a2b0601040182370a0303': 'serverGatedCrypto', + '060a2b0601040182370a030301': 'szOID_SERIALIZED', + '060a2b0601040182370a0304': 'encryptedFileSystem', + '060a2b0601040182370a030401': 'szOID_EFS_RECOVERY', + '060a2b0601040182370a0305': 'szOID_WHQL_CRYPTO', + '060a2b0601040182370a0306': 'szOID_NT5_CRYPTO', + '060a2b0601040182370a0307': 'szOID_OEM_WHQL_CRYPTO', + '060a2b0601040182370a0308': 'szOID_EMBEDDED_NT_CRYPTO', + '060a2b0601040182370a0309': 'szOID_ROOT_LIST_SIGNER', + '060a2b0601040182370a0401': 'yesnoTrustAttr', + '060a2b0601040182370a0501': 'szOID_DRM', + '060a2b0601040182370a0502': 'szOID_DRM_INDIVIDUALIZATION', + '060a2b0601040182370a0601': 'szOID_LICENSES', + '060a2b0601040182370a0602': 'szOID_LICENSE_SERVER', + '060a2b0601040182370a07': 'szOID_MICROSOFT_RDN_PREFIX', + '060a2b0601040182370a0701': 'szOID_KEYID_RDN', + '060a2b0601040182370a0801': 'szOID_REMOVE_CERTIFICATE', + '060a2b0601040182370a0901': 'szOID_CROSS_CERT_DIST_POINTS', + '060a2b0601040182370c': 'Catalog', + '060a2b0601040182370c0101': 'szOID_CATALOG_LIST', + '060a2b0601040182370c0102': 'szOID_CATALOG_LIST_MEMBER', + '060a2b0601040182370c0201': 'CAT_NAMEVALUE_OBJID', + '060a2b0601040182370c0202': 'CAT_MEMBERINFO_OBJID', + '060a2b0601040182370d': 'Microsoft PKCS10 OIDs', + '060a2b0601040182370d01': 'szOID_RENEWAL_CERTIFICATE', + '060a2b0601040182370d0201': 'szOID_ENROLLMENT_NAME_VALUE_PAIR', + '060a2b0601040182370d0202': 'szOID_ENROLLMENT_CSP_PROVIDER', + '060a2b0601040182370d0203': 'OS Version', + '060a2b0601040182370f': 'Microsoft Java', + '060a2b06010401823710': 'Microsoft Outlook/Exchange', + '060a2b0601040182371004': 'Outlook Express', + '060a2b06010401823711': 'Microsoft PKCS12 attributes', + '060a2b0601040182371101': 'szOID_LOCAL_MACHINE_KEYSET', + '060a2b06010401823712': 'Microsoft Hydra', + '060a2b06010401823713': 'Microsoft ISPU Test', + '060a2b06010401823702': 'Authenticode', + '060a2b06010401823702010a': 'spcAgencyInfo', + '060a2b06010401823702010b': 'spcStatementType', + '060a2b06010401823702010c': 'spcSpOpusInfo', + '060a2b06010401823702010e': 'certExtensions', + '060a2b06010401823702010f': 'spcPelmageData', + '060a2b060104018237020112': 'SPC_RAW_FILE_DATA_OBJID', + '060a2b060104018237020113': 'SPC_STRUCTURED_STORAGE_DATA_OBJID', + '060a2b060104018237020114': 'spcLink', + '060a2b060104018237020115': 'individualCodeSigning', + '060a2b060104018237020116': 'commercialCodeSigning', + '060a2b060104018237020119': 'spcLink', + '060a2b06010401823702011a': 'spcMinimalCriteriaInfo', + '060a2b06010401823702011b': 'spcFinancialCriteriaInfo', + '060a2b06010401823702011c': 'spcLink', + '060a2b06010401823702011d': 'SPC_HASH_INFO_OBJID', + '060a2b06010401823702011e': 'SPC_SIPINFO_OBJID', + '060a2b060104018237020104': 'spcIndirectDataContext', + '060a2b0601040182370202': 'CTL for Software Publishers Trusted CAs', + '060a2b060104018237020201': 'szOID_TRUSTED_CODESIGNING_CA_LIST', + '060a2b060104018237020202': 'szOID_TRUSTED_CLIENT_AUTH_CA_LIST', + '060a2b060104018237020203': 'szOID_TRUSTED_SERVER_AUTH_CA_LIST', + '060a2b06010401823714': 'Microsoft Enrollment Infrastructure', + '060a2b0601040182371401': 'szOID_AUTO_ENROLL_CTL_USAGE', + '060a2b0601040182371402': 'szOID_ENROLL_CERTTYPE_EXTENSION', + '060a2b060104018237140201': 'szOID_ENROLLMENT_AGENT', + '060a2b060104018237140202': 'szOID_KP_SMARTCARD_LOGON', + '060a2b060104018237140203': 'szOID_NT_PRINCIPAL_NAME', + '060a2b0601040182371403': 'szOID_CERT_MANIFOLD', + '06092b06010401823715': 'Microsoft CertSrv Infrastructure', + '06092b0601040182371501': 'szOID_CERTSRV_CA_VERSION', + '06092b0601040182371514': 'Client Information', + '060a2b06010401823719': 'Microsoft Directory Service', + '060a2b0601040182371901': 'szOID_NTDS_REPLICATION', + '060a2b06010401823703': 'Time Stamping', + '060a2b060104018237030201': 'SPC_TIME_STAMP_REQUEST_OBJID', + '060a2b0601040182371e': 'IIS', + '060a2b0601040182371f': 'Windows updates and service packs', + '060a2b0601040182371f01': 'szOID_PRODUCT_UPDATE', + '060a2b06010401823704': 'Permissions', + '060a2b06010401823728': 'Fonts', + '060a2b06010401823729': 'Microsoft Licensing and Registration', + '060a2b0601040182372a': 'Microsoft Corporate PKI (ITG)', + '060a2b06010401823758': 'CAPICOM', + '060a2b0601040182375801': 'szOID_CAPICOM_VERSION', + '060a2b0601040182375802': 'szOID_CAPICOM_ATTRIBUTE', + '060a2b060104018237580201': 'szOID_CAPICOM_DOCUMENT_NAME', + '060a2b060104018237580202': 'szOID_CAPICOM_DOCUMENT_DESCRIPTION', + '060a2b0601040182375803': 'szOID_CAPICOM_ENCRYPTED_DATA', + '060a2b060104018237580301': 'szOID_CAPICOM_ENCRYPTED_CONTENT', + '06032b0601050507': 'pkix', + '06032b060105050701': 'privateExtension', + '06032b06010505070101': 'authorityInfoAccess', + '06032b06010505070c02': 'CMC Data', + '06032b060105050702': 'policyQualifierIds', // '06032b06010505070201' : 'cps', - '06032b06010505070202' : 'unotice', - '06032b060105050703' : 'keyPurpose', - '06032b06010505070301' : 'serverAuth', - '06032b06010505070302' : 'clientAuth', - '06032b06010505070303' : 'codeSigning', - '06032b06010505070304' : 'emailProtection', - '06032b06010505070305' : 'ipsecEndSystem', - '06032b06010505070306' : 'ipsecTunnel', - '06032b06010505070307' : 'ipsecUser', - '06032b06010505070308' : 'timeStamping', - '06032b060105050704' : 'cmpInformationTypes', - '06032b06010505070401' : 'caProtEncCert', - '06032b06010505070402' : 'signKeyPairTypes', - '06032b06010505070403' : 'encKeyPairTypes', - '06032b06010505070404' : 'preferredSymmAlg', - '06032b06010505070405' : 'caKeyUpdateInfo', - '06032b06010505070406' : 'currentCRL', - '06032b06010505073001' : 'ocsp', - '06032b06010505073002' : 'caIssuers', - '06032b06010505080101' : 'HMAC-MD5', - '06032b06010505080102' : 'HMAC-SHA', - '060360864801650201010a' : 'mosaicKeyManagementAlgorithm', - '060360864801650201010b' : 'sdnsKMandSigAlgorithm', - '060360864801650201010c' : 'mosaicKMandSigAlgorithm', - '060360864801650201010d' : 'SuiteASignatureAlgorithm', - '060360864801650201010e' : 'SuiteAConfidentialityAlgorithm', - '060360864801650201010f' : 'SuiteAIntegrityAlgorithm', - '06036086480186f84201' : 'cert-extension', + '06032b06010505070202': 'unotice', + '06032b060105050703': 'keyPurpose', + '06032b06010505070301': 'serverAuth', + '06032b06010505070302': 'clientAuth', + '06032b06010505070303': 'codeSigning', + '06032b06010505070304': 'emailProtection', + '06032b06010505070305': 'ipsecEndSystem', + '06032b06010505070306': 'ipsecTunnel', + '06032b06010505070307': 'ipsecUser', + '06032b06010505070308': 'timeStamping', + '06032b060105050704': 'cmpInformationTypes', + '06032b06010505070401': 'caProtEncCert', + '06032b06010505070402': 'signKeyPairTypes', + '06032b06010505070403': 'encKeyPairTypes', + '06032b06010505070404': 'preferredSymmAlg', + '06032b06010505070405': 'caKeyUpdateInfo', + '06032b06010505070406': 'currentCRL', + '06032b06010505073001': 'ocsp', + '06032b06010505073002': 'caIssuers', + '06032b06010505080101': 'HMAC-MD5', + '06032b06010505080102': 'HMAC-SHA', + '060360864801650201010a': 'mosaicKeyManagementAlgorithm', + '060360864801650201010b': 'sdnsKMandSigAlgorithm', + '060360864801650201010c': 'mosaicKMandSigAlgorithm', + '060360864801650201010d': 'SuiteASignatureAlgorithm', + '060360864801650201010e': 'SuiteAConfidentialityAlgorithm', + '060360864801650201010f': 'SuiteAIntegrityAlgorithm', + '06036086480186f84201': 'cert-extension', // '06036086480186f8420101' : 'netscape-cert-type', - '06036086480186f842010a' : 'EntityLogo', - '06036086480186f842010b' : 'UserPicture', + '06036086480186f842010a': 'EntityLogo', + '06036086480186f842010b': 'UserPicture', // '06036086480186f842010c' : 'netscape-ssl-server-name', // '06036086480186f842010d' : 'netscape-comment', // '06036086480186f8420102' : 'netscape-base-url', @@ -852,202 +852,202 @@ X509.DN_ATTRHEX = { // '06036086480186f8420104' : 'netscape-ca-revocation-url', // '06036086480186f8420107' : 'netscape-cert-renewal-url', // '06036086480186f8420108' : 'netscape-ca-policy-url', - '06036086480186f8420109' : 'HomePage-url', - '06036086480186f84202' : 'data-type', - '06036086480186f8420201' : 'GIF', - '06036086480186f8420202' : 'JPEG', - '06036086480186f8420203' : 'URL', - '06036086480186f8420204' : 'HTML', - '06036086480186f8420205' : 'netscape-cert-sequence', - '06036086480186f8420206' : 'netscape-cert-url', - '06036086480186f84203' : 'directory', - '06036086480186f8420401' : 'serverGatedCrypto', - '06036086480186f845010603' : 'Unknown Verisign extension', - '06036086480186f845010606' : 'Unknown Verisign extension', - '06036086480186f84501070101' : 'Verisign certificatePolicy', - '06036086480186f8450107010101' : 'Unknown Verisign policy qualifier', - '06036086480186f8450107010102' : 'Unknown Verisign policy qualifier', - '0603678105' : 'TCPA', - '060367810501' : 'tcpa_specVersion', - '060367810502' : 'tcpa_attribute', - '06036781050201' : 'tcpa_at_tpmManufacturer', - '0603678105020a' : 'tcpa_at_securityQualities', - '0603678105020b' : 'tcpa_at_tpmProtectionProfile', - '0603678105020c' : 'tcpa_at_tpmSecurityTarget', - '0603678105020d' : 'tcpa_at_foundationProtectionProfile', - '0603678105020e' : 'tcpa_at_foundationSecurityTarget', - '0603678105020f' : 'tcpa_at_tpmIdLabel', - '06036781050202' : 'tcpa_at_tpmModel', - '06036781050203' : 'tcpa_at_tpmVersion', - '06036781050204' : 'tcpa_at_platformManufacturer', - '06036781050205' : 'tcpa_at_platformModel', - '06036781050206' : 'tcpa_at_platformVersion', - '06036781050207' : 'tcpa_at_componentManufacturer', - '06036781050208' : 'tcpa_at_componentModel', - '06036781050209' : 'tcpa_at_componentVersion', - '060367810503' : 'tcpa_protocol', - '06036781050301' : 'tcpa_prtt_tpmIdProtocol', - '0603672a00' : 'contentType', - '0603672a0000' : 'PANData', - '0603672a0001' : 'PANToken', - '0603672a0002' : 'PANOnly', - '0603672a01' : 'msgExt', - '0603672a0a' : 'national', - '0603672a0a8140' : 'Japan', - '0603672a02' : 'field', - '0603672a0200' : 'fullName', - '0603672a0201' : 'givenName', - '0603672a020a' : 'amount', - '0603672a0202' : 'familyName', - '0603672a0203' : 'birthFamilyName', - '0603672a0204' : 'placeName', - '0603672a0205' : 'identificationNumber', - '0603672a0206' : 'month', - '0603672a0207' : 'date', - '0603672a02070b' : 'accountNumber', - '0603672a02070c' : 'passPhrase', - '0603672a0208' : 'address', - '0603672a0209' : 'telephone', - '0603672a03' : 'attribute', - '0603672a0300' : 'cert', - '0603672a030000' : 'rootKeyThumb', - '0603672a030001' : 'additionalPolicy', - '0603672a04' : 'algorithm', - '0603672a05' : 'policy', - '0603672a0500' : 'root', - '0603672a06' : 'module', - '0603672a07' : 'certExt', - '0603672a0700' : 'hashedRootKey', - '0603672a0701' : 'certificateType', - '0603672a0702' : 'merchantData', - '0603672a0703' : 'cardCertRequired', - '0603672a0704' : 'tunneling', - '0603672a0705' : 'setExtensions', - '0603672a0706' : 'setQualifier', - '0603672a08' : 'brand', - '0603672a0801' : 'IATA-ATA', - '0603672a081e' : 'Diners', - '0603672a0822' : 'AmericanExpress', - '0603672a0804' : 'VISA', - '0603672a0805' : 'MasterCard', - '0603672a08ae7b' : 'Novus', - '0603672a09' : 'vendor', - '0603672a0900' : 'GlobeSet', - '0603672a0901' : 'IBM', - '0603672a090a' : 'Griffin', - '0603672a090b' : 'Certicom', - '0603672a090c' : 'OSS', - '0603672a090d' : 'TenthMountain', - '0603672a090e' : 'Antares', - '0603672a090f' : 'ECC', - '0603672a0910' : 'Maithean', - '0603672a0911' : 'Netscape', - '0603672a0912' : 'Verisign', - '0603672a0913' : 'BlueMoney', - '0603672a0902' : 'CyberCash', - '0603672a0914' : 'Lacerte', - '0603672a0915' : 'Fujitsu', - '0603672a0916' : 'eLab', - '0603672a0917' : 'Entrust', - '0603672a0918' : 'VIAnet', - '0603672a0919' : 'III', - '0603672a091a' : 'OpenMarket', - '0603672a091b' : 'Lexem', - '0603672a091c' : 'Intertrader', - '0603672a091d' : 'Persimmon', - '0603672a0903' : 'Terisa', - '0603672a091e' : 'NABLE', - '0603672a091f' : 'espace-net', - '0603672a0920' : 'Hitachi', - '0603672a0921' : 'Microsoft', - '0603672a0922' : 'NEC', - '0603672a0923' : 'Mitsubishi', - '0603672a0924' : 'NCR', - '0603672a0925' : 'e-COMM', - '0603672a0926' : 'Gemplus', - '0603672a0904' : 'RSADSI', - '0603672a0905' : 'VeriFone', - '0603672a0906' : 'TrinTech', - '0603672a0907' : 'BankGate', - '0603672a0908' : 'GTE', - '0603672a0909' : 'CompuSource', - '0603551d01' : 'authorityKeyIdentifier', - '0603551d0a' : 'basicConstraints', - '0603551d0b' : 'nameConstraints', - '0603551d0c' : 'policyConstraints', - '0603551d0d' : 'basicConstraints', - '0603551d0e' : 'subjectKeyIdentifier', - '0603551d0f' : 'keyUsage', - '0603551d10' : 'privateKeyUsagePeriod', - '0603551d11' : 'subjectAltName', - '0603551d12' : 'issuerAltName', - '0603551d13' : 'basicConstraints', - '0603551d02' : 'keyAttributes', - '0603551d14' : 'cRLNumber', - '0603551d15' : 'cRLReason', - '0603551d16' : 'expirationDate', - '0603551d17' : 'instructionCode', - '0603551d18' : 'invalidityDate', - '0603551d1a' : 'issuingDistributionPoint', - '0603551d1b' : 'deltaCRLIndicator', - '0603551d1c' : 'issuingDistributionPoint', - '0603551d1d' : 'certificateIssuer', - '0603551d03' : 'certificatePolicies', - '0603551d1e' : 'nameConstraints', - '0603551d1f' : 'cRLDistributionPoints', - '0603551d20' : 'certificatePolicies', - '0603551d21' : 'policyMappings', - '0603551d22' : 'policyConstraints', - '0603551d23' : 'authorityKeyIdentifier', - '0603551d24' : 'policyConstraints', - '0603551d25' : 'extKeyUsage', - '0603551d04' : 'keyUsageRestriction', - '0603551d05' : 'policyMapping', - '0603551d06' : 'subtreesConstraint', - '0603551d07' : 'subjectAltName', - '0603551d08' : 'issuerAltName', - '0603551d09' : 'subjectDirectoryAttributes', - '0603550400' : 'objectClass', - '0603550401' : 'aliasObjectName', + '06036086480186f8420109': 'HomePage-url', + '06036086480186f84202': 'data-type', + '06036086480186f8420201': 'GIF', + '06036086480186f8420202': 'JPEG', + '06036086480186f8420203': 'URL', + '06036086480186f8420204': 'HTML', + '06036086480186f8420205': 'netscape-cert-sequence', + '06036086480186f8420206': 'netscape-cert-url', + '06036086480186f84203': 'directory', + '06036086480186f8420401': 'serverGatedCrypto', + '06036086480186f845010603': 'Unknown Verisign extension', + '06036086480186f845010606': 'Unknown Verisign extension', + '06036086480186f84501070101': 'Verisign certificatePolicy', + '06036086480186f8450107010101': 'Unknown Verisign policy qualifier', + '06036086480186f8450107010102': 'Unknown Verisign policy qualifier', + '0603678105': 'TCPA', + '060367810501': 'tcpa_specVersion', + '060367810502': 'tcpa_attribute', + '06036781050201': 'tcpa_at_tpmManufacturer', + '0603678105020a': 'tcpa_at_securityQualities', + '0603678105020b': 'tcpa_at_tpmProtectionProfile', + '0603678105020c': 'tcpa_at_tpmSecurityTarget', + '0603678105020d': 'tcpa_at_foundationProtectionProfile', + '0603678105020e': 'tcpa_at_foundationSecurityTarget', + '0603678105020f': 'tcpa_at_tpmIdLabel', + '06036781050202': 'tcpa_at_tpmModel', + '06036781050203': 'tcpa_at_tpmVersion', + '06036781050204': 'tcpa_at_platformManufacturer', + '06036781050205': 'tcpa_at_platformModel', + '06036781050206': 'tcpa_at_platformVersion', + '06036781050207': 'tcpa_at_componentManufacturer', + '06036781050208': 'tcpa_at_componentModel', + '06036781050209': 'tcpa_at_componentVersion', + '060367810503': 'tcpa_protocol', + '06036781050301': 'tcpa_prtt_tpmIdProtocol', + '0603672a00': 'contentType', + '0603672a0000': 'PANData', + '0603672a0001': 'PANToken', + '0603672a0002': 'PANOnly', + '0603672a01': 'msgExt', + '0603672a0a': 'national', + '0603672a0a8140': 'Japan', + '0603672a02': 'field', + '0603672a0200': 'fullName', + '0603672a0201': 'givenName', + '0603672a020a': 'amount', + '0603672a0202': 'familyName', + '0603672a0203': 'birthFamilyName', + '0603672a0204': 'placeName', + '0603672a0205': 'identificationNumber', + '0603672a0206': 'month', + '0603672a0207': 'date', + '0603672a02070b': 'accountNumber', + '0603672a02070c': 'passPhrase', + '0603672a0208': 'address', + '0603672a0209': 'telephone', + '0603672a03': 'attribute', + '0603672a0300': 'cert', + '0603672a030000': 'rootKeyThumb', + '0603672a030001': 'additionalPolicy', + '0603672a04': 'algorithm', + '0603672a05': 'policy', + '0603672a0500': 'root', + '0603672a06': 'module', + '0603672a07': 'certExt', + '0603672a0700': 'hashedRootKey', + '0603672a0701': 'certificateType', + '0603672a0702': 'merchantData', + '0603672a0703': 'cardCertRequired', + '0603672a0704': 'tunneling', + '0603672a0705': 'setExtensions', + '0603672a0706': 'setQualifier', + '0603672a08': 'brand', + '0603672a0801': 'IATA-ATA', + '0603672a081e': 'Diners', + '0603672a0822': 'AmericanExpress', + '0603672a0804': 'VISA', + '0603672a0805': 'MasterCard', + '0603672a08ae7b': 'Novus', + '0603672a09': 'vendor', + '0603672a0900': 'GlobeSet', + '0603672a0901': 'IBM', + '0603672a090a': 'Griffin', + '0603672a090b': 'Certicom', + '0603672a090c': 'OSS', + '0603672a090d': 'TenthMountain', + '0603672a090e': 'Antares', + '0603672a090f': 'ECC', + '0603672a0910': 'Maithean', + '0603672a0911': 'Netscape', + '0603672a0912': 'Verisign', + '0603672a0913': 'BlueMoney', + '0603672a0902': 'CyberCash', + '0603672a0914': 'Lacerte', + '0603672a0915': 'Fujitsu', + '0603672a0916': 'eLab', + '0603672a0917': 'Entrust', + '0603672a0918': 'VIAnet', + '0603672a0919': 'III', + '0603672a091a': 'OpenMarket', + '0603672a091b': 'Lexem', + '0603672a091c': 'Intertrader', + '0603672a091d': 'Persimmon', + '0603672a0903': 'Terisa', + '0603672a091e': 'NABLE', + '0603672a091f': 'espace-net', + '0603672a0920': 'Hitachi', + '0603672a0921': 'Microsoft', + '0603672a0922': 'NEC', + '0603672a0923': 'Mitsubishi', + '0603672a0924': 'NCR', + '0603672a0925': 'e-COMM', + '0603672a0926': 'Gemplus', + '0603672a0904': 'RSADSI', + '0603672a0905': 'VeriFone', + '0603672a0906': 'TrinTech', + '0603672a0907': 'BankGate', + '0603672a0908': 'GTE', + '0603672a0909': 'CompuSource', + '0603551d01': 'authorityKeyIdentifier', + '0603551d0a': 'basicConstraints', + '0603551d0b': 'nameConstraints', + '0603551d0c': 'policyConstraints', + '0603551d0d': 'basicConstraints', + '0603551d0e': 'subjectKeyIdentifier', + '0603551d0f': 'keyUsage', + '0603551d10': 'privateKeyUsagePeriod', + '0603551d11': 'subjectAltName', + '0603551d12': 'issuerAltName', + '0603551d13': 'basicConstraints', + '0603551d02': 'keyAttributes', + '0603551d14': 'cRLNumber', + '0603551d15': 'cRLReason', + '0603551d16': 'expirationDate', + '0603551d17': 'instructionCode', + '0603551d18': 'invalidityDate', + '0603551d1a': 'issuingDistributionPoint', + '0603551d1b': 'deltaCRLIndicator', + '0603551d1c': 'issuingDistributionPoint', + '0603551d1d': 'certificateIssuer', + '0603551d03': 'certificatePolicies', + '0603551d1e': 'nameConstraints', + '0603551d1f': 'cRLDistributionPoints', + '0603551d20': 'certificatePolicies', + '0603551d21': 'policyMappings', + '0603551d22': 'policyConstraints', + '0603551d23': 'authorityKeyIdentifier', + '0603551d24': 'policyConstraints', + '0603551d25': 'extKeyUsage', + '0603551d04': 'keyUsageRestriction', + '0603551d05': 'policyMapping', + '0603551d06': 'subtreesConstraint', + '0603551d07': 'subjectAltName', + '0603551d08': 'issuerAltName', + '0603551d09': 'subjectDirectoryAttributes', + '0603550400': 'objectClass', + '0603550401': 'aliasObjectName', // '060355040c' : 'title', - '060355040d' : 'description', - '060355040e' : 'searchGuide', - '060355040f' : 'businessCategory', - '0603550410' : 'postalAddress', - '0603550411' : 'postalCode', - '0603550412' : 'postOfficeBox', - '0603550413' : 'physicalDeliveryOfficeName', - '0603550402' : 'knowledgeInformation', + '060355040d': 'description', + '060355040e': 'searchGuide', + '060355040f': 'businessCategory', + '0603550410': 'postalAddress', + '0603550411': 'postalCode', + '0603550412': 'postOfficeBox', + '0603550413': 'physicalDeliveryOfficeName', + '0603550402': 'knowledgeInformation', // '0603550414' : 'telephoneNumber', - '0603550415' : 'telexNumber', - '0603550416' : 'teletexTerminalIdentifier', - '0603550417' : 'facsimileTelephoneNumber', - '0603550418' : 'x121Address', - '0603550419' : 'internationalISDNNumber', - '060355041a' : 'registeredAddress', - '060355041b' : 'destinationIndicator', - '060355041c' : 'preferredDeliveryMehtod', - '060355041d' : 'presentationAddress', - '060355041e' : 'supportedApplicationContext', - '060355041f' : 'member', - '0603550420' : 'owner', - '0603550421' : 'roleOccupant', - '0603550422' : 'seeAlso', - '0603550423' : 'userPassword', - '0603550424' : 'userCertificate', - '0603550425' : 'caCertificate', - '0603550426' : 'authorityRevocationList', - '0603550427' : 'certificateRevocationList', - '0603550428' : 'crossCertificatePair', - '0603550429' : 'givenName', + '0603550415': 'telexNumber', + '0603550416': 'teletexTerminalIdentifier', + '0603550417': 'facsimileTelephoneNumber', + '0603550418': 'x121Address', + '0603550419': 'internationalISDNNumber', + '060355041a': 'registeredAddress', + '060355041b': 'destinationIndicator', + '060355041c': 'preferredDeliveryMehtod', + '060355041d': 'presentationAddress', + '060355041e': 'supportedApplicationContext', + '060355041f': 'member', + '0603550420': 'owner', + '0603550421': 'roleOccupant', + '0603550422': 'seeAlso', + '0603550423': 'userPassword', + '0603550424': 'userCertificate', + '0603550425': 'caCertificate', + '0603550426': 'authorityRevocationList', + '0603550427': 'certificateRevocationList', + '0603550428': 'crossCertificatePair', + '0603550429': 'givenName', // '060355042a' : 'givenName', - '0603550405' : 'serialNumber', - '0603550434' : 'supportedAlgorithms', - '0603550435' : 'deltaRevocationList', - '060355043a' : 'crossCertificatePair', + '0603550405': 'serialNumber', + '0603550434': 'supportedAlgorithms', + '0603550435': 'deltaRevocationList', + '060355043a': 'crossCertificatePair', // '0603550409' : 'streetAddress', - '06035508' : 'X.500-Algorithms', - '0603550801' : 'X.500-Alg-Encryption', - '060355080101' : 'rsa', - '0603604c0101' : 'DPC' -}; \ No newline at end of file + '06035508': 'X.500-Algorithms', + '0603550801': 'X.500-Alg-Encryption', + '060355080101': 'rsa', + '0603604c0101': 'DPC', +}; diff --git a/src/js/operations/Punycode.js b/src/js/operations/Punycode.js index cf58a8f1..e6b80968 100755 --- a/src/js/operations/Punycode.js +++ b/src/js/operations/Punycode.js @@ -9,14 +9,14 @@ * * @namespace */ -var Punycode = { +const Punycode = { /** * @constant * @default */ - IDN: false, - + IDN: false, + /** * To Punycode operation. * @@ -24,17 +24,17 @@ var Punycode = { * @param {Object[]} args * @returns {string} */ - run_to_ascii: function(input, args) { - var idn = args[0]; - - if (idn) { - return punycode.ToASCII(input); - } else { - return punycode.encode(input); - } - }, - - + run_to_ascii(input, args) { + const idn = args[0]; + + if (idn) { + return punycode.ToASCII(input); + } else { + return punycode.encode(input); + } + }, + + /** * From Punycode operation. * @@ -42,14 +42,14 @@ var Punycode = { * @param {Object[]} args * @returns {string} */ - run_to_unicode: function(input, args) { - var idn = args[0]; - - if (idn) { - return punycode.ToUnicode(input); - } else { - return punycode.decode(input); - } - }, - + run_to_unicode(input, args) { + const idn = args[0]; + + if (idn) { + return punycode.ToUnicode(input); + } else { + return punycode.decode(input); + } + }, + }; diff --git a/src/js/operations/QuotedPrintable.js b/src/js/operations/QuotedPrintable.js index 44375753..8ce6b188 100755 --- a/src/js/operations/QuotedPrintable.js +++ b/src/js/operations/QuotedPrintable.js @@ -2,14 +2,14 @@ ======================================================================== mimelib: http://github.com/andris9/mimelib Copyright (c) 2011-2012 Andris Reinman - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -30,8 +30,8 @@ * * @namespace */ -var QuotedPrintable = { - +const QuotedPrintable = { + /** * To Quoted Printable operation. * @@ -39,20 +39,16 @@ var QuotedPrintable = { * @param {Object[]} args * @returns {string} */ - run_to: function (input, args) { - var mimeEncodedStr = QuotedPrintable.mimeEncode(input); - - // fix line breaks - mimeEncodedStr = mimeEncodedStr.replace(/\r?\n|\r/g, function() { - return "\r\n"; - }).replace(/[\t ]+$/gm, function(spaces) { - return spaces.replace(/ /g, "=20").replace(/\t/g, "=09"); - }); + run_to(input, args) { + let mimeEncodedStr = QuotedPrintable.mimeEncode(input); + + // fix line breaks + mimeEncodedStr = mimeEncodedStr.replace(/\r?\n|\r/g, () => '\r\n').replace(/[\t ]+$/gm, spaces => spaces.replace(/ /g, '=20').replace(/\t/g, '=09')); + + return QuotedPrintable._addSoftLinebreaks(mimeEncodedStr, 'qp'); + }, + - return QuotedPrintable._addSoftLinebreaks(mimeEncodedStr, "qp"); - }, - - /** * From Quoted Printable operation. * @@ -60,47 +56,48 @@ var QuotedPrintable = { * @param {Object[]} args * @returns {byte_array} */ - run_from: function (input, args) { - var str = input.replace(/\=(?:\r?\n|$)/g, ""); - return QuotedPrintable.mimeDecode(str); - }, - - + run_from(input, args) { + const str = input.replace(/\=(?:\r?\n|$)/g, ''); + return QuotedPrintable.mimeDecode(str); + }, + + /** * Decodes mime-encoded data. * * @param {string} str * @returns {byte_array} */ - mimeDecode: function(str) { - var encodedBytesCount = (str.match(/\=[\da-fA-F]{2}/g) || []).length, - bufferLength = str.length - encodedBytesCount * 2, - chr, hex, - buffer = new Array(bufferLength), - bufferPos = 0; + mimeDecode(str) { + let encodedBytesCount = (str.match(/\=[\da-fA-F]{2}/g) || []).length, + bufferLength = str.length - encodedBytesCount * 2, + chr, + hex, + buffer = new Array(bufferLength), + bufferPos = 0; + + for (let i = 0, len = str.length; i < len; i++) { + chr = str.charAt(i); + if (chr == '=' && (hex = str.substr(i + 1, 2)) && /[\da-fA-F]{2}/.test(hex)) { + buffer[bufferPos++] = parseInt(hex, 16); + i += 2; + continue; + } + buffer[bufferPos++] = chr.charCodeAt(0); + } + + return buffer; + }, - for (var i = 0, len = str.length; i < len; i++) { - chr = str.charAt(i); - if (chr == "=" && (hex = str.substr(i + 1, 2)) && /[\da-fA-F]{2}/.test(hex)) { - buffer[bufferPos++] = parseInt(hex, 16); - i += 2; - continue; - } - buffer[bufferPos++] = chr.charCodeAt(0); - } - return buffer; - }, - - /** * Encodes mime data. * * @param {byte_array} buffer * @returns {string} */ - mimeEncode: function(buffer) { - var ranges = [ + mimeEncode(buffer) { + let ranges = [ [0x09], [0x0A], [0x0D], @@ -109,22 +106,22 @@ var QuotedPrintable = { [0x23, 0x3C], [0x3E], [0x40, 0x5E], - [0x60, 0x7E] - ], - result = ""; + [0x60, 0x7E], + ], + result = ''; + + for (let i = 0, len = buffer.length; i < len; i++) { + if (this._checkRanges(buffer[i], ranges)) { + result += String.fromCharCode(buffer[i]); + continue; + } + result += `=${buffer[i] < 0x10 ? '0' : ''}${buffer[i].toString(16).toUpperCase()}`; + } + + return result; + }, - for (var i = 0, len = buffer.length; i < len; i++) { - if (this._checkRanges(buffer[i], ranges)) { - result += String.fromCharCode(buffer[i]); - continue; - } - result += "=" + (buffer[i] < 0x10 ? "0" : "") + buffer[i].toString(16).toUpperCase(); - } - return result; - }, - - /** * Checks if a given number falls within a given set of ranges. * @@ -133,19 +130,22 @@ var QuotedPrintable = { * @param {byte_array[]} ranges * @returns {bolean} */ - _checkRanges: function(nr, ranges) { - for (var i = ranges.length - 1; i >= 0; i--) { - if (!ranges[i].length) - continue; - if (ranges[i].length == 1 && nr == ranges[i][0]) - return true; - if (ranges[i].length == 2 && nr >= ranges[i][0] && nr <= ranges[i][1]) - return true; - } - return false; - }, + _checkRanges(nr, ranges) { + for (let i = ranges.length - 1; i >= 0; i--) { + if (!ranges[i].length) { + continue; + } + if (ranges[i].length == 1 && nr == ranges[i][0]) { + return true; + } + if (ranges[i].length == 2 && nr >= ranges[i][0] && nr <= ranges[i][1]) { + return true; + } + } + return false; + }, + - /** * Adds soft line breaks to a string. * Lines can't be longer that 76 + = 78 bytes @@ -156,19 +156,19 @@ var QuotedPrintable = { * @param {string} encoding * @returns {string} */ - _addSoftLinebreaks: function(str, encoding) { - var lineLengthMax = 76; + _addSoftLinebreaks(str, encoding) { + const lineLengthMax = 76; - encoding = (encoding || "base64").toString().toLowerCase().trim(); + encoding = (encoding || 'base64').toString().toLowerCase().trim(); + + if (encoding == 'qp') { + return this._addQPSoftLinebreaks(str, lineLengthMax); + } else { + return this._addBase64SoftLinebreaks(str, lineLengthMax); + } + }, - if (encoding == "qp") { - return this._addQPSoftLinebreaks(str, lineLengthMax); - } else { - return this._addBase64SoftLinebreaks(str, lineLengthMax); - } - }, - /** * Adds soft line breaks to a base64 string. * @@ -177,12 +177,12 @@ var QuotedPrintable = { * @param {number} lineLengthMax * @returns {string} */ - _addBase64SoftLinebreaks: function(base64EncodedStr, lineLengthMax) { - base64EncodedStr = (base64EncodedStr || "").toString().trim(); - return base64EncodedStr.replace(new RegExp(".{" + lineLengthMax + "}", "g"), "$&\r\n").trim(); - }, + _addBase64SoftLinebreaks(base64EncodedStr, lineLengthMax) { + base64EncodedStr = (base64EncodedStr || '').toString().trim(); + return base64EncodedStr.replace(new RegExp(`.{${lineLengthMax}}`, 'g'), '$&\r\n').trim(); + }, + - /** * Adds soft line breaks to a quoted printable string. * @@ -191,80 +191,78 @@ var QuotedPrintable = { * @param {number} lineLengthMax * @returns {string} */ - _addQPSoftLinebreaks: function(mimeEncodedStr, lineLengthMax) { - var pos = 0, - len = mimeEncodedStr.length, - match, code, line, - lineMargin = Math.floor(lineLengthMax / 3), - result = ""; + _addQPSoftLinebreaks(mimeEncodedStr, lineLengthMax) { + let pos = 0, + len = mimeEncodedStr.length, + match, + code, + line, + lineMargin = Math.floor(lineLengthMax / 3), + result = ''; // insert soft linebreaks where needed - while (pos < len) { - line = mimeEncodedStr.substr(pos, lineLengthMax); - if ((match = line.match(/\r\n/))) { - line = line.substr(0, match.index + match[0].length); - result += line; - pos += line.length; - continue; - } + while (pos < len) { + line = mimeEncodedStr.substr(pos, lineLengthMax); + if ((match = line.match(/\r\n/))) { + line = line.substr(0, match.index + match[0].length); + result += line; + pos += line.length; + continue; + } - if (line.substr(-1) == "\n") { + if (line.substr(-1) == '\n') { // nothing to change here - result += line; - pos += line.length; - continue; - } else if ((match = line.substr(-lineMargin).match(/\n.*?$/))) { + result += line; + pos += line.length; + continue; + } else if ((match = line.substr(-lineMargin).match(/\n.*?$/))) { // truncate to nearest line break - line = line.substr(0, line.length - (match[0].length - 1)); - result += line; - pos += line.length; - continue; - } else if (line.length > lineLengthMax - lineMargin && (match = line.substr(-lineMargin).match(/[ \t\.,!\?][^ \t\.,!\?]*$/))) { + line = line.substr(0, line.length - (match[0].length - 1)); + result += line; + pos += line.length; + continue; + } else if (line.length > lineLengthMax - lineMargin && (match = line.substr(-lineMargin).match(/[ \t\.,!\?][^ \t\.,!\?]*$/))) { // truncate to nearest space - line = line.substr(0, line.length - (match[0].length - 1)); - } else if (line.substr(-1) == "\r") { - line = line.substr(0, line.length - 1); - } else { - if (line.match(/\=[\da-f]{0,2}$/i)) { - + line = line.substr(0, line.length - (match[0].length - 1)); + } else if (line.substr(-1) == '\r') { + line = line.substr(0, line.length - 1); + } else if (line.match(/\=[\da-f]{0,2}$/i)) { // push incomplete encoding sequences to the next line - if ((match = line.match(/\=[\da-f]{0,1}$/i))) { - line = line.substr(0, line.length - match[0].length); - } - - // ensure that utf-8 sequences are not split - while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\da-f]{2}){1,4}$/i) && (match = line.match(/\=[\da-f]{2}$/ig))) { - code = parseInt(match[0].substr(1, 2), 16); - if (code < 128) { - break; - } - - line = line.substr(0, line.length - 3); - - if (code >= 0xC0) { - break; - } - } - - } - } - - if (pos + line.length < len && line.substr(-1) != "\n") { - if (line.length == 76 && line.match(/\=[\da-f]{2}$/i)) { - line = line.substr(0, line.length - 3); - } else if (line.length == 76) { - line = line.substr(0, line.length - 1); - } - pos += line.length; - line += "=\r\n"; - } else { - pos += line.length; - } - - result += line; + if ((match = line.match(/\=[\da-f]{0,1}$/i))) { + line = line.substr(0, line.length - match[0].length); } - return result; - }, - + // ensure that utf-8 sequences are not split + while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\da-f]{2}){1,4}$/i) && (match = line.match(/\=[\da-f]{2}$/ig))) { + code = parseInt(match[0].substr(1, 2), 16); + if (code < 128) { + break; + } + + line = line.substr(0, line.length - 3); + + if (code >= 0xC0) { + break; + } + } + } + + if (pos + line.length < len && line.substr(-1) != '\n') { + if (line.length == 76 && line.match(/\=[\da-f]{2}$/i)) { + line = line.substr(0, line.length - 3); + } else if (line.length == 76) { + line = line.substr(0, line.length - 1); + } + pos += line.length; + line += '=\r\n'; + } else { + pos += line.length; + } + + result += line; + } + + return result; + }, + }; diff --git a/src/js/operations/Rotate.js b/src/js/operations/Rotate.js index eadad540..568e9204 100755 --- a/src/js/operations/Rotate.js +++ b/src/js/operations/Rotate.js @@ -9,19 +9,19 @@ * * @todo Support for UTF16 */ -var Rotate = { +const Rotate = { /** * @constant * @default */ - ROTATE_AMOUNT: 1, + ROTATE_AMOUNT: 1, /** * @constant * @default */ - ROTATE_WHOLE: false, - + ROTATE_WHOLE: false, + /** * Runs rotation operations across the input data. * @@ -31,19 +31,19 @@ var Rotate = { * @param {function} algo - The rotation operation to carry out * @returns {byte_array} */ - _rot: function(data, amount, algo) { - var result = []; - for (var i = 0; i < data.length; i++) { - var b = data[i]; - for (var j = 0; j < amount; j++) { - b = algo(b); - } - result.push(b); - } - return result; - }, - - + _rot(data, amount, algo) { + const result = []; + for (let i = 0; i < data.length; i++) { + let b = data[i]; + for (let j = 0; j < amount; j++) { + b = algo(b); + } + result.push(b); + } + return result; + }, + + /** * Rotate right operation. * @@ -51,15 +51,15 @@ var Rotate = { * @param {Object[]} args * @returns {byte_array} */ - run_rotr: function(input, args) { - if (args[1]) { - return Rotate._rotr_whole(input, args[0]); - } else { - return Rotate._rot(input, args[0], Rotate._rotr); - } - }, - - + run_rotr(input, args) { + if (args[1]) { + return Rotate._rotr_whole(input, args[0]); + } else { + return Rotate._rot(input, args[0], Rotate._rotr); + } + }, + + /** * Rotate left operation. * @@ -67,31 +67,31 @@ var Rotate = { * @param {Object[]} args * @returns {byte_array} */ - run_rotl: function(input, args) { - if (args[1]) { - return Rotate._rotl_whole(input, args[0]); - } else { - return Rotate._rot(input, args[0], Rotate._rotl); - } - }, - - + run_rotl(input, args) { + if (args[1]) { + return Rotate._rotl_whole(input, args[0]); + } else { + return Rotate._rot(input, args[0], Rotate._rotl); + } + }, + + /** * @constant * @default */ - ROT13_AMOUNT: 13, + ROT13_AMOUNT: 13, /** * @constant * @default */ - ROT13_LOWERCASE: true, + ROT13_LOWERCASE: true, /** * @constant * @default */ - ROT13_UPPERCASE: true, - + ROT13_UPPERCASE: true, + /** * ROT13 operation. * @@ -99,33 +99,33 @@ var Rotate = { * @param {Object[]} args * @returns {byte_array} */ - run_rot13: function(input, args) { - var amount = args[2], - output = input, - chr, - rot13_lowercase = args[0], - rot13_upperacse = args[1]; - - if (amount) { - if (amount < 0) { - amount = 26 - (Math.abs(amount) % 26); - } - - for (var i = 0; i < input.length; i++) { - chr = input[i]; - if (rot13_upperacse && chr >= 65 && chr <= 90) { // Upper case - chr = (chr - 65 + amount) % 26; - output[i] = chr + 65; - } else if (rot13_lowercase && chr >= 97 && chr <= 122) { // Lower case - chr = (chr - 97 + amount) % 26; - output[i] = chr + 97; - } - } + run_rot13(input, args) { + let amount = args[2], + output = input, + chr, + rot13_lowercase = args[0], + rot13_upperacse = args[1]; + + if (amount) { + if (amount < 0) { + amount = 26 - (Math.abs(amount) % 26); + } + + for (let i = 0; i < input.length; i++) { + chr = input[i]; + if (rot13_upperacse && chr >= 65 && chr <= 90) { // Upper case + chr = (chr - 65 + amount) % 26; + output[i] = chr + 65; + } else if (rot13_lowercase && chr >= 97 && chr <= 122) { // Lower case + chr = (chr - 97 + amount) % 26; + output[i] = chr + 97; } - return output; - }, - - + } + } + return output; + }, + + /** * Rotate right bitwise op. * @@ -133,12 +133,12 @@ var Rotate = { * @param {byte} b * @returns {byte} */ - _rotr: function(b) { - var bit = (b & 1) << 7; - return (b >> 1) | bit; - }, - - + _rotr(b) { + const bit = (b & 1) << 7; + return (b >> 1) | bit; + }, + + /** * Rotate left bitwise op. * @@ -146,12 +146,12 @@ var Rotate = { * @param {byte} b * @returns {byte} */ - _rotl: function(b) { - var bit = (b >> 7) & 1; - return ((b << 1) | bit) & 0xFF; - }, - - + _rotl(b) { + const bit = (b >> 7) & 1; + return ((b << 1) | bit) & 0xFF; + }, + + /** * Rotates a byte array to the right by a specific amount as a whole, so that bits are wrapped * from the end of the array to the beginning. @@ -161,23 +161,23 @@ var Rotate = { * @param {number} amount * @returns {byte_array} */ - _rotr_whole: function(data, amount) { - var carry_bits = 0, - new_byte, - result = []; - - amount = amount % 8; - for (var i = 0; i < data.length; i++) { - var old_byte = data[i] >>> 0; - new_byte = (old_byte >> amount) | carry_bits; - carry_bits = (old_byte & (Math.pow(2, amount)-1)) << (8-amount); - result.push(new_byte); - } - result[0] |= carry_bits; - return result; - }, - - + _rotr_whole(data, amount) { + let carry_bits = 0, + new_byte, + result = []; + + amount %= 8; + for (let i = 0; i < data.length; i++) { + const old_byte = data[i] >>> 0; + new_byte = (old_byte >> amount) | carry_bits; + carry_bits = (old_byte & (Math.pow(2, amount) - 1)) << (8 - amount); + result.push(new_byte); + } + result[0] |= carry_bits; + return result; + }, + + /** * Rotates a byte array to the left by a specific amount as a whole, so that bits are wrapped * from the beginning of the array to the end. @@ -187,20 +187,20 @@ var Rotate = { * @param {number} amount * @returns {byte_array} */ - _rotl_whole: function(data, amount) { - var carry_bits = 0, - new_byte, - result = []; - - amount = amount % 8; - for (var i = data.length-1; i >= 0; i--) { - var old_byte = data[i]; - new_byte = ((old_byte << amount) | carry_bits) & 0xFF; - carry_bits = (old_byte >> (8-amount)) & (Math.pow(2, amount)-1); - result[i] = (new_byte); - } - result[data.length-1] = result[data.length-1] | carry_bits; - return result; - }, + _rotl_whole(data, amount) { + let carry_bits = 0, + new_byte, + result = []; + + amount %= 8; + for (let i = data.length - 1; i >= 0; i--) { + const old_byte = data[i]; + new_byte = ((old_byte << amount) | carry_bits) & 0xFF; + carry_bits = (old_byte >> (8 - amount)) & (Math.pow(2, amount) - 1); + result[i] = (new_byte); + } + result[data.length - 1] = result[data.length - 1] | carry_bits; + return result; + }, }; diff --git a/src/js/operations/SeqUtils.js b/src/js/operations/SeqUtils.js index fd04b757..16bb4cf5 100755 --- a/src/js/operations/SeqUtils.js +++ b/src/js/operations/SeqUtils.js @@ -7,24 +7,24 @@ * * @namespace */ -var SeqUtils = { +const SeqUtils = { /** * @constant * @default */ - DELIMITER_OPTIONS: ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"], + DELIMITER_OPTIONS: ['Line feed', 'CRLF', 'Space', 'Comma', 'Semi-colon', 'Colon', 'Nothing (separate chars)'], /** * @constant * @default */ - SORT_REVERSE: false, + SORT_REVERSE: false, /** * @constant * @default */ - SORT_ORDER: ["Alphabetical (case sensitive)", "Alphabetical (case insensitive)", "IP address"], - + SORT_ORDER: ['Alphabetical (case sensitive)', 'Alphabetical (case insensitive)', 'IP address'], + /** * Sort operation. * @@ -32,25 +32,25 @@ var SeqUtils = { * @param {Object[]} args * @returns {string} */ - run_sort: function (input, args) { - var delim = Utils.char_rep[args[0]], - sort_reverse = args[1], - order = args[2], - sorted = input.split(delim); - - if (order == "Alphabetical (case sensitive)") { - sorted = sorted.sort(); - } else if (order == "Alphabetical (case insensitive)") { - sorted = sorted.sort(SeqUtils._case_insensitive_sort); - } else if (order == "IP address") { - sorted = sorted.sort(SeqUtils._ip_sort); - } - - if (sort_reverse) sorted.reverse(); - return sorted.join(delim); - }, - - + run_sort(input, args) { + let delim = Utils.char_rep[args[0]], + sort_reverse = args[1], + order = args[2], + sorted = input.split(delim); + + if (order == 'Alphabetical (case sensitive)') { + sorted = sorted.sort(); + } else if (order == 'Alphabetical (case insensitive)') { + sorted = sorted.sort(SeqUtils._case_insensitive_sort); + } else if (order == 'IP address') { + sorted = sorted.sort(SeqUtils._ip_sort); + } + + if (sort_reverse) sorted.reverse(); + return sorted.join(delim); + }, + + /** * Unique operation. * @@ -58,18 +58,18 @@ var SeqUtils = { * @param {Object[]} args * @returns {string} */ - run_unique: function (input, args) { - var delim = Utils.char_rep[args[0]]; - return input.split(delim).unique().join(delim); - }, - - + run_unique(input, args) { + const delim = Utils.char_rep[args[0]]; + return input.split(delim).unique().join(delim); + }, + + /** * @constant * @default */ - SEARCH_TYPE: ["Regex", "Extended (\\n, \\t, \\x...)", "Simple string"], - + SEARCH_TYPE: ['Regex', 'Extended (\\n, \\t, \\x...)', 'Simple string'], + /** * Count occurrences operation. * @@ -77,35 +77,35 @@ var SeqUtils = { * @param {Object[]} args * @returns {number} */ - run_count: function(input, args) { - var search = args[0].string, - type = args[0].option; - - if (type == "Regex" && search) { - try { - var regex = new RegExp(search, "gi"), - matches = input.match(regex); - return matches.length; - } catch(err) { - return 0; - } - } else if (search) { - if (type.indexOf("Extended") === 0) { - search = Utils.parse_escaped_chars(search); - } - return input.count(search); - } else { - return 0; - } - }, - - + run_count(input, args) { + let search = args[0].string, + type = args[0].option; + + if (type == 'Regex' && search) { + try { + let regex = new RegExp(search, 'gi'), + matches = input.match(regex); + return matches.length; + } catch (err) { + return 0; + } + } else if (search) { + if (type.indexOf('Extended') === 0) { + search = Utils.parse_escaped_chars(search); + } + return input.count(search); + } else { + return 0; + } + }, + + /** * @constant * @default */ - REVERSE_BY: ["Character", "Line"], - + REVERSE_BY: ['Character', 'Line'], + /** * Reverse operation. * @@ -113,32 +113,32 @@ var SeqUtils = { * @param {Object[]} args * @returns {byte_array} */ - run_reverse: function (input, args) { - if (args[0] == "Line") { - var lines = [], - line = [], - result = []; - for (var i = 0; i < input.length; i++) { - if (input[i] == 0x0a) { - lines.push(line); - line = []; - } else { - line.push(input[i]); - } - } - lines.push(line); - lines.reverse(); - for (i = 0; i < lines.length; i++) { - result = result.concat(lines[i]); - result.push(0x0a); - } - return result.slice(0, input.length); + run_reverse(input, args) { + if (args[0] == 'Line') { + let lines = [], + line = [], + result = []; + for (var i = 0; i < input.length; i++) { + if (input[i] == 0x0a) { + lines.push(line); + line = []; } else { - return input.reverse(); + line.push(input[i]); } - }, - - + } + lines.push(line); + lines.reverse(); + for (i = 0; i < lines.length; i++) { + result = result.concat(lines[i]); + result.push(0x0a); + } + return result.slice(0, input.length); + } else { + return input.reverse(); + } + }, + + /** * Add line numbers operation. * @@ -146,18 +146,18 @@ var SeqUtils = { * @param {Object[]} args * @returns {string} */ - run_add_line_numbers: function(input, args) { - var lines = input.split("\n"), - output = "", - width = lines.length.toString().length; - - for (var n = 0; n < lines.length; n++) { - output += Utils.pad((n+1).toString(), width, " ") + " " + lines[n] + "\n"; - } - return output.slice(0, output.length-1); - }, - - + run_add_line_numbers(input, args) { + let lines = input.split('\n'), + output = '', + width = lines.length.toString().length; + + for (let n = 0; n < lines.length; n++) { + output += `${Utils.pad((n + 1).toString(), width, ' ')} ${lines[n]}\n`; + } + return output.slice(0, output.length - 1); + }, + + /** * Remove line numbers operation. * @@ -165,11 +165,11 @@ var SeqUtils = { * @param {Object[]} args * @returns {string} */ - run_remove_line_numbers: function(input, args) { - return input.replace(/^[ \t]{0,5}\d+[\s:|\-,.)\]]/gm, ""); - }, - - + run_remove_line_numbers(input, args) { + return input.replace(/^[ \t]{0,5}\d+[\s:|\-,.)\]]/gm, ''); + }, + + /** * Expand alphabet range operation. * @@ -177,11 +177,11 @@ var SeqUtils = { * @param {Object[]} args * @returns {string} */ - run_expand_alph_range: function(input, args) { - return Utils.expand_alph_range(input).join(args[0]); - }, - - + run_expand_alph_range(input, args) { + return Utils.expand_alph_range(input).join(args[0]); + }, + + /** * Comparison operation for sorting of strings ignoring case. * @@ -190,11 +190,11 @@ var SeqUtils = { * @param {string} b * @returns {number} */ - _case_insensitive_sort: function(a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()); - }, - - + _case_insensitive_sort(a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()); + }, + + /** * Comparison operation for sorting of IPv4 addresses. * @@ -203,18 +203,18 @@ var SeqUtils = { * @param {string} b * @returns {number} */ - _ip_sort: function(a, b) { - var a_ = a.split("."), - b_ = b.split("."); - - a_ = a_[0] * 0x1000000 + a_[1] * 0x10000 + a_[2] * 0x100 + a_[3] * 1; - b_ = b_[0] * 0x1000000 + b_[1] * 0x10000 + b_[2] * 0x100 + b_[3] * 1; - - if (isNaN(a_) && !isNaN(b_)) return 1; - if (!isNaN(a_) && isNaN(b_)) return -1; - if (isNaN(a_) && isNaN(b_)) return a.localeCompare(b); - - return a_ - b_; - }, - + _ip_sort(a, b) { + let a_ = a.split('.'), + b_ = b.split('.'); + + a_ = a_[0] * 0x1000000 + a_[1] * 0x10000 + a_[2] * 0x100 + a_[3] * 1; + b_ = b_[0] * 0x1000000 + b_[1] * 0x10000 + b_[2] * 0x100 + b_[3] * 1; + + if (isNaN(a_) && !isNaN(b_)) return 1; + if (!isNaN(a_) && isNaN(b_)) return -1; + if (isNaN(a_) && isNaN(b_)) return a.localeCompare(b); + + return a_ - b_; + }, + }; diff --git a/src/js/operations/StrUtils.js b/src/js/operations/StrUtils.js index f2bf3706..67b808f5 100755 --- a/src/js/operations/StrUtils.js +++ b/src/js/operations/StrUtils.js @@ -9,87 +9,87 @@ * * @namespace */ -var StrUtils = { +const StrUtils = { /** * @constant * @default */ - REGEX_PRE_POPULATE: [ - { - name: "User defined", - value: "" - }, - { - name: "IPv4 address", - value: "(?:(?:\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d|\\d)(?:\\/\\d{1,2})?" - }, - { - name: "IPv6 address", - value: "((?=.*::)(?!.*::.+::)(::)?([\\dA-Fa-f]{1,4}:(:|\\b)|){5}|([\\dA-Fa-f]{1,4}:){6})((([\\dA-Fa-f]{1,4}((?!\\3)::|:\\b|(?![\\dA-Fa-f])))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})" - }, - { - name: "Email address", - value: "(\\w[-.\\w]*)@([-\\w]+(?:\\.[-\\w]+)*)\\.([A-Za-z]{2,4})" - }, - { - name: "URL", - value: "([A-Za-z]+://)([-\\w]+(?:\\.\\w[-\\w]*)+)(:\\d+)?(/[^.!,?;\"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]*(?:[.!,?]+[^.!,?;\"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]+)*)?" - }, - { - name: "Domain", - value: "(?:(https?):\\/\\/)?([-\\w.]+)\\.(com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+" - }, - { - name: "Windows file path", - value: "([A-Za-z]):\\\\((?:[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61}\\\\?)*[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61})(\\.[A-Za-z\\d]{1,6})?" - }, - { - name: "UNIX file path", - value: "(?:/[A-Za-z\\d.][A-Za-z\\d\\-.]{0,61})+" - }, - { - name: "MAC address", - value: "[A-Fa-f\\d]{2}(?:[:-][A-Fa-f\\d]{2}){5}" - }, - { - name: "Date (yyyy-mm-dd)", - value: "((?:19|20)\\d\\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])" - }, - { - name: "Date (dd/mm/yyyy)", - value: "(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((?:19|20)\\d\\d)" - }, - { - name: "Date (mm/dd/yyyy)", - value: "(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)\\d\\d)" - }, - { - name: "Strings", - value: "[A-Za-z\\d/\\-:.,_$%\\x27\"()<>= !\\[\\]{}@]{4,}" - }, - ], + REGEX_PRE_POPULATE: [ + { + name: 'User defined', + value: '', + }, + { + name: 'IPv4 address', + value: '(?:(?:\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d|\\d)(?:\\/\\d{1,2})?', + }, + { + name: 'IPv6 address', + value: '((?=.*::)(?!.*::.+::)(::)?([\\dA-Fa-f]{1,4}:(:|\\b)|){5}|([\\dA-Fa-f]{1,4}:){6})((([\\dA-Fa-f]{1,4}((?!\\3)::|:\\b|(?![\\dA-Fa-f])))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})', + }, + { + name: 'Email address', + value: '(\\w[-.\\w]*)@([-\\w]+(?:\\.[-\\w]+)*)\\.([A-Za-z]{2,4})', + }, + { + name: 'URL', + value: '([A-Za-z]+://)([-\\w]+(?:\\.\\w[-\\w]*)+)(:\\d+)?(/[^.!,?;"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]*(?:[.!,?]+[^.!,?;"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]+)*)?', + }, + { + name: 'Domain', + value: '(?:(https?):\\/\\/)?([-\\w.]+)\\.(com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+', + }, + { + name: 'Windows file path', + value: '([A-Za-z]):\\\\((?:[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61}\\\\?)*[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61})(\\.[A-Za-z\\d]{1,6})?', + }, + { + name: 'UNIX file path', + value: '(?:/[A-Za-z\\d.][A-Za-z\\d\\-.]{0,61})+', + }, + { + name: 'MAC address', + value: '[A-Fa-f\\d]{2}(?:[:-][A-Fa-f\\d]{2}){5}', + }, + { + name: 'Date (yyyy-mm-dd)', + value: '((?:19|20)\\d\\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', + }, + { + name: 'Date (dd/mm/yyyy)', + value: '(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((?:19|20)\\d\\d)', + }, + { + name: 'Date (mm/dd/yyyy)', + value: '(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)\\d\\d)', + }, + { + name: 'Strings', + value: '[A-Za-z\\d/\\-:.,_$%\\x27"()<>= !\\[\\]{}@]{4,}', + }, + ], /** * @constant * @default */ - REGEX_CASE_INSENSITIVE: true, + REGEX_CASE_INSENSITIVE: true, /** * @constant * @default */ - REGEX_MULTILINE_MATCHING: true, + REGEX_MULTILINE_MATCHING: true, /** * @constant * @default */ - OUTPUT_FORMAT: ["Highlight matches", "List matches", "List capture groups", "List matches with capture groups"], + OUTPUT_FORMAT: ['Highlight matches', 'List matches', 'List capture groups', 'List matches with capture groups'], /** * @constant * @default */ - DISPLAY_TOTAL: false, - + DISPLAY_TOTAL: false, + /** * Regular expression operation. * @@ -97,79 +97,48 @@ var StrUtils = { * @param {Object[]} args * @returns {html} */ - run_regex: function(input, args) { - var user_regex = args[1], - i = args[2], - m = args[3], - display_total = args[4], - output_format = args[5], - modifiers = "g"; - - if (i) modifiers += "i"; - if (m) modifiers += "m"; - - if (user_regex && user_regex != "^" && user_regex != "$") { - try { - var regex = new RegExp(user_regex, modifiers); - - switch (output_format) { - case "Highlight matches": - return StrUtils._regex_highlight(input, regex, display_total); - case "List matches": - return Utils.escape_html(StrUtils._regex_list(input, regex, display_total, true, false)); - case "List capture groups": - return Utils.escape_html(StrUtils._regex_list(input, regex, display_total, false, true)); - case "List matches with capture groups": - return Utils.escape_html(StrUtils._regex_list(input, regex, display_total, true, true)); - default: - return "Error: Invalid output format"; - } - } catch (err) { - return "Invalid regex. Details: " + err.message; - } - } else { - return Utils.escape_html(input); - } - }, + run_regex(input, args) { + let user_regex = args[1], + i = args[2], + m = args[3], + display_total = args[4], + output_format = args[5], + modifiers = 'g'; - - /** - * @constant - * @default - */ - CASE_SCOPE: ["All", "Word", "Sentence", "Paragraph"], - - /** - * To Upper case operation. - * - * @param {string} input - * @param {Object[]} args - * @returns {string} - */ - run_upper: function (input, args) { - var scope = args[0]; - - switch (scope) { - case "Word": - return input.replace(/(\b\w)/gi, function(m) { - return m.toUpperCase(); - }); - case "Sentence": - return input.replace(/(?:\.|^)\s*(\b\w)/gi, function(m) { - return m.toUpperCase(); - }); - case "Paragraph": - return input.replace(/(?:\n|^)\s*(\b\w)/gi, function(m) { - return m.toUpperCase(); - }); - case "All": - /* falls through */ - default: - return input.toUpperCase(); + if (i) modifiers += 'i'; + if (m) modifiers += 'm'; + + if (user_regex && user_regex != '^' && user_regex != '$') { + try { + const regex = new RegExp(user_regex, modifiers); + + switch (output_format) { + case 'Highlight matches': + return StrUtils._regex_highlight(input, regex, display_total); + case 'List matches': + return Utils.escape_html(StrUtils._regex_list(input, regex, display_total, true, false)); + case 'List capture groups': + return Utils.escape_html(StrUtils._regex_list(input, regex, display_total, false, true)); + case 'List matches with capture groups': + return Utils.escape_html(StrUtils._regex_list(input, regex, display_total, true, true)); + default: + return 'Error: Invalid output format'; } - }, - - + } catch (err) { + return `Invalid regex. Details: ${err.message}`; + } + } else { + return Utils.escape_html(input); + } + }, + + + /** + * @constant + * @default + */ + CASE_SCOPE: ['All', 'Word', 'Sentence', 'Paragraph'], + /** * To Upper case operation. * @@ -177,32 +146,57 @@ var StrUtils = { * @param {Object[]} args * @returns {string} */ - run_lower: function (input, args) { - return input.toLowerCase(); - }, - - + run_upper(input, args) { + const scope = args[0]; + + switch (scope) { + case 'Word': + return input.replace(/(\b\w)/gi, m => m.toUpperCase()); + case 'Sentence': + return input.replace(/(?:\.|^)\s*(\b\w)/gi, m => m.toUpperCase()); + case 'Paragraph': + return input.replace(/(?:\n|^)\s*(\b\w)/gi, m => m.toUpperCase()); + case 'All': + /* falls through */ + default: + return input.toUpperCase(); + } + }, + + + /** + * To Upper case operation. + * + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run_lower(input, args) { + return input.toLowerCase(); + }, + + /** * @constant * @default */ - SEARCH_TYPE: ["Regex", "Extended (\\n, \\t, \\x...)", "Simple string"], + SEARCH_TYPE: ['Regex', 'Extended (\\n, \\t, \\x...)', 'Simple string'], /** * @constant * @default */ - FIND_REPLACE_GLOBAL : true, + FIND_REPLACE_GLOBAL: true, /** * @constant * @default */ - FIND_REPLACE_CASE : false, + FIND_REPLACE_CASE: false, /** * @constant * @default */ - FIND_REPLACE_MULTILINE : true, - + FIND_REPLACE_MULTILINE: true, + /** * Find / Replace operation. * @@ -210,43 +204,43 @@ var StrUtils = { * @param {Object[]} args * @returns {string} */ - run_find_replace: function(input, args) { - var find = args[0].string, - type = args[0].option, - replace = args[1], - g = args[2], - i = args[3], - m = args[4], - modifiers = ""; - - if (g) modifiers += "g"; - if (i) modifiers += "i"; - if (m) modifiers += "m"; - - if (type == "Regex") { - find = new RegExp(find, modifiers); - } else if (type.indexOf("Extended") === 0) { - find = Utils.parse_escaped_chars(find); - } - - return input.replace(find, replace, modifiers); + run_find_replace(input, args) { + let find = args[0].string, + type = args[0].option, + replace = args[1], + g = args[2], + i = args[3], + m = args[4], + modifiers = ''; + + if (g) modifiers += 'g'; + if (i) modifiers += 'i'; + if (m) modifiers += 'm'; + + if (type == 'Regex') { + find = new RegExp(find, modifiers); + } else if (type.indexOf('Extended') === 0) { + find = Utils.parse_escaped_chars(find); + } + + return input.replace(find, replace, modifiers); // Non-standard addition of flags in the third argument. This will work in Firefox but // probably nowhere else. The purpose is to allow global matching when the `find` parameter // is just a string. - }, - - + }, + + /** * @constant * @default */ - SPLIT_DELIM: ",", + SPLIT_DELIM: ',', /** * @constant * @default */ - DELIMITER_OPTIONS: ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"], - + DELIMITER_OPTIONS: ['Line feed', 'CRLF', 'Space', 'Comma', 'Semi-colon', 'Colon', 'Nothing (separate chars)'], + /** * Split operation. * @@ -254,26 +248,26 @@ var StrUtils = { * @param {Object[]} args * @returns {string} */ - run_split: function(input, args) { - var split_delim = args[0] || StrUtils.SPLIT_DELIM, - join_delim = Utils.char_rep[args[1]], - sections = input.split(split_delim); - - return sections.join(join_delim); - }, - - + run_split(input, args) { + let split_delim = args[0] || StrUtils.SPLIT_DELIM, + join_delim = Utils.char_rep[args[1]], + sections = input.split(split_delim); + + return sections.join(join_delim); + }, + + /** * @constant * @default */ - DIFF_SAMPLE_DELIMITER: "\\n\\n", + DIFF_SAMPLE_DELIMITER: '\\n\\n', /** * @constant * @default */ - DIFF_BY: ["Character", "Word", "Line", "Sentence", "CSS", "JSON"], - + DIFF_BY: ['Character', 'Word', 'Line', 'Sentence', 'CSS', 'JSON'], + /** * Diff operation. * @@ -281,71 +275,71 @@ var StrUtils = { * @param {Object[]} args * @returns {html} */ - run_diff: function(input, args) { - var sample_delim = args[0], - diff_by = args[1], - show_added = args[2], - show_removed = args[3], - ignore_whitespace = args[4], - samples = input.split(sample_delim), - output = "", - diff; - - if (!samples || samples.length != 2) { - return "Incorrect number of samples, perhaps you need to modify the sample delimiter or add more samples?"; + run_diff(input, args) { + let sample_delim = args[0], + diff_by = args[1], + show_added = args[2], + show_removed = args[3], + ignore_whitespace = args[4], + samples = input.split(sample_delim), + output = '', + diff; + + if (!samples || samples.length != 2) { + return 'Incorrect number of samples, perhaps you need to modify the sample delimiter or add more samples?'; + } + + switch (diff_by) { + case 'Character': + diff = JsDiff.diffChars(samples[0], samples[1]); + break; + case 'Word': + if (ignore_whitespace) { + diff = JsDiff.diffWords(samples[0], samples[1]); + } else { + diff = JsDiff.diffWordsWithSpace(samples[0], samples[1]); } - - switch (diff_by) { - case "Character": - diff = JsDiff.diffChars(samples[0], samples[1]); - break; - case "Word": - if (ignore_whitespace) { - diff = JsDiff.diffWords(samples[0], samples[1]); - } else { - diff = JsDiff.diffWordsWithSpace(samples[0], samples[1]); - } - break; - case "Line": - if (ignore_whitespace) { - diff = JsDiff.diffTrimmedLines(samples[0], samples[1]); - } else { - diff = JsDiff.diffLines(samples[0], samples[1]); - } - break; - case "Sentence": - diff = JsDiff.diffSentences(samples[0], samples[1]); - break; - case "CSS": - diff = JsDiff.diffCss(samples[0], samples[1]); - break; - case "JSON": - diff = JsDiff.diffJson(samples[0], samples[1]); - break; - default: - return "Invalid 'Diff by' option."; + break; + case 'Line': + if (ignore_whitespace) { + diff = JsDiff.diffTrimmedLines(samples[0], samples[1]); + } else { + diff = JsDiff.diffLines(samples[0], samples[1]); } - - for (var i = 0; i < diff.length; i++) { - if (diff[i].added) { - if (show_added) output += "" + Utils.escape_html(diff[i].value) + ""; - } else if (diff[i].removed) { - if (show_removed) output += "" + Utils.escape_html(diff[i].value) + ""; - } else { - output += Utils.escape_html(diff[i].value); - } - } - - return output; - }, - - + break; + case 'Sentence': + diff = JsDiff.diffSentences(samples[0], samples[1]); + break; + case 'CSS': + diff = JsDiff.diffCss(samples[0], samples[1]); + break; + case 'JSON': + diff = JsDiff.diffJson(samples[0], samples[1]); + break; + default: + return "Invalid 'Diff by' option."; + } + + for (let i = 0; i < diff.length; i++) { + if (diff[i].added) { + if (show_added) output += `${Utils.escape_html(diff[i].value)}`; + } else if (diff[i].removed) { + if (show_removed) output += `${Utils.escape_html(diff[i].value)}`; + } else { + output += Utils.escape_html(diff[i].value); + } + } + + return output; + }, + + /** * @constant * @default */ - OFF_CHK_SAMPLE_DELIMITER: "\\n\\n", - + OFF_CHK_SAMPLE_DELIMITER: '\\n\\n', + /** * Offset checker operation. * @@ -353,73 +347,73 @@ var StrUtils = { * @param {Object[]} args * @returns {html} */ - run_offset_checker: function(input, args) { - var sample_delim = args[0], - samples = input.split(sample_delim), - outputs = [], - i = 0, - s = 0, - match = false, - in_match = false, - chr; - - if (!samples || samples.length < 2) { - return "Not enough samples, perhaps you need to modify the sample delimiter or add more data?"; - } - + run_offset_checker(input, args) { + let sample_delim = args[0], + samples = input.split(sample_delim), + outputs = [], + i = 0, + s = 0, + match = false, + in_match = false, + chr; + + if (!samples || samples.length < 2) { + return 'Not enough samples, perhaps you need to modify the sample delimiter or add more data?'; + } + // Initialise output strings - for (s = 0; s < samples.length; s++) { - outputs[s] = ""; - } - + for (s = 0; s < samples.length; s++) { + outputs[s] = ''; + } + // Loop through each character in the first sample - for (i = 0; i < samples[0].length; i++) { - chr = samples[0][i]; - match = false; - + for (i = 0; i < samples[0].length; i++) { + chr = samples[0][i]; + match = false; + // Loop through each sample to see if the chars are the same - for (s = 1; s < samples.length; s++) { - if (samples[s][i] != chr) { - match = false; - break; - } - match = true; - } - - // Write output for each sample - for (s = 0; s < samples.length; s++) { - if (samples[s].length <= i) { - if (in_match) outputs[s] += "
"; - if (s == samples.length - 1) in_match = false; - continue; - } - - if (match && !in_match) { - outputs[s] += "" + Utils.escape_html(samples[s][i]); - if (samples[s].length == i + 1) outputs[s] += ""; - if (s == samples.length - 1) in_match = true; - } else if (!match && in_match) { - outputs[s] += "
" + Utils.escape_html(samples[s][i]); - if (s == samples.length - 1) in_match = false; - } else { - outputs[s] += Utils.escape_html(samples[s][i]); - if (in_match && samples[s].length == i + 1) { - outputs[s] += "
"; - if (samples[s].length - 1 != i) in_match = false; - } - } - - if (samples[0].length - 1 == i) { - if (in_match) outputs[s] += "
"; - outputs[s] += Utils.escape_html(samples[s].substring(i + 1)); - } - } + for (s = 1; s < samples.length; s++) { + if (samples[s][i] != chr) { + match = false; + break; } - - return outputs.join(sample_delim); - }, - - + match = true; + } + + // Write output for each sample + for (s = 0; s < samples.length; s++) { + if (samples[s].length <= i) { + if (in_match) outputs[s] += ''; + if (s == samples.length - 1) in_match = false; + continue; + } + + if (match && !in_match) { + outputs[s] += `${Utils.escape_html(samples[s][i])}`; + if (samples[s].length == i + 1) outputs[s] += ''; + if (s == samples.length - 1) in_match = true; + } else if (!match && in_match) { + outputs[s] += `${Utils.escape_html(samples[s][i])}`; + if (s == samples.length - 1) in_match = false; + } else { + outputs[s] += Utils.escape_html(samples[s][i]); + if (in_match && samples[s].length == i + 1) { + outputs[s] += ''; + if (samples[s].length - 1 != i) in_match = false; + } + } + + if (samples[0].length - 1 == i) { + if (in_match) outputs[s] += ''; + outputs[s] += Utils.escape_html(samples[s].substring(i + 1)); + } + } + } + + return outputs.join(sample_delim); + }, + + /** * Parse escaped string operation. * @@ -427,11 +421,11 @@ var StrUtils = { * @param {Object[]} args * @returns {string} */ - run_parse_escaped_string: function(input, args) { - return Utils.parse_escaped_chars(input); - }, - - + run_parse_escaped_string(input, args) { + return Utils.parse_escaped_chars(input); + }, + + /** * Adds HTML highlights to matches within a string. * @@ -441,37 +435,36 @@ var StrUtils = { * @param {boolean} display_total * @returns {string} */ - _regex_highlight: function(input, regex, display_total) { - var output = "", - m, - hl = 1, - i = 0, - total = 0; - - while (!!(m = regex.exec(input))) { - // Add up to match - output += Utils.escape_html(input.slice(i, m.index)); - - // Add match with highlighting - output += "" + Utils.escape_html(m[0]) + ""; - - // Switch highlight - hl = hl == 1 ? 2 : 1; - - i = regex.lastIndex; - total++; - } - - // Add all after final match - output += Utils.escape_html(input.slice(i, input.length)); - - if (display_total) - output = "Total found: " + total + "\n\n" + output; + _regex_highlight(input, regex, display_total) { + let output = '', + m, + hl = 1, + i = 0, + total = 0; + + while (m = regex.exec(input)) { + // Add up to match + output += Utils.escape_html(input.slice(i, m.index)); + + // Add match with highlighting + output += `${Utils.escape_html(m[0])}`; + + // Switch highlight + hl = hl == 1 ? 2 : 1; + + i = regex.lastIndex; + total++; + } + + // Add all after final match + output += Utils.escape_html(input.slice(i, input.length)); + + if (display_total) { output = `Total found: ${total}\n\n${output}`; } + + return output; + }, + - return output; - }, - - /** * Creates a string listing the matches within a string. * @@ -483,30 +476,29 @@ var StrUtils = { * @param {boolean} capture_groups - Display each of the capture groups separately * @returns {string} */ - _regex_list: function(input, regex, display_total, matches, capture_groups) { - var output = "", - total = 0, - match; - - while (!!(match = regex.exec(input))) { - total++; - if (matches) { - output += match[0] + "\n"; - } - if (capture_groups) { - for (var i = 1; i < match.length; i++) { - if (matches) { - output += " Group " + i + ": "; - } - output += match[i] + "\n"; - } - } + _regex_list(input, regex, display_total, matches, capture_groups) { + let output = '', + total = 0, + match; + + while (match = regex.exec(input)) { + total++; + if (matches) { + output += `${match[0]}\n`; + } + if (capture_groups) { + for (let i = 1; i < match.length; i++) { + if (matches) { + output += ` Group ${i}: `; + } + output += `${match[i]}\n`; } - - if (display_total) - output = "Total found: " + total + "\n\n" + output; - - return output; - }, - + } + } + + if (display_total) { output = `Total found: ${total}\n\n${output}`; } + + return output; + }, + }; diff --git a/src/js/operations/Tidy.js b/src/js/operations/Tidy.js index e003b06f..00fe817f 100755 --- a/src/js/operations/Tidy.js +++ b/src/js/operations/Tidy.js @@ -7,39 +7,39 @@ * * @namespace */ -var Tidy = { +const Tidy = { /** * @constant * @default */ - REMOVE_SPACES : true, + REMOVE_SPACES: true, /** * @constant * @default */ - REMOVE_CARIAGE_RETURNS : true, + REMOVE_CARIAGE_RETURNS: true, /** * @constant * @default */ - REMOVE_LINE_FEEDS : true, + REMOVE_LINE_FEEDS: true, /** * @constant * @default */ - REMOVE_TABS : true, + REMOVE_TABS: true, /** * @constant * @default */ - REMOVE_FORM_FEEDS : true, + REMOVE_FORM_FEEDS: true, /** * @constant * @default */ - REMOVE_FULL_STOPS : false, - + REMOVE_FULL_STOPS: false, + /** * Remove whitespace operation. * @@ -47,25 +47,25 @@ var Tidy = { * @param {Object[]} args * @returns {string} */ - run_remove_whitespace: function (input, args) { - var remove_spaces = args[0], - remove_cariage_returns = args[1], - remove_line_feeds = args[2], - remove_tabs = args[3], - remove_form_feeds = args[4], - remove_full_stops = args[5], - data = input; - - if (remove_spaces) data = data.replace(/ /g, ""); - if (remove_cariage_returns) data = data.replace(/\r/g, ""); - if (remove_line_feeds) data = data.replace(/\n/g, ""); - if (remove_tabs) data = data.replace(/\t/g, ""); - if (remove_form_feeds) data = data.replace(/\f/g, ""); - if (remove_full_stops) data = data.replace(/\./g, ""); - return data; - }, - - + run_remove_whitespace(input, args) { + let remove_spaces = args[0], + remove_cariage_returns = args[1], + remove_line_feeds = args[2], + remove_tabs = args[3], + remove_form_feeds = args[4], + remove_full_stops = args[5], + data = input; + + if (remove_spaces) data = data.replace(/ /g, ''); + if (remove_cariage_returns) data = data.replace(/\r/g, ''); + if (remove_line_feeds) data = data.replace(/\n/g, ''); + if (remove_tabs) data = data.replace(/\t/g, ''); + if (remove_form_feeds) data = data.replace(/\f/g, ''); + if (remove_full_stops) data = data.replace(/\./g, ''); + return data; + }, + + /** * Remove null bytes operation. * @@ -73,31 +73,31 @@ var Tidy = { * @param {Object[]} args * @returns {byte_array} */ - run_remove_nulls: function (input, args) { - var output = []; - for (var i = 0; i < input.length; i++) { - if (input[i] !== 0) output.push(input[i]); - } - return output; - }, - - + run_remove_nulls(input, args) { + const output = []; + for (let i = 0; i < input.length; i++) { + if (input[i] !== 0) output.push(input[i]); + } + return output; + }, + + /** * @constant * @default */ - APPLY_TO_EACH_LINE : false, + APPLY_TO_EACH_LINE: false, /** * @constant * @default */ - DROP_START : 0, + DROP_START: 0, /** * @constant * @default */ - DROP_LENGTH : 5, - + DROP_LENGTH: 5, + /** * Drop bytes operation. * @@ -105,51 +105,53 @@ var Tidy = { * @param {Object[]} args * @returns {byte_array} */ - run_drop_bytes: function(input, args) { - var start = args[0], - length = args[1], - apply_to_each_line = args[2]; - - if (start < 0 || length < 0) - throw "Error: Invalid value"; - - if (!apply_to_each_line) - return input.slice(0, start).concat(input.slice(start+length, input.length)); - + run_drop_bytes(input, args) { + let start = args[0], + length = args[1], + apply_to_each_line = args[2]; + + if (start < 0 || length < 0) { + throw 'Error: Invalid value'; + } + + if (!apply_to_each_line) { + return input.slice(0, start).concat(input.slice(start + length, input.length)); + } + // Split input into lines - var lines = [], - line = []; - - for (var i = 0; i < input.length; i++) { - if (input[i] == 0x0a) { - lines.push(line); - line = []; - } else { - line.push(input[i]); - } - } + let lines = [], + line = []; + + for (var i = 0; i < input.length; i++) { + if (input[i] == 0x0a) { lines.push(line); - - var output = []; - for (i = 0; i < lines.length; i++) { - output = output.concat(lines[i].slice(0, start).concat(lines[i].slice(start+length, lines[i].length))); - output.push(0x0a); - } - return output.slice(0, output.length-1); - }, - - + line = []; + } else { + line.push(input[i]); + } + } + lines.push(line); + + let output = []; + for (i = 0; i < lines.length; i++) { + output = output.concat(lines[i].slice(0, start).concat(lines[i].slice(start + length, lines[i].length))); + output.push(0x0a); + } + return output.slice(0, output.length - 1); + }, + + /** * @constant * @default */ - TAKE_START: 0, + TAKE_START: 0, /** * @constant * @default */ - TAKE_LENGTH: 5, - + TAKE_LENGTH: 5, + /** * Take bytes operation. * @@ -157,56 +159,58 @@ var Tidy = { * @param {Object[]} args * @returns {byte_array} */ - run_take_bytes: function(input, args) { - var start = args[0], - length = args[1], - apply_to_each_line = args[2]; - - if (start < 0 || length < 0) - throw "Error: Invalid value"; - - if (!apply_to_each_line) - return input.slice(start, start+length); - + run_take_bytes(input, args) { + let start = args[0], + length = args[1], + apply_to_each_line = args[2]; + + if (start < 0 || length < 0) { + throw 'Error: Invalid value'; + } + + if (!apply_to_each_line) { + return input.slice(start, start + length); + } + // Split input into lines - var lines = [], - line = []; - - for (var i = 0; i < input.length; i++) { - if (input[i] == 0x0a) { - lines.push(line); - line = []; - } else { - line.push(input[i]); - } - } + let lines = [], + line = []; + + for (var i = 0; i < input.length; i++) { + if (input[i] == 0x0a) { lines.push(line); - - var output = []; - for (i = 0; i < lines.length; i++) { - output = output.concat(lines[i].slice(start, start+length)); - output.push(0x0a); - } - return output.slice(0, output.length-1); - }, - - + line = []; + } else { + line.push(input[i]); + } + } + lines.push(line); + + let output = []; + for (i = 0; i < lines.length; i++) { + output = output.concat(lines[i].slice(start, start + length)); + output.push(0x0a); + } + return output.slice(0, output.length - 1); + }, + + /** * @constant * @default */ - PAD_POSITION : ["Start", "End"], + PAD_POSITION: ['Start', 'End'], /** * @constant * @default */ - PAD_LENGTH : 5, + PAD_LENGTH: 5, /** * @constant * @default */ - PAD_CHAR : " ", - + PAD_CHAR: ' ', + /** * Pad lines operation. * @@ -214,25 +218,25 @@ var Tidy = { * @param {Object[]} args * @returns {string} */ - run_pad: function(input, args) { - var position = args[0], - len = args[1], - chr = args[2], - lines = input.split("\n"), - output = "", - i = 0; - - if (position == "Start") { - for (i = 0; i < lines.length; i++) { - output += Utils.pad_left(lines[i], lines[i].length+len, chr) + "\n"; - } - } else if (position == "End") { - for (i = 0; i < lines.length; i++) { - output += Utils.pad_right(lines[i], lines[i].length+len, chr) + "\n"; - } - } - - return output.slice(0, output.length-1); - }, - + run_pad(input, args) { + let position = args[0], + len = args[1], + chr = args[2], + lines = input.split('\n'), + output = '', + i = 0; + + if (position == 'Start') { + for (i = 0; i < lines.length; i++) { + output += `${Utils.pad_left(lines[i], lines[i].length + len, chr)}\n`; + } + } else if (position == 'End') { + for (i = 0; i < lines.length; i++) { + output += `${Utils.pad_right(lines[i], lines[i].length + len, chr)}\n`; + } + } + + return output.slice(0, output.length - 1); + }, + }; diff --git a/src/js/operations/URL.js b/src/js/operations/URL.js index 6734f4c0..0704494e 100755 --- a/src/js/operations/URL.js +++ b/src/js/operations/URL.js @@ -10,14 +10,14 @@ * * @namespace */ -var URL_ = { +const URL_ = { /** * @constant * @default */ - ENCODE_ALL: false, - + ENCODE_ALL: false, + /** * URL Encode operation. * @@ -25,12 +25,12 @@ var URL_ = { * @param {Object[]} args * @returns {string} */ - run_to: function(input, args) { - var encode_all = args[0]; - return encode_all ? URL_._encode_all_chars(input) : encodeURI(input); - }, - - + run_to(input, args) { + const encode_all = args[0]; + return encode_all ? URL_._encode_all_chars(input) : encodeURI(input); + }, + + /** * URL Decode operation. * @@ -38,16 +38,16 @@ var URL_ = { * @param {Object[]} args * @returns {string} */ - run_from: function(input, args) { - var data = input.replace(/\+/g, "%20"); - try { - return decodeURIComponent(data); - } catch(err) { - return unescape(data); - } - }, - - + run_from(input, args) { + const data = input.replace(/\+/g, '%20'); + try { + return decodeURIComponent(data); + } catch (err) { + return unescape(data); + } + }, + + /** * Parse URI operation. * @@ -55,56 +55,59 @@ var URL_ = { * @param {Object[]} args * @returns {string} */ - run_parse: function(input, args) { - var a = document.createElement("a"); - + run_parse(input, args) { + const a = document.createElement('a'); + // Overwrite base href which will be the current CyberChef URL to reduce confusion. - a.href = "http://example.com/"; - a.href = input; - - if (a.protocol) { - var output = ""; - if (a.hostname != window.location.hostname) { - output = "Protocol:\t" + a.protocol + "\n"; - if (a.hostname) output += "Hostname:\t" + a.hostname + "\n"; - if (a.port) output += "Port:\t\t" + a.port + "\n"; - } - - if (a.pathname) { - var pathname = a.pathname; - if (pathname.indexOf(window.location.pathname) === 0) - pathname = pathname.replace(window.location.pathname, ""); - if (pathname) - output += "Path name:\t" + pathname + "\n"; - } - - if (a.hash) { - output += "Hash:\t\t" + a.hash + "\n"; - } - - if (a.search) { - output += "Arguments:\n"; - var args_ = (a.search.slice(1, a.search.length)).split("&"); - var split_args = [], padding = 0; - for (var i = 0; i < args_.length; i++) { - split_args.push(args_[i].split("=")); - padding = (split_args[i][0].length > padding) ? split_args[i][0].length : padding; - } - for (i = 0; i < split_args.length; i++) { - output += "\t" + Utils.pad_right(split_args[i][0], padding); - if (split_args[i].length > 1 && split_args[i][1].length) - output += " = " + split_args[i][1] + "\n"; - else output += "\n"; - } - } - - return output; + a.href = 'http://example.com/'; + a.href = input; + + if (a.protocol) { + let output = ''; + if (a.hostname != window.location.hostname) { + output = `Protocol:\t${a.protocol}\n`; + if (a.hostname) output += `Hostname:\t${a.hostname}\n`; + if (a.port) output += `Port:\t\t${a.port}\n`; + } + + if (a.pathname) { + let pathname = a.pathname; + if (pathname.indexOf(window.location.pathname) === 0) { + pathname = pathname.replace(window.location.pathname, ''); } - - return "Invalid URI"; - }, - - + if (pathname) { + output += `Path name:\t${pathname}\n`; + } + } + + if (a.hash) { + output += `Hash:\t\t${a.hash}\n`; + } + + if (a.search) { + output += 'Arguments:\n'; + const args_ = (a.search.slice(1, a.search.length)).split('&'); + let split_args = [], + padding = 0; + for (var i = 0; i < args_.length; i++) { + split_args.push(args_[i].split('=')); + padding = (split_args[i][0].length > padding) ? split_args[i][0].length : padding; + } + for (i = 0; i < split_args.length; i++) { + output += `\t${Utils.pad_right(split_args[i][0], padding)}`; + if (split_args[i].length > 1 && split_args[i][1].length) { + output += ` = ${split_args[i][1]}\n`; + } else output += '\n'; + } + } + + return output; + } + + return 'Invalid URI'; + }, + + /** * URL encodes additional special characters beyond the standard set. * @@ -112,19 +115,19 @@ var URL_ = { * @param {string} str * @returns {string} */ - _encode_all_chars: function(str) { - //TODO Do this programatically - return encodeURIComponent(str) - .replace(/!/g, "%21") - .replace(/#/g, "%23") - .replace(/'/g, "%27") - .replace(/\(/g, "%28") - .replace(/\)/g, "%29") - .replace(/\*/g, "%2A") - .replace(/\-/g, "%2D") - .replace(/\./g, "%2E") - .replace(/_/g, "%5F") - .replace(/~/g, "%7E"); - }, - + _encode_all_chars(str) { + // TODO Do this programatically + return encodeURIComponent(str) + .replace(/!/g, '%21') + .replace(/#/g, '%23') + .replace(/'/g, '%27') + .replace(/\(/g, '%28') + .replace(/\)/g, '%29') + .replace(/\*/g, '%2A') + .replace(/\-/g, '%2D') + .replace(/\./g, '%2E') + .replace(/_/g, '%5F') + .replace(/~/g, '%7E'); + }, + }; diff --git a/src/js/operations/UUID.js b/src/js/operations/UUID.js index a58fb45b..1909f9ad 100755 --- a/src/js/operations/UUID.js +++ b/src/js/operations/UUID.js @@ -7,7 +7,7 @@ * * @namespace */ -var UUID = { +const UUID = { /** * Generate UUID operation. @@ -16,24 +16,24 @@ var UUID = { * @param {Object[]} args * @returns {string} */ - run_generate_v4: function(input, args) { - if (typeof(window.crypto) !== 'undefined' && typeof(window.crypto.getRandomValues) !== 'undefined') { - var buf = new Uint32Array(4), - i = 0; - window.crypto.getRandomValues(buf); - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { - var r = (buf[i >> 3] >> ((i % 8) * 4)) & 0xf, - v = c === "x" ? r : (r & 0x3 | 0x8); - i++; - return v.toString(16); - }); - } else { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { - var r = Math.random() * 16 | 0, - v = c === "x" ? r : (r & 0x3 | 0x8); - return v.toString(16); - }); - } - }, + run_generate_v4(input, args) { + if (typeof (window.crypto) !== 'undefined' && typeof (window.crypto.getRandomValues) !== 'undefined') { + let buf = new Uint32Array(4), + i = 0; + window.crypto.getRandomValues(buf); + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { + let r = (buf[i >> 3] >> ((i % 8) * 4)) & 0xf, + v = c === 'x' ? r : (r & 0x3 | 0x8); + i++; + return v.toString(16); + }); + } else { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { + let r = Math.random() * 16 | 0, + v = c === 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); + } + }, }; diff --git a/src/js/operations/Unicode.js b/src/js/operations/Unicode.js index 6b5a00d4..e7d62b40 100755 --- a/src/js/operations/Unicode.js +++ b/src/js/operations/Unicode.js @@ -7,13 +7,13 @@ * * @namespace */ -var Unicode = { +const Unicode = { /** * @constant * @default */ - PREFIXES: ["\\u", "%u", "U+"], + PREFIXES: ['\\u', '%u', 'U+'], /** * Unescape Unicode Characters operation. @@ -22,41 +22,41 @@ var Unicode = { * @param {Object[]} args * @returns {string} */ - run_unescape: function(input, args) { - var prefix = Unicode._prefix_to_regex[args[0]], - regex = new RegExp(prefix+"([a-f\\d]{4,6})", "ig"), - output = "", - m, - i = 0; - - while (!!(m = regex.exec(input))) { + run_unescape(input, args) { + let prefix = Unicode._prefix_to_regex[args[0]], + regex = new RegExp(`${prefix}([a-f\\d]{4,6})`, 'ig'), + output = '', + m, + i = 0; + + while (m = regex.exec(input)) { // Add up to match - output += input.slice(i, m.index); - i = m.index; - + output += input.slice(i, m.index); + i = m.index; + // Add match - output += Utils.chr(parseInt(m[1], 16)); - - i = regex.lastIndex; - } - + output += Utils.chr(parseInt(m[1], 16)); + + i = regex.lastIndex; + } + // Add all after final match - output += input.slice(i, input.length); - - return output; - }, - - + output += input.slice(i, input.length); + + return output; + }, + + /** * Lookup table to add prefixes to unicode delimiters so that they can be used in a regex. * * @private * @constant */ - _prefix_to_regex: { - "\\u": "\\\\u", - "%u": "%u", - "U+": "U\\+" - }, + _prefix_to_regex: { + '\\u': '\\\\u', + '%u': '%u', + 'U+': 'U\\+', + }, }; diff --git a/src/js/views/html/ControlsWaiter.js b/src/js/views/html/ControlsWaiter.js index 9d5113be..e00c8cd4 100755 --- a/src/js/views/html/ControlsWaiter.js +++ b/src/js/views/html/ControlsWaiter.js @@ -9,9 +9,9 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var ControlsWaiter = function(app, manager) { - this.app = app; - this.manager = manager; +const ControlsWaiter = function (app, manager) { + this.app = app; + this.manager = manager; }; @@ -19,41 +19,41 @@ var ControlsWaiter = function(app, manager) { * Adjusts the display properties of the control buttons so that they fit within the current width * without wrapping or overflowing. */ -ControlsWaiter.prototype.adjust_width = function() { - var controls = document.getElementById("controls"), - step = document.getElementById("step"), - clr_breaks = document.getElementById("clr-breaks"), - save_img = document.querySelector("#save img"), - load_img = document.querySelector("#load img"), - step_img = document.querySelector("#step img"), - clr_recip_img = document.querySelector("#clr-recipe img"), - clr_breaks_img = document.querySelector("#clr-breaks img"); - - if (controls.clientWidth < 470) { - step.childNodes[1].nodeValue = " Step"; - } else { - step.childNodes[1].nodeValue = " Step through"; - } - - if (controls.clientWidth < 400) { - save_img.style.display = "none"; - load_img.style.display = "none"; - step_img.style.display = "none"; - clr_recip_img.style.display = "none"; - clr_breaks_img.style.display = "none"; - } else { - save_img.style.display = "inline"; - load_img.style.display = "inline"; - step_img.style.display = "inline"; - clr_recip_img.style.display = "inline"; - clr_breaks_img.style.display = "inline"; - } - - if (controls.clientWidth < 330) { - clr_breaks.childNodes[1].nodeValue = " Clear breaks"; - } else { - clr_breaks.childNodes[1].nodeValue = " Clear breakpoints"; - } +ControlsWaiter.prototype.adjust_width = function () { + let controls = document.getElementById('controls'), + step = document.getElementById('step'), + clr_breaks = document.getElementById('clr-breaks'), + save_img = document.querySelector('#save img'), + load_img = document.querySelector('#load img'), + step_img = document.querySelector('#step img'), + clr_recip_img = document.querySelector('#clr-recipe img'), + clr_breaks_img = document.querySelector('#clr-breaks img'); + + if (controls.clientWidth < 470) { + step.childNodes[1].nodeValue = ' Step'; + } else { + step.childNodes[1].nodeValue = ' Step through'; + } + + if (controls.clientWidth < 400) { + save_img.style.display = 'none'; + load_img.style.display = 'none'; + step_img.style.display = 'none'; + clr_recip_img.style.display = 'none'; + clr_breaks_img.style.display = 'none'; + } else { + save_img.style.display = 'inline'; + load_img.style.display = 'inline'; + step_img.style.display = 'inline'; + clr_recip_img.style.display = 'inline'; + clr_breaks_img.style.display = 'inline'; + } + + if (controls.clientWidth < 330) { + clr_breaks.childNodes[1].nodeValue = ' Clear breaks'; + } else { + clr_breaks.childNodes[1].nodeValue = ' Clear breakpoints'; + } }; @@ -62,57 +62,57 @@ ControlsWaiter.prototype.adjust_width = function() { * * @param {boolean} value - The new value for Auto Bake. */ -ControlsWaiter.prototype.set_auto_bake = function(value) { - var auto_bake_checkbox = document.getElementById("auto-bake"); - - if (auto_bake_checkbox.checked != value) { - auto_bake_checkbox.click(); - } +ControlsWaiter.prototype.set_auto_bake = function (value) { + const auto_bake_checkbox = document.getElementById('auto-bake'); + + if (auto_bake_checkbox.checked != value) { + auto_bake_checkbox.click(); + } }; /** * Handler to trigger baking. */ -ControlsWaiter.prototype.bake_click = function() { - this.app.bake(); - $("#output-text").selectRange(0); +ControlsWaiter.prototype.bake_click = function () { + this.app.bake(); + $('#output-text').selectRange(0); }; /** * Handler for the 'Step through' command. Executes the next step of the recipe. */ -ControlsWaiter.prototype.step_click = function() { - this.app.bake(true); - $("#output-text").selectRange(0); +ControlsWaiter.prototype.step_click = function () { + this.app.bake(true); + $('#output-text').selectRange(0); }; /** * Handler for changes made to the Auto Bake checkbox. */ -ControlsWaiter.prototype.auto_bake_change = function() { - var auto_bake_label = document.getElementById("auto-bake-label"), - auto_bake_checkbox = document.getElementById("auto-bake"); - - this.app.auto_bake_ = auto_bake_checkbox.checked; - - if (auto_bake_checkbox.checked) { - auto_bake_label.classList.remove("btn-default"); - auto_bake_label.classList.add("btn-success"); - } else { - auto_bake_label.classList.remove("btn-success"); - auto_bake_label.classList.add("btn-default"); - } +ControlsWaiter.prototype.auto_bake_change = function () { + let auto_bake_label = document.getElementById('auto-bake-label'), + auto_bake_checkbox = document.getElementById('auto-bake'); + + this.app.auto_bake_ = auto_bake_checkbox.checked; + + if (auto_bake_checkbox.checked) { + auto_bake_label.classList.remove('btn-default'); + auto_bake_label.classList.add('btn-success'); + } else { + auto_bake_label.classList.remove('btn-success'); + auto_bake_label.classList.add('btn-default'); + } }; /** * Handler for the 'Clear recipe' command. Removes all operations from the recipe. */ -ControlsWaiter.prototype.clear_recipe_click = function() { - this.manager.recipe.clear_recipe(); +ControlsWaiter.prototype.clear_recipe_click = function () { + this.manager.recipe.clear_recipe(); }; @@ -120,13 +120,13 @@ ControlsWaiter.prototype.clear_recipe_click = function() { * Handler for the 'Clear breakpoints' command. Removes all breakpoints from operations in the * recipe. */ -ControlsWaiter.prototype.clear_breaks_click = function() { - var bps = document.querySelectorAll("#rec_list li.operation .breakpoint"); - - for (var i = 0; i < bps.length; i++) { - bps[i].setAttribute("break", "false"); - bps[i].classList.remove("breakpoint-selected"); - } +ControlsWaiter.prototype.clear_breaks_click = function () { + const bps = document.querySelectorAll('#rec_list li.operation .breakpoint'); + + for (let i = 0; i < bps.length; i++) { + bps[i].setAttribute('break', 'false'); + bps[i].classList.remove('breakpoint-selected'); + } }; @@ -135,18 +135,18 @@ ControlsWaiter.prototype.clear_breaks_click = function() { * * @param {Object[]} [recipe_config] - The recipe configuration object array. */ -ControlsWaiter.prototype.initialise_save_link = function(recipe_config) { - recipe_config = recipe_config || this.app.get_recipe_config(); - - var recipe_str = JSON.stringify(recipe_config), - input_str = Utils.to_base64(this.app.get_input()), - include_recipe = document.getElementById("save-link-recipe-checkbox").checked, - include_input = document.getElementById("save-link-input-checkbox").checked, - save_link_el = document.getElementById("save-link"), - save_link = this.generate_state_url(include_recipe, include_input, recipe_config); - - save_link_el.innerHTML = Utils.truncate(save_link, 120); - save_link_el.setAttribute("href", save_link); +ControlsWaiter.prototype.initialise_save_link = function (recipe_config) { + recipe_config = recipe_config || this.app.get_recipe_config(); + + let recipe_str = JSON.stringify(recipe_config), + input_str = Utils.to_base64(this.app.get_input()), + include_recipe = document.getElementById('save-link-recipe-checkbox').checked, + include_input = document.getElementById('save-link-input-checkbox').checked, + save_link_el = document.getElementById('save-link'), + save_link = this.generate_state_url(include_recipe, include_input, recipe_config); + + save_link_el.innerHTML = Utils.truncate(save_link, 120); + save_link_el.setAttribute('href', save_link); }; @@ -158,183 +158,179 @@ ControlsWaiter.prototype.initialise_save_link = function(recipe_config) { * @param {Object[]} [recipe_config] - The recipe configuration object array. * @returns {string} */ -ControlsWaiter.prototype.generate_state_url = function(include_recipe, include_input, recipe_config) { - recipe_config = recipe_config || this.app.get_recipe_config(); - - var link = window.location.protocol + "//" + - window.location.host + - window.location.pathname, - recipe_str = JSON.stringify(recipe_config), - input_str = Utils.to_base64(this.app.get_input(), "A-Za-z0-9+/"); // B64 alphabet with no padding - - include_recipe = include_recipe && (recipe_config.length > 0); - include_input = include_input && (input_str.length > 0) && (input_str.length < 8000); +ControlsWaiter.prototype.generate_state_url = function (include_recipe, include_input, recipe_config) { + recipe_config = recipe_config || this.app.get_recipe_config(); - if (include_recipe) { - link += "?recipe=" + encodeURIComponent(recipe_str); - } - - if (include_recipe && include_input) { - link += "&input=" + encodeURIComponent(input_str); - } else if (include_input) { - link += "?input=" + encodeURIComponent(input_str); - } - - return link; + let link = `${window.location.protocol}//${ + window.location.host + }${window.location.pathname}`, + recipe_str = JSON.stringify(recipe_config), + input_str = Utils.to_base64(this.app.get_input(), 'A-Za-z0-9+/'); // B64 alphabet with no padding + + include_recipe = include_recipe && (recipe_config.length > 0); + include_input = include_input && (input_str.length > 0) && (input_str.length < 8000); + + if (include_recipe) { + link += `?recipe=${encodeURIComponent(recipe_str)}`; + } + + if (include_recipe && include_input) { + link += `&input=${encodeURIComponent(input_str)}`; + } else if (include_input) { + link += `?input=${encodeURIComponent(input_str)}`; + } + + return link; }; /** * Handler for changes made to the save dialog text area. Re-initialises the save link. */ -ControlsWaiter.prototype.save_text_change = function() { - try { - var recipe_config = JSON.parse(document.getElementById("save-text").value); - this.initialise_save_link(recipe_config); - } catch(err) {} +ControlsWaiter.prototype.save_text_change = function () { + try { + const recipe_config = JSON.parse(document.getElementById('save-text').value); + this.initialise_save_link(recipe_config); + } catch (err) {} }; /** * Handler for the 'Save' command. Pops up the save dialog box. */ -ControlsWaiter.prototype.save_click = function() { - var recipe_config = this.app.get_recipe_config(); - var recipe_str = JSON.stringify(recipe_config).replace(/},{/g, '},\n{'); - document.getElementById("save-text").value = recipe_str; - - this.initialise_save_link(recipe_config); - $("#save-modal").modal(); +ControlsWaiter.prototype.save_click = function () { + const recipe_config = this.app.get_recipe_config(); + const recipe_str = JSON.stringify(recipe_config).replace(/},{/g, '},\n{'); + document.getElementById('save-text').value = recipe_str; + + this.initialise_save_link(recipe_config); + $('#save-modal').modal(); }; /** * Handler for the save link recipe checkbox change event. */ -ControlsWaiter.prototype.slr_check_change = function() { - this.initialise_save_link(); +ControlsWaiter.prototype.slr_check_change = function () { + this.initialise_save_link(); }; /** * Handler for the save link input checkbox change event. */ -ControlsWaiter.prototype.sli_check_change = function() { - this.initialise_save_link(); +ControlsWaiter.prototype.sli_check_change = function () { + this.initialise_save_link(); }; /** * Handler for the 'Load' command. Pops up the load dialog box. */ -ControlsWaiter.prototype.load_click = function() { - this.populate_load_recipes_list(); - $("#load-modal").modal(); +ControlsWaiter.prototype.load_click = function () { + this.populate_load_recipes_list(); + $('#load-modal').modal(); }; /** * Saves the recipe specified in the save textarea to local storage. */ -ControlsWaiter.prototype.save_button_click = function() { - var recipe_name = document.getElementById("save-name").value, - recipe_str = document.getElementById("save-text").value; - - if (!recipe_name) { - this.app.alert("Please enter a recipe name", "danger", 2000); - return; - } - - var saved_recipes = localStorage.saved_recipes ? +ControlsWaiter.prototype.save_button_click = function () { + let recipe_name = document.getElementById('save-name').value, + recipe_str = document.getElementById('save-text').value; + + if (!recipe_name) { + this.app.alert('Please enter a recipe name', 'danger', 2000); + return; + } + + let saved_recipes = localStorage.saved_recipes ? JSON.parse(localStorage.saved_recipes) : [], - recipe_id = localStorage.recipe_id || 0; - - saved_recipes.push({ - id: ++recipe_id, - name: recipe_name, - recipe: recipe_str - }); - - localStorage.saved_recipes = JSON.stringify(saved_recipes); - localStorage.recipe_id = recipe_id; - - this.app.alert("Recipe saved as \"" + recipe_name + "\".", "success", 2000); + recipe_id = localStorage.recipe_id || 0; + + saved_recipes.push({ + id: ++recipe_id, + name: recipe_name, + recipe: recipe_str, + }); + + localStorage.saved_recipes = JSON.stringify(saved_recipes); + localStorage.recipe_id = recipe_id; + + this.app.alert(`Recipe saved as "${recipe_name}".`, 'success', 2000); }; /** * Populates the list of saved recipes in the load dialog box from local storage. */ -ControlsWaiter.prototype.populate_load_recipes_list = function() { - var load_name_el = document.getElementById("load-name"); - +ControlsWaiter.prototype.populate_load_recipes_list = function () { + const load_name_el = document.getElementById('load-name'); + // Remove current recipes from select - var i = load_name_el.options.length; - while (i--) { - load_name_el.remove(i); - } + let i = load_name_el.options.length; + while (i--) { + load_name_el.remove(i); + } // Add recipes to select - var saved_recipes = localStorage.saved_recipes ? + const saved_recipes = localStorage.saved_recipes ? JSON.parse(localStorage.saved_recipes) : []; - - for (i = 0; i < saved_recipes.length; i++) { - var opt = document.createElement("option"); - opt.value = saved_recipes[i].id; - opt.innerHTML = saved_recipes[i].name; - - load_name_el.appendChild(opt); - } - + + for (i = 0; i < saved_recipes.length; i++) { + const opt = document.createElement('option'); + opt.value = saved_recipes[i].id; + opt.innerHTML = saved_recipes[i].name; + + load_name_el.appendChild(opt); + } + // Populate textarea with first recipe - document.getElementById("load-text").value = saved_recipes.length ? saved_recipes[0].recipe : ""; + document.getElementById('load-text').value = saved_recipes.length ? saved_recipes[0].recipe : ''; }; /** * Removes the currently selected recipe from local storage. */ -ControlsWaiter.prototype.load_delete_click = function() { - var id = document.getElementById("load-name").value, - saved_recipes = localStorage.saved_recipes ? +ControlsWaiter.prototype.load_delete_click = function () { + let id = document.getElementById('load-name').value, + saved_recipes = localStorage.saved_recipes ? JSON.parse(localStorage.saved_recipes) : []; - - saved_recipes = saved_recipes.filter(function(r) { - return r.id != id; - }); - - localStorage.saved_recipes = JSON.stringify(saved_recipes); - this.populate_load_recipes_list(); + + saved_recipes = saved_recipes.filter(r => r.id != id); + + localStorage.saved_recipes = JSON.stringify(saved_recipes); + this.populate_load_recipes_list(); }; /** * Displays the selected recipe in the load text box. */ -ControlsWaiter.prototype.load_name_change = function(e) { - var el = e.target, - saved_recipes = localStorage.saved_recipes ? +ControlsWaiter.prototype.load_name_change = function (e) { + let el = e.target, + saved_recipes = localStorage.saved_recipes ? JSON.parse(localStorage.saved_recipes) : [], - id = parseInt(el.value, 10); - - var recipe = saved_recipes.filter(function(r) { - return r.id == id; - })[0]; - - document.getElementById("load-text").value = recipe.recipe; + id = parseInt(el.value, 10); + + const recipe = saved_recipes.filter(r => r.id == id)[0]; + + document.getElementById('load-text').value = recipe.recipe; }; /** * Loads the selected recipe and populates the Recipe with its operations. */ -ControlsWaiter.prototype.load_button_click = function() { - try { - var recipe_config = JSON.parse(document.getElementById("load-text").value); - this.app.set_recipe_config(recipe_config); +ControlsWaiter.prototype.load_button_click = function () { + try { + const recipe_config = JSON.parse(document.getElementById('load-text').value); + this.app.set_recipe_config(recipe_config); - $("#rec_list [data-toggle=popover]").popover(); - } catch(e) { - this.app.alert("Invalid recipe", "danger", 2000); - } + $('#rec_list [data-toggle=popover]').popover(); + } catch (e) { + this.app.alert('Invalid recipe', 'danger', 2000); + } }; diff --git a/src/js/views/html/HTMLApp.js b/src/js/views/html/HTMLApp.js index fbd497ea..2ce1ace8 100755 --- a/src/js/views/html/HTMLApp.js +++ b/src/js/views/html/HTMLApp.js @@ -14,21 +14,21 @@ * @param {String[]} default_favourites - A list of default favourite operations. * @param {Object} options - Default setting for app options. */ -var HTMLApp = function(categories, operations, default_favourites, default_options) { - this.categories = categories; - this.operations = operations; - this.dfavourites = default_favourites; - this.doptions = default_options; - this.options = Utils.extend({}, default_options); - - this.chef = new Chef(); - this.manager = new Manager(this); - - this.auto_bake_ = false; - this.progress = 0; - this.ing_id = 0; - - window.chef = this.chef; +const HTMLApp = function (categories, operations, default_favourites, default_options) { + this.categories = categories; + this.operations = operations; + this.dfavourites = default_favourites; + this.doptions = default_options; + this.options = Utils.extend({}, default_options); + + this.chef = new Chef(); + this.manager = new Manager(this); + + this.auto_bake_ = false; + this.progress = 0; + this.ing_id = 0; + + window.chef = this.chef; }; @@ -37,15 +37,15 @@ var HTMLApp = function(categories, operations, default_favourites, default_optio * * @fires Manager#appstart */ -HTMLApp.prototype.setup = function() { - document.dispatchEvent(this.manager.appstart); - this.initialise_splitter(); - this.load_local_storage(); - this.populate_operations_list(); - this.manager.setup(); - this.reset_layout(); - this.set_compile_message(); - this.load_URI_params(); +HTMLApp.prototype.setup = function () { + document.dispatchEvent(this.manager.appstart); + this.initialise_splitter(); + this.load_local_storage(); + this.populate_operations_list(); + this.manager.setup(); + this.reset_layout(); + this.set_compile_message(); + this.load_URI_params(); }; @@ -54,10 +54,10 @@ HTMLApp.prototype.setup = function() { * * @param {Error} err */ -HTMLApp.prototype.handle_error = function(err) { - console.error(err); - var msg = err.display_str || err.toString(); - this.alert(msg, "danger", this.options.error_timeout, !this.options.show_errors); +HTMLApp.prototype.handle_error = function (err) { + console.error(err); + const msg = err.display_str || err.toString(); + this.alert(msg, 'danger', this.options.error_timeout, !this.options.show_errors); }; @@ -67,48 +67,48 @@ HTMLApp.prototype.handle_error = function(err) { * @param {boolean} [step] - Set to true if we should only execute one operation instead of the * whole recipe. */ -HTMLApp.prototype.bake = function(step) { - var response; - - try { - response = this.chef.bake( +HTMLApp.prototype.bake = function (step) { + let response; + + try { + response = this.chef.bake( this.get_input(), // The user's input this.get_recipe_config(), // The configuration of the recipe this.options, // Options set by the user this.progress, // The current position in the recipe - step // Whether or not to take one step or execute the whole recipe + step, // Whether or not to take one step or execute the whole recipe ); - } catch (err) { - this.handle_error(err); - } finally { - if (!response) return; - - if (response.error) { - this.handle_error(response.error); - } - this.options = response.options; - this.dish_str = response.type == "html" ? Utils.strip_html_tags(response.result, true) : response.result; - this.progress = response.progress; - this.manager.recipe.update_breakpoint_indicator(response.progress); - this.manager.output.set(response.result, response.type, response.duration); - - // If baking took too long, disable auto-bake - if (response.duration > this.options.auto_bake_threshold && this.auto_bake_) { - this.manager.controls.set_auto_bake(false); - this.alert("Baking took longer than " + this.options.auto_bake_threshold + - "ms, Auto Bake has been disabled.", "warning", 5000); - } + } catch (err) { + this.handle_error(err); + } finally { + if (!response) return; + + if (response.error) { + this.handle_error(response.error); } + this.options = response.options; + this.dish_str = response.type == 'html' ? Utils.strip_html_tags(response.result, true) : response.result; + this.progress = response.progress; + this.manager.recipe.update_breakpoint_indicator(response.progress); + this.manager.output.set(response.result, response.type, response.duration); + + // If baking took too long, disable auto-bake + if (response.duration > this.options.auto_bake_threshold && this.auto_bake_) { + this.manager.controls.set_auto_bake(false); + this.alert(`Baking took longer than ${this.options.auto_bake_threshold + }ms, Auto Bake has been disabled.`, 'warning', 5000); + } + } }; /** * Runs Auto Bake if it is set. */ -HTMLApp.prototype.auto_bake = function() { - if (this.auto_bake_) { - this.bake(); - } +HTMLApp.prototype.auto_bake = function () { + if (this.auto_bake_) { + this.bake(); + } }; @@ -121,15 +121,15 @@ HTMLApp.prototype.auto_bake = function() { * * @returns {number} - The number of miliseconds it took to run the silent bake. */ -HTMLApp.prototype.silent_bake = function() { - var start_time = new Date().getTime(), - recipe_config = this.get_recipe_config(); - - if (this.auto_bake_) { - this.chef.silent_bake(recipe_config); - } - - return new Date().getTime() - start_time; +HTMLApp.prototype.silent_bake = function () { + let start_time = new Date().getTime(), + recipe_config = this.get_recipe_config(); + + if (this.auto_bake_) { + this.chef.silent_bake(recipe_config); + } + + return new Date().getTime() - start_time; }; @@ -138,14 +138,14 @@ HTMLApp.prototype.silent_bake = function() { * * @returns {string} */ -HTMLApp.prototype.get_input = function() { - var input = this.manager.input.get(); - +HTMLApp.prototype.get_input = function () { + const input = this.manager.input.get(); + // Save to session storage in case we need to restore it later - sessionStorage.setItem("input_length", input.length); - sessionStorage.setItem("input", input); - - return input; + sessionStorage.setItem('input_length', input.length); + sessionStorage.setItem('input', input); + + return input; }; @@ -154,10 +154,10 @@ HTMLApp.prototype.get_input = function() { * * @param {string} input - The string to set the input to */ -HTMLApp.prototype.set_input = function(input) { - sessionStorage.setItem("input_length", input.length); - sessionStorage.setItem("input", input); - this.manager.input.set(input); +HTMLApp.prototype.set_input = function (input) { + sessionStorage.setItem('input_length', input.length); + sessionStorage.setItem('input', input); + this.manager.input.set(input); }; @@ -167,56 +167,56 @@ HTMLApp.prototype.set_input = function(input) { * * @fires Manager#oplistcreate */ -HTMLApp.prototype.populate_operations_list = function() { +HTMLApp.prototype.populate_operations_list = function () { // Move edit button away before we overwrite it - document.body.appendChild(document.getElementById("edit-favourites")); - - var html = ""; - - for (var i = 0; i < this.categories.length; i++) { - var cat_conf = this.categories[i], - selected = i === 0, - cat = new HTMLCategory(cat_conf.name, selected); - - for (var j = 0; j < cat_conf.ops.length; j++) { - var op_name = cat_conf.ops[j], - op = new HTMLOperation(op_name, this.operations[op_name], this, this.manager); - cat.add_operation(op); - } - - html += cat.to_html(); + document.body.appendChild(document.getElementById('edit-favourites')); + + let html = ''; + + for (var i = 0; i < this.categories.length; i++) { + let cat_conf = this.categories[i], + selected = i === 0, + cat = new HTMLCategory(cat_conf.name, selected); + + for (let j = 0; j < cat_conf.ops.length; j++) { + let op_name = cat_conf.ops[j], + op = new HTMLOperation(op_name, this.operations[op_name], this, this.manager); + cat.add_operation(op); } - - document.getElementById("categories").innerHTML = html; - - var op_lists = document.querySelectorAll("#categories .op_list"); - - for (i = 0; i < op_lists.length; i++) { - op_lists[i].dispatchEvent(this.manager.oplistcreate); - } - + + html += cat.to_html(); + } + + document.getElementById('categories').innerHTML = html; + + const op_lists = document.querySelectorAll('#categories .op_list'); + + for (i = 0; i < op_lists.length; i++) { + op_lists[i].dispatchEvent(this.manager.oplistcreate); + } + // Add edit button to first category (Favourites) - document.querySelector("#categories a").appendChild(document.getElementById("edit-favourites")); + document.querySelector('#categories a').appendChild(document.getElementById('edit-favourites')); }; /** * Sets up the adjustable splitter to allow the user to resize areas of the page. */ -HTMLApp.prototype.initialise_splitter = function() { - Split(["#operations", "#recipe", "#IO"], { - sizes: [20, 30, 50], - minSize: [240, 325, 500], - gutterSize: 4, - onDrag: this.manager.controls.adjust_width.bind(this.manager.controls) - }); - - Split(["#input", "#output"], { - direction: "vertical", - gutterSize: 4, - }); - - this.reset_layout(); +HTMLApp.prototype.initialise_splitter = function () { + Split(['#operations', '#recipe', '#IO'], { + sizes: [20, 30, 50], + minSize: [240, 325, 500], + gutterSize: 4, + onDrag: this.manager.controls.adjust_width.bind(this.manager.controls), + }); + + Split(['#input', '#output'], { + direction: 'vertical', + gutterSize: 4, + }); + + this.reset_layout(); }; @@ -224,16 +224,16 @@ HTMLApp.prototype.initialise_splitter = function() { * Loads the information previously saved to the HTML5 local storage object so that user options * and favourites can be restored. */ -HTMLApp.prototype.load_local_storage = function() { +HTMLApp.prototype.load_local_storage = function () { // Load options - var l_options; - if (localStorage.options !== undefined) { - l_options = JSON.parse(localStorage.options); - } - this.manager.options.load(l_options); - + let l_options; + if (localStorage.options !== undefined) { + l_options = JSON.parse(localStorage.options); + } + this.manager.options.load(l_options); + // Load favourites - this.load_favourites(); + this.load_favourites(); }; @@ -242,48 +242,46 @@ HTMLApp.prototype.load_local_storage = function() { * Favourites category with them. * If the user currently has no saved favourites, the defaults from the view constructor are used. */ -HTMLApp.prototype.load_favourites = function() { - var favourites = localStorage.favourites && +HTMLApp.prototype.load_favourites = function () { + let favourites = localStorage.favourites && localStorage.favourites.length > 2 ? JSON.parse(localStorage.favourites) : this.dfavourites; - - favourites = this.valid_favourites(favourites); - this.save_favourites(favourites); - - var fav_cat = this.categories.filter(function(c) { - return c.name == "Favourites"; - })[0]; - - if (fav_cat) { - fav_cat.ops = favourites; - } else { - this.categories.unshift({ - name: "Favourites", - ops: favourites - }); - } + + favourites = this.valid_favourites(favourites); + this.save_favourites(favourites); + + const fav_cat = this.categories.filter(c => c.name == 'Favourites')[0]; + + if (fav_cat) { + fav_cat.ops = favourites; + } else { + this.categories.unshift({ + name: 'Favourites', + ops: favourites, + }); + } }; /** * Filters the list of favourite operations that the user had stored and removes any that are no * longer available. The user is notified if this is the case. - + * @param {string[]} favourites - A list of the user's favourite operations * @returns {string[]} A list of the valid favourites */ -HTMLApp.prototype.valid_favourites = function(favourites) { - var valid_favs = []; - for (var i = 0; i < favourites.length; i++) { - if (this.operations.hasOwnProperty(favourites[i])) { - valid_favs.push(favourites[i]); - } else { - this.alert("The operation \"" + favourites[i] + "\" is no longer " + - "available. It has been removed from your favourites.", "info"); - } +HTMLApp.prototype.valid_favourites = function (favourites) { + const valid_favs = []; + for (let i = 0; i < favourites.length; i++) { + if (this.operations.hasOwnProperty(favourites[i])) { + valid_favs.push(favourites[i]); + } else { + this.alert(`The operation "${favourites[i]}" is no longer ` + + 'available. It has been removed from your favourites.', 'info'); } - return valid_favs; + } + return valid_favs; }; @@ -292,8 +290,8 @@ HTMLApp.prototype.valid_favourites = function(favourites) { * * @param {string[]} favourites - A list of the user's favourite operations */ -HTMLApp.prototype.save_favourites = function(favourites) { - localStorage.setItem("favourites", JSON.stringify(this.valid_favourites(favourites))); +HTMLApp.prototype.save_favourites = function (favourites) { + localStorage.setItem('favourites', JSON.stringify(this.valid_favourites(favourites))); }; @@ -301,11 +299,11 @@ HTMLApp.prototype.save_favourites = function(favourites) { * Resets favourite operations back to the default as specified in the view constructor and * refreshes the operation list. */ -HTMLApp.prototype.reset_favourites = function() { - this.save_favourites(this.dfavourites); - this.load_favourites(); - this.populate_operations_list(); - this.manager.recipe.initialise_operation_drag_n_drop(); +HTMLApp.prototype.reset_favourites = function () { + this.save_favourites(this.dfavourites); + this.load_favourites(); + this.populate_operations_list(); + this.manager.recipe.initialise_operation_drag_n_drop(); }; @@ -314,82 +312,82 @@ HTMLApp.prototype.reset_favourites = function() { * * @param {string} name - The name of the operation */ -HTMLApp.prototype.add_favourite = function(name) { - var favourites = JSON.parse(localStorage.favourites); +HTMLApp.prototype.add_favourite = function (name) { + const favourites = JSON.parse(localStorage.favourites); - if (favourites.indexOf(name) >= 0) { - this.alert("'" + name + "' is already in your favourites", "info", 2000); - return; - } - - favourites.push(name); - this.save_favourites(favourites); - this.load_favourites(); - this.populate_operations_list(); - this.manager.recipe.initialise_operation_drag_n_drop(); + if (favourites.indexOf(name) >= 0) { + this.alert(`'${name}' is already in your favourites`, 'info', 2000); + return; + } + + favourites.push(name); + this.save_favourites(favourites); + this.load_favourites(); + this.populate_operations_list(); + this.manager.recipe.initialise_operation_drag_n_drop(); }; /** * Checks for input and recipe in the URI parameters and loads them if present. */ -HTMLApp.prototype.load_URI_params = function() { +HTMLApp.prototype.load_URI_params = function () { // Load query string from URI - this.query_string = (function(a) { - if (a === "") return {}; - var b = {}; - for (var i = 0; i < a.length; i++) { - var p = a[i].split('='); - if (p.length != 2) { - b[a[i]] = true; - } else { - b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); - } - } - return b; - })(window.location.search.substr(1).split('&')); - + this.query_string = (function (a) { + if (a === '') return {}; + const b = {}; + for (let i = 0; i < a.length; i++) { + const p = a[i].split('='); + if (p.length != 2) { + b[a[i]] = true; + } else { + b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, ' ')); + } + } + return b; + }(window.location.search.substr(1).split('&'))); + // Turn off auto-bake while loading - var auto_bake_val = this.auto_bake_; - this.auto_bake_ = false; - + const auto_bake_val = this.auto_bake_; + this.auto_bake_ = false; + // Read in recipe from query string - if (this.query_string.recipe) { - try { - var recipe_config = JSON.parse(this.query_string.recipe); - this.set_recipe_config(recipe_config); - } catch(err) {} - } else if (this.query_string.op) { + if (this.query_string.recipe) { + try { + const recipe_config = JSON.parse(this.query_string.recipe); + this.set_recipe_config(recipe_config); + } catch (err) {} + } else if (this.query_string.op) { // If there's no recipe, look for single operations - this.manager.recipe.clear_recipe(); - try { - this.manager.recipe.add_operation(this.query_string.op); - } catch(err) { + this.manager.recipe.clear_recipe(); + try { + this.manager.recipe.add_operation(this.query_string.op); + } catch (err) { // If no exact match, search for nearest match and add that - var matched_ops = this.manager.ops.filter_operations(this.query_string.op, false); - if (matched_ops.length) { - this.manager.recipe.add_operation(matched_ops[0].name); - } - + const matched_ops = this.manager.ops.filter_operations(this.query_string.op, false); + if (matched_ops.length) { + this.manager.recipe.add_operation(matched_ops[0].name); + } + // Populate search with the string - var search = document.getElementById("search"); - - search.value = this.query_string.op; - search.dispatchEvent(new Event("search")); - } + const search = document.getElementById('search'); + + search.value = this.query_string.op; + search.dispatchEvent(new Event('search')); } - + } + // Read in input data from query string - if (this.query_string.input) { - try { - var input_data = Utils.from_base64(this.query_string.input); - this.set_input(input_data); - } catch(err) {} - } - + if (this.query_string.input) { + try { + const input_data = Utils.from_base64(this.query_string.input); + this.set_input(input_data); + } catch (err) {} + } + // Restore auto-bake state - this.auto_bake_ = auto_bake_val; - this.auto_bake(); + this.auto_bake_ = auto_bake_val; + this.auto_bake(); }; @@ -398,8 +396,8 @@ HTMLApp.prototype.load_URI_params = function() { * * @returns {number} */ -HTMLApp.prototype.next_ing_id = function() { - return this.ing_id++; +HTMLApp.prototype.next_ing_id = function () { + return this.ing_id++; }; @@ -408,10 +406,10 @@ HTMLApp.prototype.next_ing_id = function() { * * @returns {Object[]} */ -HTMLApp.prototype.get_recipe_config = function() { - var recipe_config = this.manager.recipe.get_config(); - sessionStorage.setItem("recipe_config", JSON.stringify(recipe_config)); - return recipe_config; +HTMLApp.prototype.get_recipe_config = function () { + const recipe_config = this.manager.recipe.get_config(); + sessionStorage.setItem('recipe_config', JSON.stringify(recipe_config)); + return recipe_config; }; @@ -420,73 +418,73 @@ HTMLApp.prototype.get_recipe_config = function() { * * @param {Object[]} recipe_config - The recipe configuration */ -HTMLApp.prototype.set_recipe_config = function(recipe_config) { - sessionStorage.setItem("recipe_config", JSON.stringify(recipe_config)); - document.getElementById("rec_list").innerHTML = null; - - for (var i = 0; i < recipe_config.length; i++) { - var item = this.manager.recipe.add_operation(recipe_config[i].op); - +HTMLApp.prototype.set_recipe_config = function (recipe_config) { + sessionStorage.setItem('recipe_config', JSON.stringify(recipe_config)); + document.getElementById('rec_list').innerHTML = null; + + for (let i = 0; i < recipe_config.length; i++) { + const item = this.manager.recipe.add_operation(recipe_config[i].op); + // Populate arguments - var args = item.querySelectorAll(".arg"); - for (var j = 0; j < args.length; j++) { - if (args[j].getAttribute("type") == "checkbox") { + const args = item.querySelectorAll('.arg'); + for (let j = 0; j < args.length; j++) { + if (args[j].getAttribute('type') == 'checkbox') { // checkbox - args[j].checked = recipe_config[i].args[j]; - } else if (args[j].classList.contains("toggle-string")) { + args[j].checked = recipe_config[i].args[j]; + } else if (args[j].classList.contains('toggle-string')) { // toggle_string - args[j].value = recipe_config[i].args[j].string; - args[j].previousSibling.children[0].innerHTML = recipe_config[i].args[j].option + - " "; - } else { + args[j].value = recipe_config[i].args[j].string; + args[j].previousSibling.children[0].innerHTML = `${recipe_config[i].args[j].option + } `; + } else { // all others - args[j].value = recipe_config[i].args[j]; - } - } - - // Set disabled and breakpoint - if (recipe_config[i].disabled) { - item.querySelector(".disable-icon").click(); - } - if (recipe_config[i].breakpoint) { - item.querySelector(".breakpoint").click(); - } - - this.progress = 0; + args[j].value = recipe_config[i].args[j]; + } } + + // Set disabled and breakpoint + if (recipe_config[i].disabled) { + item.querySelector('.disable-icon').click(); + } + if (recipe_config[i].breakpoint) { + item.querySelector('.breakpoint').click(); + } + + this.progress = 0; + } }; /** * Resets the splitter positions to default. */ -HTMLApp.prototype.reset_layout = function() { - document.getElementById("operations").style.width = "calc(20% - 2px)"; - document.getElementById("recipe").style.width = "calc(30% - 4px)"; - document.getElementById("IO").style.width = "calc(50% - 2px)"; - document.getElementById("input").style.height = "calc(50% - 2px)"; - document.getElementById("output").style.height = "calc(50% - 2px)"; - - this.manager.controls.adjust_width(); +HTMLApp.prototype.reset_layout = function () { + document.getElementById('operations').style.width = 'calc(20% - 2px)'; + document.getElementById('recipe').style.width = 'calc(30% - 4px)'; + document.getElementById('IO').style.width = 'calc(50% - 2px)'; + document.getElementById('input').style.height = 'calc(50% - 2px)'; + document.getElementById('output').style.height = 'calc(50% - 2px)'; + + this.manager.controls.adjust_width(); }; /** * Sets the compile message. */ -HTMLApp.prototype.set_compile_message = function() { +HTMLApp.prototype.set_compile_message = function () { // Display time since last build and compile message - var now = new Date(), - time_since_compile = Utils.fuzzy_time(now.getTime() - window.compile_time), - compile_info = "Last build: " + - time_since_compile.substr(0,1).toUpperCase() + time_since_compile.substr(1) + " ago"; - - if (window.compile_message !== "") { - compile_info += " - " + window.compile_message; - } - - compile_info += ""; - document.getElementById("notice").innerHTML = compile_info; + let now = new Date(), + time_since_compile = Utils.fuzzy_time(now.getTime() - window.compile_time), + compile_info = `Last build: ${ + time_since_compile.substr(0, 1).toUpperCase()}${time_since_compile.substr(1)} ago`; + + if (window.compile_message !== '') { + compile_info += ` - ${window.compile_message}`; + } + + compile_info += ''; + document.getElementById('notice').innerHTML = compile_info; }; @@ -513,44 +511,44 @@ HTMLApp.prototype.set_compile_message = function() { * // that will disappear after 5 seconds. * this.alert("Happy Christmas!", "info", 5000); */ -HTMLApp.prototype.alert = function(str, style, timeout, silent) { - var time = new Date(); - - console.log("[" + time.toLocaleString() + "] " + str); - if (silent) return; - - style = style || "danger"; - timeout = timeout || 0; - - var alert_el = document.getElementById("alert"), - alert_content = document.getElementById("alert-content"); - - alert_el.classList.remove("alert-danger"); - alert_el.classList.remove("alert-warning"); - alert_el.classList.remove("alert-info"); - alert_el.classList.remove("alert-success"); - alert_el.classList.add("alert-" + style); - +HTMLApp.prototype.alert = function (str, style, timeout, silent) { + const time = new Date(); + + console.log(`[${time.toLocaleString()}] ${str}`); + if (silent) return; + + style = style || 'danger'; + timeout = timeout || 0; + + let alert_el = document.getElementById('alert'), + alert_content = document.getElementById('alert-content'); + + alert_el.classList.remove('alert-danger'); + alert_el.classList.remove('alert-warning'); + alert_el.classList.remove('alert-info'); + alert_el.classList.remove('alert-success'); + alert_el.classList.add(`alert-${style}`); + // If the box hasn't been closed, append to it rather than replacing - if (alert_el.style.display == "block") { - alert_content.innerHTML += - "

[" + time.toLocaleTimeString() + "] " + str; - } else { - alert_content.innerHTML = - "[" + time.toLocaleTimeString() + "] " + str; - } - + if (alert_el.style.display == 'block') { + alert_content.innerHTML += + `

[${time.toLocaleTimeString()}] ${str}`; + } else { + alert_content.innerHTML = + `[${time.toLocaleTimeString()}] ${str}`; + } + // Stop the animation if it is in progress - $("#alert").stop(); - alert_el.style.display = "block"; - alert_el.style.opacity = 1; - - if (timeout > 0) { - clearTimeout(this.alert_timeout); - this.alert_timeout = setTimeout(function(){ - $("#alert").slideUp(100); - }, timeout); - } + $('#alert').stop(); + alert_el.style.display = 'block'; + alert_el.style.opacity = 1; + + if (timeout > 0) { + clearTimeout(this.alert_timeout); + this.alert_timeout = setTimeout(() => { + $('#alert').slideUp(100); + }, timeout); + } }; @@ -567,27 +565,26 @@ HTMLApp.prototype.alert = function(str, style, timeout, silent) { * // Pops up a box asking if the user would like a cookie. Prints the answer to the console. * this.confirm("Question", "Would you like a cookie?", function(answer) {console.log(answer);}); */ -HTMLApp.prototype.confirm = function(title, body, callback, scope) { - scope = scope || this; - document.getElementById("confirm-title").innerHTML = title; - document.getElementById("confirm-body").innerHTML = body; - document.getElementById("confirm-modal").style.display = "block"; - - this.confirm_closed = false; - $("#confirm-modal").modal() - .one("show.bs.modal", function(e) { - this.confirm_closed = false; - }.bind(this)) - .one("click", "#confirm-yes", function() { - this.confirm_closed = true; - callback.bind(scope)(true); - $("#confirm-modal").modal("hide"); - }.bind(this)) - .one("hide.bs.modal", function(e) { - if (!this.confirm_closed) - callback.bind(scope)(false); - this.confirm_closed = true; - }.bind(this)); +HTMLApp.prototype.confirm = function (title, body, callback, scope) { + scope = scope || this; + document.getElementById('confirm-title').innerHTML = title; + document.getElementById('confirm-body').innerHTML = body; + document.getElementById('confirm-modal').style.display = 'block'; + + this.confirm_closed = false; + $('#confirm-modal').modal() + .one('show.bs.modal', (e) => { + this.confirm_closed = false; + }) + .one('click', '#confirm-yes', () => { + this.confirm_closed = true; + callback.bind(scope)(true); + $('#confirm-modal').modal('hide'); + }) + .one('hide.bs.modal', (e) => { + if (!this.confirm_closed) { callback.bind(scope)(false); } + this.confirm_closed = true; + }); }; @@ -595,8 +592,8 @@ HTMLApp.prototype.confirm = function(title, body, callback, scope) { * Handler for the alert close button click event. * Closes the alert box. */ -HTMLApp.prototype.alert_close_click = function() { - document.getElementById("alert").style.display = "none"; +HTMLApp.prototype.alert_close_click = function () { + document.getElementById('alert').style.display = 'none'; }; @@ -607,14 +604,14 @@ HTMLApp.prototype.alert_close_click = function() { * @listens Manager#statechange * @param {event} e */ -HTMLApp.prototype.state_change = function(e) { - this.auto_bake(); - +HTMLApp.prototype.state_change = function (e) { + this.auto_bake(); + // Update the current history state (not creating a new one) - if (this.options.update_url) { - this.last_state_url = this.manager.controls.generate_state_url(true, true); - window.history.replaceState({}, "CyberChef", this.last_state_url); - } + if (this.options.update_url) { + this.last_state_url = this.manager.controls.generate_state_url(true, true); + window.history.replaceState({}, 'CyberChef', this.last_state_url); + } }; @@ -624,44 +621,44 @@ HTMLApp.prototype.state_change = function(e) { * * @param {event} e */ -HTMLApp.prototype.pop_state = function(e) { - if (window.location.href.split("#")[0] !== this.last_state_url) { - this.load_URI_params(); - } +HTMLApp.prototype.pop_state = function (e) { + if (window.location.href.split('#')[0] !== this.last_state_url) { + this.load_URI_params(); + } }; /** * Function to call an external API from this view. */ -HTMLApp.prototype.call_api = function(url, type, data, data_type, content_type) { - type = type || "POST"; - data = data || {}; - data_type = data_type || undefined; - content_type = content_type || "application/json"; - - var response = null, - success = false; - - $.ajax({ - url: url, - async: false, - type: type, - data: data, - dataType: data_type, - contentType: content_type, - success: function(data) { - success = true; - response = data; - }, - error: function(data) { - success = false; - response = data; - }, - }); - - return { - success: success, - response: response - }; +HTMLApp.prototype.call_api = function (url, type, data, data_type, content_type) { + type = type || 'POST'; + data = data || {}; + data_type = data_type || undefined; + content_type = content_type || 'application/json'; + + let response = null, + success = false; + + $.ajax({ + url, + async: false, + type, + data, + dataType: data_type, + contentType: content_type, + success(data) { + success = true; + response = data; + }, + error(data) { + success = false; + response = data; + }, + }); + + return { + success, + response, + }; }; diff --git a/src/js/views/html/HTMLCategory.js b/src/js/views/html/HTMLCategory.js index 83909d50..3a3ed925 100755 --- a/src/js/views/html/HTMLCategory.js +++ b/src/js/views/html/HTMLCategory.js @@ -9,10 +9,10 @@ * @param {string} name - The name of the category. * @param {boolean} selected - Whether this category is pre-selected or not. */ -var HTMLCategory = function(name, selected) { - this.name = name; - this.selected = selected; - this.op_list = []; +const HTMLCategory = function (name, selected) { + this.name = name; + this.selected = selected; + this.op_list = []; }; @@ -21,8 +21,8 @@ var HTMLCategory = function(name, selected) { * * @param {HTMLOperation} operation - The operation to add. */ -HTMLCategory.prototype.add_operation = function(operation) { - this.op_list.push(operation); +HTMLCategory.prototype.add_operation = function (operation) { + this.op_list.push(operation); }; @@ -31,20 +31,20 @@ HTMLCategory.prototype.add_operation = function(operation) { * * @returns {string} */ -HTMLCategory.prototype.to_html = function() { - var cat_name = "cat" + this.name.replace(/[\s/-:_]/g, ""); - var html = "
\ +HTMLCategory.prototype.to_html = function () { + const cat_name = `cat${this.name.replace(/[\s/-:_]/g, '')}`; + let html = `
\ \ - " + this.name + "\ + data-parent='#categories' href='#${cat_name}'>\ + ${this.name}\ \ -
    "; - - for (var i = 0; i < this.op_list.length; i++) { - html += this.op_list[i].to_stub_html(); - } - - html += "
"; - return html; +
    `; + + for (let i = 0; i < this.op_list.length; i++) { + html += this.op_list[i].to_stub_html(); + } + + html += '
'; + return html; }; diff --git a/src/js/views/html/HTMLIngredient.js b/src/js/views/html/HTMLIngredient.js index b5a28259..a5ea0a8f 100755 --- a/src/js/views/html/HTMLIngredient.js +++ b/src/js/views/html/HTMLIngredient.js @@ -10,19 +10,19 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var HTMLIngredient = function(config, app, manager) { - this.app = app; - this.manager = manager; - - this.name = config.name; - this.type = config.type; - this.value = config.value; - this.disabled = config.disabled || false; - this.disable_args = config.disable_args || false; - this.placeholder = config.placeholder || false; - this.target = config.target; - this.toggle_values = config.toggle_values; - this.id = "ing-" + this.app.next_ing_id(); +const HTMLIngredient = function (config, app, manager) { + this.app = app; + this.manager = manager; + + this.name = config.name; + this.type = config.type; + this.value = config.value; + this.disabled = config.disabled || false; + this.disable_args = config.disable_args || false; + this.placeholder = config.placeholder || false; + this.target = config.target; + this.toggle_values = config.toggle_values; + this.id = `ing-${this.app.next_ing_id()}`; }; @@ -31,123 +31,124 @@ var HTMLIngredient = function(config, app, manager) { * * @returns {string} */ -HTMLIngredient.prototype.to_html = function() { - var inline = (this.type == "boolean" || - this.type == "number" || - this.type == "option" || - this.type == "short_string" || - this.type == "binary_short_string"), - html = inline ? "" : "
 
", - i, m; - - html += "
"; - - switch (this.type) { - case "string": - case "binary_string": - case "byte_array": - html += ""; - break; - case "short_string": - case "binary_short_string": - html += ""; - break; - case "toggle_string": - html += "
\ +HTMLIngredient.prototype.to_html = function () { + let inline = (this.type == 'boolean' || + this.type == 'number' || + this.type == 'option' || + this.type == 'short_string' || + this.type == 'binary_short_string'), + html = inline ? '' : "
 
", + i, + m; + + html += `
`; + + switch (this.type) { + case 'string': + case 'binary_string': + case 'byte_array': + html += ``; + break; + case 'short_string': + case 'binary_short_string': + html += ``; + break; + case 'toggle_string': + html += `
\
"; - break; - case "number": - html += ""; - break; - case "boolean": - html += ""; - - if (this.disable_args) { - this.manager.add_dynamic_listener("#" + this.id, "click", this.toggle_disable_args, this); - } - break; - case "option": - html += ""; - break; - case "populate_option": - html += ""; - - this.manager.add_dynamic_listener("#" + this.id, "change", this.populate_option_change, this); - break; - case "editable_option": - html += "
"; - html += ""; - html += ""; - html += "
"; - - - this.manager.add_dynamic_listener("#sel-" + this.id, "change", this.editable_option_change, this); - break; - case "text": - html += ""; - break; - default: - break; - } - html += "
"; - - return html; + aria-haspopup='true' aria-expanded='false'${ + this.disabled ? " disabled='disabled'" : ''}>${this.toggle_values[0] + }
`; + break; + case 'number': + html += ``; + break; + case 'boolean': + html += ``; + + if (this.disable_args) { + this.manager.add_dynamic_listener(`#${this.id}`, 'click', this.toggle_disable_args, this); + } + break; + case 'option': + html += `'; + break; + case 'populate_option': + html += `'; + + this.manager.add_dynamic_listener(`#${this.id}`, 'change', this.populate_option_change, this); + break; + case 'editable_option': + html += "
"; + html += `'; + html += ``; + html += '
'; + + + this.manager.add_dynamic_listener(`#sel-${this.id}`, 'change', this.editable_option_change, this); + break; + case 'text': + html += ``; + break; + default: + break; + } + html += '
'; + + return html; }; @@ -157,25 +158,25 @@ HTMLIngredient.prototype.to_html = function() { * * @param {event} e */ -HTMLIngredient.prototype.toggle_disable_args = function(e) { - var el = e.target, - op = el.parentNode.parentNode, - args = op.querySelectorAll(".arg-group"), - els; - - for (var i = 0; i < this.disable_args.length; i++) { - els = args[this.disable_args[i]].querySelectorAll("input, select, button"); - - for (var j = 0; j < els.length; j++) { - if (els[j].getAttribute("disabled")) { - els[j].removeAttribute("disabled"); - } else { - els[j].setAttribute("disabled", "disabled"); - } - } +HTMLIngredient.prototype.toggle_disable_args = function (e) { + let el = e.target, + op = el.parentNode.parentNode, + args = op.querySelectorAll('.arg-group'), + els; + + for (let i = 0; i < this.disable_args.length; i++) { + els = args[this.disable_args[i]].querySelectorAll('input, select, button'); + + for (let j = 0; j < els.length; j++) { + if (els[j].getAttribute('disabled')) { + els[j].removeAttribute('disabled'); + } else { + els[j].setAttribute('disabled', 'disabled'); + } } - - this.manager.recipe.ing_change(); + } + + this.manager.recipe.ing_change(); }; @@ -185,14 +186,14 @@ HTMLIngredient.prototype.toggle_disable_args = function(e) { * * @param {event} e */ -HTMLIngredient.prototype.populate_option_change = function(e) { - var el = e.target, - op = el.parentNode.parentNode, - target = op.querySelectorAll(".arg-group")[this.target].querySelector("input, select, textarea"); +HTMLIngredient.prototype.populate_option_change = function (e) { + let el = e.target, + op = el.parentNode.parentNode, + target = op.querySelectorAll('.arg-group')[this.target].querySelector('input, select, textarea'); - target.value = el.childNodes[el.selectedIndex].getAttribute("populate-value"); - - this.manager.recipe.ing_change(); + target.value = el.childNodes[el.selectedIndex].getAttribute('populate-value'); + + this.manager.recipe.ing_change(); }; @@ -202,11 +203,11 @@ HTMLIngredient.prototype.populate_option_change = function(e) { * * @param {event} e */ -HTMLIngredient.prototype.editable_option_change = function(e) { - var select = e.target, - input = select.nextSibling; +HTMLIngredient.prototype.editable_option_change = function (e) { + let select = e.target, + input = select.nextSibling; - input.value = select.childNodes[select.selectedIndex].value; - - this.manager.recipe.ing_change(); + input.value = select.childNodes[select.selectedIndex].value; + + this.manager.recipe.ing_change(); }; diff --git a/src/js/views/html/HTMLOperation.js b/src/js/views/html/HTMLOperation.js index 1bf9849d..1405fa8d 100755 --- a/src/js/views/html/HTMLOperation.js +++ b/src/js/views/html/HTMLOperation.js @@ -11,31 +11,31 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var HTMLOperation = function(name, config, app, manager) { - this.app = app; - this.manager = manager; - - this.name = name; - this.description = config.description; - this.manual_bake = config.manual_bake || false; - this.config = config; - this.ing_list = []; - - for (var i = 0; i < config.args.length; i++) { - var ing = new HTMLIngredient(config.args[i], this.app, this.manager); - this.ing_list.push(ing); - } +const HTMLOperation = function (name, config, app, manager) { + this.app = app; + this.manager = manager; + + this.name = name; + this.description = config.description; + this.manual_bake = config.manual_bake || false; + this.config = config; + this.ing_list = []; + + for (let i = 0; i < config.args.length; i++) { + const ing = new HTMLIngredient(config.args[i], this.app, this.manager); + this.ing_list.push(ing); + } }; /** * @constant */ -HTMLOperation.INFO_ICON = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByElEQVR4XqVTzWoaYRQ9KZJmoVaS1J1QiYTIuOgqi9lEugguQhYhdGs3hTyAi0CWJTvJIks30ZBNsimUtlqkVLoQCuJsphRriyFjabWtEyf/Rv3iWcwwymTlgQuH851z5hu43wRGkEwmXwCIA4hiGAUAmUQikQbhEHwyGCWVSglVVUW73RYmyKnxjB56ncJ6NpsVx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kchkZK1WQzQaxU2pVGUglkjIbreLUCiEx0qlStlFCpfPiPstYDtVKJH9ZFI2Gw1FGA6H6LTbCAaDeGu1FJl6UuYjpwTGzucokZW1NfnS66kyfT4fXns9RaZmlgNcuhZQU+jowLzuOK/HgwEW3E5ZlhLXVWKk11P3wNYNWw+HZdA0sUgx1zjGmD05nckx0ilGjBJdUq3fr7K5e8bGf43RdL7fOPSQb4lI8SLbrUfkUIuY32VTI1bJn5BqDnh4Dodt9ryPUDzyD7aquWoKQohl2i9sAbubwPkTcHkP3FHsg+yT+7sN7G0AF3Xg6sHB3onbdgWWKBDQg/BcTuVt51dQA/JrnIcyIu6rmPV3/hJgACPc0BMEYTg+AAAAAElFTkSuQmCC'; /** @@ -43,28 +43,28 @@ HTMLOperation.REMOVE_ICON = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABwkl * * @returns {string} */ -HTMLOperation.prototype.to_stub_html = function(remove_icon) { - var html = "
  • "; - } - - if (this.description) { - html += ""; - } - - html += "
  • "; - - return html; +HTMLOperation.prototype.to_stub_html = function (remove_icon) { + let html = "
  • ${this.name}`; + + if (remove_icon) { + html += ``; + } + + if (this.description) { + html += ``; + } + + html += '
  • '; + + return html; }; @@ -73,22 +73,22 @@ HTMLOperation.prototype.to_stub_html = function(remove_icon) { * * @returns {string} */ -HTMLOperation.prototype.to_full_html = function() { - var html = "
    " + this.name + "
    "; +HTMLOperation.prototype.to_full_html = function () { + let html = `
    ${this.name}
    `; - for (var i = 0; i < this.ing_list.length; i++) { - html += this.ing_list[i].to_html(); - } - - html += "
    \ + for (let i = 0; i < this.ing_list.length; i++) { + html += this.ing_list[i].to_html(); + } + + html += "
    \
    \
    "; - - html += "
    \ + + html += "
    \
     
    "; - - return html; + + return html; }; @@ -99,16 +99,16 @@ HTMLOperation.prototype.to_full_html = function() { * @param {number} name_pos - The position of the search string in the operation name * @param {number} desc_pos - The position of the search string in the operation description */ -HTMLOperation.prototype.highlight_search_string = function(search_str, name_pos, desc_pos) { - if (name_pos >= 0) { - this.name = this.name.slice(0, name_pos) + "" + - this.name.slice(name_pos, name_pos + search_str.length) + "" + - this.name.slice(name_pos + search_str.length); - } - - if (this.description && desc_pos >= 0) { - this.description = this.description.slice(0, desc_pos) + "" + - this.description.slice(desc_pos, desc_pos + search_str.length) + "" + - this.description.slice(desc_pos + search_str.length); - } +HTMLOperation.prototype.highlight_search_string = function (search_str, name_pos, desc_pos) { + if (name_pos >= 0) { + this.name = `${this.name.slice(0, name_pos)}${ + this.name.slice(name_pos, name_pos + search_str.length)}${ + this.name.slice(name_pos + search_str.length)}`; + } + + if (this.description && desc_pos >= 0) { + this.description = `${this.description.slice(0, desc_pos)}${ + this.description.slice(desc_pos, desc_pos + search_str.length)}${ + this.description.slice(desc_pos + search_str.length)}`; + } }; diff --git a/src/js/views/html/HighlighterWaiter.js b/src/js/views/html/HighlighterWaiter.js index da7d1c5f..51de90e3 100755 --- a/src/js/views/html/HighlighterWaiter.js +++ b/src/js/views/html/HighlighterWaiter.js @@ -8,11 +8,11 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -var HighlighterWaiter = function(app) { - this.app = app; - - this.mouse_button_down = false; - this.mouse_target = null; +const HighlighterWaiter = function (app) { + this.app = app; + + this.mouse_button_down = false; + this.mouse_target = null; }; @@ -21,7 +21,7 @@ var HighlighterWaiter = function(app) { * @readonly * @enum */ -HighlighterWaiter.INPUT = 0; +HighlighterWaiter.INPUT = 0; /** * HighlighterWaiter data type enum for the output. * @readonly @@ -37,18 +37,18 @@ HighlighterWaiter.OUTPUT = 1; * @private * @returns {boolean} */ -HighlighterWaiter.prototype._is_selection_backwards = function() { - var backwards = false, - sel = window.getSelection(); - - if (!sel.isCollapsed) { - var range = document.createRange(); - range.setStart(sel.anchorNode, sel.anchorOffset); - range.setEnd(sel.focusNode, sel.focusOffset); - backwards = range.collapsed; - range.detach(); - } - return backwards; +HighlighterWaiter.prototype._is_selection_backwards = function () { + let backwards = false, + sel = window.getSelection(); + + if (!sel.isCollapsed) { + const range = document.createRange(); + range.setStart(sel.anchorNode, sel.anchorOffset); + range.setEnd(sel.focusNode, sel.focusOffset); + backwards = range.collapsed; + range.detach(); + } + return backwards; }; @@ -60,16 +60,16 @@ HighlighterWaiter.prototype._is_selection_backwards = function() { * @param {number} offset - The offset since the last HTML element. * @returns {number} */ -HighlighterWaiter.prototype._get_output_html_offset = function(node, offset) { - var sel = window.getSelection(), - range = document.createRange(); - - range.selectNodeContents(document.getElementById("output-html")); - range.setEnd(node, offset); - sel.removeAllRanges(); - sel.addRange(range); - - return sel.toString().length; +HighlighterWaiter.prototype._get_output_html_offset = function (node, offset) { + let sel = window.getSelection(), + range = document.createRange(); + + range.selectNodeContents(document.getElementById('output-html')); + range.setEnd(node, offset); + sel.removeAllRanges(); + sel.addRange(range); + + return sel.toString().length; }; @@ -81,33 +81,33 @@ HighlighterWaiter.prototype._get_output_html_offset = function(node, offset) { * @returns {number} pos.start * @returns {number} pos.end */ -HighlighterWaiter.prototype._get_output_html_selection_offsets = function() { - var sel = window.getSelection(), - range, - start = 0, - end = 0, - backwards = false; - - if (sel.rangeCount) { - range = sel.getRangeAt(sel.rangeCount - 1); - backwards = this._is_selection_backwards(); - start = this._get_output_html_offset(range.startContainer, range.startOffset); - end = this._get_output_html_offset(range.endContainer, range.endOffset); - sel.removeAllRanges(); - sel.addRange(range); - - if (backwards) { +HighlighterWaiter.prototype._get_output_html_selection_offsets = function () { + let sel = window.getSelection(), + range, + start = 0, + end = 0, + backwards = false; + + if (sel.rangeCount) { + range = sel.getRangeAt(sel.rangeCount - 1); + backwards = this._is_selection_backwards(); + start = this._get_output_html_offset(range.startContainer, range.startOffset); + end = this._get_output_html_offset(range.endContainer, range.endOffset); + sel.removeAllRanges(); + sel.addRange(range); + + if (backwards) { // If selecting backwards, reverse the start and end offsets for the selection to // prevent deselecting as the drag continues. - sel.collapseToEnd(); - sel.extend(sel.anchorNode, range.startOffset); - } + sel.collapseToEnd(); + sel.extend(sel.anchorNode, range.startOffset); } - - return { - start: start, - end: end - }; + } + + return { + start, + end, + }; }; @@ -117,10 +117,10 @@ HighlighterWaiter.prototype._get_output_html_selection_offsets = function() { * * @param {event} e */ -HighlighterWaiter.prototype.input_scroll = function(e) { - var el = e.target; - document.getElementById("input-highlighter").scrollTop = el.scrollTop; - document.getElementById("input-highlighter").scrollLeft = el.scrollLeft; +HighlighterWaiter.prototype.input_scroll = function (e) { + const el = e.target; + document.getElementById('input-highlighter').scrollTop = el.scrollTop; + document.getElementById('input-highlighter').scrollLeft = el.scrollLeft; }; @@ -130,10 +130,10 @@ HighlighterWaiter.prototype.input_scroll = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_scroll = function(e) { - var el = e.target; - document.getElementById("output-highlighter").scrollTop = el.scrollTop; - document.getElementById("output-highlighter").scrollLeft = el.scrollLeft; +HighlighterWaiter.prototype.output_scroll = function (e) { + const el = e.target; + document.getElementById('output-highlighter').scrollTop = el.scrollTop; + document.getElementById('output-highlighter').scrollLeft = el.scrollLeft; }; @@ -143,19 +143,19 @@ HighlighterWaiter.prototype.output_scroll = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.input_mousedown = function(e) { - this.mouse_button_down = true; - this.mouse_target = HighlighterWaiter.INPUT; - this.remove_highlights(); - - var el = e.target, - start = el.selectionStart, - end = el.selectionEnd; - - if (start !== 0 || end !== 0) { - document.getElementById("input-selection-info").innerHTML = this.selection_info(start, end); - this.highlight_output([{start: start, end: end}]); - } +HighlighterWaiter.prototype.input_mousedown = function (e) { + this.mouse_button_down = true; + this.mouse_target = HighlighterWaiter.INPUT; + this.remove_highlights(); + + let el = e.target, + start = el.selectionStart, + end = el.selectionEnd; + + if (start !== 0 || end !== 0) { + document.getElementById('input-selection-info').innerHTML = this.selection_info(start, end); + this.highlight_output([{ start, end }]); + } }; @@ -165,19 +165,19 @@ HighlighterWaiter.prototype.input_mousedown = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_mousedown = function(e) { - this.mouse_button_down = true; - this.mouse_target = HighlighterWaiter.OUTPUT; - this.remove_highlights(); - - var el = e.target, - start = el.selectionStart, - end = el.selectionEnd; - - if (start !== 0 || end !== 0) { - document.getElementById("output-selection-info").innerHTML = this.selection_info(start, end); - this.highlight_input([{start: start, end: end}]); - } +HighlighterWaiter.prototype.output_mousedown = function (e) { + this.mouse_button_down = true; + this.mouse_target = HighlighterWaiter.OUTPUT; + this.remove_highlights(); + + let el = e.target, + start = el.selectionStart, + end = el.selectionEnd; + + if (start !== 0 || end !== 0) { + document.getElementById('output-selection-info').innerHTML = this.selection_info(start, end); + this.highlight_input([{ start, end }]); + } }; @@ -187,14 +187,14 @@ HighlighterWaiter.prototype.output_mousedown = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_html_mousedown = function(e) { - this.mouse_button_down = true; - this.mouse_target = HighlighterWaiter.OUTPUT; - - var sel = this._get_output_html_selection_offsets(); - if (sel.start !== 0 || sel.end !== 0) { - document.getElementById("output-selection-info").innerHTML = this.selection_info(sel.start, sel.end); - } +HighlighterWaiter.prototype.output_html_mousedown = function (e) { + this.mouse_button_down = true; + this.mouse_target = HighlighterWaiter.OUTPUT; + + const sel = this._get_output_html_selection_offsets(); + if (sel.start !== 0 || sel.end !== 0) { + document.getElementById('output-selection-info').innerHTML = this.selection_info(sel.start, sel.end); + } }; @@ -203,8 +203,8 @@ HighlighterWaiter.prototype.output_html_mousedown = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.input_mouseup = function(e) { - this.mouse_button_down = false; +HighlighterWaiter.prototype.input_mouseup = function (e) { + this.mouse_button_down = false; }; @@ -213,8 +213,8 @@ HighlighterWaiter.prototype.input_mouseup = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_mouseup = function(e) { - this.mouse_button_down = false; +HighlighterWaiter.prototype.output_mouseup = function (e) { + this.mouse_button_down = false; }; @@ -223,8 +223,8 @@ HighlighterWaiter.prototype.output_mouseup = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_html_mouseup = function(e) { - this.mouse_button_down = false; +HighlighterWaiter.prototype.output_html_mouseup = function (e) { + this.mouse_button_down = false; }; @@ -234,21 +234,20 @@ HighlighterWaiter.prototype.output_html_mouseup = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.input_mousemove = function(e) { +HighlighterWaiter.prototype.input_mousemove = function (e) { // Check that the left mouse button is pressed - if (!this.mouse_button_down || + if (!this.mouse_button_down || e.which != 1 || - this.mouse_target != HighlighterWaiter.INPUT) - return; - - var el = e.target, - start = el.selectionStart, - end = el.selectionEnd; + this.mouse_target != HighlighterWaiter.INPUT) { return; } - if (start !== 0 || end !== 0) { - document.getElementById("input-selection-info").innerHTML = this.selection_info(start, end); - this.highlight_output([{start: start, end: end}]); - } + let el = e.target, + start = el.selectionStart, + end = el.selectionEnd; + + if (start !== 0 || end !== 0) { + document.getElementById('input-selection-info').innerHTML = this.selection_info(start, end); + this.highlight_output([{ start, end }]); + } }; @@ -258,21 +257,20 @@ HighlighterWaiter.prototype.input_mousemove = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_mousemove = function(e) { +HighlighterWaiter.prototype.output_mousemove = function (e) { // Check that the left mouse button is pressed - if (!this.mouse_button_down || + if (!this.mouse_button_down || e.which != 1 || - this.mouse_target != HighlighterWaiter.OUTPUT) - return; - - var el = e.target, - start = el.selectionStart, - end = el.selectionEnd; - - if (start !== 0 || end !== 0) { - document.getElementById("output-selection-info").innerHTML = this.selection_info(start, end); - this.highlight_input([{start: start, end: end}]); - } + this.mouse_target != HighlighterWaiter.OUTPUT) { return; } + + let el = e.target, + start = el.selectionStart, + end = el.selectionEnd; + + if (start !== 0 || end !== 0) { + document.getElementById('output-selection-info').innerHTML = this.selection_info(start, end); + this.highlight_input([{ start, end }]); + } }; @@ -282,17 +280,16 @@ HighlighterWaiter.prototype.output_mousemove = function(e) { * * @param {event} e */ -HighlighterWaiter.prototype.output_html_mousemove = function(e) { +HighlighterWaiter.prototype.output_html_mousemove = function (e) { // Check that the left mouse button is pressed - if (!this.mouse_button_down || + if (!this.mouse_button_down || e.which != 1 || - this.mouse_target != HighlighterWaiter.OUTPUT) - return; - - var sel = this._get_output_html_selection_offsets(); - if (sel.start !== 0 || sel.end !== 0) { - document.getElementById("output-selection-info").innerHTML = this.selection_info(sel.start, sel.end); - } + this.mouse_target != HighlighterWaiter.OUTPUT) { return; } + + const sel = this._get_output_html_selection_offsets(); + if (sel.start !== 0 || sel.end !== 0) { + document.getElementById('output-selection-info').innerHTML = this.selection_info(sel.start, sel.end); + } }; @@ -304,30 +301,30 @@ HighlighterWaiter.prototype.output_html_mousemove = function(e) { * @param {number} end - The end offset. * @returns {string} */ -HighlighterWaiter.prototype.selection_info = function(start, end) { - var width = end.toString().length; - width = width < 2 ? 2 : width; - var start_str = Utils.pad(start.toString(), width, " ").replace(/ /g, " "), - end_str = Utils.pad(end.toString(), width, " ").replace(/ /g, " "), - len_str = Utils.pad((end-start).toString(), width, " ").replace(/ /g, " "); - - return "start: " + start_str + "
    end: " + end_str + "
    length: " + len_str; +HighlighterWaiter.prototype.selection_info = function (start, end) { + let width = end.toString().length; + width = width < 2 ? 2 : width; + let start_str = Utils.pad(start.toString(), width, ' ').replace(/ /g, ' '), + end_str = Utils.pad(end.toString(), width, ' ').replace(/ /g, ' '), + len_str = Utils.pad((end - start).toString(), width, ' ').replace(/ /g, ' '); + + return `start: ${start_str}
    end: ${end_str}
    length: ${len_str}`; }; /** * Removes highlighting and selection information. */ -HighlighterWaiter.prototype.remove_highlights = function() { - document.getElementById("input-highlighter").innerHTML = ""; - document.getElementById("output-highlighter").innerHTML = ""; - document.getElementById("input-selection-info").innerHTML = ""; - document.getElementById("output-selection-info").innerHTML = ""; +HighlighterWaiter.prototype.remove_highlights = function () { + document.getElementById('input-highlighter').innerHTML = ''; + document.getElementById('output-highlighter').innerHTML = ''; + document.getElementById('input-selection-info').innerHTML = ''; + document.getElementById('output-selection-info').innerHTML = ''; }; /** - * Generates a list of all the highlight functions assigned to operations in the recipe, if the + * Generates a list of all the highlight functions assigned to operations in the recipe, if the * entire recipe supports highlighting. * * @returns {Object[]} highlights @@ -335,29 +332,29 @@ HighlighterWaiter.prototype.remove_highlights = function() { * @returns {function} highlights[].b * @returns {Object[]} highlights[].args */ -HighlighterWaiter.prototype.generate_highlight_list = function() { - var recipe_config = this.app.get_recipe_config(), - highlights = []; - - for (var i = 0; i < recipe_config.length; i++) { - if (recipe_config[i].disabled) continue; - +HighlighterWaiter.prototype.generate_highlight_list = function () { + let recipe_config = this.app.get_recipe_config(), + highlights = []; + + for (let i = 0; i < recipe_config.length; i++) { + if (recipe_config[i].disabled) continue; + // If any breakpoints are set, do not attempt to highlight - if (recipe_config[i].breakpoint) return false; - - var op = this.app.operations[recipe_config[i].op]; - + if (recipe_config[i].breakpoint) return false; + + const op = this.app.operations[recipe_config[i].op]; + // If any of the operations do not support highlighting, fail immediately. - if (op.highlight === false || op.highlight === undefined) return false; - - highlights.push({ - f: op.highlight, - b: op.highlight_reverse, - args: recipe_config[i].args - }); - } - - return highlights; + if (op.highlight === false || op.highlight === undefined) return false; + + highlights.push({ + f: op.highlight, + b: op.highlight_reverse, + args: recipe_config[i].args, + }); + } + + return highlights; }; @@ -372,26 +369,26 @@ HighlighterWaiter.prototype.generate_highlight_list = function() { * @param {number} pos.start - The start offset. * @param {number} pos.end - The end offset. */ -HighlighterWaiter.prototype.highlight_output = function(pos) { - var highlights = this.generate_highlight_list(); +HighlighterWaiter.prototype.highlight_output = function (pos) { + const highlights = this.generate_highlight_list(); - if (!highlights || !this.app.auto_bake_) { - return false; - } + if (!highlights || !this.app.auto_bake_) { + return false; + } - for (var i = 0; i < highlights.length; i++) { + for (let i = 0; i < highlights.length; i++) { // Remove multiple highlights before processing again - pos = [pos[0]]; - - if (typeof highlights[i].f == "function") { - pos = highlights[i].f(pos, highlights[i].args); - } + pos = [pos[0]]; + + if (typeof highlights[i].f === 'function') { + pos = highlights[i].f(pos, highlights[i].args); } - - document.getElementById("output-selection-info").innerHTML = this.selection_info(pos[0].start, pos[0].end); - this.highlight( - document.getElementById("output-text"), - document.getElementById("output-highlighter"), + } + + document.getElementById('output-selection-info').innerHTML = this.selection_info(pos[0].start, pos[0].end); + this.highlight( + document.getElementById('output-text'), + document.getElementById('output-highlighter'), pos); }; @@ -407,26 +404,26 @@ HighlighterWaiter.prototype.highlight_output = function(pos) { * @param {number} pos.start - The start offset. * @param {number} pos.end - The end offset. */ -HighlighterWaiter.prototype.highlight_input = function(pos) { - var highlights = this.generate_highlight_list(); - - if (!highlights || !this.app.auto_bake_) { - return false; - } +HighlighterWaiter.prototype.highlight_input = function (pos) { + const highlights = this.generate_highlight_list(); - for (var i = 0; i < highlights.length; i++) { + if (!highlights || !this.app.auto_bake_) { + return false; + } + + for (let i = 0; i < highlights.length; i++) { // Remove multiple highlights before processing again - pos = [pos[0]]; - - if (typeof highlights[i].b == "function") { - pos = highlights[i].b(pos, highlights[i].args); - } + pos = [pos[0]]; + + if (typeof highlights[i].b === 'function') { + pos = highlights[i].b(pos, highlights[i].args); } - - document.getElementById("input-selection-info").innerHTML = this.selection_info(pos[0].start, pos[0].end); - this.highlight( - document.getElementById("input-text"), - document.getElementById("input-highlighter"), + } + + document.getElementById('input-selection-info').innerHTML = this.selection_info(pos[0].start, pos[0].end); + this.highlight( + document.getElementById('input-text'), + document.getElementById('input-highlighter'), pos); }; @@ -441,66 +438,66 @@ HighlighterWaiter.prototype.highlight_input = function(pos) { * @param {number} pos.start - The start offset. * @param {number} pos.end - The end offset. */ -HighlighterWaiter.prototype.highlight = function(textarea, highlighter, pos) { - if (!this.app.options.show_highlighter) return false; - if (!this.app.options.attempt_highlight) return false; - +HighlighterWaiter.prototype.highlight = function (textarea, highlighter, pos) { + if (!this.app.options.show_highlighter) return false; + if (!this.app.options.attempt_highlight) return false; + // Check if there is a carriage return in the output dish as this will not // be displayed by the HTML textarea and will mess up highlighting offsets. - if (!this.app.dish_str || this.app.dish_str.indexOf("\r") >= 0) return false; - - var start_placeholder = "[start_highlight]", - start_placeholder_regex = /\[start_highlight\]/g, - end_placeholder = "[end_highlight]", - end_placeholder_regex = /\[end_highlight\]/g, - text = textarea.value; - + if (!this.app.dish_str || this.app.dish_str.indexOf('\r') >= 0) return false; + + let start_placeholder = '[start_highlight]', + start_placeholder_regex = /\[start_highlight\]/g, + end_placeholder = '[end_highlight]', + end_placeholder_regex = /\[end_highlight\]/g, + text = textarea.value; + // Put placeholders in position // If there's only one value, select that // If there are multiple, ignore the first one and select all others - if (pos.length == 1) { - if (pos[0].end < pos[0].start) return; - text = text.slice(0, pos[0].start) + + if (pos.length == 1) { + if (pos[0].end < pos[0].start) return; + text = text.slice(0, pos[0].start) + start_placeholder + text.slice(pos[0].start, pos[0].end) + end_placeholder + text.slice(pos[0].end, text.length); - } else { + } else { // O(n^2) - Can anyone improve this without overwriting placeholders? - var result = "", - end_placed = true; - - for (var i = 0; i < text.length; i++) { - for (var j = 1; j < pos.length; j++) { - if (pos[j].end < pos[j].start) continue; - if (pos[j].start == i) { - result += start_placeholder; - end_placed = false; - } - if (pos[j].end == i) { - result += end_placeholder; - end_placed = true; - } - } - result += text[i]; + let result = '', + end_placed = true; + + for (let i = 0; i < text.length; i++) { + for (let j = 1; j < pos.length; j++) { + if (pos[j].end < pos[j].start) continue; + if (pos[j].start == i) { + result += start_placeholder; + end_placed = false; } - if (!end_placed) result += end_placeholder; - text = result; + if (pos[j].end == i) { + result += end_placeholder; + end_placed = true; + } + } + result += text[i]; } - - var css_class = "hl1"; - //if (colour) css_class += "-"+colour; - + if (!end_placed) result += end_placeholder; + text = result; + } + + const css_class = 'hl1'; + // if (colour) css_class += "-"+colour; + // Remove HTML tags - text = text.replace(/&/g, "&") - .replace(//g, ">") - .replace(/\n/g, " ") + text = `${text.replace(/&/g, '&') + .replace(//g, '>') + .replace(/\n/g, ' ') // Convert placeholders to tags - .replace(start_placeholder_regex, "") - .replace(end_placeholder_regex, "") + " "; - + .replace(start_placeholder_regex, ``) + .replace(end_placeholder_regex, '')} `; + // Adjust width to allow for scrollbars - highlighter.style.width = textarea.clientWidth + "px"; - highlighter.innerHTML = text; - highlighter.scrollTop = textarea.scrollTop; - highlighter.scrollLeft = textarea.scrollLeft; + highlighter.style.width = `${textarea.clientWidth}px`; + highlighter.innerHTML = text; + highlighter.scrollTop = textarea.scrollTop; + highlighter.scrollLeft = textarea.scrollLeft; }; diff --git a/src/js/views/html/InputWaiter.js b/src/js/views/html/InputWaiter.js index d6b7821c..a70e217b 100755 --- a/src/js/views/html/InputWaiter.js +++ b/src/js/views/html/InputWaiter.js @@ -9,27 +9,27 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var InputWaiter = function(app, manager) { - this.app = app; - this.manager = manager; - +const InputWaiter = function (app, manager) { + this.app = app; + this.manager = manager; + // Define keys that don't change the input so we don't have to autobake when they are pressed - this.bad_keys = [ - 16, //Shift - 17, //Ctrl - 18, //Alt - 19, //Pause - 20, //Caps - 27, //Esc - 33,34,35,36, //PgUp, PgDn, End, Home - 37,38,39,40, //Directional - 44, //PrntScrn - 91,92, //Win - 93, //Context - 112,113,114,115,116,117,118,119,120,121,122,123, //F1-12 - 144, //Num - 145, //Scroll - ]; + this.bad_keys = [ + 16, // Shift + 17, // Ctrl + 18, // Alt + 19, // Pause + 20, // Caps + 27, // Esc + 33, 34, 35, 36, // PgUp, PgDn, End, Home + 37, 38, 39, 40, // Directional + 44, // PrntScrn + 91, 92, // Win + 93, // Context + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, // F1-12 + 144, // Num + 145, //Scroll + ]; }; @@ -38,8 +38,8 @@ var InputWaiter = function(app, manager) { * * @returns {string} */ -InputWaiter.prototype.get = function() { - return document.getElementById("input-text").value; +InputWaiter.prototype.get = function () { + return document.getElementById('input-text').value; }; @@ -50,9 +50,9 @@ InputWaiter.prototype.get = function() { * * @fires Manager#statechange */ -InputWaiter.prototype.set = function(input) { - document.getElementById("input-text").value = input; - window.dispatchEvent(this.manager.statechange); +InputWaiter.prototype.set = function (input) { + document.getElementById('input-text').value = input; + window.dispatchEvent(this.manager.statechange); }; @@ -62,14 +62,14 @@ InputWaiter.prototype.set = function(input) { * @param {number} length - The length of the current input string * @param {number} lines - The number of the lines in the current input string */ -InputWaiter.prototype.set_input_info = function(length, lines) { - var width = length.toString().length; - width = width < 2 ? 2 : width; - - var length_str = Utils.pad(length.toString(), width, " ").replace(/ /g, " "); - var lines_str = Utils.pad(lines.toString(), width, " ").replace(/ /g, " "); - - document.getElementById("input-info").innerHTML = "length: " + length_str + "
    lines: " + lines_str; +InputWaiter.prototype.set_input_info = function (length, lines) { + let width = length.toString().length; + width = width < 2 ? 2 : width; + + const length_str = Utils.pad(length.toString(), width, ' ').replace(/ /g, ' '); + const lines_str = Utils.pad(lines.toString(), width, ' ').replace(/ /g, ' '); + + document.getElementById('input-info').innerHTML = `length: ${length_str}
    lines: ${lines_str}`; }; @@ -81,24 +81,24 @@ InputWaiter.prototype.set_input_info = function(length, lines) { * * @fires Manager#statechange */ -InputWaiter.prototype.input_change = function(e) { +InputWaiter.prototype.input_change = function (e) { // Remove highlighting from input and output panes as the offsets might be different now - this.manager.highlighter.remove_highlights(); - + this.manager.highlighter.remove_highlights(); + // Reset recipe progress as any previous processing will be redundant now - this.app.progress = 0; - + this.app.progress = 0; + // Update the input metadata info - var input_text = this.get(), - lines = input_text.count("\n") + 1; - - this.set_input_info(input_text.length, lines); - - - if (this.bad_keys.indexOf(e.keyCode) < 0) { + let input_text = this.get(), + lines = input_text.count('\n') + 1; + + this.set_input_info(input_text.length, lines); + + + if (this.bad_keys.indexOf(e.keyCode) < 0) { // Fire the statechange event as the input has been modified - window.dispatchEvent(this.manager.statechange); - } + window.dispatchEvent(this.manager.statechange); + } }; @@ -108,14 +108,15 @@ InputWaiter.prototype.input_change = function(e) { * * @param {event} e */ -InputWaiter.prototype.input_dragover = function(e) { +InputWaiter.prototype.input_dragover = function (e) { // This will be set if we're dragging an operation - if (e.dataTransfer.effectAllowed === "move") - return false; - - e.stopPropagation(); - e.preventDefault(); - e.target.classList.add("dropping-file"); + if (e.dataTransfer.effectAllowed === 'move') { + return false; + } + + e.stopPropagation(); + e.preventDefault(); + e.target.classList.add('dropping-file'); }; @@ -125,10 +126,10 @@ InputWaiter.prototype.input_dragover = function(e) { * * @param {event} e */ -InputWaiter.prototype.input_dragleave = function(e) { - e.stopPropagation(); - e.preventDefault(); - e.target.classList.remove("dropping-file"); +InputWaiter.prototype.input_dragleave = function (e) { + e.stopPropagation(); + e.preventDefault(); + e.target.classList.remove('dropping-file'); }; @@ -138,64 +139,65 @@ InputWaiter.prototype.input_dragleave = function(e) { * * @param {event} e */ -InputWaiter.prototype.input_drop = function(e) { +InputWaiter.prototype.input_drop = function (e) { // This will be set if we're dragging an operation - if (e.dataTransfer.effectAllowed === "move") - return false; - - e.stopPropagation(); - e.preventDefault(); - - var el = e.target, - file = e.dataTransfer.files[0], - text = e.dataTransfer.getData("Text"), - reader = new FileReader(), - input_charcode = "", - offset = 0, - CHUNK_SIZE = 20480; // 20KB - - var set_input = function() { - if (input_charcode.length > 100000 && this.app.auto_bake_) { - this.manager.controls.set_auto_bake(false); - this.app.alert("Turned off Auto Bake as the input is large", "warning", 5000); - } - - this.set(input_charcode); - var recipe_config = this.app.get_recipe_config(); - if (!recipe_config[0] || recipe_config[0].op != "From Hex") { - recipe_config.unshift({op:"From Hex",args:["Space"]}); - this.app.set_recipe_config(recipe_config); - } - - el.classList.remove("loading_file"); - }.bind(this); - - var seek = function() { - if (offset >= file.size) { - set_input(); - return; - } - el.value = "Processing... " + Math.round(offset / file.size * 100) + "%"; - var slice = file.slice(offset, offset + CHUNK_SIZE); - reader.readAsArrayBuffer(slice); - }.bind(this); - - reader.onload = function(e) { - var data = new Uint8Array(reader.result); - input_charcode += Utils.to_hex_fast(data); - offset += CHUNK_SIZE; - seek(); - }.bind(this); - - - el.classList.remove("dropping-file"); - - if (file) { - el.classList.add("loading_file"); - seek(); - } else if (text) { - this.set(text); + if (e.dataTransfer.effectAllowed === 'move') { + return false; + } + + e.stopPropagation(); + e.preventDefault(); + + let el = e.target, + file = e.dataTransfer.files[0], + text = e.dataTransfer.getData('Text'), + reader = new FileReader(), + input_charcode = '', + offset = 0, + CHUNK_SIZE = 20480; // 20KB + + const set_input = function () { + if (input_charcode.length > 100000 && this.app.auto_bake_) { + this.manager.controls.set_auto_bake(false); + this.app.alert('Turned off Auto Bake as the input is large', 'warning', 5000); } + + this.set(input_charcode); + const recipe_config = this.app.get_recipe_config(); + if (!recipe_config[0] || recipe_config[0].op != 'From Hex') { + recipe_config.unshift({ op: 'From Hex', args: ['Space'] }); + this.app.set_recipe_config(recipe_config); + } + + el.classList.remove('loading_file'); + }.bind(this); + + const seek = function () { + if (offset >= file.size) { + set_input(); + return; + } + el.value = `Processing... ${Math.round(offset / file.size * 100)}%`; + const slice = file.slice(offset, offset + CHUNK_SIZE); + reader.readAsArrayBuffer(slice); + }; + + reader.onload = function (e) { + const data = new Uint8Array(reader.result); + input_charcode += Utils.to_hex_fast(data); + offset += CHUNK_SIZE; + seek(); + }; + + + el.classList.remove('dropping-file'); + + if (file) { + el.classList.add('loading_file'); + seek(); + } else if (text) { + this.set(text); + } }; @@ -205,13 +207,13 @@ InputWaiter.prototype.input_drop = function(e) { * * @fires Manager#statechange */ -InputWaiter.prototype.clear_io_click = function() { - this.manager.highlighter.remove_highlights(); - document.getElementById("input-text").value = ""; - document.getElementById("output-text").value = ""; - document.getElementById("input-info").innerHTML = ""; - document.getElementById("output-info").innerHTML = ""; - document.getElementById("input-selection-info").innerHTML = ""; - document.getElementById("output-selection-info").innerHTML = ""; - window.dispatchEvent(this.manager.statechange); +InputWaiter.prototype.clear_io_click = function () { + this.manager.highlighter.remove_highlights(); + document.getElementById('input-text').value = ''; + document.getElementById('output-text').value = ''; + document.getElementById('input-info').innerHTML = ''; + document.getElementById('output-info').innerHTML = ''; + document.getElementById('input-selection-info').innerHTML = ''; + document.getElementById('output-selection-info').innerHTML = ''; + window.dispatchEvent(this.manager.statechange); }; diff --git a/src/js/views/html/Manager.js b/src/js/views/html/Manager.js index 9c414d3c..6abdf37a 100755 --- a/src/js/views/html/Manager.js +++ b/src/js/views/html/Manager.js @@ -8,142 +8,142 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -var Manager = function(app) { - this.app = app; - +const Manager = function (app) { + this.app = app; + // Define custom events /** * @event Manager#appstart */ - this.appstart = new CustomEvent("appstart", {bubbles: true}); + this.appstart = new CustomEvent('appstart', { bubbles: true }); /** * @event Manager#operationadd */ - this.operationadd = new CustomEvent("operationadd", {bubbles: true}); + this.operationadd = new CustomEvent('operationadd', { bubbles: true }); /** * @event Manager#operationremove */ - this.operationremove = new CustomEvent("operationremove", {bubbles: true}); + this.operationremove = new CustomEvent('operationremove', { bubbles: true }); /** * @event Manager#oplistcreate */ - this.oplistcreate = new CustomEvent("oplistcreate", {bubbles: true}); + this.oplistcreate = new CustomEvent('oplistcreate', { bubbles: true }); /** * @event Manager#statechange */ - this.statechange = new CustomEvent("statechange", {bubbles: true}); - + this.statechange = new CustomEvent('statechange', { bubbles: true }); + // Define Waiter objects to handle various areas - this.window = new WindowWaiter(this.app); - this.controls = new ControlsWaiter(this.app, this); - this.recipe = new RecipeWaiter(this.app, this); - this.ops = new OperationsWaiter(this.app, this); - this.input = new InputWaiter(this.app, this); - this.output = new OutputWaiter(this.app, this); - this.options = new OptionsWaiter(this.app); - this.highlighter = new HighlighterWaiter(this.app); - this.seasonal = new SeasonalWaiter(this.app, this); - + this.window = new WindowWaiter(this.app); + this.controls = new ControlsWaiter(this.app, this); + this.recipe = new RecipeWaiter(this.app, this); + this.ops = new OperationsWaiter(this.app, this); + this.input = new InputWaiter(this.app, this); + this.output = new OutputWaiter(this.app, this); + this.options = new OptionsWaiter(this.app); + this.highlighter = new HighlighterWaiter(this.app); + this.seasonal = new SeasonalWaiter(this.app, this); + // Object to store dynamic handlers to fire on elements that may not exist yet - this.dynamic_handlers = {}; - - this.initialise_event_listeners(); + this.dynamic_handlers = {}; + + this.initialise_event_listeners(); }; /** * Sets up the various components and listeners. */ -Manager.prototype.setup = function() { - this.recipe.initialise_operation_drag_n_drop(); - this.controls.auto_bake_change(); - this.seasonal.load(); +Manager.prototype.setup = function () { + this.recipe.initialise_operation_drag_n_drop(); + this.controls.auto_bake_change(); + this.seasonal.load(); }; /** * Main function to handle the creation of the event listeners. */ -Manager.prototype.initialise_event_listeners = function() { +Manager.prototype.initialise_event_listeners = function () { // Global - window.addEventListener("resize", this.window.window_resize.bind(this.window)); - window.addEventListener("blur", this.window.window_blur.bind(this.window)); - window.addEventListener("focus", this.window.window_focus.bind(this.window)); - window.addEventListener("statechange", this.app.state_change.bind(this.app)); - window.addEventListener("popstate", this.app.pop_state.bind(this.app)); - + window.addEventListener('resize', this.window.window_resize.bind(this.window)); + window.addEventListener('blur', this.window.window_blur.bind(this.window)); + window.addEventListener('focus', this.window.window_focus.bind(this.window)); + window.addEventListener('statechange', this.app.state_change.bind(this.app)); + window.addEventListener('popstate', this.app.pop_state.bind(this.app)); + // Controls - document.getElementById("bake").addEventListener("click", this.controls.bake_click.bind(this.controls)); - document.getElementById("auto-bake").addEventListener("change", this.controls.auto_bake_change.bind(this.controls)); - document.getElementById("step").addEventListener("click", this.controls.step_click.bind(this.controls)); - document.getElementById("clr-recipe").addEventListener("click", this.controls.clear_recipe_click.bind(this.controls)); - document.getElementById("clr-breaks").addEventListener("click", this.controls.clear_breaks_click.bind(this.controls)); - document.getElementById("save").addEventListener("click", this.controls.save_click.bind(this.controls)); - document.getElementById("save-button").addEventListener("click", this.controls.save_button_click.bind(this.controls)); - document.getElementById("save-link-recipe-checkbox").addEventListener("change", this.controls.slr_check_change.bind(this.controls)); - document.getElementById("save-link-input-checkbox").addEventListener("change", this.controls.sli_check_change.bind(this.controls)); - document.getElementById("load").addEventListener("click", this.controls.load_click.bind(this.controls)); - document.getElementById("load-delete-button").addEventListener("click", this.controls.load_delete_click.bind(this.controls)); - document.getElementById("load-name").addEventListener("change", this.controls.load_name_change.bind(this.controls)); - document.getElementById("load-button").addEventListener("click", this.controls.load_button_click.bind(this.controls)); - this.add_multi_event_listener("#save-text", "keyup paste", this.controls.save_text_change, this.controls); - + document.getElementById('bake').addEventListener('click', this.controls.bake_click.bind(this.controls)); + document.getElementById('auto-bake').addEventListener('change', this.controls.auto_bake_change.bind(this.controls)); + document.getElementById('step').addEventListener('click', this.controls.step_click.bind(this.controls)); + document.getElementById('clr-recipe').addEventListener('click', this.controls.clear_recipe_click.bind(this.controls)); + document.getElementById('clr-breaks').addEventListener('click', this.controls.clear_breaks_click.bind(this.controls)); + document.getElementById('save').addEventListener('click', this.controls.save_click.bind(this.controls)); + document.getElementById('save-button').addEventListener('click', this.controls.save_button_click.bind(this.controls)); + document.getElementById('save-link-recipe-checkbox').addEventListener('change', this.controls.slr_check_change.bind(this.controls)); + document.getElementById('save-link-input-checkbox').addEventListener('change', this.controls.sli_check_change.bind(this.controls)); + document.getElementById('load').addEventListener('click', this.controls.load_click.bind(this.controls)); + document.getElementById('load-delete-button').addEventListener('click', this.controls.load_delete_click.bind(this.controls)); + document.getElementById('load-name').addEventListener('change', this.controls.load_name_change.bind(this.controls)); + document.getElementById('load-button').addEventListener('click', this.controls.load_button_click.bind(this.controls)); + this.add_multi_event_listener('#save-text', 'keyup paste', this.controls.save_text_change, this.controls); + // Operations - this.add_multi_event_listener("#search", "keyup paste search", this.ops.search_operations, this.ops); - this.add_dynamic_listener(".op_list li.operation", "dblclick", this.ops.operation_dblclick, this.ops); - document.getElementById("edit-favourites").addEventListener("click", this.ops.edit_favourites_click.bind(this.ops)); - document.getElementById("save-favourites").addEventListener("click", this.ops.save_favourites_click.bind(this.ops)); - document.getElementById("reset-favourites").addEventListener("click", this.ops.reset_favourites_click.bind(this.ops)); - this.add_dynamic_listener(".op_list .op-icon", "mouseover", this.ops.op_icon_mouseover, this.ops); - this.add_dynamic_listener(".op_list .op-icon", "mouseleave", this.ops.op_icon_mouseleave, this.ops); - this.add_dynamic_listener(".op_list", "oplistcreate", this.ops.op_list_create, this.ops); - this.add_dynamic_listener("li.operation", "operationadd", this.recipe.op_add.bind(this.recipe)); - + this.add_multi_event_listener('#search', 'keyup paste search', this.ops.search_operations, this.ops); + this.add_dynamic_listener('.op_list li.operation', 'dblclick', this.ops.operation_dblclick, this.ops); + document.getElementById('edit-favourites').addEventListener('click', this.ops.edit_favourites_click.bind(this.ops)); + document.getElementById('save-favourites').addEventListener('click', this.ops.save_favourites_click.bind(this.ops)); + document.getElementById('reset-favourites').addEventListener('click', this.ops.reset_favourites_click.bind(this.ops)); + this.add_dynamic_listener('.op_list .op-icon', 'mouseover', this.ops.op_icon_mouseover, this.ops); + this.add_dynamic_listener('.op_list .op-icon', 'mouseleave', this.ops.op_icon_mouseleave, this.ops); + this.add_dynamic_listener('.op_list', 'oplistcreate', this.ops.op_list_create, this.ops); + this.add_dynamic_listener('li.operation', 'operationadd', this.recipe.op_add.bind(this.recipe)); + // Recipe - this.add_dynamic_listener(".arg", "keyup", this.recipe.ing_change, this.recipe); - this.add_dynamic_listener(".arg", "change", this.recipe.ing_change, this.recipe); - this.add_dynamic_listener(".disable-icon", "click", this.recipe.disable_click, this.recipe); - this.add_dynamic_listener(".breakpoint", "click", this.recipe.breakpoint_click, this.recipe); - this.add_dynamic_listener("#rec_list li.operation", "dblclick", this.recipe.operation_dblclick, this.recipe); - this.add_dynamic_listener("#rec_list li.operation > div", "dblclick", this.recipe.operation_child_dblclick, this.recipe); - this.add_dynamic_listener("#rec_list .input-group .dropdown-menu a", "click", this.recipe.dropdown_toggle_click, this.recipe); - this.add_dynamic_listener("#rec_list", "operationremove", this.recipe.op_remove.bind(this.recipe)); - + this.add_dynamic_listener('.arg', 'keyup', this.recipe.ing_change, this.recipe); + this.add_dynamic_listener('.arg', 'change', this.recipe.ing_change, this.recipe); + this.add_dynamic_listener('.disable-icon', 'click', this.recipe.disable_click, this.recipe); + this.add_dynamic_listener('.breakpoint', 'click', this.recipe.breakpoint_click, this.recipe); + this.add_dynamic_listener('#rec_list li.operation', 'dblclick', this.recipe.operation_dblclick, this.recipe); + this.add_dynamic_listener('#rec_list li.operation > div', 'dblclick', this.recipe.operation_child_dblclick, this.recipe); + this.add_dynamic_listener('#rec_list .input-group .dropdown-menu a', 'click', this.recipe.dropdown_toggle_click, this.recipe); + this.add_dynamic_listener('#rec_list', 'operationremove', this.recipe.op_remove.bind(this.recipe)); + // Input - this.add_multi_event_listener("#input-text", "keyup paste", this.input.input_change, this.input); - document.getElementById("reset-layout").addEventListener("click", this.app.reset_layout.bind(this.app)); - document.getElementById("clr-io").addEventListener("click", this.input.clear_io_click.bind(this.input)); - document.getElementById("input-text").addEventListener("dragover", this.input.input_dragover.bind(this.input)); - document.getElementById("input-text").addEventListener("dragleave", this.input.input_dragleave.bind(this.input)); - document.getElementById("input-text").addEventListener("drop", this.input.input_drop.bind(this.input)); - document.getElementById("input-text").addEventListener("scroll", this.highlighter.input_scroll.bind(this.highlighter)); - document.getElementById("input-text").addEventListener("mouseup", this.highlighter.input_mouseup.bind(this.highlighter)); - document.getElementById("input-text").addEventListener("mousemove", this.highlighter.input_mousemove.bind(this.highlighter)); - this.add_multi_event_listener("#input-text", "mousedown dblclick select", this.highlighter.input_mousedown, this.highlighter); - + this.add_multi_event_listener('#input-text', 'keyup paste', this.input.input_change, this.input); + document.getElementById('reset-layout').addEventListener('click', this.app.reset_layout.bind(this.app)); + document.getElementById('clr-io').addEventListener('click', this.input.clear_io_click.bind(this.input)); + document.getElementById('input-text').addEventListener('dragover', this.input.input_dragover.bind(this.input)); + document.getElementById('input-text').addEventListener('dragleave', this.input.input_dragleave.bind(this.input)); + document.getElementById('input-text').addEventListener('drop', this.input.input_drop.bind(this.input)); + document.getElementById('input-text').addEventListener('scroll', this.highlighter.input_scroll.bind(this.highlighter)); + document.getElementById('input-text').addEventListener('mouseup', this.highlighter.input_mouseup.bind(this.highlighter)); + document.getElementById('input-text').addEventListener('mousemove', this.highlighter.input_mousemove.bind(this.highlighter)); + this.add_multi_event_listener('#input-text', 'mousedown dblclick select', this.highlighter.input_mousedown, this.highlighter); + // Output - document.getElementById("save-to-file").addEventListener("click", this.output.save_click.bind(this.output)); - document.getElementById("switch").addEventListener("click", this.output.switch_click.bind(this.output)); - document.getElementById("undo-switch").addEventListener("click", this.output.undo_switch_click.bind(this.output)); - document.getElementById("output-text").addEventListener("scroll", this.highlighter.output_scroll.bind(this.highlighter)); - document.getElementById("output-text").addEventListener("mouseup", this.highlighter.output_mouseup.bind(this.highlighter)); - document.getElementById("output-text").addEventListener("mousemove", this.highlighter.output_mousemove.bind(this.highlighter)); - document.getElementById("output-html").addEventListener("mouseup", this.highlighter.output_html_mouseup.bind(this.highlighter)); - document.getElementById("output-html").addEventListener("mousemove", this.highlighter.output_html_mousemove.bind(this.highlighter)); - this.add_multi_event_listener("#output-text", "mousedown dblclick select", this.highlighter.output_mousedown, this.highlighter); - this.add_multi_event_listener("#output-html", "mousedown dblclick select", this.highlighter.output_html_mousedown, this.highlighter); - + document.getElementById('save-to-file').addEventListener('click', this.output.save_click.bind(this.output)); + document.getElementById('switch').addEventListener('click', this.output.switch_click.bind(this.output)); + document.getElementById('undo-switch').addEventListener('click', this.output.undo_switch_click.bind(this.output)); + document.getElementById('output-text').addEventListener('scroll', this.highlighter.output_scroll.bind(this.highlighter)); + document.getElementById('output-text').addEventListener('mouseup', this.highlighter.output_mouseup.bind(this.highlighter)); + document.getElementById('output-text').addEventListener('mousemove', this.highlighter.output_mousemove.bind(this.highlighter)); + document.getElementById('output-html').addEventListener('mouseup', this.highlighter.output_html_mouseup.bind(this.highlighter)); + document.getElementById('output-html').addEventListener('mousemove', this.highlighter.output_html_mousemove.bind(this.highlighter)); + this.add_multi_event_listener('#output-text', 'mousedown dblclick select', this.highlighter.output_mousedown, this.highlighter); + this.add_multi_event_listener('#output-html', 'mousedown dblclick select', this.highlighter.output_html_mousedown, this.highlighter); + // Options - document.getElementById("options").addEventListener("click", this.options.options_click.bind(this.options)); - document.getElementById("reset-options").addEventListener("click", this.options.reset_options_click.bind(this.options)); - $(".option-item input:checkbox").on("switchChange.bootstrapSwitch", this.options.switch_change.bind(this.options)); - $(".option-item input:checkbox").on("switchChange.bootstrapSwitch", this.options.set_word_wrap.bind(this.options)); - this.add_dynamic_listener(".option-item input[type=number]", "keyup", this.options.number_change, this.options); - this.add_dynamic_listener(".option-item input[type=number]", "change", this.options.number_change, this.options); - this.add_dynamic_listener(".option-item select", "change", this.options.select_change, this.options); - + document.getElementById('options').addEventListener('click', this.options.options_click.bind(this.options)); + document.getElementById('reset-options').addEventListener('click', this.options.reset_options_click.bind(this.options)); + $('.option-item input:checkbox').on('switchChange.bootstrapSwitch', this.options.switch_change.bind(this.options)); + $('.option-item input:checkbox').on('switchChange.bootstrapSwitch', this.options.set_word_wrap.bind(this.options)); + this.add_dynamic_listener('.option-item input[type=number]', 'keyup', this.options.number_change, this.options); + this.add_dynamic_listener('.option-item input[type=number]', 'change', this.options.number_change, this.options); + this.add_dynamic_listener('.option-item select', 'change', this.options.select_change, this.options); + // Misc - document.getElementById("alert-close").addEventListener("click", this.app.alert_close_click.bind(this.app)); + document.getElementById('alert-close').addEventListener('click', this.app.alert_close_click.bind(this.app)); }; @@ -160,11 +160,11 @@ Manager.prototype.initialise_event_listeners = function() { * // Calls the clickable function whenever any element with the .clickable class is clicked * this.add_listeners(".clickable", "click", this.clickable, this); */ -Manager.prototype.add_listeners = function(selector, event_type, callback, scope) { - scope = scope || this; - [].forEach.call(document.querySelectorAll(selector), function(el) { - el.addEventListener(event_type, callback.bind(scope)); - }); +Manager.prototype.add_listeners = function (selector, event_type, callback, scope) { + scope = scope || this; + [].forEach.call(document.querySelectorAll(selector), (el) => { + el.addEventListener(event_type, callback.bind(scope)); + }); }; @@ -181,11 +181,11 @@ Manager.prototype.add_listeners = function(selector, event_type, callback, scope * // search element * this.add_multi_event_listener("search", "keyup paste search", this.search, this); */ -Manager.prototype.add_multi_event_listener = function(selector, event_types, callback, scope) { - var evs = event_types.split(" "); - for (var i = 0; i < evs.length; i++) { - document.querySelector(selector).addEventListener(evs[i], callback.bind(scope)); - } +Manager.prototype.add_multi_event_listener = function (selector, event_types, callback, scope) { + const evs = event_types.split(' '); + for (let i = 0; i < evs.length; i++) { + document.querySelector(selector).addEventListener(evs[i], callback.bind(scope)); + } }; @@ -202,11 +202,11 @@ Manager.prototype.add_multi_event_listener = function(selector, event_types, cal * // with the .saveable class * this.add_multi_event_listener(".saveable", "keyup paste", this.save, this); */ -Manager.prototype.add_multi_event_listeners = function(selector, event_types, callback, scope) { - var evs = event_types.split(" "); - for (var i = 0; i < evs.length; i++) { - this.add_listeners(selector, evs[i], callback, scope); - } +Manager.prototype.add_multi_event_listeners = function (selector, event_types, callback, scope) { + const evs = event_types.split(' '); + for (let i = 0; i < evs.length; i++) { + this.add_listeners(selector, evs[i], callback, scope); + } }; @@ -224,20 +224,20 @@ Manager.prototype.add_multi_event_listeners = function(selector, event_types, ca * // listener is created * this.add_dynamic_listener("button", "click", alert, this); */ -Manager.prototype.add_dynamic_listener = function(selector, event_type, callback, scope) { - var event_config = { - selector: selector, - callback: callback.bind(scope || this) - }; - - if (this.dynamic_handlers.hasOwnProperty(event_type)) { +Manager.prototype.add_dynamic_listener = function (selector, event_type, callback, scope) { + const event_config = { + selector, + callback: callback.bind(scope || this), + }; + + if (this.dynamic_handlers.hasOwnProperty(event_type)) { // Listener already exists, add new handler to the appropriate list - this.dynamic_handlers[event_type].push(event_config); - } else { - this.dynamic_handlers[event_type] = [event_config]; + this.dynamic_handlers[event_type].push(event_config); + } else { + this.dynamic_handlers[event_type] = [event_config]; // Set up listener for this new type - document.addEventListener(event_type, this.dynamic_listener_handler.bind(this)); - } + document.addEventListener(event_type, this.dynamic_listener_handler.bind(this)); + } }; @@ -247,17 +247,17 @@ Manager.prototype.add_dynamic_listener = function(selector, event_type, callback * * @param {Event} e - The event to be handled */ -Manager.prototype.dynamic_listener_handler = function(e) { - var handlers = this.dynamic_handlers[e.type], - matches = e.target.matches || +Manager.prototype.dynamic_listener_handler = function (e) { + let handlers = this.dynamic_handlers[e.type], + matches = e.target.matches || e.target.webkitMatchesSelector || e.target.mozMatchesSelector || e.target.msMatchesSelector || e.target.oMatchesSelector; - - for (var i = 0; i < handlers.length; i++) { - if (matches && e.target[matches.name](handlers[i].selector)) { - handlers[i].callback(e); - } + + for (let i = 0; i < handlers.length; i++) { + if (matches && e.target[matches.name](handlers[i].selector)) { + handlers[i].callback(e); } + } }; diff --git a/src/js/views/html/OperationsWaiter.js b/src/js/views/html/OperationsWaiter.js index 4d796e6e..878ba62f 100755 --- a/src/js/views/html/OperationsWaiter.js +++ b/src/js/views/html/OperationsWaiter.js @@ -11,12 +11,12 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var OperationsWaiter = function(app, manager) { - this.app = app; - this.manager = manager; - - this.options = {}; - this.remove_intent = false; +const OperationsWaiter = function (app, manager) { + this.app = app; + this.manager = manager; + + this.options = {}; + this.remove_intent = false; }; @@ -26,67 +26,68 @@ var OperationsWaiter = function(app, manager) { * * @param {event} e */ -OperationsWaiter.prototype.search_operations = function(e) { - var ops, selected; - - if (e.type == "search") { // Search - e.preventDefault(); - ops = document.querySelectorAll("#search-results li"); - if (ops.length) { - selected = this.get_selected_op(ops); - if (selected > -1) { - this.manager.recipe.add_operation(ops[selected].innerHTML); - this.app.auto_bake(); - } - } +OperationsWaiter.prototype.search_operations = function (e) { + let ops, + selected; + + if (e.type == 'search') { // Search + e.preventDefault(); + ops = document.querySelectorAll('#search-results li'); + if (ops.length) { + selected = this.get_selected_op(ops); + if (selected > -1) { + this.manager.recipe.add_operation(ops[selected].innerHTML); + this.app.auto_bake(); + } } - - if (e.keyCode == 13) { // Return - e.preventDefault(); - } else if (e.keyCode == 40) { // Down - e.preventDefault(); - ops = document.querySelectorAll("#search-results li"); - if (ops.length) { - selected = this.get_selected_op(ops); - if (selected > -1) { - ops[selected].classList.remove("selected-op"); - } - if (selected == ops.length-1) selected = -1; - ops[selected+1].classList.add("selected-op"); - } - } else if (e.keyCode == 38) { // Up - e.preventDefault(); - ops = document.querySelectorAll("#search-results li"); - if (ops.length) { - selected = this.get_selected_op(ops); - if (selected > -1) { - ops[selected].classList.remove("selected-op"); - } - if (selected === 0) selected = ops.length; - ops[selected-1].classList.add("selected-op"); - } - } else { - var search_results_el = document.getElementById("search-results"), - el = e.target, - str = el.value; - - while (search_results_el.firstChild) { - search_results_el.removeChild(search_results_el.firstChild); - } - - $("#categories .in").collapse("hide"); - if (str) { - var matched_ops = this.filter_operations(str, true), - matched_ops_html = ""; - - for (var i = 0; i < matched_ops.length; i++) { - matched_ops_html += matched_ops[i].to_stub_html(); - } - - search_results_el.innerHTML = matched_ops_html; - search_results_el.dispatchEvent(this.manager.oplistcreate); - } + } + + if (e.keyCode == 13) { // Return + e.preventDefault(); + } else if (e.keyCode == 40) { // Down + e.preventDefault(); + ops = document.querySelectorAll('#search-results li'); + if (ops.length) { + selected = this.get_selected_op(ops); + if (selected > -1) { + ops[selected].classList.remove('selected-op'); + } + if (selected == ops.length - 1) selected = -1; + ops[selected + 1].classList.add('selected-op'); } + } else if (e.keyCode == 38) { // Up + e.preventDefault(); + ops = document.querySelectorAll('#search-results li'); + if (ops.length) { + selected = this.get_selected_op(ops); + if (selected > -1) { + ops[selected].classList.remove('selected-op'); + } + if (selected === 0) selected = ops.length; + ops[selected - 1].classList.add('selected-op'); + } + } else { + let search_results_el = document.getElementById('search-results'), + el = e.target, + str = el.value; + + while (search_results_el.firstChild) { + search_results_el.removeChild(search_results_el.firstChild); + } + + $('#categories .in').collapse('hide'); + if (str) { + let matched_ops = this.filter_operations(str, true), + matched_ops_html = ''; + + for (let i = 0; i < matched_ops.length; i++) { + matched_ops_html += matched_ops[i].to_stub_html(); + } + + search_results_el.innerHTML = matched_ops_html; + search_results_el.dispatchEvent(this.manager.oplistcreate); + } + } }; @@ -98,32 +99,32 @@ OperationsWaiter.prototype.search_operations = function(e) { * name and description * @returns {string[]} */ -OperationsWaiter.prototype.filter_operations = function(search_str, highlight) { - var matched_ops = [], - matched_descs = []; - - search_str = search_str.toLowerCase(); - - for (var op_name in this.app.operations) { - var op = this.app.operations[op_name], - name_pos = op_name.toLowerCase().indexOf(search_str), - desc_pos = op.description.toLowerCase().indexOf(search_str); - - if (name_pos >= 0 || desc_pos >= 0) { - var operation = new HTMLOperation(op_name, this.app.operations[op_name], this.app, this.manager); - if (highlight) { - operation.highlight_search_string(search_str, name_pos, desc_pos); - } - - if (name_pos < 0) { - matched_ops.push(operation); - } else { - matched_descs.push(operation); - } - } +OperationsWaiter.prototype.filter_operations = function (search_str, highlight) { + let matched_ops = [], + matched_descs = []; + + search_str = search_str.toLowerCase(); + + for (const op_name in this.app.operations) { + let op = this.app.operations[op_name], + name_pos = op_name.toLowerCase().indexOf(search_str), + desc_pos = op.description.toLowerCase().indexOf(search_str); + + if (name_pos >= 0 || desc_pos >= 0) { + const operation = new HTMLOperation(op_name, this.app.operations[op_name], this.app, this.manager); + if (highlight) { + operation.highlight_search_string(search_str, name_pos, desc_pos); + } + + if (name_pos < 0) { + matched_ops.push(operation); + } else { + matched_descs.push(operation); + } } - - return matched_descs.concat(matched_ops); + } + + return matched_descs.concat(matched_ops); }; @@ -134,13 +135,13 @@ OperationsWaiter.prototype.filter_operations = function(search_str, highlight) { * @param {element[]} ops * @returns {number} */ -OperationsWaiter.prototype.get_selected_op = function(ops) { - for (var i = 0; i < ops.length; i++) { - if (ops[i].classList.contains("selected-op")) { - return i; - } +OperationsWaiter.prototype.get_selected_op = function (ops) { + for (let i = 0; i < ops.length; i++) { + if (ops[i].classList.contains('selected-op')) { + return i; } - return -1; + } + return -1; }; @@ -150,9 +151,9 @@ OperationsWaiter.prototype.get_selected_op = function(ops) { * @listens Manager#oplistcreate * @param {event} e */ -OperationsWaiter.prototype.op_list_create = function(e) { - this.manager.recipe.create_sortable_seed_list(e.target); - $("[data-toggle=popover]").popover(); +OperationsWaiter.prototype.op_list_create = function (e) { + this.manager.recipe.create_sortable_seed_list(e.target); + $('[data-toggle=popover]').popover(); }; @@ -162,11 +163,11 @@ OperationsWaiter.prototype.op_list_create = function(e) { * * @param {event} e */ -OperationsWaiter.prototype.operation_dblclick = function(e) { - var li = e.target; - - this.manager.recipe.add_operation(li.textContent); - this.app.auto_bake(); +OperationsWaiter.prototype.operation_dblclick = function (e) { + const li = e.target; + + this.manager.recipe.add_operation(li.textContent); + this.app.auto_bake(); }; @@ -176,50 +177,48 @@ OperationsWaiter.prototype.operation_dblclick = function(e) { * * @param {event} e */ -OperationsWaiter.prototype.edit_favourites_click = function(e) { - e.preventDefault(); - e.stopPropagation(); - +OperationsWaiter.prototype.edit_favourites_click = function (e) { + e.preventDefault(); + e.stopPropagation(); + // Add favourites to modal - var fav_cat = this.app.categories.filter(function(c) { - return c.name == "Favourites"; - })[0]; - - var html = ""; - for (var i = 0; i < fav_cat.ops.length; i++) { - var op_name = fav_cat.ops[i]; - var operation = new HTMLOperation(op_name, this.app.operations[op_name], this.app, this.manager); - html += operation.to_stub_html(true); - } - - var edit_favourites_list = document.getElementById("edit-favourites-list"); - edit_favourites_list.innerHTML = html; + const fav_cat = this.app.categories.filter(c => c.name == 'Favourites')[0]; + + let html = ''; + for (let i = 0; i < fav_cat.ops.length; i++) { + const op_name = fav_cat.ops[i]; + const operation = new HTMLOperation(op_name, this.app.operations[op_name], this.app, this.manager); + html += operation.to_stub_html(true); + } + + const edit_favourites_list = document.getElementById('edit-favourites-list'); + edit_favourites_list.innerHTML = html; + this.remove_intent = false; + + const editable_list = Sortable.create(edit_favourites_list, { + filter: '.remove-icon', + onFilter(evt) { + const el = editable_list.closest(evt.item); + if (el) { + $(el).popover('destroy'); + el.parentNode.removeChild(el); + } + }, + onEnd: function (evt) { + if (this.remove_intent) evt.item.remove(); + }.bind(this), + }); + + Sortable.utils.on(edit_favourites_list, 'dragleave', () => { + this.remove_intent = true; + }); + + Sortable.utils.on(edit_favourites_list, 'dragover', () => { this.remove_intent = false; - - var editable_list = Sortable.create(edit_favourites_list, { - filter: '.remove-icon', - onFilter: function (evt) { - var el = editable_list.closest(evt.item); - if (el) { - $(el).popover("destroy"); - el.parentNode.removeChild(el); - } - }, - onEnd: function(evt) { - if (this.remove_intent) evt.item.remove(); - }.bind(this), - }); - - Sortable.utils.on(edit_favourites_list, "dragleave", function() { - this.remove_intent = true; - }.bind(this)); - - Sortable.utils.on(edit_favourites_list, "dragover", function() { - this.remove_intent = false; - }.bind(this)); - - $("#edit-favourites-list [data-toggle=popover]").popover(); - $("#favourites-modal").modal(); + }); + + $('#edit-favourites-list [data-toggle=popover]').popover(); + $('#favourites-modal').modal(); }; @@ -227,18 +226,18 @@ OperationsWaiter.prototype.edit_favourites_click = function(e) { * Handler for save favourites click events. * Saves the selected favourites and reloads them. */ -OperationsWaiter.prototype.save_favourites_click = function() { - var favourites_list = [], - favs = document.querySelectorAll("#edit-favourites-list li"); - - for (var i = 0; i < favs.length; i++) { - favourites_list.push(favs[i].textContent); - } +OperationsWaiter.prototype.save_favourites_click = function () { + let favourites_list = [], + favs = document.querySelectorAll('#edit-favourites-list li'); - this.app.save_favourites(favourites_list); - this.app.load_favourites(); - this.app.populate_operations_list(); - this.manager.recipe.initialise_operation_drag_n_drop(); + for (let i = 0; i < favs.length; i++) { + favourites_list.push(favs[i].textContent); + } + + this.app.save_favourites(favourites_list); + this.app.load_favourites(); + this.app.populate_operations_list(); + this.manager.recipe.initialise_operation_drag_n_drop(); }; @@ -246,8 +245,8 @@ OperationsWaiter.prototype.save_favourites_click = function() { * Handler for reset favourites click events. * Resets favourites to their defaults. */ -OperationsWaiter.prototype.reset_favourites_click = function() { - this.app.reset_favourites(); +OperationsWaiter.prototype.reset_favourites_click = function () { + this.app.reset_favourites(); }; @@ -257,11 +256,11 @@ OperationsWaiter.prototype.reset_favourites_click = function() { * * @param {event} e */ -OperationsWaiter.prototype.op_icon_mouseover = function(e) { - var op_el = e.target.parentNode; - if (e.target.getAttribute("data-toggle") == "popover") { - $(op_el).popover("hide"); - } +OperationsWaiter.prototype.op_icon_mouseover = function (e) { + const op_el = e.target.parentNode; + if (e.target.getAttribute('data-toggle') == 'popover') { + $(op_el).popover('hide'); + } }; @@ -272,11 +271,11 @@ OperationsWaiter.prototype.op_icon_mouseover = function(e) { * * @param {event} e */ -OperationsWaiter.prototype.op_icon_mouseleave = function(e) { - var op_el = e.target.parentNode, - to_el = e.toElement || e.relatedElement; - - if (e.target.getAttribute("data-toggle") == "popover" && to_el === op_el) { - $(op_el).popover("show"); - } +OperationsWaiter.prototype.op_icon_mouseleave = function (e) { + let op_el = e.target.parentNode, + to_el = e.toElement || e.relatedElement; + + if (e.target.getAttribute('data-toggle') == 'popover' && to_el === op_el) { + $(op_el).popover('show'); + } }; diff --git a/src/js/views/html/OptionsWaiter.js b/src/js/views/html/OptionsWaiter.js index 05d80185..63162afe 100755 --- a/src/js/views/html/OptionsWaiter.js +++ b/src/js/views/html/OptionsWaiter.js @@ -8,8 +8,8 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -var OptionsWaiter = function(app) { - this.app = app; +const OptionsWaiter = function (app) { + this.app = app; }; @@ -18,33 +18,33 @@ var OptionsWaiter = function(app) { * * @param {Object} options */ -OptionsWaiter.prototype.load = function(options) { - $(".option-item input:checkbox").bootstrapSwitch({ - size: "small", - animate: false, - }); - - for (var option in options) { - this.app.options[option] = options[option]; - } - - // Set options to match object - var cboxes = document.querySelectorAll("#options-body input[type=checkbox]"); - for (var i = 0; i < cboxes.length; i++) { - $(cboxes[i]).bootstrapSwitch("state", this.app.options[cboxes[i].getAttribute("option")]); - } +OptionsWaiter.prototype.load = function (options) { + $('.option-item input:checkbox').bootstrapSwitch({ + size: 'small', + animate: false, + }); - var nboxes = document.querySelectorAll("#options-body input[type=number]"); - for (i = 0; i < nboxes.length; i++) { - nboxes[i].value = this.app.options[nboxes[i].getAttribute("option")]; - nboxes[i].dispatchEvent(new CustomEvent("change", {bubbles: true})); - } - - var selects = document.querySelectorAll("#options-body select"); - for (i = 0; i < selects.length; i++) { - selects[i].value = this.app.options[selects[i].getAttribute("option")]; - selects[i].dispatchEvent(new CustomEvent("change", {bubbles: true})); - } + for (const option in options) { + this.app.options[option] = options[option]; + } + + // Set options to match object + const cboxes = document.querySelectorAll('#options-body input[type=checkbox]'); + for (var i = 0; i < cboxes.length; i++) { + $(cboxes[i]).bootstrapSwitch('state', this.app.options[cboxes[i].getAttribute('option')]); + } + + const nboxes = document.querySelectorAll('#options-body input[type=number]'); + for (i = 0; i < nboxes.length; i++) { + nboxes[i].value = this.app.options[nboxes[i].getAttribute('option')]; + nboxes[i].dispatchEvent(new CustomEvent('change', { bubbles: true })); + } + + const selects = document.querySelectorAll('#options-body select'); + for (i = 0; i < selects.length; i++) { + selects[i].value = this.app.options[selects[i].getAttribute('option')]; + selects[i].dispatchEvent(new CustomEvent('change', { bubbles: true })); + } }; @@ -52,8 +52,8 @@ OptionsWaiter.prototype.load = function(options) { * Handler for options click events. * Dispays the options pane. */ -OptionsWaiter.prototype.options_click = function() { - $("#options-modal").modal(); +OptionsWaiter.prototype.options_click = function () { + $('#options-modal').modal(); }; @@ -61,8 +61,8 @@ OptionsWaiter.prototype.options_click = function() { * Handler for reset options click events. * Resets options back to their default values. */ -OptionsWaiter.prototype.reset_options_click = function() { - this.load(this.app.doptions); +OptionsWaiter.prototype.reset_options_click = function () { + this.load(this.app.doptions); }; @@ -73,12 +73,12 @@ OptionsWaiter.prototype.reset_options_click = function() { * @param {event} e * @param {boolean} state */ -OptionsWaiter.prototype.switch_change = function(e, state) { - var el = e.target, - option = el.getAttribute("option"); - - this.app.options[option] = state; - localStorage.setItem("options", JSON.stringify(this.app.options)); +OptionsWaiter.prototype.switch_change = function (e, state) { + let el = e.target, + option = el.getAttribute('option'); + + this.app.options[option] = state; + localStorage.setItem('options', JSON.stringify(this.app.options)); }; @@ -88,12 +88,12 @@ OptionsWaiter.prototype.switch_change = function(e, state) { * * @param {event} e */ -OptionsWaiter.prototype.number_change = function(e) { - var el = e.target, - option = el.getAttribute("option"); - - this.app.options[option] = parseInt(el.value, 10); - localStorage.setItem("options", JSON.stringify(this.app.options)); +OptionsWaiter.prototype.number_change = function (e) { + let el = e.target, + option = el.getAttribute('option'); + + this.app.options[option] = parseInt(el.value, 10); + localStorage.setItem('options', JSON.stringify(this.app.options)); }; @@ -103,30 +103,30 @@ OptionsWaiter.prototype.number_change = function(e) { * * @param {event} e */ -OptionsWaiter.prototype.select_change = function(e) { - var el = e.target, - option = el.getAttribute("option"); - - this.app.options[option] = el.value; - localStorage.setItem("options", JSON.stringify(this.app.options)); +OptionsWaiter.prototype.select_change = function (e) { + let el = e.target, + option = el.getAttribute('option'); + + this.app.options[option] = el.value; + localStorage.setItem('options', JSON.stringify(this.app.options)); }; /** * Sets or unsets word wrap on the input and output depending on the word_wrap option value. */ -OptionsWaiter.prototype.set_word_wrap = function() { - document.getElementById("input-text").classList.remove("word-wrap"); - document.getElementById("output-text").classList.remove("word-wrap"); - document.getElementById("output-html").classList.remove("word-wrap"); - document.getElementById("input-highlighter").classList.remove("word-wrap"); - document.getElementById("output-highlighter").classList.remove("word-wrap"); - - if (!this.app.options.word_wrap) { - document.getElementById("input-text").classList.add("word-wrap"); - document.getElementById("output-text").classList.add("word-wrap"); - document.getElementById("output-html").classList.add("word-wrap"); - document.getElementById("input-highlighter").classList.add("word-wrap"); - document.getElementById("output-highlighter").classList.add("word-wrap"); - } +OptionsWaiter.prototype.set_word_wrap = function () { + document.getElementById('input-text').classList.remove('word-wrap'); + document.getElementById('output-text').classList.remove('word-wrap'); + document.getElementById('output-html').classList.remove('word-wrap'); + document.getElementById('input-highlighter').classList.remove('word-wrap'); + document.getElementById('output-highlighter').classList.remove('word-wrap'); + + if (!this.app.options.word_wrap) { + document.getElementById('input-text').classList.add('word-wrap'); + document.getElementById('output-text').classList.add('word-wrap'); + document.getElementById('output-html').classList.add('word-wrap'); + document.getElementById('input-highlighter').classList.add('word-wrap'); + document.getElementById('output-highlighter').classList.add('word-wrap'); + } }; diff --git a/src/js/views/html/OutputWaiter.js b/src/js/views/html/OutputWaiter.js index ea378293..e00df9d0 100755 --- a/src/js/views/html/OutputWaiter.js +++ b/src/js/views/html/OutputWaiter.js @@ -9,9 +9,9 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var OutputWaiter = function(app, manager) { - this.app = app; - this.manager = manager; +const OutputWaiter = function (app, manager) { + this.app = app; + this.manager = manager; }; @@ -20,8 +20,8 @@ var OutputWaiter = function(app, manager) { * * @returns {string} */ -OutputWaiter.prototype.get = function() { - return document.getElementById("output-text").value; +OutputWaiter.prototype.get = function () { + return document.getElementById('output-text').value; }; @@ -32,43 +32,43 @@ OutputWaiter.prototype.get = function() { * @param {string} type - The data type of the output * @param {number} duration - The length of time (ms) it took to generate the output */ -OutputWaiter.prototype.set = function(data_str, type, duration) { - var output_text = document.getElementById("output-text"), - output_html = document.getElementById("output-html"), - output_highlighter = document.getElementById("output-highlighter"), - input_highlighter = document.getElementById("input-highlighter"); +OutputWaiter.prototype.set = function (data_str, type, duration) { + let output_text = document.getElementById('output-text'), + output_html = document.getElementById('output-html'), + output_highlighter = document.getElementById('output-highlighter'), + input_highlighter = document.getElementById('input-highlighter'); + + if (type == 'html') { + output_text.style.display = 'none'; + output_html.style.display = 'block'; + output_highlighter.display = 'none'; + input_highlighter.display = 'none'; + + output_text.value = ''; + output_html.innerHTML = data_str; - if (type == "html") { - output_text.style.display = "none"; - output_html.style.display = "block"; - output_highlighter.display = "none"; - input_highlighter.display = "none"; - - output_text.value = ""; - output_html.innerHTML = data_str; - // Execute script sections - var script_elements = output_html.querySelectorAll("script"); - for (var i = 0; i < script_elements.length; i++) { - try { - eval(script_elements[i].innerHTML); // jshint ignore:line - } catch (err) { - console.error(err); - } - } - } else { - output_text.style.display = "block"; - output_html.style.display = "none"; - output_highlighter.display = "block"; - input_highlighter.display = "block"; - - output_text.value = Utils.printable(data_str, true); - output_html.innerHTML = ""; + const script_elements = output_html.querySelectorAll('script'); + for (let i = 0; i < script_elements.length; i++) { + try { + eval(script_elements[i].innerHTML); // jshint ignore:line + } catch (err) { + console.error(err); + } } - - this.manager.highlighter.remove_highlights(); - var lines = data_str.count("\n") + 1; - this.set_output_info(data_str.length, lines, duration); + } else { + output_text.style.display = 'block'; + output_html.style.display = 'none'; + output_highlighter.display = 'block'; + input_highlighter.display = 'block'; + + output_text.value = Utils.printable(data_str, true); + output_html.innerHTML = ''; + } + + this.manager.highlighter.remove_highlights(); + const lines = data_str.count('\n') + 1; + this.set_output_info(data_str.length, lines, duration); }; @@ -79,19 +79,19 @@ OutputWaiter.prototype.set = function(data_str, type, duration) { * @param {number} lines - The number of the lines in the current output string * @param {number} duration - The length of time (ms) it took to generate the output */ -OutputWaiter.prototype.set_output_info = function(length, lines, duration) { - var width = length.toString().length; - width = width < 4 ? 4 : width; - - var length_str = Utils.pad(length.toString(), width, " ").replace(/ /g, " "); - var lines_str = Utils.pad(lines.toString(), width, " ").replace(/ /g, " "); - var time_str = Utils.pad(duration.toString() + "ms", width, " ").replace(/ /g, " "); - - document.getElementById("output-info").innerHTML = "time: " + time_str + - "
    length: " + length_str + - "
    lines: " + lines_str; - document.getElementById("input-selection-info").innerHTML = ""; - document.getElementById("output-selection-info").innerHTML = ""; +OutputWaiter.prototype.set_output_info = function (length, lines, duration) { + let width = length.toString().length; + width = width < 4 ? 4 : width; + + const length_str = Utils.pad(length.toString(), width, ' ').replace(/ /g, ' '); + const lines_str = Utils.pad(lines.toString(), width, ' ').replace(/ /g, ' '); + const time_str = Utils.pad(`${duration.toString()}ms`, width, ' ').replace(/ /g, ' '); + + document.getElementById('output-info').innerHTML = `time: ${time_str + }
    length: ${length_str + }
    lines: ${lines_str}`; + document.getElementById('input-selection-info').innerHTML = ''; + document.getElementById('output-selection-info').innerHTML = ''; }; @@ -99,22 +99,22 @@ OutputWaiter.prototype.set_output_info = function(length, lines, duration) { * Handler for save click events. * Saves the current output to a file, downloaded as a URL octet stream. */ -OutputWaiter.prototype.save_click = function() { - var data = Utils.to_base64(this.app.dish_str), - filename = window.prompt("Please enter a filename:", "download.dat"); - - if (filename) { - var el = document.createElement("a"); - el.setAttribute("href", "data:application/octet-stream;base64;charset=utf-8," + data); - el.setAttribute("download", filename); - +OutputWaiter.prototype.save_click = function () { + let data = Utils.to_base64(this.app.dish_str), + filename = window.prompt('Please enter a filename:', 'download.dat'); + + if (filename) { + const el = document.createElement('a'); + el.setAttribute('href', `data:application/octet-stream;base64;charset=utf-8,${data}`); + el.setAttribute('download', filename); + // Firefox requires that the element be added to the DOM before it can be clicked - el.style.display = "none"; - document.body.appendChild(el); - - el.click(); - el.remove(); - } + el.style.display = 'none'; + document.body.appendChild(el); + + el.click(); + el.remove(); + } }; @@ -122,10 +122,10 @@ OutputWaiter.prototype.save_click = function() { * Handler for switch click events. * Moves the current output into the input textarea. */ -OutputWaiter.prototype.switch_click = function() { - this.switch_orig_data = this.manager.input.get(); - document.getElementById("undo-switch").disabled = false; - this.app.set_input(this.app.dish_str); +OutputWaiter.prototype.switch_click = function () { + this.switch_orig_data = this.manager.input.get(); + document.getElementById('undo-switch').disabled = false; + this.app.set_input(this.app.dish_str); }; @@ -133,7 +133,7 @@ OutputWaiter.prototype.switch_click = function() { * Handler for undo switch click events. * Removes the output from the input and replaces the input that was removed. */ -OutputWaiter.prototype.undo_switch_click = function() { - this.app.set_input(this.switch_orig_data); - document.getElementById("undo-switch").disabled = true; +OutputWaiter.prototype.undo_switch_click = function () { + this.app.set_input(this.switch_orig_data); + document.getElementById('undo-switch').disabled = true; }; diff --git a/src/js/views/html/RecipeWaiter.js b/src/js/views/html/RecipeWaiter.js index 1cf7be32..8f016bc6 100755 --- a/src/js/views/html/RecipeWaiter.js +++ b/src/js/views/html/RecipeWaiter.js @@ -11,52 +11,52 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var RecipeWaiter = function(app, manager) { - this.app = app; - this.manager = manager; - this.remove_intent = false; +const RecipeWaiter = function (app, manager) { + this.app = app; + this.manager = manager; + this.remove_intent = false; }; /** * Sets up the drag and drop capability for operations in the operations and recipe areas. */ -RecipeWaiter.prototype.initialise_operation_drag_n_drop = function() { - var rec_list = document.getElementById("rec_list"), - op_lists = document.querySelectorAll(".category .op_list"); - - +RecipeWaiter.prototype.initialise_operation_drag_n_drop = function () { + let rec_list = document.getElementById('rec_list'), + op_lists = document.querySelectorAll('.category .op_list'); + + // Recipe list - Sortable.create(rec_list, { - group: "recipe", - sort: true, - animation: 0, - delay: 0, - filter: ".arg-input,.arg", // Relies on commenting out a line in Sortable.js which calls evt.preventDefault() - setData: function(dataTransfer, drag_el) { - dataTransfer.setData("Text", drag_el.querySelector(".arg-title").textContent); - }, - onEnd: function(evt) { - if (this.remove_intent) { - evt.item.remove(); - evt.target.dispatchEvent(this.manager.operationremove); - } - }.bind(this) - }); - - Sortable.utils.on(rec_list, "dragover", function() { - this.remove_intent = false; - }.bind(this)); - - Sortable.utils.on(rec_list, "dragleave", function() { - this.remove_intent = true; - this.app.progress = 0; - }.bind(this)); - + Sortable.create(rec_list, { + group: 'recipe', + sort: true, + animation: 0, + delay: 0, + filter: '.arg-input,.arg', // Relies on commenting out a line in Sortable.js which calls evt.preventDefault() + setData(dataTransfer, drag_el) { + dataTransfer.setData('Text', drag_el.querySelector('.arg-title').textContent); + }, + onEnd: function (evt) { + if (this.remove_intent) { + evt.item.remove(); + evt.target.dispatchEvent(this.manager.operationremove); + } + }.bind(this), + }); + + Sortable.utils.on(rec_list, 'dragover', () => { + this.remove_intent = false; + }); + + Sortable.utils.on(rec_list, 'dragleave', () => { + this.remove_intent = true; + this.app.progress = 0; + }); + // Favourites category - document.querySelector("#categories a").addEventListener("dragover", this.fav_dragover.bind(this)); - document.querySelector("#categories a").addEventListener("dragleave", this.fav_dragleave.bind(this)); - document.querySelector("#categories a").addEventListener("drop", this.fav_drop.bind(this)); + document.querySelector('#categories a').addEventListener('dragover', this.fav_dragover.bind(this)); + document.querySelector('#categories a').addEventListener('dragleave', this.fav_dragleave.bind(this)); + document.querySelector('#categories a').addEventListener('drop', this.fav_drop.bind(this)); }; @@ -65,23 +65,23 @@ RecipeWaiter.prototype.initialise_operation_drag_n_drop = function() { * * @param {element} list_el - The list the initialise */ -RecipeWaiter.prototype.create_sortable_seed_list = function(list_el) { - Sortable.create(list_el, { - group: { - name: "recipe", - pull: "clone", - put: false - }, - sort: false, - setData: function(dataTransfer, drag_el) { - dataTransfer.setData("Text", drag_el.textContent); - }, - onStart: function(evt) { - $(evt.item).popover("destroy"); - evt.item.setAttribute("data-toggle", "popover-disabled"); - }, - onEnd: this.op_sort_end.bind(this) - }); +RecipeWaiter.prototype.create_sortable_seed_list = function (list_el) { + Sortable.create(list_el, { + group: { + name: 'recipe', + pull: 'clone', + put: false, + }, + sort: false, + setData(dataTransfer, drag_el) { + dataTransfer.setData('Text', drag_el.textContent); + }, + onStart(evt) { + $(evt.item).popover('destroy'); + evt.item.setAttribute('data-toggle', 'popover-disabled'); + }, + onEnd: this.op_sort_end.bind(this), + }); }; @@ -93,25 +93,25 @@ RecipeWaiter.prototype.create_sortable_seed_list = function(list_el) { * @fires Manager#operationadd * @param {event} evt */ -RecipeWaiter.prototype.op_sort_end = function(evt) { - if (this.remove_intent) { - if (evt.item.parentNode.id == "rec_list") { - evt.item.remove(); - } - return; +RecipeWaiter.prototype.op_sort_end = function (evt) { + if (this.remove_intent) { + if (evt.item.parentNode.id == 'rec_list') { + evt.item.remove(); } - + return; + } + // Reinitialise the popover on the original element in the ops list because for some reason it // gets destroyed and recreated. - $(evt.clone).popover(); - $(evt.clone).children("[data-toggle=popover]").popover(); - - if (evt.item.parentNode.id !== "rec_list") { - return; - } - - this.build_recipe_operation(evt.item); - evt.item.dispatchEvent(this.manager.operationadd); + $(evt.clone).popover(); + $(evt.clone).children('[data-toggle=popover]').popover(); + + if (evt.item.parentNode.id !== 'rec_list') { + return; + } + + this.build_recipe_operation(evt.item); + evt.item.dispatchEvent(this.manager.operationadd); }; @@ -122,22 +122,23 @@ RecipeWaiter.prototype.op_sort_end = function(evt) { * * @param {event} e */ -RecipeWaiter.prototype.fav_dragover = function(e) { - if (e.dataTransfer.effectAllowed !== "move") - return false; - - e.stopPropagation(); - e.preventDefault(); - if (e.target.className && e.target.className.indexOf("category-title") > -1) { +RecipeWaiter.prototype.fav_dragover = function (e) { + if (e.dataTransfer.effectAllowed !== 'move') { + return false; + } + + e.stopPropagation(); + e.preventDefault(); + if (e.target.className && e.target.className.indexOf('category-title') > -1) { // Hovering over the a - e.target.classList.add("favourites-hover"); - } else if (e.target.parentNode.className && e.target.parentNode.className.indexOf("category-title") > -1) { + e.target.classList.add('favourites-hover'); + } else if (e.target.parentNode.className && e.target.parentNode.className.indexOf('category-title') > -1) { // Hovering over the Edit button - e.target.parentNode.classList.add("favourites-hover"); - } else if (e.target.parentNode.parentNode.className && e.target.parentNode.parentNode.className.indexOf("category-title") > -1) { + e.target.parentNode.classList.add('favourites-hover'); + } else if (e.target.parentNode.parentNode.className && e.target.parentNode.parentNode.className.indexOf('category-title') > -1) { // Hovering over the image on the Edit button - e.target.parentNode.parentNode.classList.add("favourites-hover"); - } + e.target.parentNode.parentNode.classList.add('favourites-hover'); + } }; @@ -147,10 +148,10 @@ RecipeWaiter.prototype.fav_dragover = function(e) { * * @param {event} e */ -RecipeWaiter.prototype.fav_dragleave = function(e) { - e.stopPropagation(); - e.preventDefault(); - document.querySelector("#categories a").classList.remove("favourites-hover"); +RecipeWaiter.prototype.fav_dragleave = function (e) { + e.stopPropagation(); + e.preventDefault(); + document.querySelector('#categories a').classList.remove('favourites-hover'); }; @@ -160,13 +161,13 @@ RecipeWaiter.prototype.fav_dragleave = function(e) { * * @param {event} e */ -RecipeWaiter.prototype.fav_drop = function(e) { - e.stopPropagation(); - e.preventDefault(); - e.target.classList.remove("favourites-hover"); - - var op_name = e.dataTransfer.getData("Text"); - this.app.add_favourite(op_name); +RecipeWaiter.prototype.fav_drop = function (e) { + e.stopPropagation(); + e.preventDefault(); + e.target.classList.remove('favourites-hover'); + + const op_name = e.dataTransfer.getData('Text'); + this.app.add_favourite(op_name); }; @@ -175,8 +176,8 @@ RecipeWaiter.prototype.fav_drop = function(e) { * * @fires Manager#statechange */ -RecipeWaiter.prototype.ing_change = function() { - window.dispatchEvent(this.manager.statechange); +RecipeWaiter.prototype.ing_change = function () { + window.dispatchEvent(this.manager.statechange); }; @@ -187,21 +188,21 @@ RecipeWaiter.prototype.ing_change = function() { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.disable_click = function(e) { - var icon = e.target; - - if (icon.getAttribute("disabled") == "false") { - icon.setAttribute("disabled", "true"); - icon.classList.add("disable-icon-selected"); - icon.parentNode.parentNode.classList.add("disabled"); - } else { - icon.setAttribute("disabled", "false"); - icon.classList.remove("disable-icon-selected"); - icon.parentNode.parentNode.classList.remove("disabled"); - } - - this.app.progress = 0; - window.dispatchEvent(this.manager.statechange); +RecipeWaiter.prototype.disable_click = function (e) { + const icon = e.target; + + if (icon.getAttribute('disabled') == 'false') { + icon.setAttribute('disabled', 'true'); + icon.classList.add('disable-icon-selected'); + icon.parentNode.parentNode.classList.add('disabled'); + } else { + icon.setAttribute('disabled', 'false'); + icon.classList.remove('disable-icon-selected'); + icon.parentNode.parentNode.classList.remove('disabled'); + } + + this.app.progress = 0; + window.dispatchEvent(this.manager.statechange); }; @@ -212,18 +213,18 @@ RecipeWaiter.prototype.disable_click = function(e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.breakpoint_click = function(e) { - var bp = e.target; +RecipeWaiter.prototype.breakpoint_click = function (e) { + const bp = e.target; - if (bp.getAttribute("break") == "false") { - bp.setAttribute("break", "true"); - bp.classList.add("breakpoint-selected"); - } else { - bp.setAttribute("break", "false"); - bp.classList.remove("breakpoint-selected"); - } - - window.dispatchEvent(this.manager.statechange); + if (bp.getAttribute('break') == 'false') { + bp.setAttribute('break', 'true'); + bp.classList.add('breakpoint-selected'); + } else { + bp.setAttribute('break', 'false'); + bp.classList.remove('breakpoint-selected'); + } + + window.dispatchEvent(this.manager.statechange); }; @@ -234,9 +235,9 @@ RecipeWaiter.prototype.breakpoint_click = function(e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.operation_dblclick = function(e) { - e.target.remove(); - window.dispatchEvent(this.manager.statechange); +RecipeWaiter.prototype.operation_dblclick = function (e) { + e.target.remove(); + window.dispatchEvent(this.manager.statechange); }; @@ -247,9 +248,9 @@ RecipeWaiter.prototype.operation_dblclick = function(e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.operation_child_dblclick = function(e) { - e.target.parentNode.remove(); - window.dispatchEvent(this.manager.statechange); +RecipeWaiter.prototype.operation_child_dblclick = function (e) { + e.target.parentNode.remove(); + window.dispatchEvent(this.manager.statechange); }; @@ -258,49 +259,54 @@ RecipeWaiter.prototype.operation_child_dblclick = function(e) { * * @returns {recipe_config} */ -RecipeWaiter.prototype.get_config = function() { - var config = [], ingredients, ing_list, disabled, bp, item, - operations = document.querySelectorAll("#rec_list li.operation"); - - for (var i = 0; i < operations.length; i++) { - ingredients = []; - disabled = operations[i].querySelector(".disable-icon"); - bp = operations[i].querySelector(".breakpoint"); - ing_list = operations[i].querySelectorAll(".arg"); - - for (var j = 0; j < ing_list.length; j++) { - if (ing_list[j].getAttribute("type") == "checkbox") { +RecipeWaiter.prototype.get_config = function () { + let config = [], + ingredients, + ing_list, + disabled, + bp, + item, + operations = document.querySelectorAll('#rec_list li.operation'); + + for (let i = 0; i < operations.length; i++) { + ingredients = []; + disabled = operations[i].querySelector('.disable-icon'); + bp = operations[i].querySelector('.breakpoint'); + ing_list = operations[i].querySelectorAll('.arg'); + + for (let j = 0; j < ing_list.length; j++) { + if (ing_list[j].getAttribute('type') == 'checkbox') { // checkbox - ingredients[j] = ing_list[j].checked; - } else if (ing_list[j].classList.contains("toggle-string")) { + ingredients[j] = ing_list[j].checked; + } else if (ing_list[j].classList.contains('toggle-string')) { // toggle_string - ingredients[j] = { - option: ing_list[j].previousSibling.children[0].textContent.slice(0, -1), - string: ing_list[j].value - }; - } else { - // all others - ingredients[j] = ing_list[j].value; - } - } - - item = { - op: operations[i].querySelector(".arg-title").textContent, - args: ingredients + ingredients[j] = { + option: ing_list[j].previousSibling.children[0].textContent.slice(0, -1), + string: ing_list[j].value, }; - - if (disabled && disabled.getAttribute("disabled") == "true") { - item.disabled = true; - } - - if (bp && bp.getAttribute("break") == "true") { - item.breakpoint = true; - } - - config.push(item); + } else { + // all others + ingredients[j] = ing_list[j].value; + } } - - return config; + + item = { + op: operations[i].querySelector('.arg-title').textContent, + args: ingredients, + }; + + if (disabled && disabled.getAttribute('disabled') == 'true') { + item.disabled = true; + } + + if (bp && bp.getAttribute('break') == 'true') { + item.breakpoint = true; + } + + config.push(item); + } + + return config; }; @@ -309,15 +315,15 @@ RecipeWaiter.prototype.get_config = function() { * * @param {number} position */ -RecipeWaiter.prototype.update_breakpoint_indicator = function(position) { - var operations = document.querySelectorAll("#rec_list li.operation"); - for (var i = 0; i < operations.length; i++) { - if (i == position) { - operations[i].classList.add("break"); - } else { - operations[i].classList.remove("break"); - } +RecipeWaiter.prototype.update_breakpoint_indicator = function (position) { + const operations = document.querySelectorAll('#rec_list li.operation'); + for (let i = 0; i < operations.length; i++) { + if (i == position) { + operations[i].classList.add('break'); + } else { + operations[i].classList.remove('break'); } + } }; @@ -327,21 +333,21 @@ RecipeWaiter.prototype.update_breakpoint_indicator = function(position) { * * @param {element} el - The operation stub element from the operations pane */ -RecipeWaiter.prototype.build_recipe_operation = function(el) { - var op_name = el.textContent; - var op = new HTMLOperation(op_name, this.app.operations[op_name], this.app, this.manager); - el.innerHTML = op.to_full_html(); - - if (this.app.operations[op_name].flow_control) { - el.classList.add("flow-control-op"); - } - +RecipeWaiter.prototype.build_recipe_operation = function (el) { + const op_name = el.textContent; + const op = new HTMLOperation(op_name, this.app.operations[op_name], this.app, this.manager); + el.innerHTML = op.to_full_html(); + + if (this.app.operations[op_name].flow_control) { + el.classList.add('flow-control-op'); + } + // Disable auto-bake if this is a manual op - this should be moved to the 'operationadd' // handler after event restructuring - if (op.manual_bake && this.app.auto_bake_) { - this.manager.controls.set_auto_bake(false); - this.app.alert("Auto-Bake is disabled by default when using this operation.", "info", 5000); - } + if (op.manual_bake && this.app.auto_bake_) { + this.manager.controls.set_auto_bake(false); + this.app.alert('Auto-Bake is disabled by default when using this operation.', 'info', 5000); + } }; /** @@ -351,15 +357,15 @@ RecipeWaiter.prototype.build_recipe_operation = function(el) { * @param {string} name - The name of the operation to add * @returns {element} */ -RecipeWaiter.prototype.add_operation = function(name) { - var item = document.createElement("li"); - item.classList.add("operation"); - item.innerHTML = name; - this.build_recipe_operation(item); - document.getElementById("rec_list").appendChild(item); - - item.dispatchEvent(this.manager.operationadd); - return item; +RecipeWaiter.prototype.add_operation = function (name) { + const item = document.createElement('li'); + item.classList.add('operation'); + item.innerHTML = name; + this.build_recipe_operation(item); + document.getElementById('rec_list').appendChild(item); + + item.dispatchEvent(this.manager.operationadd); + return item; }; @@ -368,12 +374,12 @@ RecipeWaiter.prototype.add_operation = function(name) { * * @fires Manager#operationremove */ -RecipeWaiter.prototype.clear_recipe = function() { - var rec_list = document.getElementById("rec_list"); - while (rec_list.firstChild) { - rec_list.removeChild(rec_list.firstChild); - } - rec_list.dispatchEvent(this.manager.operationremove); +RecipeWaiter.prototype.clear_recipe = function () { + const rec_list = document.getElementById('rec_list'); + while (rec_list.firstChild) { + rec_list.removeChild(rec_list.firstChild); + } + rec_list.dispatchEvent(this.manager.operationremove); }; @@ -383,12 +389,12 @@ RecipeWaiter.prototype.clear_recipe = function() { * * @param {event} e */ -RecipeWaiter.prototype.dropdown_toggle_click = function(e) { - var el = e.target, - button = el.parentNode.parentNode.previousSibling; - - button.innerHTML = el.textContent + " "; - this.ing_change(); +RecipeWaiter.prototype.dropdown_toggle_click = function (e) { + let el = e.target, + button = el.parentNode.parentNode.previousSibling; + + button.innerHTML = `${el.textContent} `; + this.ing_change(); }; @@ -399,8 +405,8 @@ RecipeWaiter.prototype.dropdown_toggle_click = function(e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.op_add = function(e) { - window.dispatchEvent(this.manager.statechange); +RecipeWaiter.prototype.op_add = function (e) { + window.dispatchEvent(this.manager.statechange); }; @@ -411,6 +417,6 @@ RecipeWaiter.prototype.op_add = function(e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.op_remove = function(e) { - window.dispatchEvent(this.manager.statechange); -}; \ No newline at end of file +RecipeWaiter.prototype.op_remove = function (e) { + window.dispatchEvent(this.manager.statechange); +}; diff --git a/src/js/views/html/SeasonalWaiter.js b/src/js/views/html/SeasonalWaiter.js index 5198c2b4..3a36897d 100755 --- a/src/js/views/html/SeasonalWaiter.js +++ b/src/js/views/html/SeasonalWaiter.js @@ -9,37 +9,37 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -var SeasonalWaiter = function(app, manager) { - this.app = app; - this.manager = manager; +const SeasonalWaiter = function (app, manager) { + this.app = app; + this.manager = manager; }; /** * Loads all relevant items depending on the current date. */ -SeasonalWaiter.prototype.load = function() { - var now = new Date(); - +SeasonalWaiter.prototype.load = function () { + const now = new Date(); + // Snowfall - if (now.getMonth() == 11 && now.getDate() > 12) { // Dec 13 -> Dec 31 - this.app.options.snow = false; - this.create_snow_option(); - this.manager.add_dynamic_listener(".option-item input:checkbox[option='snow']", "switchChange.bootstrapSwitch", this.let_it_snow, this); - this.manager.add_window_listener("resize", this.let_it_snow, this); - this.manager.add_listeners(".btn", "click", this.shake_off_snow, this); - if (now.getDate() == 25) this.let_it_snow(); - } - + if (now.getMonth() == 11 && now.getDate() > 12) { // Dec 13 -> Dec 31 + this.app.options.snow = false; + this.create_snow_option(); + this.manager.add_dynamic_listener(".option-item input:checkbox[option='snow']", 'switchChange.bootstrapSwitch', this.let_it_snow, this); + this.manager.add_window_listener('resize', this.let_it_snow, this); + this.manager.add_listeners('.btn', 'click', this.shake_off_snow, this); + if (now.getDate() == 25) this.let_it_snow(); + } + // SpiderChef // if (now.getMonth() == 3 && now.getDate() == 1) { // Apr 1 // this.insert_spider_icons(); // this.insert_spider_text(); // } - + // Konami code - this.kkeys = []; - window.addEventListener("keydown", this.konami_code_listener.bind(this)); + this.kkeys = []; + window.addEventListener('keydown', this.konami_code_listener.bind(this)); }; @@ -47,19 +47,19 @@ SeasonalWaiter.prototype.load = function() { * Replaces chef icons with spider icons. * #spiderchef */ -SeasonalWaiter.prototype.insert_spider_icons = function() { - var spider16 = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB3UlEQVQ4y2NgGJaAmYGBgVnf0oKJgYGBobWtXamqqoYTn2I4CI+LTzM2NTulpKbu+vPHz2dV5RWlluZmi3j5+KqFJSSEzpw8uQPdAEYYIzo5Kfjrl28rWFlZzjAzMYuEBQao3Lh+g+HGvbsMzExMDN++fWf4/PXLBzY2tqYNK1f2+4eHM2xcuRLigsT09Igf3384MTExbf767etBI319jU8fPsi+//jx/72HDxh5uLkZ7ty7y/Dz1687Avz8n2UUFR3Z2NjOySoqfmdhYGBg+PbtuwI7O8e5H79+8X379t357PnzYo+ePP7y6cuXc9++f69nYGRsvf/w4XdtLS2R799/bBUWFHr57sP7Jbs3b/ZkzswvUP3165fZ7z9//r988WIVAyPDr8tXr576+u3bpb9//7YwMjKeV1dV41NWVGoVEhDgPH761DJREeHaz1+/lqlpafUx6+jrRfz4+fPy+w8fTu/fsf3uw7t3L39+//4cv7DwGQYGhpdPbt9m4BcRFlNWVJC4fuvWASszs4C379792Ldt2xZBUdEdDP5hYSqQGIjDGa965uYKCalpZQwMDAxhMTG9DAwMDLaurhIkJY7A8IgGBgYGBgd3Dz2yUpeFo6O4ras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n3A3ybU/lu5RCUBc5qA0Ih0Q2EWiCPRk7VfMNhjLW1zETic1tLYZDMKyuSsdfh5l6bwho5+0il4kyA0VohlNcF5FP8DlWo/VB16HYB2hJ0pzgIe2mcXxP2IOumPRY17U0tll8KIkZNb+sppafOxYkQPSaYfchyYoL9GMqWYpTLRIq1QUcT4O3aPQgqVqPwIOIMwDhzX6mQUFIQAgo+9MzcrWrML3mj6+YIKiFCZyhL87RqVQKrEskF+P1BUvfLCAkfRwoPUtq6l5o5+lZb5SolJo6oT8avTCl+c9OTmat6pKW8mLkvBpGzlvsiGuQr4ZEEwA1EQgoR/gNtxIxKBluz+OtMJiF31jHxqXBiAqAUj4WRxpADFM0DCFlv1khvX7Wol4vF4AIldVVxdZqlrIfiCYQPHDy6bAGv7nKYRVY6JewExZVAP+ey5Rv+Ba97aaUHMW5NauLmMZFkegBb/EP14d6NoS9QLWFSzWBmuZza8CQmSpXsAqmGtVy14VALWuuYWWy+W3OteXa4jwceQX6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII="; - +SeasonalWaiter.prototype.insert_spider_icons = function () { + let spider16 = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB3UlEQVQ4y2NgGJaAmYGBgVnf0oKJgYGBobWtXamqqoYTn2I4CI+LTzM2NTulpKbu+vPHz2dV5RWlluZmi3j5+KqFJSSEzpw8uQPdAEYYIzo5Kfjrl28rWFlZzjAzMYuEBQao3Lh+g+HGvbsMzExMDN++fWf4/PXLBzY2tqYNK1f2+4eHM2xcuRLigsT09Igf3384MTExbf767etBI319jU8fPsi+//jx/72HDxh5uLkZ7ty7y/Dz1687Avz8n2UUFR3Z2NjOySoqfmdhYGBg+PbtuwI7O8e5H79+8X379t357PnzYo+ePP7y6cuXc9++f69nYGRsvf/w4XdtLS2R799/bBUWFHr57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PZjoFJaIiUkz9EJy15j/X3qCsAIqMcFjSWrNE1Iygg0fEmrtLzEUTdT/OhBFht9fHDVCbEUt3LJxi08B8Xj6vTDESriq9lVWqBECgHujqiqAUmufb1X3cfRXoluhjZWiwkOnSUcUS6ZD8LUmmhks6b5j1ezkAkAKZBe5QvPPcNBnoCawMwT66Qxk0R2xwwRAui2iSDGuaPDcubzo3EJq8wcx/9Vmk3QryH42QBQCFF0UagIiJtjX6DskIXTLEucJSHIIIMuO0BOcjn3A3ybU/lu5RCUBc5qA0Ih0Q2EWiCPRk7VfMNhjLW1zETic1tLYZDMKyuSsdfh5l6bwho5+0il4kyA0VohlNcF5FP8DlWo/VB16HYB2hJ0pzgIe2mcXxP2IOumPRY17U0tll8KIkZNb+sppafOxYkQPSaYfchyYoL9GMqWYpTLRIq1QUcT4O3aPQgqVqPwIOIMwDhzX6mQUFIQAgo+9MzcrWrML3mj6+YIKiFCZyhL87RqVQKrEskF+P1BUvfLCAkfRwoPUtq6l5o5+lZb5SolJo6oT8avTCl+c9OTmat6pKW8mLkvBpGzlvsiGuQr4ZEEwA1EQgoR/gNtxIxKBluz+OtMJiF31jHxqXBiAqAUj4WRxpADFM0DCFlv1khvX7Wol4vF4AIldVVxdZqlrIfiCYQPHDy6bAGv7nKYRVY6JewExZVAP+ey5Rv+Ba97aaUHMW5NauLmMZFkegBb/EP14d6NoS9QLWFSzWBmuZza8CQmSpXsAqmGtVy14VALWuuYWWy+W3OteXa4jwceQX6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII='; + // Favicon - document.querySelector("link[rel=icon]").setAttribute("href", "data:image/png;base64," + spider16); - + document.querySelector('link[rel=icon]').setAttribute('href', `data:image/png;base64,${spider16}`); + // Bake button - document.querySelector("#bake img").setAttribute("src", "data:image/png;base64," + spider32); - + document.querySelector('#bake img').setAttribute('src', `data:image/png;base64,${spider32}`); + // About box - document.querySelector(".about-img-left").setAttribute("src", "data:image/png;base64," + spider64); + document.querySelector('.about-img-left').setAttribute('src', `data:image/png;base64,${spider64}`); }; @@ -67,28 +67,28 @@ SeasonalWaiter.prototype.insert_spider_icons = function() { * Replaces all instances of the word "cyber" with "spider". * #spiderchef */ -SeasonalWaiter.prototype.insert_spider_text = function() { +SeasonalWaiter.prototype.insert_spider_text = function () { // Title - document.title = document.title.replace(/Cyber/g, "Spider"); - + document.title = document.title.replace(/Cyber/g, 'Spider'); + // Body - SeasonalWaiter.tree_walk(document.body, function(node) { + SeasonalWaiter.tree_walk(document.body, (node) => { // process only text nodes - if (node.nodeType == 3) { - node.nodeValue = node.nodeValue.replace(/Cyber/g, "Spider"); - } - }, true); - + if (node.nodeType == 3) { + node.nodeValue = node.nodeValue.replace(/Cyber/g, 'Spider'); + } + }, true); + // Bake button - SeasonalWaiter.tree_walk(document.getElementById("bake-group"), function(node) { + SeasonalWaiter.tree_walk(document.getElementById('bake-group'), (node) => { // process only text nodes - if (node.nodeType == 3) { - node.nodeValue = node.nodeValue.replace(/Bake/g, "Spin"); - } - }, true); - + if (node.nodeType == 3) { + node.nodeValue = node.nodeValue.replace(/Bake/g, 'Spin'); + } + }, true); + // Recipe title - document.querySelector("#recipe .title").innerHTML = "Web"; + document.querySelector('#recipe .title').innerHTML = 'Web'; }; @@ -96,17 +96,17 @@ SeasonalWaiter.prototype.insert_spider_text = function() { * Adds an option to make it snow. * #letitsnow */ -SeasonalWaiter.prototype.create_snow_option = function() { - var options_body = document.getElementById("options-body"), - option_item = document.createElement("div"); - - option_item.className = "option-item"; - option_item.innerHTML = +SeasonalWaiter.prototype.create_snow_option = function () { + let options_body = document.getElementById('options-body'), + option_item = document.createElement('div'); + + option_item.className = 'option-item'; + option_item.innerHTML = "\ Let it snow"; - options_body.appendChild(option_item); - - this.manager.options.load(); + options_body.appendChild(option_item); + + this.manager.options.load(); }; @@ -114,73 +114,73 @@ SeasonalWaiter.prototype.create_snow_option = function() { * Initialises a snowstorm. * #letitsnow */ -SeasonalWaiter.prototype.let_it_snow = function() { - $(document).snowfall("clear"); - if (!this.app.options.snow) return; - - var options = {}, - firefox_version = navigator.userAgent.match(/Firefox\/(\d\d?)/); - - if (firefox_version && parseInt(firefox_version[1], 10) < 30) { +SeasonalWaiter.prototype.let_it_snow = function () { + $(document).snowfall('clear'); + if (!this.app.options.snow) return; + + let options = {}, + firefox_version = navigator.userAgent.match(/Firefox\/(\d\d?)/); + + if (firefox_version && parseInt(firefox_version[1], 10) < 30) { // Firefox < 30 - options = { - flakeCount : 10, - flakeColor : '#fff', - flakePosition: 'absolute', - minSize : 1, - maxSize : 2, - minSpeed : 1, - maxSpeed : 5, - round : false, - shadow : false, - collection : false, - collectionHeight : 20, - deviceorientation : true - }; - } else { + options = { + flakeCount: 10, + flakeColor: '#fff', + flakePosition: 'absolute', + minSize: 1, + maxSize: 2, + minSpeed: 1, + maxSpeed: 5, + round: false, + shadow: false, + collection: false, + collectionHeight: 20, + deviceorientation: true, + }; + } else { // All other browsers - options = { - flakeCount : 35, //35 - flakeColor : '#fff', - flakePosition: 'absolute', - minSize : 5, - maxSize : 8, - minSpeed : 1, - maxSpeed : 5, - round : true, - shadow : true, - collection : ".btn", - collectionHeight : 20, - deviceorientation : true - }; - } - - $(document).snowfall(options); + options = { + flakeCount: 35, // 35 + flakeColor: '#fff', + flakePosition: 'absolute', + minSize: 5, + maxSize: 8, + minSpeed: 1, + maxSpeed: 5, + round: true, + shadow: true, + collection: '.btn', + collectionHeight: 20, + deviceorientation: true, + }; + } + + $(document).snowfall(options); }; /** * When a button is clicked, shake the snow off that button. * #letitsnow */ -SeasonalWaiter.prototype.shake_off_snow = function(e) { - var el = e.target, - rect = el.getBoundingClientRect(), - canvases = document.querySelectorAll("canvas.snowfall-canvas"), - canvas = null, - remove_func = function() { - ctx.clearRect(0, 0, canvas.width, canvas.height); - $(this).fadeIn(); - }; - - for (var i = 0; i < canvases.length; i++) { - canvas = canvases[i]; - if (canvas.style.left == rect.left + "px" && canvas.style.top == (rect.top - 20) + "px") { - var ctx = canvas.getContext("2d"); - - $(canvas).fadeOut("slow", remove_func); - break; - } +SeasonalWaiter.prototype.shake_off_snow = function (e) { + let el = e.target, + rect = el.getBoundingClientRect(), + canvases = document.querySelectorAll('canvas.snowfall-canvas'), + canvas = null, + remove_func = function () { + ctx.clearRect(0, 0, canvas.width, canvas.height); + $(this).fadeIn(); + }; + + for (let i = 0; i < canvases.length; i++) { + canvas = canvases[i]; + if (canvas.style.left == `${rect.left}px` && canvas.style.top == `${rect.top - 20}px`) { + var ctx = canvas.getContext('2d'); + + $(canvas).fadeOut('slow', remove_func); + break; } + } }; @@ -189,19 +189,19 @@ SeasonalWaiter.prototype.shake_off_snow = function(e) { * sequence. * #konamicode */ -SeasonalWaiter.prototype.konami_code_listener = function(e) { - this.kkeys.push(e.keyCode); - var konami = [38,38,40,40,37,39,37,39,66,65]; - for (var i = 0; i < this.kkeys.length; i++) { - if (this.kkeys[i] != konami[i]) { - this.kkeys = []; - break; - } - if (i == konami.length - 1) { - $("body").children().toggleClass("konami"); - this.kkeys = []; - } +SeasonalWaiter.prototype.konami_code_listener = function (e) { + this.kkeys.push(e.keyCode); + const konami = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; + for (let i = 0; i < this.kkeys.length; i++) { + if (this.kkeys[i] != konami[i]) { + this.kkeys = []; + break; } + if (i == konami.length - 1) { + $('body').children().toggleClass('konami'); + this.kkeys = []; + } + } }; @@ -213,42 +213,42 @@ SeasonalWaiter.prototype.konami_code_listener = function(e) { * @param {Function} fn - The callback function to operate on each node * @param {booleam} all_nodes - Whether to operate on every node or not */ -SeasonalWaiter.tree_walk = (function() { +SeasonalWaiter.tree_walk = (function () { // Create closure for constants - var skipTags = { - "SCRIPT": true, "IFRAME": true, "OBJECT": true, - "EMBED": true, "STYLE": true, "LINK": true, "META": true - }; - - return function(parent, fn, all_nodes) { - var node = parent.firstChild; - - while (node && node != parent) { - if (all_nodes || node.nodeType === 1) { - if (fn(node) === false) { - return(false); - } - } + const skipTags = { + SCRIPT: true, IFRAME: true, OBJECT: true, + EMBED: true, STYLE: true, LINK: true, META: true, + }; + + return function (parent, fn, all_nodes) { + let node = parent.firstChild; + + while (node && node != parent) { + if (all_nodes || node.nodeType === 1) { + if (fn(node) === false) { + return (false); + } + } // If it's an element && // has children && // has a tagname && is not in the skipTags list // then, we can enumerate children - if (node.nodeType === 1 && + if (node.nodeType === 1 && node.firstChild && !(node.tagName && skipTags[node.tagName])) { - node = node.firstChild; - } else if (node.nextSibling) { - node = node.nextSibling; - } else { + node = node.firstChild; + } else if (node.nextSibling) { + node = node.nextSibling; + } else { // No child and no nextsibling // Find parent that has a nextSibling - while ((node = node.parentNode) != parent) { - if (node.nextSibling) { - node = node.nextSibling; - break; - } - } - } + while ((node = node.parentNode) != parent) { + if (node.nextSibling) { + node = node.nextSibling; + break; + } } - }; -})(); + } + } + }; +}()); diff --git a/src/js/views/html/WindowWaiter.js b/src/js/views/html/WindowWaiter.js index 3f905b62..3b32fe76 100755 --- a/src/js/views/html/WindowWaiter.js +++ b/src/js/views/html/WindowWaiter.js @@ -8,8 +8,8 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -var WindowWaiter = function(app) { - this.app = app; +const WindowWaiter = function (app) { + this.app = app; }; @@ -18,9 +18,9 @@ var WindowWaiter = function(app) { * Resets the layout of CyberChef's panes after 200ms (so that continuous resizing doesn't cause * continuous resetting). */ -WindowWaiter.prototype.window_resize = function() { - clearTimeout(this.reset_layout_timeout); - this.reset_layout_timeout = setTimeout(this.app.reset_layout.bind(this.app), 200); +WindowWaiter.prototype.window_resize = function () { + clearTimeout(this.reset_layout_timeout); + this.reset_layout_timeout = setTimeout(this.app.reset_layout.bind(this.app), 200); }; @@ -29,8 +29,8 @@ WindowWaiter.prototype.window_resize = function() { * Saves the current time so that we can calculate how long the window was unfocussed for when * focus is returned. */ -WindowWaiter.prototype.window_blur = function() { - this.window_blur_time = new Date().getTime(); +WindowWaiter.prototype.window_blur = function () { + this.window_blur_time = new Date().getTime(); }; @@ -44,9 +44,9 @@ WindowWaiter.prototype.window_blur = function() { * This will stop baking taking a long time when the CyberChef browser tab has been unfocused for * a long time and the browser has swapped out all its memory. */ -WindowWaiter.prototype.window_focus = function() { - var unfocused_time = new Date().getTime() - this.window_blur_time; - if (unfocused_time > 60000) { - this.app.silent_bake(); - } +WindowWaiter.prototype.window_focus = function () { + const unfocused_time = new Date().getTime() - this.window_blur_time; + if (unfocused_time > 60000) { + this.app.silent_bake(); + } }; diff --git a/src/js/views/html/main.js b/src/js/views/html/main.js index 71cbb7ad..16977685 100755 --- a/src/js/views/html/main.js +++ b/src/js/views/html/main.js @@ -9,41 +9,41 @@ /** * Main function used to build the CyberChef web app. */ -var main = function() { - var default_favourites = [ - "To Base64", - "From Base64", - "To Hex", - "From Hex", - "To Hexdump", - "From Hexdump", - "URL Decode", - "Regular expression", - "Entropy", - "Fork" - ]; - - var default_options = { - update_url : true, - show_highlighter : true, - treat_as_utf8 : true, - word_wrap : true, - show_errors : true, - error_timeout : 4000, - auto_bake_threshold : 200, - attempt_highlight : true, - snow : false, - }; +const main = function () { + const default_favourites = [ + 'To Base64', + 'From Base64', + 'To Hex', + 'From Hex', + 'To Hexdump', + 'From Hexdump', + 'URL Decode', + 'Regular expression', + 'Entropy', + 'Fork', + ]; - document.removeEventListener("DOMContentLoaded", main, false); - window.app = new HTMLApp(Categories, OperationConfig, default_favourites, default_options); - window.app.setup(); + const default_options = { + update_url: true, + show_highlighter: true, + treat_as_utf8: true, + word_wrap: true, + show_errors: true, + error_timeout: 4000, + auto_bake_threshold: 200, + attempt_highlight: true, + snow: false, + }; + + document.removeEventListener('DOMContentLoaded', main, false); + window.app = new HTMLApp(Categories, OperationConfig, default_favourites, default_options); + window.app.setup(); }; // Fix issues with browsers that don't support console.log() -window.console = console || {log: function() {}, error: function() {}}; +window.console = console || { log() {}, error() {} }; -window.compile_time = moment.tz("<%= grunt.template.today() %>", "ddd MMM D YYYY HH:mm:ss", "UTC").valueOf(); -window.compile_message = "<%= compile_msg %>"; +window.compile_time = moment.tz('<%= grunt.template.today() %>', 'ddd MMM D YYYY HH:mm:ss', 'UTC').valueOf(); +window.compile_message = '<%= compile_msg %>'; -document.addEventListener("DOMContentLoaded", main, false); +document.addEventListener('DOMContentLoaded', main, false); diff --git a/webpack-babel.js b/webpack-babel.js index 2efde3f7..3fdac107 100644 --- a/webpack-babel.js +++ b/webpack-babel.js @@ -76,7 +76,7 @@ export default { [ 'env', { modules: false, - targets: { chrome: 55, firefox: 50} + targets: { chrome: 55, firefox: 50 }, }, ], ], @@ -105,7 +105,7 @@ export default { test: /\.svg(\?[^/]*)?$/, loader: fontLoader, }, - ].concat(cssConfig.loaders) + ].concat(cssConfig.loaders), }, plugins: [ cssConfig.plugin, @@ -113,6 +113,6 @@ export default { template: './src/html/index.html', filename: 'index.html', compileTime: new Date().toISOString(), - }) - ] -} + }), + ], +}; From 640f555b8aa417b5c09b266a7509f55ec4a66ed6 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 29 Nov 2016 01:58:58 +0000 Subject: [PATCH 04/15] fix eslint:recommended errors this should find most of the imports --- .eslintrc.json | 12 ++++++-- package.json | 1 + src/js/config/Categories.js | 2 ++ src/js/config/OperationConfig.js | 38 ++++++++++++++++++++++++++ src/js/core/Chef.js | 7 +++-- src/js/core/Dish.js | 6 ++-- src/js/core/FlowControl.js | 5 ++++ src/js/core/Ingredient.js | 7 +++-- src/js/core/Operation.js | 7 +++-- src/js/core/Recipe.js | 3 ++ src/js/core/Utils.js | 4 +++ src/js/operations/Base.js | 2 ++ src/js/operations/Base64.js | 4 +++ src/js/operations/BitwiseOp.js | 4 +++ src/js/operations/ByteRepr.js | 4 +++ src/js/operations/CharEnc.js | 4 +++ src/js/operations/Checksum.js | 4 +++ src/js/operations/Cipher.js | 3 ++ src/js/operations/Code.js | 4 +++ src/js/operations/Compress.js | 5 ++++ src/js/operations/Convert.js | 2 ++ src/js/operations/DateTime.js | 2 ++ src/js/operations/Endian.js | 3 ++ src/js/operations/Entropy.js | 3 ++ src/js/operations/Extract.js | 2 ++ src/js/operations/FileType.js | 4 +++ src/js/operations/HTML.js | 4 ++- src/js/operations/HTTP.js | 2 ++ src/js/operations/Hash.js | 4 +++ src/js/operations/Hexdump.js | 4 +++ src/js/operations/IP.js | 4 +++ src/js/operations/JS.js | 2 ++ src/js/operations/MAC.js | 2 ++ src/js/operations/Numberwang.js | 2 ++ src/js/operations/OS.js | 2 ++ src/js/operations/PublicKey.js | 4 +++ src/js/operations/Punycode.js | 2 ++ src/js/operations/QuotedPrintable.js | 2 ++ src/js/operations/Rotate.js | 2 ++ src/js/operations/SeqUtils.js | 4 +++ src/js/operations/StrUtils.js | 4 +++ src/js/operations/Tidy.js | 4 +++ src/js/operations/URL.js | 3 ++ src/js/operations/UUID.js | 4 +++ src/js/operations/Unicode.js | 4 +++ src/js/views/html/ControlsWaiter.js | 10 +++++-- src/js/views/html/HTMLApp.js | 21 +++++++++++--- src/js/views/html/HTMLCategory.js | 4 +-- src/js/views/html/HTMLIngredient.js | 4 +-- src/js/views/html/HTMLOperation.js | 6 ++-- src/js/views/html/HighlighterWaiter.js | 5 ++-- src/js/views/html/InputWaiter.js | 6 ++-- src/js/views/html/Manager.js | 12 ++++++++ src/js/views/html/OperationsWaiter.js | 7 +++-- src/js/views/html/OptionsWaiter.js | 6 ++-- src/js/views/html/OutputWaiter.js | 6 ++-- src/js/views/html/RecipeWaiter.js | 10 ++++--- src/js/views/html/SeasonalWaiter.js | 6 ++-- src/js/views/html/WindowWaiter.js | 4 +-- src/js/views/html/main.js | 3 ++ yarn.lock | 2 +- 61 files changed, 269 insertions(+), 44 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 573dfac3..6f413948 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,13 +1,21 @@ { - "extends": "airbnb-base", + + "extends": "eslint:recommended", "parser": "babel-eslint", "plugins": ["babel"], + "rules": { + "no-unused-vars": 0, + "no-console": 0, + "no-cond-assign": 0, + "no-unsafe-finally": 0 + }, "settings": { "import/resolver": { "webpack": {} } }, "env": { - "browser": true + "browser": true, + "node": true } } diff --git a/package.json b/package.json index 8eec627d..51cfc726 100755 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "webpack-dev-server": "2.1.0-beta.12" }, "dependencies": { + "core-js": "^2.4.1", "esprima": "^3.1.2", "estraverse": "^4.2.0", "jquery": "^3.1.1", diff --git a/src/js/config/Categories.js b/src/js/config/Categories.js index 02305f80..7131a8e3 100755 --- a/src/js/config/Categories.js +++ b/src/js/config/Categories.js @@ -264,3 +264,5 @@ const Categories = [ ], }, ]; + +export default Categories; diff --git a/src/js/config/OperationConfig.js b/src/js/config/OperationConfig.js index f8c74a9a..1f6625d4 100755 --- a/src/js/config/OperationConfig.js +++ b/src/js/config/OperationConfig.js @@ -1,3 +1,39 @@ +import FlowControl from '../core/FlowControl'; +import Base64 from '../operations/Base64'; +import BitwiseOp from '../operations/BitwiseOp'; +import ByteRepr from '../operations/ByteRepr'; +import Hexdump from '../operations/Hexdump'; +import Base from '../operations/Base'; +import HTML from '../operations/HTML'; +import URL_ from '../operations/URL'; +import Unicode from '../operations/Unicode'; +import QuotedPrintable from '../operations/QuotedPrintable'; +import Punycode from '../operations/Punycode'; +import IP from '../operations/IP'; +import CharEnc from '../operations/CharEnc'; +import Cipher from '../operations/Cipher'; +import Rotate from '../operations/Rotate'; +import HTTP from '../operations/HTTP'; +import MAC from '../operations/MAC'; +import StrUtils from '../operations/StrUtils'; +import Tidy from '../operations/Tidy'; +import SeqUtils from '../operations/SeqUtils'; +import Extract from '../operations/Extract'; +import DateTime from '../operations/DateTime'; +import Convert from '../operations/Convert'; +import Compress from '../operations/Compress'; +import JS from '../operations/JS'; +import Code from '../operations/Code'; +import Hash from '../operations/Hash'; +import Checksum from '../operations/Checksum'; +import Entropy from '../operations/Entropy'; +import Numberwang from '../operations/Numberwang'; +import PublicKey from '../operations/PublicKey'; +import FileType from '../operations/FileType'; +import OS from '../operations/OS'; +import Endian from '../operations/Endian'; +import UUID from '../operations/UUID'; + /* * Tell JSHint to ignore "'Object' is not defined" errors in this file, as it references every * single operation object by definition. @@ -2784,3 +2820,5 @@ const OperationConfig = { args: [], }, }; + +export default OperationConfig; diff --git a/src/js/core/Chef.js b/src/js/core/Chef.js index 5edf2f7e..79de0353 100755 --- a/src/js/core/Chef.js +++ b/src/js/core/Chef.js @@ -1,3 +1,6 @@ +import Dish from './Dish'; +import Recipe from './Recipe'; + /** * The main controller for CyberChef. * @@ -7,9 +10,9 @@ * * @class */ -const Chef = function () { +export default function Chef() { this.dish = new Dish(); -}; +} /** diff --git a/src/js/core/Dish.js b/src/js/core/Dish.js index 37e531cb..2c520474 100755 --- a/src/js/core/Dish.js +++ b/src/js/core/Dish.js @@ -1,3 +1,5 @@ +import Utils from './Utils'; + /** * The data being operated on by each operation. * @@ -9,10 +11,10 @@ * @param {byte_array|string|number} value - The value of the input data. * @param {number} type - The data type of value, see Dish enums. */ -const Dish = function (value, type) { +export default function Dish(value, type) { this.value = value || typeof value === 'string' ? value : null; this.type = type || Dish.BYTE_ARRAY; -}; +} /** diff --git a/src/js/core/FlowControl.js b/src/js/core/FlowControl.js index 1824c1f0..e0315158 100755 --- a/src/js/core/FlowControl.js +++ b/src/js/core/FlowControl.js @@ -1,3 +1,6 @@ +import Recipe from './Recipe'; +import Dish from './Dish'; + /** * Flow Control operations. * @@ -170,3 +173,5 @@ const FlowControl = { }, }; + +export default FlowControl; diff --git a/src/js/core/Ingredient.js b/src/js/core/Ingredient.js index 534d6ca9..600104fd 100755 --- a/src/js/core/Ingredient.js +++ b/src/js/core/Ingredient.js @@ -1,3 +1,5 @@ +import Utils from './Utils'; + /** * The arguments to operations. * @@ -8,7 +10,7 @@ * @class * @param {Object} ingredient_config */ -const Ingredient = function (ingredient_config) { +export default function Ingredient(ingredient_config) { this.name = ''; this.type = ''; this.value = null; @@ -16,7 +18,7 @@ const Ingredient = function (ingredient_config) { if (ingredient_config) { this._parse_config(ingredient_config); } -}; +} /** @@ -72,7 +74,6 @@ Ingredient.prepare = function (data, type) { } else { return data; } - break; case 'number': var number = parseFloat(data); if (isNaN(number)) { diff --git a/src/js/core/Operation.js b/src/js/core/Operation.js index 9c6bd150..7217b618 100755 --- a/src/js/core/Operation.js +++ b/src/js/core/Operation.js @@ -1,3 +1,6 @@ +import Dish from './Dish'; +import Ingredient from './Ingredient'; + /** * The Operation specified by the user to be run. * @@ -9,7 +12,7 @@ * @param {string} operation_name * @param {Object} operation_config */ -const Operation = function (operation_name, operation_config) { +export default function Operation(operation_name, operation_config) { this.name = operation_name; this.description = ''; this.input_type = -1; @@ -24,7 +27,7 @@ const Operation = function (operation_name, operation_config) { if (operation_config) { this._parse_config(operation_config); } -}; +} /** diff --git a/src/js/core/Recipe.js b/src/js/core/Recipe.js index a4ba7542..f58e8bae 100755 --- a/src/js/core/Recipe.js +++ b/src/js/core/Recipe.js @@ -1,3 +1,6 @@ +import OperationConfig from '../config/OperationConfig'; +import Operation from './Operation'; + /** * The Recipe controls a list of Operations and the Dish they operate on. * diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js index 41951035..0f3c6121 100755 --- a/src/js/core/Utils.js +++ b/src/js/core/Utils.js @@ -1,3 +1,5 @@ +import $ from 'jquery'; + /* globals CryptoJS, moment */ /** @@ -1156,3 +1158,5 @@ CryptoJS.enc.Hex.parse = function (hexStr) { return new CryptoJS.lib.WordArray.init(words, hexStrLength / 2); }; + +export default Utils; diff --git a/src/js/operations/Base.js b/src/js/operations/Base.js index 62af6436..16a7c394 100755 --- a/src/js/operations/Base.js +++ b/src/js/operations/Base.js @@ -50,3 +50,5 @@ const Base = { }, }; + +export default Base; diff --git a/src/js/operations/Base64.js b/src/js/operations/Base64.js index 9b3e6969..8ae8cf5b 100755 --- a/src/js/operations/Base64.js +++ b/src/js/operations/Base64.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * Base64 operations. * @@ -361,3 +363,5 @@ const Base64 = { }, }; + +export default Base64; diff --git a/src/js/operations/BitwiseOp.js b/src/js/operations/BitwiseOp.js index 2eb02e7e..3b08287c 100755 --- a/src/js/operations/BitwiseOp.js +++ b/src/js/operations/BitwiseOp.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals CryptoJS */ /** @@ -298,3 +300,5 @@ const BitwiseOp = { }, }; + +export default BitwiseOp; diff --git a/src/js/operations/ByteRepr.js b/src/js/operations/ByteRepr.js index 85cbfe6a..e84c20ee 100755 --- a/src/js/operations/ByteRepr.js +++ b/src/js/operations/ByteRepr.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals app */ /** @@ -396,3 +398,5 @@ const ByteRepr = { }, }; + +export default ByteRepr; diff --git a/src/js/operations/CharEnc.js b/src/js/operations/CharEnc.js index 8f089f6f..a419986b 100755 --- a/src/js/operations/CharEnc.js +++ b/src/js/operations/CharEnc.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals CryptoJS */ /** @@ -44,3 +46,5 @@ const CharEnc = { }, }; + +export default CharEnc; diff --git a/src/js/operations/Checksum.js b/src/js/operations/Checksum.js index 09372ae7..263f98e2 100755 --- a/src/js/operations/Checksum.js +++ b/src/js/operations/Checksum.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * Checksum operations. * @@ -128,3 +130,5 @@ const Checksum = { }, }; + +export default Checksum; diff --git a/src/js/operations/Cipher.js b/src/js/operations/Cipher.js index 2d59d48c..693e2012 100755 --- a/src/js/operations/Cipher.js +++ b/src/js/operations/Cipher.js @@ -1,3 +1,4 @@ +import Utils from '../core/Utils'; /* globals CryptoJS, blowfish */ /** @@ -427,3 +428,5 @@ CryptoJS.kdf.OpenSSL.execute = function (password, keySize, ivSize, salt) { // Return params return CryptoJS.lib.CipherParams.create({ key, iv, salt }); }; + +export default Cipher; diff --git a/src/js/operations/Code.js b/src/js/operations/Code.js index 2f0edae8..78503859 100755 --- a/src/js/operations/Code.js +++ b/src/js/operations/Code.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals prettyPrintOne, vkbeautify */ /** @@ -303,3 +305,5 @@ const Code = { }, }; + +export default Code; diff --git a/src/js/operations/Compress.js b/src/js/operations/Compress.js index 9a7207e6..f5a328ee 100755 --- a/src/js/operations/Compress.js +++ b/src/js/operations/Compress.js @@ -1,3 +1,6 @@ +import Utils from '../core/Utils'; +import Uint8Array from 'core-js/modules/es6.typed.uint8-array'; + /* globals Zlib, bzip2 */ /** @@ -346,3 +349,5 @@ const Compress = { }, }; + +export default Compress; diff --git a/src/js/operations/Convert.js b/src/js/operations/Convert.js index 97861721..bbe087cd 100755 --- a/src/js/operations/Convert.js +++ b/src/js/operations/Convert.js @@ -410,3 +410,5 @@ const Convert = { }, }; + +export default Convert; diff --git a/src/js/operations/DateTime.js b/src/js/operations/DateTime.js index 29b00299..c5a859ec 100755 --- a/src/js/operations/DateTime.js +++ b/src/js/operations/DateTime.js @@ -452,3 +452,5 @@ const DateTime = { }; + +export default DateTime; diff --git a/src/js/operations/Endian.js b/src/js/operations/Endian.js index ae852983..8e4ea25f 100755 --- a/src/js/operations/Endian.js +++ b/src/js/operations/Endian.js @@ -1,3 +1,4 @@ +import Utils from '../core/Utils'; /** * Endian operations. * @@ -92,3 +93,5 @@ const Endian = { }, }; + +export default Endian; diff --git a/src/js/operations/Entropy.js b/src/js/operations/Entropy.js index b22f8dd9..f10cfb5c 100755 --- a/src/js/operations/Entropy.js +++ b/src/js/operations/Entropy.js @@ -1,3 +1,4 @@ +import Utils from '../core/Utils'; /** * Entropy operations. * @@ -164,3 +165,5 @@ const Entropy = { }, }; + +export default Entropy; diff --git a/src/js/operations/Extract.js b/src/js/operations/Extract.js index f381c58e..eb8b122c 100755 --- a/src/js/operations/Extract.js +++ b/src/js/operations/Extract.js @@ -297,3 +297,5 @@ const Extract = { }, }; + +export default Extract; diff --git a/src/js/operations/FileType.js b/src/js/operations/FileType.js index f98f0566..8b16e92e 100755 --- a/src/js/operations/FileType.js +++ b/src/js/operations/FileType.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * File type operations. * @@ -524,3 +526,5 @@ const FileType = { }, }; + +export default FileType; diff --git a/src/js/operations/HTML.js b/src/js/operations/HTML.js index f9a72358..25389b10 100755 --- a/src/js/operations/HTML.js +++ b/src/js/operations/HTML.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * HTML operations. * @@ -205,9 +207,9 @@ const HTML = { l = Math.round(hsl_[2] * 100), k = 1 - Math.max(r / 255, g / 255, b / 255), c = (1 - r / 255 - k) / (1 - k), - m = (1 - g / 255 - k) / (1 - k), // jshint ignore:line y = (1 - b / 255 - k) / (1 - k); + m = (1 - g / 255 - k) / (1 - k); c = isNaN(c) ? '0' : c.toFixed(2); m = isNaN(m) ? '0' : m.toFixed(2); y = isNaN(y) ? '0' : y.toFixed(2); diff --git a/src/js/operations/HTTP.js b/src/js/operations/HTTP.js index 3dd80143..d3cc0073 100755 --- a/src/js/operations/HTTP.js +++ b/src/js/operations/HTTP.js @@ -51,3 +51,5 @@ const HTTP = { }, }; + +export default HTTP; diff --git a/src/js/operations/Hash.js b/src/js/operations/Hash.js index 0211a018..23719a32 100755 --- a/src/js/operations/Hash.js +++ b/src/js/operations/Hash.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals CryptoJS, Checksum */ /** @@ -339,3 +341,5 @@ const Hash = { }, }; + +export default Hash; diff --git a/src/js/operations/Hexdump.js b/src/js/operations/Hexdump.js index 0deeac9e..dc4adc3a 100755 --- a/src/js/operations/Hexdump.js +++ b/src/js/operations/Hexdump.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals app */ /** @@ -196,3 +198,5 @@ const Hexdump = { }, }; + +export default Hexdump; diff --git a/src/js/operations/IP.js b/src/js/operations/IP.js index 8f3701c0..a075a632 100755 --- a/src/js/operations/IP.js +++ b/src/js/operations/IP.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals BigInteger */ /** @@ -802,3 +804,5 @@ const IP = { }, }; + +export default IP; diff --git a/src/js/operations/JS.js b/src/js/operations/JS.js index 03f38a1d..1ffe102d 100755 --- a/src/js/operations/JS.js +++ b/src/js/operations/JS.js @@ -158,3 +158,5 @@ const JS = { }, }; + +export default JS; diff --git a/src/js/operations/MAC.js b/src/js/operations/MAC.js index 91b97b27..51d7bd47 100755 --- a/src/js/operations/MAC.js +++ b/src/js/operations/MAC.js @@ -86,3 +86,5 @@ const MAC = { }, }; + +export default MAC; diff --git a/src/js/operations/Numberwang.js b/src/js/operations/Numberwang.js index c7555489..f02743f1 100755 --- a/src/js/operations/Numberwang.js +++ b/src/js/operations/Numberwang.js @@ -25,3 +25,5 @@ const Numberwang = { }, }; + +export default Numberwang; diff --git a/src/js/operations/OS.js b/src/js/operations/OS.js index 1a4228c9..d3cd0e43 100755 --- a/src/js/operations/OS.js +++ b/src/js/operations/OS.js @@ -307,3 +307,5 @@ const OS = { }, }; + +export default OS; diff --git a/src/js/operations/PublicKey.js b/src/js/operations/PublicKey.js index 32b06155..a7800ae9 100755 --- a/src/js/operations/PublicKey.js +++ b/src/js/operations/PublicKey.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */ /** @@ -1051,3 +1053,5 @@ X509.DN_ATTRHEX = { '060355080101': 'rsa', '0603604c0101': 'DPC', }; + +export default PublicKey; diff --git a/src/js/operations/Punycode.js b/src/js/operations/Punycode.js index e6b80968..45433a09 100755 --- a/src/js/operations/Punycode.js +++ b/src/js/operations/Punycode.js @@ -53,3 +53,5 @@ const Punycode = { }, }; + +export default Punycode; diff --git a/src/js/operations/QuotedPrintable.js b/src/js/operations/QuotedPrintable.js index 8ce6b188..f864a81c 100755 --- a/src/js/operations/QuotedPrintable.js +++ b/src/js/operations/QuotedPrintable.js @@ -266,3 +266,5 @@ const QuotedPrintable = { }, }; + +export default QuotedPrintable; diff --git a/src/js/operations/Rotate.js b/src/js/operations/Rotate.js index 568e9204..53bd47f3 100755 --- a/src/js/operations/Rotate.js +++ b/src/js/operations/Rotate.js @@ -204,3 +204,5 @@ const Rotate = { }, }; + +export default Rotate; diff --git a/src/js/operations/SeqUtils.js b/src/js/operations/SeqUtils.js index 16bb4cf5..b1d0b0a5 100755 --- a/src/js/operations/SeqUtils.js +++ b/src/js/operations/SeqUtils.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * Sequence utility operations. * @@ -218,3 +220,5 @@ const SeqUtils = { }, }; + +export default SeqUtils; diff --git a/src/js/operations/StrUtils.js b/src/js/operations/StrUtils.js index 67b808f5..9d2a9103 100755 --- a/src/js/operations/StrUtils.js +++ b/src/js/operations/StrUtils.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /* globals JsDiff */ /** @@ -502,3 +504,5 @@ const StrUtils = { }, }; + +export default StrUtils; diff --git a/src/js/operations/Tidy.js b/src/js/operations/Tidy.js index 00fe817f..bc622876 100755 --- a/src/js/operations/Tidy.js +++ b/src/js/operations/Tidy.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * Tidy operations. * @@ -240,3 +242,5 @@ const Tidy = { }, }; + +export default Tidy; diff --git a/src/js/operations/URL.js b/src/js/operations/URL.js index 0704494e..d9295290 100755 --- a/src/js/operations/URL.js +++ b/src/js/operations/URL.js @@ -1,3 +1,4 @@ +import Utils from '../core/Utils'; /* globals unescape */ /** @@ -131,3 +132,5 @@ const URL_ = { }, }; + +export default URL_; diff --git a/src/js/operations/UUID.js b/src/js/operations/UUID.js index 1909f9ad..fc24a6bd 100755 --- a/src/js/operations/UUID.js +++ b/src/js/operations/UUID.js @@ -1,3 +1,5 @@ +import Uint32Array from 'core-js/modules/es6.typed.uint32-array'; + /** * UUID operations. * @@ -37,3 +39,5 @@ const UUID = { }, }; + +export default UUID; diff --git a/src/js/operations/Unicode.js b/src/js/operations/Unicode.js index e7d62b40..1c17c1d4 100755 --- a/src/js/operations/Unicode.js +++ b/src/js/operations/Unicode.js @@ -1,3 +1,5 @@ +import Utils from '../core/Utils'; + /** * Unicode operations. * @@ -60,3 +62,5 @@ const Unicode = { }, }; + +export default Unicode; diff --git a/src/js/views/html/ControlsWaiter.js b/src/js/views/html/ControlsWaiter.js index e00c8cd4..ed162fa7 100755 --- a/src/js/views/html/ControlsWaiter.js +++ b/src/js/views/html/ControlsWaiter.js @@ -1,3 +1,5 @@ +import $ from 'jquery'; +import Utils from '../../core/Utils'; /** * Waiter to handle events related to the CyberChef controls (i.e. Bake, Step, Save, Load etc.) * @@ -9,10 +11,10 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const ControlsWaiter = function (app, manager) { +export default function ControlsWaiter(app, manager) { this.app = app; this.manager = manager; -}; +} /** @@ -191,7 +193,9 @@ ControlsWaiter.prototype.save_text_change = function () { try { const recipe_config = JSON.parse(document.getElementById('save-text').value); this.initialise_save_link(recipe_config); - } catch (err) {} + } catch (err) { + // ignore error + } }; diff --git a/src/js/views/html/HTMLApp.js b/src/js/views/html/HTMLApp.js index 2ce1ace8..c1ffdb7e 100755 --- a/src/js/views/html/HTMLApp.js +++ b/src/js/views/html/HTMLApp.js @@ -1,3 +1,12 @@ +import $ from 'jquery'; + +import Utils from '../../core/Utils'; +import Chef from '../../core/Chef'; +import Manager from './Manager'; +import HTMLCategory from './HTMLCategory'; +import HTMLOperation from './HTMLOperation'; + + /* globals Split */ /** @@ -14,7 +23,7 @@ * @param {String[]} default_favourites - A list of default favourite operations. * @param {Object} options - Default setting for app options. */ -const HTMLApp = function (categories, operations, default_favourites, default_options) { +export default function HTMLApp(categories, operations, default_favourites, default_options) { this.categories = categories; this.operations = operations; this.dfavourites = default_favourites; @@ -29,7 +38,7 @@ const HTMLApp = function (categories, operations, default_favourites, default_op this.ing_id = 0; window.chef = this.chef; -}; +} /** @@ -356,7 +365,9 @@ HTMLApp.prototype.load_URI_params = function () { try { const recipe_config = JSON.parse(this.query_string.recipe); this.set_recipe_config(recipe_config); - } catch (err) {} + } catch (err) { + // ignore error + } } else if (this.query_string.op) { // If there's no recipe, look for single operations this.manager.recipe.clear_recipe(); @@ -382,7 +393,9 @@ HTMLApp.prototype.load_URI_params = function () { try { const input_data = Utils.from_base64(this.query_string.input); this.set_input(input_data); - } catch (err) {} + } catch (err) { + // ignore error + } } // Restore auto-bake state diff --git a/src/js/views/html/HTMLCategory.js b/src/js/views/html/HTMLCategory.js index 3a3ed925..d418550c 100755 --- a/src/js/views/html/HTMLCategory.js +++ b/src/js/views/html/HTMLCategory.js @@ -9,11 +9,11 @@ * @param {string} name - The name of the category. * @param {boolean} selected - Whether this category is pre-selected or not. */ -const HTMLCategory = function (name, selected) { +export default function HTMLCategory(name, selected) { this.name = name; this.selected = selected; this.op_list = []; -}; +} /** diff --git a/src/js/views/html/HTMLIngredient.js b/src/js/views/html/HTMLIngredient.js index a5ea0a8f..d4089954 100755 --- a/src/js/views/html/HTMLIngredient.js +++ b/src/js/views/html/HTMLIngredient.js @@ -10,7 +10,7 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const HTMLIngredient = function (config, app, manager) { +export default function HTMLIngredient(config, app, manager) { this.app = app; this.manager = manager; @@ -23,7 +23,7 @@ const HTMLIngredient = function (config, app, manager) { this.target = config.target; this.toggle_values = config.toggle_values; this.id = `ing-${this.app.next_ing_id()}`; -}; +} /** diff --git a/src/js/views/html/HTMLOperation.js b/src/js/views/html/HTMLOperation.js index 1405fa8d..2f6acfe9 100755 --- a/src/js/views/html/HTMLOperation.js +++ b/src/js/views/html/HTMLOperation.js @@ -1,3 +1,5 @@ +import HTMLIngredient from './HTMLIngredient'; + /** * Object to handle the creation of operations. * @@ -11,7 +13,7 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const HTMLOperation = function (name, config, app, manager) { +export default function HTMLOperation(name, config, app, manager) { this.app = app; this.manager = manager; @@ -25,7 +27,7 @@ const HTMLOperation = function (name, config, app, manager) { const ing = new HTMLIngredient(config.args[i], this.app, this.manager); this.ing_list.push(ing); } -}; +} /** diff --git a/src/js/views/html/HighlighterWaiter.js b/src/js/views/html/HighlighterWaiter.js index 51de90e3..931cbdc4 100755 --- a/src/js/views/html/HighlighterWaiter.js +++ b/src/js/views/html/HighlighterWaiter.js @@ -1,3 +1,4 @@ +import Utils from '../../core/Utils'; /** * Waiter to handle events related to highlighting in CyberChef. * @@ -8,12 +9,12 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -const HighlighterWaiter = function (app) { +export default function HighlighterWaiter(app) { this.app = app; this.mouse_button_down = false; this.mouse_target = null; -}; +} /** diff --git a/src/js/views/html/InputWaiter.js b/src/js/views/html/InputWaiter.js index a70e217b..275144e7 100755 --- a/src/js/views/html/InputWaiter.js +++ b/src/js/views/html/InputWaiter.js @@ -1,3 +1,5 @@ +import Uint8Array from 'core-js/modules/es6.typed.uint8-array'; +import Utils from '../../core/Utils'; /** * Waiter to handle events related to the input. * @@ -9,7 +11,7 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const InputWaiter = function (app, manager) { +export default function InputWaiter(app, manager) { this.app = app; this.manager = manager; @@ -30,7 +32,7 @@ const InputWaiter = function (app, manager) { 144, // Num 145, //Scroll ]; -}; +} /** diff --git a/src/js/views/html/Manager.js b/src/js/views/html/Manager.js index 6abdf37a..d64154f4 100755 --- a/src/js/views/html/Manager.js +++ b/src/js/views/html/Manager.js @@ -1,3 +1,15 @@ +import $ from 'jquery'; + +import WindowWaiter from './WindowWaiter'; +import ControlsWaiter from './ControlsWaiter'; +import RecipeWaiter from './RecipeWaiter'; +import OperationsWaiter from './OperationsWaiter'; +import InputWaiter from './InputWaiter'; +import OutputWaiter from './OutputWaiter'; +import HighlighterWaiter from './HighlighterWaiter'; +import SeasonalWaiter from './SeasonalWaiter'; +import OptionsWaiter from './OptionsWaiter'; + /** * This object controls the Waiters responsible for handling events from all areas of the app. * diff --git a/src/js/views/html/OperationsWaiter.js b/src/js/views/html/OperationsWaiter.js index 878ba62f..83315fb0 100755 --- a/src/js/views/html/OperationsWaiter.js +++ b/src/js/views/html/OperationsWaiter.js @@ -1,3 +1,6 @@ +import $ from 'jquery'; +import HTMLOperation from './HTMLOperation'; + /* globals Sortable */ /** @@ -11,13 +14,13 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const OperationsWaiter = function (app, manager) { +export default function OperationsWaiter(app, manager) { this.app = app; this.manager = manager; this.options = {}; this.remove_intent = false; -}; +} /** diff --git a/src/js/views/html/OptionsWaiter.js b/src/js/views/html/OptionsWaiter.js index 63162afe..65a5a2f8 100755 --- a/src/js/views/html/OptionsWaiter.js +++ b/src/js/views/html/OptionsWaiter.js @@ -1,3 +1,5 @@ +import $ from 'jquery'; + /** * Waiter to handle events related to the CyberChef options. * @@ -8,9 +10,9 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -const OptionsWaiter = function (app) { +export default function OptionsWaiter(app) { this.app = app; -}; +} /** diff --git a/src/js/views/html/OutputWaiter.js b/src/js/views/html/OutputWaiter.js index e00df9d0..73ba94d2 100755 --- a/src/js/views/html/OutputWaiter.js +++ b/src/js/views/html/OutputWaiter.js @@ -1,3 +1,5 @@ +import Utils from '../../core/Utils'; + /** * Waiter to handle events related to the output. * @@ -9,10 +11,10 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const OutputWaiter = function (app, manager) { +export default function OutputWaiter(app, manager) { this.app = app; this.manager = manager; -}; +} /** diff --git a/src/js/views/html/RecipeWaiter.js b/src/js/views/html/RecipeWaiter.js index 8f016bc6..54d67215 100755 --- a/src/js/views/html/RecipeWaiter.js +++ b/src/js/views/html/RecipeWaiter.js @@ -1,3 +1,5 @@ +import $ from 'jquery'; +import HTMLOperation from './HTMLOperation'; /* globals Sortable */ /** @@ -11,11 +13,11 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const RecipeWaiter = function (app, manager) { +export default function RecipeWaiter(app, manager) { this.app = app; this.manager = manager; this.remove_intent = false; -}; +} /** @@ -405,7 +407,7 @@ RecipeWaiter.prototype.dropdown_toggle_click = function (e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.op_add = function (e) { +RecipeWaiter.prototype.op_add = function () { window.dispatchEvent(this.manager.statechange); }; @@ -417,6 +419,6 @@ RecipeWaiter.prototype.op_add = function (e) { * @fires Manager#statechange * @param {event} e */ -RecipeWaiter.prototype.op_remove = function (e) { +RecipeWaiter.prototype.op_remove = function () { window.dispatchEvent(this.manager.statechange); }; diff --git a/src/js/views/html/SeasonalWaiter.js b/src/js/views/html/SeasonalWaiter.js index 3a36897d..5d9b03d4 100755 --- a/src/js/views/html/SeasonalWaiter.js +++ b/src/js/views/html/SeasonalWaiter.js @@ -1,3 +1,5 @@ +import $ from 'jquery'; + /** * Waiter to handle seasonal events and easter eggs. * @@ -9,10 +11,10 @@ * @param {HTMLApp} app - The main view object for CyberChef. * @param {Manager} manager - The CyberChef event manager. */ -const SeasonalWaiter = function (app, manager) { +export default function SeasonalWaiter(app, manager) { this.app = app; this.manager = manager; -}; +} /** diff --git a/src/js/views/html/WindowWaiter.js b/src/js/views/html/WindowWaiter.js index 3b32fe76..803fed89 100755 --- a/src/js/views/html/WindowWaiter.js +++ b/src/js/views/html/WindowWaiter.js @@ -8,9 +8,9 @@ * @constructor * @param {HTMLApp} app - The main view object for CyberChef. */ -const WindowWaiter = function (app) { +export default function WindowWaiter(app) { this.app = app; -}; +} /** diff --git a/src/js/views/html/main.js b/src/js/views/html/main.js index 16977685..16fa2c57 100755 --- a/src/js/views/html/main.js +++ b/src/js/views/html/main.js @@ -1,3 +1,6 @@ +import HTMLApp from './HTMLApp'; +import Categories from '../../config/Categories'; +import OperationConfig from '../../config/OperationConfig'; /* globals moment */ /** diff --git a/yarn.lock b/yarn.lock index 740be2d9..2b05477d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1185,7 +1185,7 @@ cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" -core-js@^2.4.0: +core-js@^2.4.0, core-js@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" From 95daa65d7d48678c7c3cdb22408156e1a557d249 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 29 Nov 2016 02:08:20 +0000 Subject: [PATCH 05/15] remove globals ignore --- src/js/core/Utils.js | 2 +- src/js/operations/BitwiseOp.js | 2 +- src/js/operations/ByteRepr.js | 2 +- src/js/operations/CharEnc.js | 2 +- src/js/operations/Cipher.js | 2 +- src/js/operations/Code.js | 2 +- src/js/operations/Compress.js | 2 +- src/js/operations/DateTime.js | 2 +- src/js/operations/HTTP.js | 2 +- src/js/operations/Hash.js | 2 +- src/js/operations/Hexdump.js | 2 +- src/js/operations/IP.js | 2 +- src/js/operations/JS.js | 2 +- src/js/operations/PublicKey.js | 2 +- src/js/operations/Punycode.js | 2 +- src/js/operations/StrUtils.js | 2 +- src/js/operations/URL.js | 2 +- src/js/views/html/HTMLApp.js | 2 +- src/js/views/html/OperationsWaiter.js | 2 +- src/js/views/html/RecipeWaiter.js | 2 +- src/js/views/html/main.js | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js index 0f3c6121..744c596b 100755 --- a/src/js/core/Utils.js +++ b/src/js/core/Utils.js @@ -1,6 +1,6 @@ import $ from 'jquery'; -/* globals CryptoJS, moment */ + /** * Utility functions for use in operations, the core framework and the stage. diff --git a/src/js/operations/BitwiseOp.js b/src/js/operations/BitwiseOp.js index 3b08287c..4cdf6b34 100755 --- a/src/js/operations/BitwiseOp.js +++ b/src/js/operations/BitwiseOp.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals CryptoJS */ + /** * Bitwise operations. diff --git a/src/js/operations/ByteRepr.js b/src/js/operations/ByteRepr.js index e84c20ee..ffe12776 100755 --- a/src/js/operations/ByteRepr.js +++ b/src/js/operations/ByteRepr.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals app */ + /** * Byte representation operations. diff --git a/src/js/operations/CharEnc.js b/src/js/operations/CharEnc.js index a419986b..f6ad6e21 100755 --- a/src/js/operations/CharEnc.js +++ b/src/js/operations/CharEnc.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals CryptoJS */ + /** * Character encoding operations. diff --git a/src/js/operations/Cipher.js b/src/js/operations/Cipher.js index 693e2012..6f0d12d9 100755 --- a/src/js/operations/Cipher.js +++ b/src/js/operations/Cipher.js @@ -1,5 +1,5 @@ import Utils from '../core/Utils'; -/* globals CryptoJS, blowfish */ + /** * Cipher operations. diff --git a/src/js/operations/Code.js b/src/js/operations/Code.js index 78503859..940eca49 100755 --- a/src/js/operations/Code.js +++ b/src/js/operations/Code.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals prettyPrintOne, vkbeautify */ + /** * Code operations. diff --git a/src/js/operations/Compress.js b/src/js/operations/Compress.js index f5a328ee..5f94f9d9 100755 --- a/src/js/operations/Compress.js +++ b/src/js/operations/Compress.js @@ -1,7 +1,7 @@ import Utils from '../core/Utils'; import Uint8Array from 'core-js/modules/es6.typed.uint8-array'; -/* globals Zlib, bzip2 */ + /** * Compression operations. diff --git a/src/js/operations/DateTime.js b/src/js/operations/DateTime.js index c5a859ec..89367d11 100755 --- a/src/js/operations/DateTime.js +++ b/src/js/operations/DateTime.js @@ -1,4 +1,4 @@ -/* globals moment */ + /** * Date and time operations. diff --git a/src/js/operations/HTTP.js b/src/js/operations/HTTP.js index d3cc0073..54bc9939 100755 --- a/src/js/operations/HTTP.js +++ b/src/js/operations/HTTP.js @@ -1,4 +1,4 @@ -/* globals UAS_parser */ + /** * HTTP operations. diff --git a/src/js/operations/Hash.js b/src/js/operations/Hash.js index 23719a32..bfe9837b 100755 --- a/src/js/operations/Hash.js +++ b/src/js/operations/Hash.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals CryptoJS, Checksum */ + /** * Hashing operations. diff --git a/src/js/operations/Hexdump.js b/src/js/operations/Hexdump.js index dc4adc3a..dde4f964 100755 --- a/src/js/operations/Hexdump.js +++ b/src/js/operations/Hexdump.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals app */ + /** * Hexdump operations. diff --git a/src/js/operations/IP.js b/src/js/operations/IP.js index a075a632..a8b79201 100755 --- a/src/js/operations/IP.js +++ b/src/js/operations/IP.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals BigInteger */ + /** * Internet Protocol address operations. diff --git a/src/js/operations/JS.js b/src/js/operations/JS.js index 1ffe102d..e626e793 100755 --- a/src/js/operations/JS.js +++ b/src/js/operations/JS.js @@ -1,4 +1,4 @@ -/* globals esprima, escodegen, esmangle */ + /** * JavaScript operations. diff --git a/src/js/operations/PublicKey.js b/src/js/operations/PublicKey.js index a7800ae9..1ca5a97a 100755 --- a/src/js/operations/PublicKey.js +++ b/src/js/operations/PublicKey.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */ + /** * Public Key operations. diff --git a/src/js/operations/Punycode.js b/src/js/operations/Punycode.js index 45433a09..31390afa 100755 --- a/src/js/operations/Punycode.js +++ b/src/js/operations/Punycode.js @@ -1,4 +1,4 @@ -/* globals punycode */ + /** * Punycode operations. diff --git a/src/js/operations/StrUtils.js b/src/js/operations/StrUtils.js index 9d2a9103..03f79d56 100755 --- a/src/js/operations/StrUtils.js +++ b/src/js/operations/StrUtils.js @@ -1,6 +1,6 @@ import Utils from '../core/Utils'; -/* globals JsDiff */ + /** * String utility operations. diff --git a/src/js/operations/URL.js b/src/js/operations/URL.js index d9295290..84af7652 100755 --- a/src/js/operations/URL.js +++ b/src/js/operations/URL.js @@ -1,5 +1,5 @@ import Utils from '../core/Utils'; -/* globals unescape */ + /** * URL operations. diff --git a/src/js/views/html/HTMLApp.js b/src/js/views/html/HTMLApp.js index c1ffdb7e..09eb0162 100755 --- a/src/js/views/html/HTMLApp.js +++ b/src/js/views/html/HTMLApp.js @@ -7,7 +7,7 @@ import HTMLCategory from './HTMLCategory'; import HTMLOperation from './HTMLOperation'; -/* globals Split */ + /** * HTML view for CyberChef responsible for building the web page and dealing with all user diff --git a/src/js/views/html/OperationsWaiter.js b/src/js/views/html/OperationsWaiter.js index 83315fb0..a5f766ed 100755 --- a/src/js/views/html/OperationsWaiter.js +++ b/src/js/views/html/OperationsWaiter.js @@ -1,7 +1,7 @@ import $ from 'jquery'; import HTMLOperation from './HTMLOperation'; -/* globals Sortable */ + /** * Waiter to handle events related to the operations. diff --git a/src/js/views/html/RecipeWaiter.js b/src/js/views/html/RecipeWaiter.js index 54d67215..f0eb8ed2 100755 --- a/src/js/views/html/RecipeWaiter.js +++ b/src/js/views/html/RecipeWaiter.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import HTMLOperation from './HTMLOperation'; -/* globals Sortable */ + /** * Waiter to handle events related to the recipe. diff --git a/src/js/views/html/main.js b/src/js/views/html/main.js index 16fa2c57..f4025d92 100755 --- a/src/js/views/html/main.js +++ b/src/js/views/html/main.js @@ -1,7 +1,7 @@ import HTMLApp from './HTMLApp'; import Categories from '../../config/Categories'; import OperationConfig from '../../config/OperationConfig'; -/* globals moment */ + /** * @author n1474335 [n1474335@gmail.com] From 661b42010303107c232567328844d1fb790979b7 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 29 Nov 2016 03:11:21 +0000 Subject: [PATCH 06/15] add 3rd party libraries to imports --- .eslintrc.json | 3 + package.json | 15 ++- src/html/index.html | 95 +++++++-------- src/js/core/Recipe.js | 4 +- src/js/core/Utils.js | 4 +- src/js/index.js | 137 +-------------------- src/js/lib/diff.js | 2 +- src/js/operations/ByteRepr.js | 6 +- src/js/operations/CharEnc.js | 3 +- src/js/operations/Cipher.js | 2 + src/js/operations/Code.js | 4 +- src/js/operations/Compress.js | 16 +++ src/js/operations/DateTime.js | 2 +- src/js/operations/HTTP.js | 2 +- src/js/operations/Hash.js | 3 +- src/js/operations/Hexdump.js | 2 +- src/js/operations/IP.js | 2 +- src/js/operations/JS.js | 4 +- src/js/operations/PublicKey.js | 2 +- src/js/operations/Punycode.js | 2 +- src/js/operations/StrUtils.js | 1 + src/js/views/html/HTMLApp.js | 3 +- src/js/views/html/Manager.js | 4 +- src/js/views/html/OperationsWaiter.js | 1 + src/js/views/html/RecipeWaiter.js | 1 + src/js/views/html/main.js | 7 +- webpack-babel.js | 25 ++++ yarn.lock | 169 ++++++++++++++++++++++++-- 28 files changed, 301 insertions(+), 220 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 6f413948..2044d90f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,5 +17,8 @@ "env": { "browser": true, "node": true + }, + "globals": { + "COMPILE_TIME": true } } diff --git a/package.json b/package.json index 51cfc726..6190fda3 100755 --- a/package.json +++ b/package.json @@ -61,18 +61,31 @@ "grunt-inline-alt": "~0.3.10", "grunt-jsdoc": "^1.1.0", "html-webpack-plugin": "^2.24.1", + "imports-loader": "^0.6.5", "ink-docstrap": "^1.1.4", "style-loader": "^0.13.1", "webpack": "2.1.0-beta.27", "webpack-dev-server": "2.1.0-beta.12" }, "dependencies": { + "bootstrap": "^3.3.7", + "bootstrap-switch": "^3.3.2", "core-js": "^2.4.1", + "crypto-js": "^3.1.8", + "escodegen": "^1.8.1", + "esmangle": "^1.0.1", "esprima": "^3.1.2", "estraverse": "^4.2.0", + "google-code-prettify": "^1.0.5", "jquery": "^3.1.1", "json-loader": "^0.5.4", + "jsrsasign": "^6.2.2", "moment": "^2.17.0", - "moment-timezone": "^0.5.10" + "moment-timezone": "^0.5.10", + "node-bzip": "^0.0.1-2", + "sladex-blowfish": "^0.8.1", + "split.js": "^1.1.1", + "vkbeautify": "^0.99.1", + "zlibjs": "^0.2.0" } } diff --git a/src/html/index.html b/src/html/index.html index 2692dc44..4c7f74e3 100755 --- a/src/html/index.html +++ b/src/html/index.html @@ -1,17 +1,17 @@ ' is a single-line comment - index += 3; - skipSingleLineComment(3); - } else { - break; - } - } else if (ch === 0x3C) { // U+003C is '<' - if (source.slice(index + 1, index + 4) === '!--') { - ++index; // `<` - ++index; // `!` - ++index; // `-` - ++index; // `-` - skipSingleLineComment(4); - } else { - break; - } - } else { - break; - } - } - } - - function scanHexEscape(prefix) { - var i, len, ch, code = 0; - - len = (prefix === 'u') ? 4 : 2; - for (i = 0; i < len; ++i) { - if (index < length && isHexDigit(source[index])) { - ch = source[index++]; - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } else { - return ''; - } - } - return String.fromCharCode(code); - } - - function scanUnicodeCodePointEscape() { - var ch, code, cu1, cu2; - - ch = source[index]; - code = 0; - - // At least, one hex digit is required. - if (ch === '}') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - while (index < length) { - ch = source[index++]; - if (!isHexDigit(ch)) { - break; - } - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } - - if (code > 0x10FFFF || ch !== '}') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - // UTF-16 Encoding - if (code <= 0xFFFF) { - return String.fromCharCode(code); - } - cu1 = ((code - 0x10000) >> 10) + 0xD800; - cu2 = ((code - 0x10000) & 1023) + 0xDC00; - return String.fromCharCode(cu1, cu2); - } - - function getEscapedIdentifier() { - var ch, id; - - ch = source.charCodeAt(index++); - id = String.fromCharCode(ch); - - // '\u' (U+005C, U+0075) denotes an escaped character. - if (ch === 0x5C) { - if (source.charCodeAt(index) !== 0x75) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - ++index; - ch = scanHexEscape('u'); - if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - id = ch; - } - - while (index < length) { - ch = source.charCodeAt(index); - if (!isIdentifierPart(ch)) { - break; - } - ++index; - id += String.fromCharCode(ch); - - // '\u' (U+005C, U+0075) denotes an escaped character. - if (ch === 0x5C) { - id = id.substr(0, id.length - 1); - if (source.charCodeAt(index) !== 0x75) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - ++index; - ch = scanHexEscape('u'); - if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - id += ch; - } - } - - return id; - } - - function getIdentifier() { - var start, ch; - - start = index++; - while (index < length) { - ch = source.charCodeAt(index); - if (ch === 0x5C) { - // Blackslash (U+005C) marks Unicode escape sequence. - index = start; - return getEscapedIdentifier(); - } - if (isIdentifierPart(ch)) { - ++index; - } else { - break; - } - } - - return source.slice(start, index); - } - - function scanIdentifier() { - var start, id, type; - - start = index; - - // Backslash (U+005C) starts an escaped character. - id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier(); - - // There is no keyword or literal with only one character. - // Thus, it must be an identifier. - if (id.length === 1) { - type = Token.Identifier; - } else if (isKeyword(id)) { - type = Token.Keyword; - } else if (id === 'null') { - type = Token.NullLiteral; - } else if (id === 'true' || id === 'false') { - type = Token.BooleanLiteral; - } else { - type = Token.Identifier; - } - - return { - type: type, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - - // 7.7 Punctuators - - function scanPunctuator() { - var start = index, - code = source.charCodeAt(index), - code2, - ch1 = source[index], - ch2, - ch3, - ch4; - - switch (code) { - - // Check for most common single-character punctuators. - case 0x2E: // . dot - case 0x28: // ( open bracket - case 0x29: // ) close bracket - case 0x3B: // ; semicolon - case 0x2C: // , comma - case 0x7B: // { open curly brace - case 0x7D: // } close curly brace - case 0x5B: // [ - case 0x5D: // ] - case 0x3A: // : - case 0x3F: // ? - case 0x7E: // ~ - ++index; - if (extra.tokenize) { - if (code === 0x28) { - extra.openParenToken = extra.tokens.length; - } else if (code === 0x7B) { - extra.openCurlyToken = extra.tokens.length; - } - } - return { - type: Token.Punctuator, - value: String.fromCharCode(code), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - - default: - code2 = source.charCodeAt(index + 1); - - // '=' (U+003D) marks an assignment or comparison operator. - if (code2 === 0x3D) { - switch (code) { - case 0x2B: // + - case 0x2D: // - - case 0x2F: // / - case 0x3C: // < - case 0x3E: // > - case 0x5E: // ^ - case 0x7C: // | - case 0x25: // % - case 0x26: // & - case 0x2A: // * - index += 2; - return { - type: Token.Punctuator, - value: String.fromCharCode(code) + String.fromCharCode(code2), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - - case 0x21: // ! - case 0x3D: // = - index += 2; - - // !== and === - if (source.charCodeAt(index) === 0x3D) { - ++index; - } - return { - type: Token.Punctuator, - value: source.slice(start, index), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - } - } - - // 4-character punctuator: >>>= - - ch4 = source.substr(index, 4); - - if (ch4 === '>>>=') { - index += 4; - return { - type: Token.Punctuator, - value: ch4, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - ch3 = ch4.substr(0, 3); - - if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') { - index += 3; - return { - type: Token.Punctuator, - value: ch3, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - // Other 2-character punctuators: ++ -- << >> && || - ch2 = ch3.substr(0, 2); - - if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') { - index += 2; - return { - type: Token.Punctuator, - value: ch2, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - // 1-character punctuators: < > = ! + - * % & | ^ / - - if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { - ++index; - return { - type: Token.Punctuator, - value: ch1, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - // 7.8.3 Numeric Literals - - function scanHexLiteral(start) { - var number = ''; - - while (index < length) { - if (!isHexDigit(source[index])) { - break; - } - number += source[index++]; - } - - if (number.length === 0) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - if (isIdentifierStart(source.charCodeAt(index))) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - return { - type: Token.NumericLiteral, - value: parseInt('0x' + number, 16), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - function scanOctalLiteral(start) { - var number = '0' + source[index++]; - while (index < length) { - if (!isOctalDigit(source[index])) { - break; - } - number += source[index++]; - } - - if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - return { - type: Token.NumericLiteral, - value: parseInt(number, 8), - octal: true, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - function scanNumericLiteral() { - var number, start, ch; - - ch = source[index]; - assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), - 'Numeric literal must start with a decimal digit or a decimal point'); - - start = index; - number = ''; - if (ch !== '.') { - number = source[index++]; - ch = source[index]; - - // Hex number starts with '0x'. - // Octal number starts with '0'. - if (number === '0') { - if (ch === 'x' || ch === 'X') { - ++index; - return scanHexLiteral(start); - } - if (isOctalDigit(ch)) { - return scanOctalLiteral(start); - } - - // decimal number starts with '0' such as '09' is illegal. - if (ch && isDecimalDigit(ch.charCodeAt(0))) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - while (isDecimalDigit(source.charCodeAt(index))) { - number += source[index++]; - } - ch = source[index]; - } - - if (ch === '.') { - number += source[index++]; - while (isDecimalDigit(source.charCodeAt(index))) { - number += source[index++]; - } - ch = source[index]; - } - - if (ch === 'e' || ch === 'E') { - number += source[index++]; - - ch = source[index]; - if (ch === '+' || ch === '-') { - number += source[index++]; - } - if (isDecimalDigit(source.charCodeAt(index))) { - while (isDecimalDigit(source.charCodeAt(index))) { - number += source[index++]; - } - } else { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - if (isIdentifierStart(source.charCodeAt(index))) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - return { - type: Token.NumericLiteral, - value: parseFloat(number), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - // 7.8.4 String Literals - - function scanStringLiteral() { - var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart; - startLineNumber = lineNumber; - startLineStart = lineStart; - - quote = source[index]; - assert((quote === '\'' || quote === '"'), - 'String literal must starts with a quote'); - - start = index; - ++index; - - while (index < length) { - ch = source[index++]; - - if (ch === quote) { - quote = ''; - break; - } else if (ch === '\\') { - ch = source[index++]; - if (!ch || !isLineTerminator(ch.charCodeAt(0))) { - switch (ch) { - case 'u': - case 'x': - if (source[index] === '{') { - ++index; - str += scanUnicodeCodePointEscape(); - } else { - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - str += unescaped; - } else { - index = restore; - str += ch; - } - } - break; - case 'n': - str += '\n'; - break; - case 'r': - str += '\r'; - break; - case 't': - str += '\t'; - break; - case 'b': - str += '\b'; - break; - case 'f': - str += '\f'; - break; - case 'v': - str += '\x0B'; - break; - - default: - if (isOctalDigit(ch)) { - code = '01234567'.indexOf(ch); - - // \0 is not octal escape sequence - if (code !== 0) { - octal = true; - } - - if (index < length && isOctalDigit(source[index])) { - octal = true; - code = code * 8 + '01234567'.indexOf(source[index++]); - - // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 - if ('0123'.indexOf(ch) >= 0 && - index < length && - isOctalDigit(source[index])) { - code = code * 8 + '01234567'.indexOf(source[index++]); - } - } - str += String.fromCharCode(code); - } else { - str += ch; - } - break; - } - } else { - ++lineNumber; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - lineStart = index; - } - } else if (isLineTerminator(ch.charCodeAt(0))) { - break; - } else { - str += ch; - } - } - - if (quote !== '') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - return { - type: Token.StringLiteral, - value: str, - octal: octal, - startLineNumber: startLineNumber, - startLineStart: startLineStart, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - function testRegExp(pattern, flags) { - var value; - try { - value = new RegExp(pattern, flags); - } catch (e) { - throwError({}, Messages.InvalidRegExp); - } - return value; - } - - function scanRegExpBody() { - var ch, str, classMarker, terminated, body; - - ch = source[index]; - assert(ch === '/', 'Regular expression literal must start with a slash'); - str = source[index++]; - - classMarker = false; - terminated = false; - while (index < length) { - ch = source[index++]; - str += ch; - if (ch === '\\') { - ch = source[index++]; - // ECMA-262 7.8.5 - if (isLineTerminator(ch.charCodeAt(0))) { - throwError({}, Messages.UnterminatedRegExp); - } - str += ch; - } else if (isLineTerminator(ch.charCodeAt(0))) { - throwError({}, Messages.UnterminatedRegExp); - } else if (classMarker) { - if (ch === ']') { - classMarker = false; - } - } else { - if (ch === '/') { - terminated = true; - break; - } else if (ch === '[') { - classMarker = true; - } - } - } - - if (!terminated) { - throwError({}, Messages.UnterminatedRegExp); - } - - // Exclude leading and trailing slash. - body = str.substr(1, str.length - 2); - return { - value: body, - literal: str - }; - } - - function scanRegExpFlags() { - var ch, str, flags, restore; - - str = ''; - flags = ''; - while (index < length) { - ch = source[index]; - if (!isIdentifierPart(ch.charCodeAt(0))) { - break; - } - - ++index; - if (ch === '\\' && index < length) { - ch = source[index]; - if (ch === 'u') { - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - flags += ch; - for (str += '\\u'; restore < index; ++restore) { - str += source[restore]; - } - } else { - index = restore; - flags += 'u'; - str += '\\u'; - } - throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL'); - } else { - str += '\\'; - throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - flags += ch; - str += ch; - } - } - - return { - value: flags, - literal: str - }; - } - - function scanRegExp() { - var start, body, flags, value; - - lookahead = null; - skipComment(); - start = index; - - body = scanRegExpBody(); - flags = scanRegExpFlags(); - value = testRegExp(body.value, flags.value); - - if (extra.tokenize) { - return { - type: Token.RegularExpression, - value: value, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - return { - literal: body.literal + flags.literal, - value: value, - start: start, - end: index - }; - } - - function collectRegex() { - var pos, loc, regex, token; - - skipComment(); - - pos = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - regex = scanRegExp(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - /* istanbul ignore next */ - if (!extra.tokenize) { - // Pop the previous token, which is likely '/' or '/=' - if (extra.tokens.length > 0) { - token = extra.tokens[extra.tokens.length - 1]; - if (token.range[0] === pos && token.type === 'Punctuator') { - if (token.value === '/' || token.value === '/=') { - extra.tokens.pop(); - } - } - } - - extra.tokens.push({ - type: 'RegularExpression', - value: regex.literal, - range: [pos, index], - loc: loc - }); - } - - return regex; - } - - function isIdentifierName(token) { - return token.type === Token.Identifier || - token.type === Token.Keyword || - token.type === Token.BooleanLiteral || - token.type === Token.NullLiteral; - } - - function advanceSlash() { - var prevToken, - checkToken; - // Using the following algorithm: - // https://github.com/mozilla/sweet.js/wiki/design - prevToken = extra.tokens[extra.tokens.length - 1]; - if (!prevToken) { - // Nothing before that: it cannot be a division. - return collectRegex(); - } - if (prevToken.type === 'Punctuator') { - if (prevToken.value === ']') { - return scanPunctuator(); - } - if (prevToken.value === ')') { - checkToken = extra.tokens[extra.openParenToken - 1]; - if (checkToken && - checkToken.type === 'Keyword' && - (checkToken.value === 'if' || - checkToken.value === 'while' || - checkToken.value === 'for' || - checkToken.value === 'with')) { - return collectRegex(); - } - return scanPunctuator(); - } - if (prevToken.value === '}') { - // Dividing a function by anything makes little sense, - // but we have to check for that. - if (extra.tokens[extra.openCurlyToken - 3] && - extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') { - // Anonymous function. - checkToken = extra.tokens[extra.openCurlyToken - 4]; - if (!checkToken) { - return scanPunctuator(); - } - } else if (extra.tokens[extra.openCurlyToken - 4] && - extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') { - // Named function. - checkToken = extra.tokens[extra.openCurlyToken - 5]; - if (!checkToken) { - return collectRegex(); - } - } else { - return scanPunctuator(); - } - // checkToken determines whether the function is - // a declaration or an expression. - if (FnExprTokens.indexOf(checkToken.value) >= 0) { - // It is an expression. - return scanPunctuator(); - } - // It is a declaration. - return collectRegex(); - } - return collectRegex(); - } - if (prevToken.type === 'Keyword') { - return collectRegex(); - } - return scanPunctuator(); - } - - function advance() { - var ch; - - skipComment(); - - if (index >= length) { - return { - type: Token.EOF, - lineNumber: lineNumber, - lineStart: lineStart, - start: index, - end: index - }; - } - - ch = source.charCodeAt(index); - - if (isIdentifierStart(ch)) { - return scanIdentifier(); - } - - // Very common: ( and ) and ; - if (ch === 0x28 || ch === 0x29 || ch === 0x3B) { - return scanPunctuator(); - } - - // String literal starts with single quote (U+0027) or double quote (U+0022). - if (ch === 0x27 || ch === 0x22) { - return scanStringLiteral(); - } - - - // Dot (.) U+002E can also start a floating-point number, hence the need - // to check the next character. - if (ch === 0x2E) { - if (isDecimalDigit(source.charCodeAt(index + 1))) { - return scanNumericLiteral(); - } - return scanPunctuator(); - } - - if (isDecimalDigit(ch)) { - return scanNumericLiteral(); - } - - // Slash (/) U+002F can also start a regex. - if (extra.tokenize && ch === 0x2F) { - return advanceSlash(); - } - - return scanPunctuator(); - } - - function collectToken() { - var loc, token, value; - - skipComment(); - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - token = advance(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - if (token.type !== Token.EOF) { - value = source.slice(token.start, token.end); - extra.tokens.push({ - type: TokenName[token.type], - value: value, - range: [token.start, token.end], - loc: loc - }); - } - - return token; - } - - function lex() { - var token; - - token = lookahead; - index = token.end; - lineNumber = token.lineNumber; - lineStart = token.lineStart; - - lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); - - index = token.end; - lineNumber = token.lineNumber; - lineStart = token.lineStart; - - return token; - } - - function peek() { - var pos, line, start; - - pos = index; - line = lineNumber; - start = lineStart; - lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); - index = pos; - lineNumber = line; - lineStart = start; - } - - function Position() { - this.line = lineNumber; - this.column = index - lineStart; - } - - function SourceLocation() { - this.start = new Position(); - this.end = null; - } - - function WrappingSourceLocation(startToken) { - if (startToken.type === Token.StringLiteral) { - this.start = { - line: startToken.startLineNumber, - column: startToken.start - startToken.startLineStart - }; - } else { - this.start = { - line: startToken.lineNumber, - column: startToken.start - startToken.lineStart - }; - } - this.end = null; - } - - function Node() { - // Skip comment. - index = lookahead.start; - if (lookahead.type === Token.StringLiteral) { - lineNumber = lookahead.startLineNumber; - lineStart = lookahead.startLineStart; - } else { - lineNumber = lookahead.lineNumber; - lineStart = lookahead.lineStart; - } - if (extra.range) { - this.range = [index, 0]; - } - if (extra.loc) { - this.loc = new SourceLocation(); - } - } - - function WrappingNode(startToken) { - if (extra.range) { - this.range = [startToken.start, 0]; - } - if (extra.loc) { - this.loc = new WrappingSourceLocation(startToken); - } - } - - WrappingNode.prototype = Node.prototype = { - - processComment: function () { - var lastChild, - trailingComments, - bottomRight = extra.bottomRightStack, - last = bottomRight[bottomRight.length - 1]; - - if (this.type === Syntax.Program) { - if (this.body.length > 0) { - return; - } - } - - if (extra.trailingComments.length > 0) { - if (extra.trailingComments[0].range[0] >= this.range[1]) { - trailingComments = extra.trailingComments; - extra.trailingComments = []; - } else { - extra.trailingComments.length = 0; - } - } else { - if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) { - trailingComments = last.trailingComments; - delete last.trailingComments; - } - } - - // Eating the stack. - if (last) { - while (last && last.range[0] >= this.range[0]) { - lastChild = last; - last = bottomRight.pop(); - } - } - - if (lastChild) { - if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= this.range[0]) { - this.leadingComments = lastChild.leadingComments; - lastChild.leadingComments = undefined; - } - } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= this.range[0]) { - this.leadingComments = extra.leadingComments; - extra.leadingComments = []; - } - - - if (trailingComments) { - this.trailingComments = trailingComments; - } - - bottomRight.push(this); - }, - - finish: function () { - if (extra.range) { - this.range[1] = index; - } - if (extra.loc) { - this.loc.end = new Position(); - if (extra.source) { - this.loc.source = extra.source; - } - } - - if (extra.attachComment) { - this.processComment(); - } - }, - - finishArrayExpression: function (elements) { - this.type = Syntax.ArrayExpression; - this.elements = elements; - this.finish(); - return this; - }, - - finishArrowFunctionExpression: function (params, defaults, body, expression) { - this.type = Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.defaults = defaults; - this.body = body; - this.rest = null; - this.generator = false; - this.expression = expression; - this.finish(); - return this; - }, - - finishAssignmentExpression: function (operator, left, right) { - this.type = Syntax.AssignmentExpression; - this.operator = operator; - this.left = left; - this.right = right; - this.finish(); - return this; - }, - - finishBinaryExpression: function (operator, left, right) { - this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; - this.operator = operator; - this.left = left; - this.right = right; - this.finish(); - return this; - }, - - finishBlockStatement: function (body) { - this.type = Syntax.BlockStatement; - this.body = body; - this.finish(); - return this; - }, - - finishBreakStatement: function (label) { - this.type = Syntax.BreakStatement; - this.label = label; - this.finish(); - return this; - }, - - finishCallExpression: function (callee, args) { - this.type = Syntax.CallExpression; - this.callee = callee; - this.arguments = args; - this.finish(); - return this; - }, - - finishCatchClause: function (param, body) { - this.type = Syntax.CatchClause; - this.param = param; - this.body = body; - this.finish(); - return this; - }, - - finishConditionalExpression: function (test, consequent, alternate) { - this.type = Syntax.ConditionalExpression; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - this.finish(); - return this; - }, - - finishContinueStatement: function (label) { - this.type = Syntax.ContinueStatement; - this.label = label; - this.finish(); - return this; - }, - - finishDebuggerStatement: function () { - this.type = Syntax.DebuggerStatement; - this.finish(); - return this; - }, - - finishDoWhileStatement: function (body, test) { - this.type = Syntax.DoWhileStatement; - this.body = body; - this.test = test; - this.finish(); - return this; - }, - - finishEmptyStatement: function () { - this.type = Syntax.EmptyStatement; - this.finish(); - return this; - }, - - finishExpressionStatement: function (expression) { - this.type = Syntax.ExpressionStatement; - this.expression = expression; - this.finish(); - return this; - }, - - finishForStatement: function (init, test, update, body) { - this.type = Syntax.ForStatement; - this.init = init; - this.test = test; - this.update = update; - this.body = body; - this.finish(); - return this; - }, - - finishForInStatement: function (left, right, body) { - this.type = Syntax.ForInStatement; - this.left = left; - this.right = right; - this.body = body; - this.each = false; - this.finish(); - return this; - }, - - finishFunctionDeclaration: function (id, params, defaults, body) { - this.type = Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.defaults = defaults; - this.body = body; - this.rest = null; - this.generator = false; - this.expression = false; - this.finish(); - return this; - }, - - finishFunctionExpression: function (id, params, defaults, body) { - this.type = Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.defaults = defaults; - this.body = body; - this.rest = null; - this.generator = false; - this.expression = false; - this.finish(); - return this; - }, - - finishIdentifier: function (name) { - this.type = Syntax.Identifier; - this.name = name; - this.finish(); - return this; - }, - - finishIfStatement: function (test, consequent, alternate) { - this.type = Syntax.IfStatement; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - this.finish(); - return this; - }, - - finishLabeledStatement: function (label, body) { - this.type = Syntax.LabeledStatement; - this.label = label; - this.body = body; - this.finish(); - return this; - }, - - finishLiteral: function (token) { - this.type = Syntax.Literal; - this.value = token.value; - this.raw = source.slice(token.start, token.end); - this.finish(); - return this; - }, - - finishMemberExpression: function (accessor, object, property) { - this.type = Syntax.MemberExpression; - this.computed = accessor === '['; - this.object = object; - this.property = property; - this.finish(); - return this; - }, - - finishNewExpression: function (callee, args) { - this.type = Syntax.NewExpression; - this.callee = callee; - this.arguments = args; - this.finish(); - return this; - }, - - finishObjectExpression: function (properties) { - this.type = Syntax.ObjectExpression; - this.properties = properties; - this.finish(); - return this; - }, - - finishPostfixExpression: function (operator, argument) { - this.type = Syntax.UpdateExpression; - this.operator = operator; - this.argument = argument; - this.prefix = false; - this.finish(); - return this; - }, - - finishProgram: function (body) { - this.type = Syntax.Program; - this.body = body; - this.finish(); - return this; - }, - - finishProperty: function (kind, key, value) { - this.type = Syntax.Property; - this.key = key; - this.value = value; - this.kind = kind; - this.finish(); - return this; - }, - - finishReturnStatement: function (argument) { - this.type = Syntax.ReturnStatement; - this.argument = argument; - this.finish(); - return this; - }, - - finishSequenceExpression: function (expressions) { - this.type = Syntax.SequenceExpression; - this.expressions = expressions; - this.finish(); - return this; - }, - - finishSwitchCase: function (test, consequent) { - this.type = Syntax.SwitchCase; - this.test = test; - this.consequent = consequent; - this.finish(); - return this; - }, - - finishSwitchStatement: function (discriminant, cases) { - this.type = Syntax.SwitchStatement; - this.discriminant = discriminant; - this.cases = cases; - this.finish(); - return this; - }, - - finishThisExpression: function () { - this.type = Syntax.ThisExpression; - this.finish(); - return this; - }, - - finishThrowStatement: function (argument) { - this.type = Syntax.ThrowStatement; - this.argument = argument; - this.finish(); - return this; - }, - - finishTryStatement: function (block, guardedHandlers, handlers, finalizer) { - this.type = Syntax.TryStatement; - this.block = block; - this.guardedHandlers = guardedHandlers; - this.handlers = handlers; - this.finalizer = finalizer; - this.finish(); - return this; - }, - - finishUnaryExpression: function (operator, argument) { - this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression; - this.operator = operator; - this.argument = argument; - this.prefix = true; - this.finish(); - return this; - }, - - finishVariableDeclaration: function (declarations, kind) { - this.type = Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = kind; - this.finish(); - return this; - }, - - finishVariableDeclarator: function (id, init) { - this.type = Syntax.VariableDeclarator; - this.id = id; - this.init = init; - this.finish(); - return this; - }, - - finishWhileStatement: function (test, body) { - this.type = Syntax.WhileStatement; - this.test = test; - this.body = body; - this.finish(); - return this; - }, - - finishWithStatement: function (object, body) { - this.type = Syntax.WithStatement; - this.object = object; - this.body = body; - this.finish(); - return this; - } - }; - - // Return true if there is a line terminator before the next token. - - function peekLineTerminator() { - var pos, line, start, found; - - pos = index; - line = lineNumber; - start = lineStart; - skipComment(); - found = lineNumber !== line; - index = pos; - lineNumber = line; - lineStart = start; - - return found; - } - - // Throw an exception - - function throwError(token, messageFormat) { - var error, - args = Array.prototype.slice.call(arguments, 2), - msg = messageFormat.replace( - /%(\d)/g, - function (whole, index) { - assert(index < args.length, 'Message reference must be in range'); - return args[index]; - } - ); - - if (typeof token.lineNumber === 'number') { - error = new Error('Line ' + token.lineNumber + ': ' + msg); - error.index = token.start; - error.lineNumber = token.lineNumber; - error.column = token.start - lineStart + 1; - } else { - error = new Error('Line ' + lineNumber + ': ' + msg); - error.index = index; - error.lineNumber = lineNumber; - error.column = index - lineStart + 1; - } - - error.description = msg; - throw error; - } - - function throwErrorTolerant() { - try { - throwError.apply(null, arguments); - } catch (e) { - if (extra.errors) { - extra.errors.push(e); - } else { - throw e; - } - } - } - - - // Throw an exception because of the token. - - function throwUnexpected(token) { - if (token.type === Token.EOF) { - throwError(token, Messages.UnexpectedEOS); - } - - if (token.type === Token.NumericLiteral) { - throwError(token, Messages.UnexpectedNumber); - } - - if (token.type === Token.StringLiteral) { - throwError(token, Messages.UnexpectedString); - } - - if (token.type === Token.Identifier) { - throwError(token, Messages.UnexpectedIdentifier); - } - - if (token.type === Token.Keyword) { - if (isFutureReservedWord(token.value)) { - throwError(token, Messages.UnexpectedReserved); - } else if (strict && isStrictModeReservedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - return; - } - throwError(token, Messages.UnexpectedToken, token.value); - } - - // BooleanLiteral, NullLiteral, or Punctuator. - throwError(token, Messages.UnexpectedToken, token.value); - } - - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - - function expect(value) { - var token = lex(); - if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpected(token); - } - } - - /** - * @name expectTolerant - * @description Quietly expect the given token value when in tolerant mode, otherwise delegates - * to expect(value) - * @param {String} value The value we are expecting the lookahead token to have - * @since 2.0 - */ - function expectTolerant(value) { - if (extra.errors) { - var token = lookahead; - if (token.type !== Token.Punctuator && token.value !== value) { - throwErrorTolerant(token, Messages.UnexpectedToken, token.value); - } else { - lex(); - } - } else { - expect(value); - } - } - - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - - function expectKeyword(keyword) { - var token = lex(); - if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpected(token); - } - } - - // Return true if the next token matches the specified punctuator. - - function match(value) { - return lookahead.type === Token.Punctuator && lookahead.value === value; - } - - // Return true if the next token matches the specified keyword - - function matchKeyword(keyword) { - return lookahead.type === Token.Keyword && lookahead.value === keyword; - } - - // Return true if the next token is an assignment operator - - function matchAssign() { - var op; - - if (lookahead.type !== Token.Punctuator) { - return false; - } - op = lookahead.value; - return op === '=' || - op === '*=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - } - - function consumeSemicolon() { - var line; - - // Catch the very common case first: immediately a semicolon (U+003B). - if (source.charCodeAt(index) === 0x3B || match(';')) { - lex(); - return; - } - - line = lineNumber; - skipComment(); - if (lineNumber !== line) { - return; - } - - if (lookahead.type !== Token.EOF && !match('}')) { - throwUnexpected(lookahead); - } - } - - // Return true if provided expression is LeftHandSideExpression - - function isLeftHandSide(expr) { - return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; - } - - // 11.1.4 Array Initialiser - - function parseArrayInitialiser() { - var elements = [], node = new Node(); - - expect('['); - - while (!match(']')) { - if (match(',')) { - lex(); - elements.push(null); - } else { - elements.push(parseAssignmentExpression()); - - if (!match(']')) { - expect(','); - } - } - } - - lex(); - - return node.finishArrayExpression(elements); - } - - // 11.1.5 Object Initialiser - - function parsePropertyFunction(param, first) { - var previousStrict, body, node = new Node(); - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (first && strict && isRestrictedWord(param[0].name)) { - throwErrorTolerant(first, Messages.StrictParamName); - } - strict = previousStrict; - return node.finishFunctionExpression(null, param, [], body); - } - - function parseObjectPropertyKey() { - var token, node = new Node(); - - token = lex(); - - // Note: This function is called only from parseObjectProperty(), where - // EOF and Punctuator tokens are already filtered out. - - if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return node.finishLiteral(token); - } - - return node.finishIdentifier(token.value); - } - - function parseObjectProperty() { - var token, key, id, value, param, node = new Node(); - - token = lookahead; - - if (token.type === Token.Identifier) { - - id = parseObjectPropertyKey(); - - // Property Assignment: Getter and Setter. - - if (token.value === 'get' && !match(':')) { - key = parseObjectPropertyKey(); - expect('('); - expect(')'); - value = parsePropertyFunction([]); - return node.finishProperty('get', key, value); - } - if (token.value === 'set' && !match(':')) { - key = parseObjectPropertyKey(); - expect('('); - token = lookahead; - if (token.type !== Token.Identifier) { - expect(')'); - throwErrorTolerant(token, Messages.UnexpectedToken, token.value); - value = parsePropertyFunction([]); - } else { - param = [ parseVariableIdentifier() ]; - expect(')'); - value = parsePropertyFunction(param, token); - } - return node.finishProperty('set', key, value); - } - expect(':'); - value = parseAssignmentExpression(); - return node.finishProperty('init', id, value); - } - if (token.type === Token.EOF || token.type === Token.Punctuator) { - throwUnexpected(token); - } else { - key = parseObjectPropertyKey(); - expect(':'); - value = parseAssignmentExpression(); - return node.finishProperty('init', key, value); - } - } - - function parseObjectInitialiser() { - var properties = [], token, property, name, key, kind, map = {}, toString = String, node = new Node(); - - expect('{'); - - while (!match('}')) { - property = parseObjectProperty(); - - if (property.key.type === Syntax.Identifier) { - name = property.key.name; - } else { - name = toString(property.key.value); - } - kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; - - key = '$' + name; - if (Object.prototype.hasOwnProperty.call(map, key)) { - if (map[key] === PropertyKind.Data) { - if (strict && kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.StrictDuplicateProperty); - } else if (kind !== PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } - } else { - if (kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } else if (map[key] & kind) { - throwErrorTolerant({}, Messages.AccessorGetSet); - } - } - map[key] |= kind; - } else { - map[key] = kind; - } - - properties.push(property); - - if (!match('}')) { - expectTolerant(','); - } - } - - expect('}'); - - return node.finishObjectExpression(properties); - } - - // 11.1.6 The Grouping Operator - - function parseGroupExpression() { - var expr; - - expect('('); - - if (match(')')) { - lex(); - return PlaceHolders.ArrowParameterPlaceHolder; - } - - ++state.parenthesisCount; - - expr = parseExpression(); - - expect(')'); - - return expr; - } - - - // 11.1 Primary Expressions - - function parsePrimaryExpression() { - var type, token, expr, node; - - if (match('(')) { - return parseGroupExpression(); - } - - if (match('[')) { - return parseArrayInitialiser(); - } - - if (match('{')) { - return parseObjectInitialiser(); - } - - type = lookahead.type; - node = new Node(); - - if (type === Token.Identifier) { - expr = node.finishIdentifier(lex().value); - } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { - if (strict && lookahead.octal) { - throwErrorTolerant(lookahead, Messages.StrictOctalLiteral); - } - expr = node.finishLiteral(lex()); - } else if (type === Token.Keyword) { - if (matchKeyword('function')) { - return parseFunctionExpression(); - } - if (matchKeyword('this')) { - lex(); - expr = node.finishThisExpression(); - } else { - throwUnexpected(lex()); - } - } else if (type === Token.BooleanLiteral) { - token = lex(); - token.value = (token.value === 'true'); - expr = node.finishLiteral(token); - } else if (type === Token.NullLiteral) { - token = lex(); - token.value = null; - expr = node.finishLiteral(token); - } else if (match('/') || match('/=')) { - if (typeof extra.tokens !== 'undefined') { - expr = node.finishLiteral(collectRegex()); - } else { - expr = node.finishLiteral(scanRegExp()); - } - peek(); - } else { - throwUnexpected(lex()); - } - - return expr; - } - - // 11.2 Left-Hand-Side Expressions - - function parseArguments() { - var args = []; - - expect('('); - - if (!match(')')) { - while (index < length) { - args.push(parseAssignmentExpression()); - if (match(')')) { - break; - } - expectTolerant(','); - } - } - - expect(')'); - - return args; - } - - function parseNonComputedProperty() { - var token, node = new Node(); - - token = lex(); - - if (!isIdentifierName(token)) { - throwUnexpected(token); - } - - return node.finishIdentifier(token.value); - } - - function parseNonComputedMember() { - expect('.'); - - return parseNonComputedProperty(); - } - - function parseComputedMember() { - var expr; - - expect('['); - - expr = parseExpression(); - - expect(']'); - - return expr; - } - - function parseNewExpression() { - var callee, args, node = new Node(); - - expectKeyword('new'); - callee = parseLeftHandSideExpression(); - args = match('(') ? parseArguments() : []; - - return node.finishNewExpression(callee, args); - } - - function parseLeftHandSideExpressionAllowCall() { - var expr, args, property, startToken, previousAllowIn = state.allowIn; - - startToken = lookahead; - state.allowIn = true; - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - for (;;) { - if (match('.')) { - property = parseNonComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); - } else if (match('(')) { - args = parseArguments(); - expr = new WrappingNode(startToken).finishCallExpression(expr, args); - } else if (match('[')) { - property = parseComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); - } else { - break; - } - } - state.allowIn = previousAllowIn; - - return expr; - } - - function parseLeftHandSideExpression() { - var expr, property, startToken; - assert(state.allowIn, 'callee of new expression always allow in keyword.'); - - startToken = lookahead; - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - for (;;) { - if (match('[')) { - property = parseComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); - } else if (match('.')) { - property = parseNonComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); - } else { - break; - } - } - return expr; - } - - // 11.3 Postfix Expressions - - function parsePostfixExpression() { - var expr, token, startToken = lookahead; - - expr = parseLeftHandSideExpressionAllowCall(); - - if (lookahead.type === Token.Punctuator) { - if ((match('++') || match('--')) && !peekLineTerminator()) { - // 11.3.1, 11.3.2 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPostfix); - } - - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - token = lex(); - expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr); - } - } - - return expr; - } - - // 11.4 Unary Operators - - function parseUnaryExpression() { - var token, expr, startToken; - - if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { - expr = parsePostfixExpression(); - } else if (match('++') || match('--')) { - startToken = lookahead; - token = lex(); - expr = parseUnaryExpression(); - // 11.4.4, 11.4.5 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPrefix); - } - - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); - } else if (match('+') || match('-') || match('~') || match('!')) { - startToken = lookahead; - token = lex(); - expr = parseUnaryExpression(); - expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); - } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { - startToken = lookahead; - token = lex(); - expr = parseUnaryExpression(); - expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); - if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { - throwErrorTolerant({}, Messages.StrictDelete); - } - } else { - expr = parsePostfixExpression(); - } - - return expr; - } - - function binaryPrecedence(token, allowIn) { - var prec = 0; - - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return 0; - } - - switch (token.value) { - case '||': - prec = 1; - break; - - case '&&': - prec = 2; - break; - - case '|': - prec = 3; - break; - - case '^': - prec = 4; - break; - - case '&': - prec = 5; - break; - - case '==': - case '!=': - case '===': - case '!==': - prec = 6; - break; - - case '<': - case '>': - case '<=': - case '>=': - case 'instanceof': - prec = 7; - break; - - case 'in': - prec = allowIn ? 7 : 0; - break; - - case '<<': - case '>>': - case '>>>': - prec = 8; - break; - - case '+': - case '-': - prec = 9; - break; - - case '*': - case '/': - case '%': - prec = 11; - break; - - default: - break; - } - - return prec; - } - - // 11.5 Multiplicative Operators - // 11.6 Additive Operators - // 11.7 Bitwise Shift Operators - // 11.8 Relational Operators - // 11.9 Equality Operators - // 11.10 Binary Bitwise Operators - // 11.11 Binary Logical Operators - - function parseBinaryExpression() { - var marker, markers, expr, token, prec, stack, right, operator, left, i; - - marker = lookahead; - left = parseUnaryExpression(); - if (left === PlaceHolders.ArrowParameterPlaceHolder) { - return left; - } - - token = lookahead; - prec = binaryPrecedence(token, state.allowIn); - if (prec === 0) { - return left; - } - token.prec = prec; - lex(); - - markers = [marker, lookahead]; - right = parseUnaryExpression(); - - stack = [left, token, right]; - - while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) { - - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { - right = stack.pop(); - operator = stack.pop().value; - left = stack.pop(); - markers.pop(); - expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right); - stack.push(expr); - } - - // Shift. - token = lex(); - token.prec = prec; - stack.push(token); - markers.push(lookahead); - expr = parseUnaryExpression(); - stack.push(expr); - } - - // Final reduce to clean-up the stack. - i = stack.length - 1; - expr = stack[i]; - markers.pop(); - while (i > 1) { - expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr); - i -= 2; - } - - return expr; - } - - - // 11.12 Conditional Operator - - function parseConditionalExpression() { - var expr, previousAllowIn, consequent, alternate, startToken; - - startToken = lookahead; - - expr = parseBinaryExpression(); - if (expr === PlaceHolders.ArrowParameterPlaceHolder) { - return expr; - } - if (match('?')) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = parseAssignmentExpression(); - state.allowIn = previousAllowIn; - expect(':'); - alternate = parseAssignmentExpression(); - - expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate); - } - - return expr; - } - - // [ES6] 14.2 Arrow Function - - function parseConciseBody() { - if (match('{')) { - return parseFunctionSourceElements(); - } - return parseAssignmentExpression(); - } - - function reinterpretAsCoverFormalsList(expressions) { - var i, len, param, params, defaults, defaultCount, options, rest; - - params = []; - defaults = []; - defaultCount = 0; - rest = null; - options = { - paramSet: {} - }; - - for (i = 0, len = expressions.length; i < len; i += 1) { - param = expressions[i]; - if (param.type === Syntax.Identifier) { - params.push(param); - defaults.push(null); - validateParam(options, param, param.name); - } else if (param.type === Syntax.AssignmentExpression) { - params.push(param.left); - defaults.push(param.right); - ++defaultCount; - validateParam(options, param.left, param.left.name); - } else { - return null; - } - } - - if (options.message === Messages.StrictParamDupe) { - throwError( - strict ? options.stricted : options.firstRestricted, - options.message - ); - } - - if (defaultCount === 0) { - defaults = []; - } - - return { - params: params, - defaults: defaults, - rest: rest, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - } - - function parseArrowFunctionExpression(options, node) { - var previousStrict, body; - - expect('=>'); - previousStrict = strict; - - body = parseConciseBody(); - - if (strict && options.firstRestricted) { - throwError(options.firstRestricted, options.message); - } - if (strict && options.stricted) { - throwErrorTolerant(options.stricted, options.message); - } - - strict = previousStrict; - - return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement); - } - - // 11.13 Assignment Operators - - function parseAssignmentExpression() { - var oldParenthesisCount, token, expr, right, list, startToken; - - oldParenthesisCount = state.parenthesisCount; - - startToken = lookahead; - token = lookahead; - - expr = parseConditionalExpression(); - - if (expr === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) { - if (state.parenthesisCount === oldParenthesisCount || - state.parenthesisCount === (oldParenthesisCount + 1)) { - if (expr.type === Syntax.Identifier) { - list = reinterpretAsCoverFormalsList([ expr ]); - } else if (expr.type === Syntax.AssignmentExpression) { - list = reinterpretAsCoverFormalsList([ expr ]); - } else if (expr.type === Syntax.SequenceExpression) { - list = reinterpretAsCoverFormalsList(expr.expressions); - } else if (expr === PlaceHolders.ArrowParameterPlaceHolder) { - list = reinterpretAsCoverFormalsList([]); - } - if (list) { - return parseArrowFunctionExpression(list, new WrappingNode(startToken)); - } - } - } - - if (matchAssign()) { - // LeftHandSideExpression - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - // 11.13.1 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant(token, Messages.StrictLHSAssignment); - } - - token = lex(); - right = parseAssignmentExpression(); - expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right); - } - - return expr; - } - - // 11.14 Comma Operator - - function parseExpression() { - var expr, startToken = lookahead, expressions; - - expr = parseAssignmentExpression(); - - if (match(',')) { - expressions = [expr]; - - while (index < length) { - if (!match(',')) { - break; - } - lex(); - expressions.push(parseAssignmentExpression()); - } - - expr = new WrappingNode(startToken).finishSequenceExpression(expressions); - } - - return expr; - } - - // 12.1 Block - - function parseStatementList() { - var list = [], - statement; - - while (index < length) { - if (match('}')) { - break; - } - statement = parseSourceElement(); - if (typeof statement === 'undefined') { - break; - } - list.push(statement); - } - - return list; - } - - function parseBlock() { - var block, node = new Node(); - - expect('{'); - - block = parseStatementList(); - - expect('}'); - - return node.finishBlockStatement(block); - } - - // 12.2 Variable Statement - - function parseVariableIdentifier() { - var token, node = new Node(); - - token = lex(); - - if (token.type !== Token.Identifier) { - throwUnexpected(token); - } - - return node.finishIdentifier(token.value); - } - - function parseVariableDeclaration(kind) { - var init = null, id, node = new Node(); - - id = parseVariableIdentifier(); - - // 12.2.1 - if (strict && isRestrictedWord(id.name)) { - throwErrorTolerant({}, Messages.StrictVarName); - } - - if (kind === 'const') { - expect('='); - init = parseAssignmentExpression(); - } else if (match('=')) { - lex(); - init = parseAssignmentExpression(); - } - - return node.finishVariableDeclarator(id, init); - } - - function parseVariableDeclarationList(kind) { - var list = []; - - do { - list.push(parseVariableDeclaration(kind)); - if (!match(',')) { - break; - } - lex(); - } while (index < length); - - return list; - } - - function parseVariableStatement(node) { - var declarations; - - expectKeyword('var'); - - declarations = parseVariableDeclarationList(); - - consumeSemicolon(); - - return node.finishVariableDeclaration(declarations, 'var'); - } - - // kind may be `const` or `let` - // Both are experimental and not in the specification yet. - // see http://wiki.ecmascript.org/doku.php?id=harmony:const - // and http://wiki.ecmascript.org/doku.php?id=harmony:let - function parseConstLetDeclaration(kind) { - var declarations, node = new Node(); - - expectKeyword(kind); - - declarations = parseVariableDeclarationList(kind); - - consumeSemicolon(); - - return node.finishVariableDeclaration(declarations, kind); - } - - // 12.3 Empty Statement - - function parseEmptyStatement() { - var node = new Node(); - expect(';'); - return node.finishEmptyStatement(); - } - - // 12.4 Expression Statement - - function parseExpressionStatement(node) { - var expr = parseExpression(); - consumeSemicolon(); - return node.finishExpressionStatement(expr); - } - - // 12.5 If statement - - function parseIfStatement(node) { - var test, consequent, alternate; - - expectKeyword('if'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - consequent = parseStatement(); - - if (matchKeyword('else')) { - lex(); - alternate = parseStatement(); - } else { - alternate = null; - } - - return node.finishIfStatement(test, consequent, alternate); - } - - // 12.6 Iteration Statements - - function parseDoWhileStatement(node) { - var body, test, oldInIteration; - - expectKeyword('do'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - if (match(';')) { - lex(); - } - - return node.finishDoWhileStatement(body, test); - } - - function parseWhileStatement(node) { - var test, body, oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - return node.finishWhileStatement(test, body); - } - - function parseForVariableDeclaration() { - var token, declarations, node = new Node(); - - token = lex(); - declarations = parseVariableDeclarationList(); - - return node.finishVariableDeclaration(declarations, token.value); - } - - function parseForStatement(node) { - var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn; - - init = test = update = null; - - expectKeyword('for'); - - expect('('); - - if (match(';')) { - lex(); - } else { - if (matchKeyword('var') || matchKeyword('let')) { - state.allowIn = false; - init = parseForVariableDeclaration(); - state.allowIn = previousAllowIn; - - if (init.declarations.length === 1 && matchKeyword('in')) { - lex(); - left = init; - right = parseExpression(); - init = null; - } - } else { - state.allowIn = false; - init = parseExpression(); - state.allowIn = previousAllowIn; - - if (matchKeyword('in')) { - // LeftHandSideExpression - if (!isLeftHandSide(init)) { - throwErrorTolerant({}, Messages.InvalidLHSInForIn); - } - - lex(); - left = init; - right = parseExpression(); - init = null; - } - } - - if (typeof left === 'undefined') { - expect(';'); - } - } - - if (typeof left === 'undefined') { - - if (!match(';')) { - test = parseExpression(); - } - expect(';'); - - if (!match(')')) { - update = parseExpression(); - } - } - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - return (typeof left === 'undefined') ? - node.finishForStatement(init, test, update, body) : - node.finishForInStatement(left, right, body); - } - - // 12.7 The continue statement - - function parseContinueStatement(node) { - var label = null, key; - - expectKeyword('continue'); - - // Optimize the most common form: 'continue;'. - if (source.charCodeAt(index) === 0x3B) { - lex(); - - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return node.finishContinueStatement(null); - } - - if (peekLineTerminator()) { - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return node.finishContinueStatement(null); - } - - if (lookahead.type === Token.Identifier) { - label = parseVariableIdentifier(); - - key = '$' + label.name; - if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return node.finishContinueStatement(label); - } - - // 12.8 The break statement - - function parseBreakStatement(node) { - var label = null, key; - - expectKeyword('break'); - - // Catch the very common case first: immediately a semicolon (U+003B). - if (source.charCodeAt(index) === 0x3B) { - lex(); - - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return node.finishBreakStatement(null); - } - - if (peekLineTerminator()) { - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return node.finishBreakStatement(null); - } - - if (lookahead.type === Token.Identifier) { - label = parseVariableIdentifier(); - - key = '$' + label.name; - if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return node.finishBreakStatement(label); - } - - // 12.9 The return statement - - function parseReturnStatement(node) { - var argument = null; - - expectKeyword('return'); - - if (!state.inFunctionBody) { - throwErrorTolerant({}, Messages.IllegalReturn); - } - - // 'return' followed by a space and an identifier is very common. - if (source.charCodeAt(index) === 0x20) { - if (isIdentifierStart(source.charCodeAt(index + 1))) { - argument = parseExpression(); - consumeSemicolon(); - return node.finishReturnStatement(argument); - } - } - - if (peekLineTerminator()) { - return node.finishReturnStatement(null); - } - - if (!match(';')) { - if (!match('}') && lookahead.type !== Token.EOF) { - argument = parseExpression(); - } - } - - consumeSemicolon(); - - return node.finishReturnStatement(argument); - } - - // 12.10 The with statement - - function parseWithStatement(node) { - var object, body; - - if (strict) { - // TODO(ikarienator): Should we update the test cases instead? - skipComment(); - throwErrorTolerant({}, Messages.StrictModeWith); - } - - expectKeyword('with'); - - expect('('); - - object = parseExpression(); - - expect(')'); - - body = parseStatement(); - - return node.finishWithStatement(object, body); - } - - // 12.10 The swith statement - - function parseSwitchCase() { - var test, consequent = [], statement, node = new Node(); - - if (matchKeyword('default')) { - lex(); - test = null; - } else { - expectKeyword('case'); - test = parseExpression(); - } - expect(':'); - - while (index < length) { - if (match('}') || matchKeyword('default') || matchKeyword('case')) { - break; - } - statement = parseStatement(); - consequent.push(statement); - } - - return node.finishSwitchCase(test, consequent); - } - - function parseSwitchStatement(node) { - var discriminant, cases, clause, oldInSwitch, defaultFound; - - expectKeyword('switch'); - - expect('('); - - discriminant = parseExpression(); - - expect(')'); - - expect('{'); - - cases = []; - - if (match('}')) { - lex(); - return node.finishSwitchStatement(discriminant, cases); - } - - oldInSwitch = state.inSwitch; - state.inSwitch = true; - defaultFound = false; - - while (index < length) { - if (match('}')) { - break; - } - clause = parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - throwError({}, Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - - state.inSwitch = oldInSwitch; - - expect('}'); - - return node.finishSwitchStatement(discriminant, cases); - } - - // 12.13 The throw statement - - function parseThrowStatement(node) { - var argument; - - expectKeyword('throw'); - - if (peekLineTerminator()) { - throwError({}, Messages.NewlineAfterThrow); - } - - argument = parseExpression(); - - consumeSemicolon(); - - return node.finishThrowStatement(argument); - } - - // 12.14 The try statement - - function parseCatchClause() { - var param, body, node = new Node(); - - expectKeyword('catch'); - - expect('('); - if (match(')')) { - throwUnexpected(lookahead); - } - - param = parseVariableIdentifier(); - // 12.14.1 - if (strict && isRestrictedWord(param.name)) { - throwErrorTolerant({}, Messages.StrictCatchVariable); - } - - expect(')'); - body = parseBlock(); - return node.finishCatchClause(param, body); - } - - function parseTryStatement(node) { - var block, handlers = [], finalizer = null; - - expectKeyword('try'); - - block = parseBlock(); - - if (matchKeyword('catch')) { - handlers.push(parseCatchClause()); - } - - if (matchKeyword('finally')) { - lex(); - finalizer = parseBlock(); - } - - if (handlers.length === 0 && !finalizer) { - throwError({}, Messages.NoCatchOrFinally); - } - - return node.finishTryStatement(block, [], handlers, finalizer); - } - - // 12.15 The debugger statement - - function parseDebuggerStatement(node) { - expectKeyword('debugger'); - - consumeSemicolon(); - - return node.finishDebuggerStatement(); - } - - // 12 Statements - - function parseStatement() { - var type = lookahead.type, - expr, - labeledBody, - key, - node; - - if (type === Token.EOF) { - throwUnexpected(lookahead); - } - - if (type === Token.Punctuator && lookahead.value === '{') { - return parseBlock(); - } - - node = new Node(); - - if (type === Token.Punctuator) { - switch (lookahead.value) { - case ';': - return parseEmptyStatement(node); - case '(': - return parseExpressionStatement(node); - default: - break; - } - } else if (type === Token.Keyword) { - switch (lookahead.value) { - case 'break': - return parseBreakStatement(node); - case 'continue': - return parseContinueStatement(node); - case 'debugger': - return parseDebuggerStatement(node); - case 'do': - return parseDoWhileStatement(node); - case 'for': - return parseForStatement(node); - case 'function': - return parseFunctionDeclaration(node); - case 'if': - return parseIfStatement(node); - case 'return': - return parseReturnStatement(node); - case 'switch': - return parseSwitchStatement(node); - case 'throw': - return parseThrowStatement(node); - case 'try': - return parseTryStatement(node); - case 'var': - return parseVariableStatement(node); - case 'while': - return parseWhileStatement(node); - case 'with': - return parseWithStatement(node); - default: - break; - } - } - - expr = parseExpression(); - - // 12.12 Labelled Statements - if ((expr.type === Syntax.Identifier) && match(':')) { - lex(); - - key = '$' + expr.name; - if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { - throwError({}, Messages.Redeclaration, 'Label', expr.name); - } - - state.labelSet[key] = true; - labeledBody = parseStatement(); - delete state.labelSet[key]; - return node.finishLabeledStatement(expr, labeledBody); - } - - consumeSemicolon(); - - return node.finishExpressionStatement(expr); - } - - // 13 Function Definition - - function parseFunctionSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, - node = new Node(); - - expect('{'); - - while (index < length) { - if (lookahead.type !== Token.StringLiteral) { - break; - } - token = lookahead; - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = source.slice(token.start + 1, token.end - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - oldLabelSet = state.labelSet; - oldInIteration = state.inIteration; - oldInSwitch = state.inSwitch; - oldInFunctionBody = state.inFunctionBody; - oldParenthesisCount = state.parenthesizedCount; - - state.labelSet = {}; - state.inIteration = false; - state.inSwitch = false; - state.inFunctionBody = true; - state.parenthesizedCount = 0; - - while (index < length) { - if (match('}')) { - break; - } - sourceElement = parseSourceElement(); - if (typeof sourceElement === 'undefined') { - break; - } - sourceElements.push(sourceElement); - } - - expect('}'); - - state.labelSet = oldLabelSet; - state.inIteration = oldInIteration; - state.inSwitch = oldInSwitch; - state.inFunctionBody = oldInFunctionBody; - state.parenthesizedCount = oldParenthesisCount; - - return node.finishBlockStatement(sourceElements); - } - - function validateParam(options, param, name) { - var key = '$' + name; - if (strict) { - if (isRestrictedWord(name)) { - options.stricted = param; - options.message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = Messages.StrictParamDupe; - } - } else if (!options.firstRestricted) { - if (isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(name)) { - options.firstRestricted = param; - options.message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.firstRestricted = param; - options.message = Messages.StrictParamDupe; - } - } - options.paramSet[key] = true; - } - - function parseParam(options) { - var token, param, def; - - token = lookahead; - param = parseVariableIdentifier(); - validateParam(options, token, token.value); - if (match('=')) { - lex(); - def = parseAssignmentExpression(); - ++options.defaultCount; - } - - options.params.push(param); - options.defaults.push(def); - - return !match(')'); - } - - function parseParams(firstRestricted) { - var options; - - options = { - params: [], - defaultCount: 0, - defaults: [], - firstRestricted: firstRestricted - }; - - expect('('); - - if (!match(')')) { - options.paramSet = {}; - while (index < length) { - if (!parseParam(options)) { - break; - } - expect(','); - } - } - - expect(')'); - - if (options.defaultCount === 0) { - options.defaults = []; - } - - return { - params: options.params, - defaults: options.defaults, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - } - - function parseFunctionDeclaration() { - var id, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, node = new Node(); - - expectKeyword('function'); - token = lookahead; - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - - tmp = parseParams(firstRestricted); - params = tmp.params; - defaults = tmp.defaults; - stricted = tmp.stricted; - firstRestricted = tmp.firstRestricted; - if (tmp.message) { - message = tmp.message; - } - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && stricted) { - throwErrorTolerant(stricted, message); - } - strict = previousStrict; - - return node.finishFunctionDeclaration(id, params, defaults, body); - } - - function parseFunctionExpression() { - var token, id = null, stricted, firstRestricted, message, tmp, - params = [], defaults = [], body, previousStrict, node = new Node(); - - expectKeyword('function'); - - if (!match('(')) { - token = lookahead; - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - tmp = parseParams(firstRestricted); - params = tmp.params; - defaults = tmp.defaults; - stricted = tmp.stricted; - firstRestricted = tmp.firstRestricted; - if (tmp.message) { - message = tmp.message; - } - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && stricted) { - throwErrorTolerant(stricted, message); - } - strict = previousStrict; - - return node.finishFunctionExpression(id, params, defaults, body); - } - - // 14 Program - - function parseSourceElement() { - if (lookahead.type === Token.Keyword) { - switch (lookahead.value) { - case 'const': - case 'let': - return parseConstLetDeclaration(lookahead.value); - case 'function': - return parseFunctionDeclaration(); - default: - return parseStatement(); - } - } - - if (lookahead.type !== Token.EOF) { - return parseStatement(); - } - } - - function parseSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted; - - while (index < length) { - token = lookahead; - if (token.type !== Token.StringLiteral) { - break; - } - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = source.slice(token.start + 1, token.end - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - while (index < length) { - sourceElement = parseSourceElement(); - /* istanbul ignore if */ - if (typeof sourceElement === 'undefined') { - break; - } - sourceElements.push(sourceElement); - } - return sourceElements; - } - - function parseProgram() { - var body, node; - - skipComment(); - peek(); - node = new Node(); - strict = false; - - body = parseSourceElements(); - return node.finishProgram(body); - } - - function filterTokenLocation() { - var i, entry, token, tokens = []; - - for (i = 0; i < extra.tokens.length; ++i) { - entry = extra.tokens[i]; - token = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - token.range = entry.range; - } - if (extra.loc) { - token.loc = entry.loc; - } - tokens.push(token); - } - - extra.tokens = tokens; - } - - function tokenize(code, options) { - var toString, - tokens; - - toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { - code = toString(code); - } - - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - length = source.length; - lookahead = null; - state = { - allowIn: true, - labelSet: {}, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - lastCommentStart: -1 - }; - - extra = {}; - - // Options matching. - options = options || {}; - - // Of course we collect tokens here. - options.tokens = true; - extra.tokens = []; - extra.tokenize = true; - // The following two fields are necessary to compute the Regex tokens. - extra.openParenToken = -1; - extra.openCurlyToken = -1; - - extra.range = (typeof options.range === 'boolean') && options.range; - extra.loc = (typeof options.loc === 'boolean') && options.loc; - - if (typeof options.comment === 'boolean' && options.comment) { - extra.comments = []; - } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - - try { - peek(); - if (lookahead.type === Token.EOF) { - return extra.tokens; - } - - lex(); - while (lookahead.type !== Token.EOF) { - try { - lex(); - } catch (lexError) { - if (extra.errors) { - extra.errors.push(lexError); - // We have to break on the first error - // to avoid infinite loops. - break; - } else { - throw lexError; - } - } - } - - filterTokenLocation(); - tokens = extra.tokens; - if (typeof extra.comments !== 'undefined') { - tokens.comments = extra.comments; - } - if (typeof extra.errors !== 'undefined') { - tokens.errors = extra.errors; - } - } catch (e) { - throw e; - } finally { - extra = {}; - } - return tokens; - } - - function parse(code, options) { - var program, toString; - - toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { - code = toString(code); - } - - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - length = source.length; - lookahead = null; - state = { - allowIn: true, - labelSet: {}, - parenthesisCount: 0, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - lastCommentStart: -1 - }; - - extra = {}; - if (typeof options !== 'undefined') { - extra.range = (typeof options.range === 'boolean') && options.range; - extra.loc = (typeof options.loc === 'boolean') && options.loc; - extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; - - if (extra.loc && options.source !== null && options.source !== undefined) { - extra.source = toString(options.source); - } - - if (typeof options.tokens === 'boolean' && options.tokens) { - extra.tokens = []; - } - if (typeof options.comment === 'boolean' && options.comment) { - extra.comments = []; - } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - if (extra.attachComment) { - extra.range = true; - extra.comments = []; - extra.bottomRightStack = []; - extra.trailingComments = []; - extra.leadingComments = []; - } - } - - try { - program = parseProgram(); - if (typeof extra.comments !== 'undefined') { - program.comments = extra.comments; - } - if (typeof extra.tokens !== 'undefined') { - filterTokenLocation(); - program.tokens = extra.tokens; - } - if (typeof extra.errors !== 'undefined') { - program.errors = extra.errors; - } - } catch (e) { - throw e; - } finally { - extra = {}; - } - - return program; - } - - // Sync with *.json manifests. - exports.version = '2.0.0-dev'; - - exports.tokenize = tokenize; - - exports.parse = parse; - - // Deep copy. - /* istanbul ignore next */ - exports.Syntax = (function () { - var name, types = {}; - - if (typeof Object.create === 'function') { - types = Object.create(null); - } - - for (name in Syntax) { - if (Syntax.hasOwnProperty(name)) { - types[name] = Syntax[name]; - } - } - - if (typeof Object.freeze === 'function') { - Object.freeze(types); - } - - return types; - }()); - -})); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/src/js/lib/jquery-2.1.1.js b/src/js/lib/jquery-2.1.1.js deleted file mode 100755 index bd539afd..00000000 --- a/src/js/lib/jquery-2.1.1.js +++ /dev/null @@ -1,9192 +0,0 @@ -/** @license -======================================================================== - jQuery JavaScript Library v2.1.1 - http://jquery.com/ - - Includes Sizzle.js - http://sizzlejs.com/ - - Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - Released under the MIT license - http://jquery.org/license - - Date: 2014-05-01T17:11Z -*/ -"use strict"; - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var arr = []; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - version = "2.1.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isPlainObject: function( obj ) { - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.constructor && - !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - // Support: Android < 4.0, iOS < 6 (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - var script, - indirect = eval; - - code = jQuery.trim( code ); - - if ( code ) { - // If the code includes a valid, prologue position - // strict mode pragma, execute code by injecting a - // script tag into the document. - if ( code.indexOf("use strict") === 1 ) { - script = document.createElement("script"); - script.text = code; - document.head.appendChild( script ).parentNode.removeChild( script ); - } else { - // Otherwise, avoid the DOM node creation, insertion - // and removal by using an indirect global eval - indirect( code ); - } - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
    "; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - len = this.length, - ret = [], - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; - }, - - sibling: function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter(function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return elem.contentDocument || jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.unique( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * The ready event handler and self cleanup method - */ -function completed() { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - jQuery.ready(); -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - } else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - } - } - return readyList.promise( obj ); -}; - -// Kick off the DOM ready check even if the user does not -jQuery.ready.promise(); - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - len ? fn( elems[0], key ) : emptyGet; -}; - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( owner ) { - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - /* jshint -W018 */ - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - -function Data() { - // Support: Android < 4, - // Old WebKit does not have Object.preventExtensions/freeze method, - // return new empty object instead with no [[set]] accessor - Object.defineProperty( this.cache = {}, 0, { - get: function() { - return {}; - } - }); - - this.expando = jQuery.expando + Math.random(); -} - -Data.uid = 1; -Data.accepts = jQuery.acceptData; - -Data.prototype = { - key: function( owner ) { - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return the key for a frozen object. - if ( !Data.accepts( owner ) ) { - return 0; - } - - var descriptor = {}, - // Check if the owner object already has a cache key - unlock = owner[ this.expando ]; - - // If not, create one - if ( !unlock ) { - unlock = Data.uid++; - - // Secure it in a non-enumerable, non-writable property - try { - descriptor[ this.expando ] = { value: unlock }; - Object.defineProperties( owner, descriptor ); - - // Support: Android < 4 - // Fallback to a less secure definition - } catch ( e ) { - descriptor[ this.expando ] = unlock; - jQuery.extend( owner, descriptor ); - } - } - - // Ensure the cache object - if ( !this.cache[ unlock ] ) { - this.cache[ unlock ] = {}; - } - - return unlock; - }, - set: function( owner, data, value ) { - var prop, - // There may be an unlock assigned to this node, - // if there is no entry for this "owner", create one inline - // and set the unlock as though an owner entry had always existed - unlock = this.key( owner ), - cache = this.cache[ unlock ]; - - // Handle: [ owner, key, value ] args - if ( typeof data === "string" ) { - cache[ data ] = value; - - // Handle: [ owner, { properties } ] args - } else { - // Fresh assignments by object are shallow copied - if ( jQuery.isEmptyObject( cache ) ) { - jQuery.extend( this.cache[ unlock ], data ); - // Otherwise, copy the properties one-by-one to the cache object - } else { - for ( prop in data ) { - cache[ prop ] = data[ prop ]; - } - } - } - return cache; - }, - get: function( owner, key ) { - // Either a valid cache is found, or will be created. - // New caches will be created and the unlock returned, - // allowing direct access to the newly created - // empty data object. A valid owner object must be provided. - var cache = this.cache[ this.key( owner ) ]; - - return key === undefined ? - cache : cache[ key ]; - }, - access: function( owner, key, value ) { - var stored; - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ((key && typeof key === "string") && value === undefined) ) { - - stored = this.get( owner, key ); - - return stored !== undefined ? - stored : this.get( owner, jQuery.camelCase(key) ); - } - - // [*]When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, name, camel, - unlock = this.key( owner ), - cache = this.cache[ unlock ]; - - if ( key === undefined ) { - this.cache[ unlock ] = {}; - - } else { - // Support array or space separated string of keys - if ( jQuery.isArray( key ) ) { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = key.concat( key.map( jQuery.camelCase ) ); - } else { - camel = jQuery.camelCase( key ); - // Try the string as a key before any manipulation - if ( key in cache ) { - name = [ key, camel ]; - } else { - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - name = camel; - name = name in cache ? - [ name ] : ( name.match( rnotwhite ) || [] ); - } - } - - i = name.length; - while ( i-- ) { - delete cache[ name[ i ] ]; - } - } - }, - hasData: function( owner ) { - return !jQuery.isEmptyObject( - this.cache[ owner[ this.expando ] ] || {} - ); - }, - discard: function( owner ) { - if ( owner[ this.expando ] ) { - delete this.cache[ owner[ this.expando ] ]; - } - } -}; -var data_priv = new Data(); - -var data_user = new Data(); - - - -/* - Implementation Summary - - 1. Enforce API surface and semantic compatibility with 1.9.x branch - 2. Improve the module's maintainability by reducing the storage - paths to a single mechanism. - 3. Use the same single mechanism to support "private" and "user" data. - 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) - 5. Avoid exposing implementation details on user objects (eg. expando properties) - 6. Provide a clear path for implementation upgrade to WeakMap in 2014 -*/ -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - data_user.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend({ - hasData: function( elem ) { - return data_user.hasData( elem ) || data_priv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return data_user.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - data_user.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to data_priv methods, these can be deprecated. - _data: function( elem, name, data ) { - return data_priv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - data_priv.remove( elem, name ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = data_user.get( elem ); - - if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - data_priv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - data_user.set( this, key ); - }); - } - - return access( this, function( value ) { - var data, - camelKey = jQuery.camelCase( key ); - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - // Attempt to get data from the cache - // with the key as-is - data = data_user.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to get data from the cache - // with the key camelized - data = data_user.get( elem, camelKey ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, camelKey, undefined ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each(function() { - // First, attempt to store a copy or reference of any - // data that might've been store with a camelCased key. - var data = data_user.get( this, camelKey ); - - // For HTML5 data-* attribute interop, we have to - // store property names with dashes in a camelCase form. - // This might not apply to all properties...* - data_user.set( this, camelKey, value ); - - // *... In the case of properties that might _actually_ - // have dashes, we need to also store a copy of that - // unchanged property. - if ( key.indexOf("-") !== -1 && data !== undefined ) { - data_user.set( this, key, value ); - } - }); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each(function() { - data_user.remove( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = data_priv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { - queue = data_priv.access( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return data_priv.get( elem, key ) || data_priv.access( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - data_priv.remove( elem, [ type + "queue", key ] ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = data_priv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // #11217 - WebKit loses check when the name is after the checked attribute - // Support: Windows Web Apps (WWA) - // `name` and `type` need .setAttribute for WWA - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE9-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -})(); -var strundefined = typeof undefined; - - - -support.focusinBubbles = "onfocusin" in window; - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = data_priv.get( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = data_priv.hasData( elem ) && data_priv.get( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - data_priv.remove( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, j, ret, matched, handleObj, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, matches, sel, handleObj, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.disabled !== true || event.type !== "click" ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: Cordova 2.5 (WebKit) (#13255) - // All events should have a target; Cordova deviceready doesn't - if ( !event.target ) { - event.target = document; - } - - // Support: Safari 6.0+, Chrome < 28 - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } -}; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && e.preventDefault ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && e.stopPropagation ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -// Support: Chrome 15+ -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// Create "bubbling" focus and blur events -// Support: Firefox, Chrome, Safari -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - data_priv.remove( doc, fix ); - - } else { - data_priv.access( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -var - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rhtml = /<|&#?\w+;/, - rnoInnerhtml = /<(?:script|style|link)/i, - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /^$|\/(?:java|ecma)script/i, - rscriptTypeMasked = /^true\/(.*)/, - rcleanScript = /^\s*\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - - // Support: IE 9 - option: [ 1, "" ], - - thead: [ 1, "", "
    " ], - col: [ 2, "", "
    " ], - tr: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - - _default: [ 0, "", "" ] - }; - -// Support: IE 9 -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: 1.x compatibility -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute("type"); - } - - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - data_priv.set( - elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) - ); - } -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( data_priv.hasData( src ) ) { - pdataOld = data_priv.access( src ); - pdataCur = data_priv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( data_user.hasData( src ) ) { - udataOld = data_user.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - data_user.set( dest, udataCur ); - } -} - -function getAll( context, tag ) { - var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : - context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : - []; - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], ret ) : - ret; -} - -// Support: IE >= 9 -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); - - // Support: IE >= 9 - // Fix Cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Fixes #12346 - // Support: Webkit, IE - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; - }, - - cleanData: function( elems ) { - var data, elem, type, key, - special = jQuery.event.special, - i = 0; - - for ( ; (elem = elems[ i ]) !== undefined; i++ ) { - if ( jQuery.acceptData( elem ) ) { - key = elem[ data_priv.expando ]; - - if ( key && (data = data_priv.cache[ key ]) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - if ( data_priv.cache[ key ] ) { - // Discard any remaining `private` data - delete data_priv.cache[ key ]; - } - } - } - // Discard any remaining `user` data - delete data_user.cache[ elem[ data_user.expando ] ]; - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each(function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - }); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); - } - } - } - } - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: QtWebKit - // .get() because push.apply(_, arraylike) throws - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "